This project involves building a toy programming language that is capable of evaluating and type-checking a set of statements which may be boolean/arithmetic expressions, variable instantiations and function declaration/application upto a single formal parameter. The language also supports lambda expressions and uses call-by value and definition before usage method for function application.
Refer to Specifications folder to know more about the language syntax and usage. This folder includes Problem_Statement.pdf, EBNF.txt describing the language syntax and examples demonstrating the usage of various expressions.
- Generate the parser/evaluator/type-checker by executing the command
makeormake allin the terminal. - To run a program file named , execute the command
./parser <file>in the terminal. This will parse, evaluate and type-check the file named<file>.
NOTE:
mlton(along withmllexandmlyacc) should be available for proper execution of makefile.
NOTE: The parser creates three auxilliary files named Yes, Error and lastToken. These files are used for reporting syntax error raised by the parser.
- After execution, use
make cleanto clear all the extra files (like .sig, lex.sml, aux files etc.)