- The Moscow ML distribution contains some examples illustrating
the use of mosmllex and mosmlyacc. See for example the directories
calc and lexyacc under mosml/examples.
- Programs for the lecture:
- Absyn.sml: Abstract syntax for a simple
expression language, including an evaluation function.
- Exprlex.lex: Input to mosmllex.
- Exprpar.grm: Input to mosmlyacc.
- parse.sml: File containing functions to
parse expressions. You do not have to change this file solving the
exercises. You only have to use the function parses: string -> expr
(parses an expression from a string) and the function
parsef: string -> expr, which parses an expressions from a file.
- You can see how to compile the above
files here.