Compiler Design
Paper Code: 105601
Question 01: Given grammar is ambiguous or not?[7M]
E → E + E| E * E| id
Answer:
Question 02: Consider the context free grammar.
[14M]
S→ SS+ |SS* |a
(a) Show how the string aa+a* can be generated by the grammar.
(b) Construct the parse tree for the string.
(c) What language does this grammar generate.
Answer:
Question 03: What is left recursion? Eliminate the left recursion from the following grammar:
[7M]
E → E + T |T
T → T*F |F
E → (E) |id
Answer:
Comments
Post a Comment