Compiler Lab Assignment 1-2.docx
Compiler Lab Assignment 1-2.docx
Assignment 2:
A. Create a parser that can handle all the components of this programming language.
a. Write the production rules of your grammar.
b. Remove ambiguity using precedence and associativity.
c. Build the state-automata and the parse table.
d. Do error recovery using Synch symbols.
B. Show that this parser correctly parses the input token generated by your lexical
analyser for the programs written in your programming language as well as identifies
errors.
a. Parse the programs written in Assignment 1 and show that your compiler is
correctly detecting the tokens and report errors.
b. Parse the program using your parser. Print step by step parsing process and
draw the parse tree.