Compiler Lab 2
Compiler Lab 2
Compiler Lab 2
Antlr
Antlr is a syntax analyzer/parser generator which takes a
language definition in the form of LL(*) grammar and generates
the corresponding parser in Java. The Java program when
executed, takes the input program and checks if it conforms to
the grammar.
1. Try with wrong inputs and see that the parse tree
does not get generated. Observe the errors thrown.
2. Enhance the grammar and add rules for accepting an
integer also along with identifiers.
Example 2:
Exercises