PLDA Homework 2: Function evaluation (extended)

Due: Oct. 25, 2010

Extend Homework 1 to allow for function expressions, namely:

Prog ::= Def* Expr
Def ::= id ['rec'] '=' Expr
Expr ::= 'int' | Expr '+' Expr | Expr '*' Expr | 'if' Expr 'then' Expr 'else' Expr | 
'fun' id '=' Expr | Expr Expr
The last two productions correspond to function definition (with one argument) and function application, like in the lambda calculus. Definitions may be recursive (for functions only) or not.
Marius Minea
Last modified: Mon Oct 18 17:00:00 EET 2010