Compiler Construction assign. 1
Consider the following abstract syntax for a language, which is similar to the language in your course notes:
datatype Expr = Fun of string * Expr
| Var of string
| Let of (string * Expr) list * Expr
| Apply of Expr * Expr
Describe the steps you would take to implement a compiler for this language (to MIPS and Java Bytecode).
Construct a syntax for this language; your syntax may only have two keywords and one style of delimiter (such as '(', '{', '.', or '[').
Is your grammar ambiguous? Justify your answer.
Implement a recursive descent parser for your language; you may assume that a suitable lexer exists that provides a token by calling a function lex()
You do not need to concern yourself with building the abstract syntax tree if this has not been covered prior to completing the assignment.
Implement an interpreter for this language. (Note, this is the lambda-calculus, extended with a simple facility for naming sets of functions.)
2008 P4Q3
2006 P4Q2 a-c