CM-Lex and CM-Yacc

A lexer and parser generator for Standard ML, OCaml, and Haskell

Existing lexer and parser generators such as Lex and Yacc suffer from practical inconveniences because they use disembodied code to implement actions. To prevent this problem, CM-Lex and CM-Yacc generate closed functors that are then instantiated by the programmer with appropriate action code. This results in all code being type checked in its appropriate context, and it assists the type checker in localizing errors correctly.

CM-Lex and CM-Yacc are implemented for Standard ML, OCaml, and Haskell. However, all three versions are implemented in Standard ML. Installation instructions appear in the INSTALL file.

Resources:
source distribution
user's manual
Hygienic Source-Code Generation Using Functors
Github repository