Compiler Design and Construction - Old Questions
Question Answer Details
6. Given the following grammar:
Answer
AI Generated Answer
AI is thinking...
Official Answer
Given Grammar;
Now, Calculating First and Follow:
FIRST
First(E) = First(T) = First(F) = { (, id }
First(E’) = { +, ∈ }
First(T’) = { *, ∈ }
FOLLOW
Follow(E) = { ), $}
Follow(E’) = { ), $}
Follow(F) = { *, +, ), $ }
Follow(T) = { +, ) , $}
Follow(T’) = { +, ) , $}
Now, the Parsing table for given grammar is as below: