Starting from:
$29.99

$23.99

Project #2 Solution

Hand-in Policy: Source code (modified file and additional if needed) should be handed in via Moodle. No late submission will be accepted.

Collaboration Policy: No collaboration is permitted. Any cheating (copying someone else’s work in any

form) will result in a grade of -100 for the first offense and -200 for the subsequent ones.

Grading: Each project will be graded on the scale 100.  

 

 

Coffee Language Parse (100 points): Given the previous description of the Coffee language (CoffeLanguage_Syntax.pdf)  you are asked to implement the parser. You are expected to use Shift- Reduce parser. Your output will be the string representation of a parse tree. Tokenization should be done by your previous project. You should implement your own tree structure to build your parse tree.

 

 You will combine your previous project with the code provided and complete the Parser class.  

 

 

The only file that you are required to modify is “Parser.java” and “Lexer.java”.  

 

Submission and Grading

 

Coffee-Part2.zip contains an IntelliJ Idea project, you are expected to submit an IntelliJ Idea project. Do not modify the provided files other than Parser and Lexer classes.  

 

 

 

Example input:  (+ x y) Parsing result:  

START - INPUT

 

- EXPI


 

       - (+ EXPI EXPI)

 

- (+ EXPI Id)

 

- (+ Id Id)

 

 

 

Note: There are several changes in Coffee Project. You should consider these changes and modify your Project 1 submission according to new version.

More products