In the tar file 2_15-revised.tar, there's a smaller compiler for the revised calculator language in Chapter 2 of the text where we have changed the syntax to prefix rather than infix. The compiler compiles the text's 2_15 languag to C. The compiler code is in 2_15-func_active.c --> just the main() lexer-v2-1.c, lexer-v2-1.h --> the lexer code (actually contained in common/) parse-2.15-func_active.c --> the parser emit.c, emit.h --> the emitter symbol_table.c, symbol_table.h --> symbol table manipulation The runtime (also written in C since we are emitting C) is in the directory Runtime/header.c; it has library code for the implemented functions (add, subtract, multiply, divide) and it has the basic header, which includes the two important runtime data structures, the "expression_stack" and the space for runtime variable state "location". Our first modification to the calculator language will be to add "goto" syntax. First, you will need to modify the parser to recognize a new instruction "goto DESTINATION" in addition to its current suite of "read", "write", and assignment, and you will need to modify the parse to also recognize the label. To recognize a DESTINATION, you can use the already existing "identifier" regular expression. For the DESTINATION syntax; let's stick with the traditional postpositional ":". Thus it would might look something like: read A read B goto D write B D: write A You don't have to save your DESTINATIONs in any sort of data structure unless you wish, thus saving you from doing any sanity checks on your goto calls. You can run tests by using the Makefile-tests; for example, you might do something like: % make % make -f Makefile-tests clean && make -f Makefile-tests to recompile your code and then run the test suite. The file "test3.calc" tests your new GOTO statement. Once your code is working, your generated C code in the area of the "goto C" should look something like: goto C; expression_stack[stackptr] = location[0]; stackptr++; expression_stack[stackptr] = location[1]; stackptr++; mul(); location[3] = expression_stack[0]; stackptr = 0; C : expression_stack[stackptr] = location[2]; stackptr++; printf("%d\n",expression_stack[0]); You do not have to modify the graphviz output to reflect the new syntax, but you are welcome to do so if you wish. When you have finished, please tar up the two directories and submit them on Blackboard.