MLLex - MLton Standard ML Compiler (SML Compiler)

MLton MLTONWIKIVERSION | MLLex |
Home Index

MLLex is a lexical analyzer generator for Standard ML modeled after the Lex lexical analyzer generator.

A version of MLLex, ported from the SML/NJ sources, is distributed with MLton.

## Description

MLLex takes as input the lex language as defined in the ML-Lex manual, and outputs a lexical analyzer in SML.

## Implementation

lexgen.sml
main.sml
call-main.sml

## Details and Notes

There are 3 main passes in the MLLex tool:

- Source parsing. In this pass, lex source program are parsed into internal representations. The core part of this pass is a hand-written lexer and an LL(1) parser. The output of this pass is a record of user code, rules (along with start states) and actions. (MLlex definitions are wiped off.)

- DFA construction. In this pass, a DFA is constructed by the algorithm of H. Yamada et. al.

- Output. In this pass, the generated DFA is written out as a transition table, along with a table-driven algorithm, to an SML file.

## Also see

- MLYacc

- AppelEtAl94

- Price09

Last edited on 2010-05-13 19:35:18 by MatthewFluet.