(a) Define Ambiguity related to grammars, also discuss the rules to d…

Previous year question for Compiler Design.

Question

(a) Define Ambiguity related to grammars, also discuss the rules to disambiguate. Check whether the following grammar is ambiguous. If so, then remove the ambiguity $E \to E+E \mid E-E \mid E*E \mid E/E \mid (E) \mid -E \mid id$.

(b) Describe the method of the shift reduce parsing and how it is implemented using stack ? Explain with suitable example.

Related pages

More PYQs on Ambiguity in Grammars

Open on CachedInfo