P1: Functional and Cool Programming

For this assignment, you will implement several functions using the Reason and Cool programming languages. You will be provided with the interface for various functions or a specific problem, and you are responsible for implementing the specified functionality.

P2: Lexer (Java)

For this assignment you will write a lexical analyzer, also called a scanner, using a lexical analyzer generator. You will describe the set of tokens for Cool in an appropriate input format and the analyzer generator will generate actual code. You will then write additional code to serialize the tokens for use by later interpreter stages.

P3: Parser (Python)

For this assignment you will write a parser using a parser generator. You will describe the Cool grammar in an appropriate input format and the parser generator will generate actual code (in Python). You will also write additional code to unserialize the tokens produced by the lexer stage and to serialize the abstract syntax tree produced by your parser.

P4: Semantic Analysis (JavaScript)

For this assignment you will write a semantic analyzer. Among other things, this involves traversing the abstract syntax tree and the class hierarchy. You will reject all Cool programs that do not comply with the Cool type system.

P5: Interpreter (Reason)

For this assignment you will write an interpreter. Among other things, this involves implementing the operational semantics specification of Cool. You will track enough information to generate legitimate run-time errors (e.g., dispatch on void). You do not have to worry about "malformed input" because the semantic analyzer (from PA4) has already ruled out bad programs.

Assignment Submission

We use automated grading scripts to give you immediate feedback on your programming assignments. Click here to be taken to the submission page.