Compilers and Interpreters: Assignment 3
September 22, 2008
Problem 4.19 from our textbook (extend the scanner to allow underscore in
Compile the following Triangle program with the Triangle compiler using
your modified scanner. Run the compiled program. Use the disassembler to get
the assembly code generated by the compiler. The code for the compiler
can be found at
const x_1 ~ 7;
x_2 := 3;
x_2 := x_1*x_2;
Due Wednesday, October 1, at the start of class.
Hand in (or e-mail me before Wednesday class)
- the modified lexical grammar
- a printout of your revised Scanner.java,
- the TAM code generated by the compiler on the test program.