[Project 1 is due on Monday, 10/28]
Goal: Understanding the interaction between Lex and Yacc
Abstract: This project is a first step toward building a compiler for a C-MINUS-MINUS language, which have been especially crafted to be used for this academic project. This project is meant to make you conversant with the interaction between the lex/flex (lexical analysis generator) and the yacc/bison (parser generator).
Deadline: End of Fall’2013 (Although the deadline for every project is the end of semester, each project builds the foundation for the successive one. So, please pace yourself such that you are able to finish the overall project on time.)
Problem (Harder): The problem description can be found here where the grammar presented has shift-reduce conflict. It would be interesting to find out all the origins of shift-reduce conflicts.
Problem (Simpler): Here is the problem description with an updated grammar, where all the shift-reduce conflicts have been removed.
Expected Results: The test files (with extensions .cmm) can be found here. All the test files have their corresponding erroneous files (test*e.cmm), which can be tested for syntactic errors.
The expected result can be generated using the executable ccmm found here. You can run the program as follows:
<path_to_file>/ccmm < testfile.cmm
To run all the positive tests, run the script runpositive located here. There should not be any “syntax error” for the positive tests.
To run all the negative tests, run runnegative also located here. All the negative tests should result in “syntax errors”.
Submitting to provide system:
provide comp181 project1 <file1> [<file2> [<file3> ...]]