Question No. 1: Consider the Grammar: A > B a | c B b | d c b|dc a B > q |e | A a c c > fA C B | q a) Eliminate the left recursion from the given grammar (if exists). b) Remove the left factoring from the given grammar (if exists). c) Make unambiguous if ambiguity found in given grammar. d) Describe the language generated by this grammar, also give five strings that can accept by this grammar. e) Calculate FIRST & FOLLOW sets as needed. f) Construct an LL (1) parse table for the grammar. g) Use the parse table to recognize the sentence 'c df c q aqfa’. Show the stack implementation.
Question No. 1:
Consider the Grammar: PLEASE REFER TO IMAGE FOR CORRECT FORMATTING OF THE QUESTION
A à B a | c B b | d C b | d C a
B à q | e | A a C
C à f A C B | q
a) Eliminate the left recursion from the given grammar (if exists).
b) Remove the left factoring from the given grammar (if exists).
c) Make unambiguous if ambiguity found in given grammar
d) Describe the language generated by this grammar, also give five strings that can accept by this grammar.
e) Calculate FIRST & FOLLOW sets as needed.
f) Construct an LL (1) parse table for the grammar.
g) Use the parse table to recognize the sentence ‘c d f c q a q f a’. Show the stack implementation.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps