CS 327 Homework 3
- Due Date
- 4:00 pm Friday September 25
- Assignment Names
- hw3
- File Names
- ast.c error.c list.c pool.c sc.c testlexer.c codegen.c lexer.c parser.c reserved.c testparser.c ast.h codegen.h debug.h error.h lexer.h list.h parser.h pool.h reserved.h Makefile
- Add the relational
operators
<<=>>= - Add the binary
operators
LTLEGTGE - Make the write and writeln statements take multiple arguments, like
this:
write(1, a + 2, 3) - In addition, modify write and writeln to allow (but not require)
field widths for arguments,
like this:
write(1 : 10, a + 2, 3 : w + 4). You will need to modify the lexer, parser, and ast. - Add a repeat statement. The syntax is
repeat stmt_list until rel_expr. You will need to modify the lexer and parser and add a case in the ast. - Add (or modify existing) print functions for the ast additions. Use the same style as the original print functions.
Turnin will create and collect a tar ball containing your files, in addition to running testlexer and testparser on some sample files. If you don't fix up the print functions then I will be unable to test your additions, so don't ignore this part of the assignment.