Compiler-Design-Grammars
Question 1 |
Construct the LL(1) table for the following grammar.
1. Expr → _Expr 2. Expr → (Expr) 3. Expr → Var Expr Tail 4. ExprTail → _Expr 5. ExprTail → λ 6. Var → Id Var Tail 7. VarTail → (Expr) 8. VarTail → λ 9. Goal → Expr$
Theory Explanation. |
Question 2 |
Consider the CFG with {S,A,B} as the non-terminal alphabet, {a,b} as the terminal alphabet, S as the start symbol and the following set of production rules:
S → aB S → bA B → b A → a B → bS A → aS B → aBB A → bAA
For the correct answer strings to Q.78, how many derivation trees are there?
1 | |
2 | |
3 | |
4 |
Question 2 Explanation:
There exist two parse tree for the string “aabbab” using LMD (left most derivation)