Question
Consider the following grammar G: E -> E + T | T T -> T F | F F -> F* | a | b
Consider the following grammar G: E -> E + T | T T -> T F | F F -> F* | a | b
This grammar can be used to generate regular expressions over the alphabet {a,b} with standard precedence rules. Show your solution for each of the following 5 points:
1. Remove left recursion and write the resulting grammar G1. 2. For the grammar G1, compute and write the sets FIRST for every right hand side of every production, and the sets FOLLOW for every left hand side (i.e. any non-terminal). 3. Find and write the table for a predictive parser 4. Is G1 LL(1)? Justify your answer. 5. If the answer to (4) above is yes, then trace parsing of: a* + ab*
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started