Ambiguous-and-Unambiguous-Grammar

Question 1

Consider the following grammar for arithmetic expression using binary operators – and/which are not associative:

   E → E−T|T
   T → T/F|F
   F → (E)id 
(E is the start symbol)

(a) Is this grammar unambiguous? If so, what is the relative precedence between – and/if not, give an unambiguous grammar that gives/precedence over -
(b) Does the grammar allow expressions with redundant parentheses as in (id/id) or in id-(id/id)? If so, convert the grammar into one which does not generate expressions with redundant parentheses. Do this with minimum number of changes to the given production rules and adding at most one more production rule.

A
Theory Explanation.
There is 1 question to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access