Home
  Contact
  Short Vita
  Research
  Teaching
  LSDIS Lab
  Links

TinyJava Compiler Project

Available information:

  1. All students will be implementing a small subset of the programming language Java, called TinyJava.
  2. Graduate students will have to implement additional constructs.
  3. The programming project will be subdivided into four parts. Current assignments are listed below:
    1. Part 1.
      As an example, I am including a Lex specification file for a simple desk calculator. The associated y.tab.h file has been automatically generated by Yacc (using the option -d). Please note that yacc is available in the directory /usr/ccs/bin/ which may be missing from your PATH shell variable. The wordcount (wc) specification presented in class is also available. Please, read some hints about using yytext as an external variable.
    2. Part 2.a) As an example, I am including a YACC specification file for a simple desk calculator, together with the associated LEX specification, and a simple main program.
      A good discussion of shift/reducue and reduce/reduce conflicts is included in the Bison manual.
      A few hints on providing error recovery in YACC-generated parsers are also included.
    3. Part 2.b) As an example of using semantic rules in YACC, I am including a YACC specification file for a simple desk calculator (including evaluation of expressions), together with the associated LEX specification, and a simple main program.
      Additional hints on how to implement project 2b are available here.
      You will find additional examples on nike in my directory: ~kochut/csx570/semant.
      I also created pages with additional hints on implementing symbol tables.
    4. Part 3. The last programming assignment is to add the intermediate code generation for the Java Virtual Machine. The intermediate code generation should be handled according to the TinyJava code patterns. Graduate student extensions of TinyJava should be handled according to the additional code patterns.
      I have created a page with a few examples of intermediate code generation for the Jasmin assembler.