Home
  Contact
  Short Vita
  Research
  Teaching
  LSDIS Lab
  Links

Programming Project: Part 2 [85 pts.]

Due: February 29, 2012; April 7, 2012

In this assignment you will implement a parser and a semantic analyzer for TinyJava. The assignment is split into two parts, as explained below.

Please, note that the grammar of TinyJava has changed and is slightly different than the one included in the class handout. The modified grammar is available on the class web site.

A. Implement a parser for TinyJava [due: February 29; 35 pts]

Create a YACC (or Bison) specification for TinyJava. Implement a parser for TinyJava (using your own Lex/Flex scanner for TinyJava).

You should start with a parser which handles only correct programs and then add a mechanism for error detection and recovery. Testing will be done on a mix of syntactically correct and incorrect programs.

B. Implement a semantic analyzer for TinyJava [due: April 7; 50 pts]

Enhance your parser created in part a) by adding the semantic analyzer. You must implement a symbol table mechanism and add semantic verification to your existing parser. Testing will be done on any TinyJava programs, emphasizing syntactically correct but semantically incorrect programs.

Your executable program MUST be called tjc and it MUST accept the source program file name from the command line. The source program file name MUST have the suffix .java. Furthermore, the base name of the file must be the same as the name of the TinyJava class it contains.

Submit (using submit) the directory containing your parser on nike to user csx570. The submitted directory must contain all the necessary files to create your tjc executable, including a suitable Makefile and a README file explaining how to create the tjc parser.