Parser As we studied in class, the front end of a compiler consists of a lexer a
ID: 640925 • Letter: P
Question
Parser
As we studied in class, the front end of a compiler consists of a lexer and a parser. Lexer takes source code as input and produces a sequence of token based on the grammar defined for a programming language. Parser takes tokens as input and produces intermediate code in form of abstract parse trees. In this assignment you are about to complete a parser for Clite which is written in Java. A zip file containing the following files. It can be downloaded here. http://cs.txwes.edu/csc3320_2015sp/parser.html
You need to complete the following three methods in the file Parser.java. Don't modify other files.
Before implementing them, you need to study the completed methods for other grammar categories first. They are implemented in similar fashion. You need to use mystery.cpp to test your implementation of the three methods. The output should be the same as below. Once your parser works correctly with mystery.cpp, you need to run test with mystery_err.cpp where there are several syntax errors. Based on the error message, correct the errors and re-run your parser.
Submissions: The code of the three methods and corrected mystery_err.cpp AND parser tree output for mystery.cpp mystery_err.cpp