Computer Science 5641
Compiler Design
Homework Assignment 3 (20 points)
Due October 29, 2002
- [5] Construct an LL(1) parser for the grammar:
- BEXPR -> BEXPR or BTERM | BTERM
- BTERM -> BTERM and BFACTOR | BFACTOR
- BFACTOR -> not BFACTOR | ( BEXPR ) | true | false
Document any changes you make to the grammar.
- [5] Construct an SLR parser for the grammar in the previous question.
- [5] Do exercise 5.6 from the textbook.
- [5] Convert the grammar in part 1 to an equivalent grammar using only
one non-terminal and then implement that grammar in bison.
NOTE:
The following question may not be covered by the time this homework is due,
so it will be held for the next homework assignment:
- [5] Do exercise 6.3 from the textbook.