loading...

CS606 Compiler Construction GDB Solution Spring 2014

Graded Discussion Topic:

There are two types of parsing techniques, Top-down and Bottom-up. Considering an ambiguous grammar, which parsing technique is more appropriate to use? Discuss it with proper reasoning.

Solution: Bottom-up parsing technique is used for ambiguous grammar.

  • Bottom-up parsing can be viewed as trying to find a rightmost derivation in reverse for an input string.
  • handle is a rightmost substring in right-sentential form that matches the body of a production such that replacing that right-hand side by the nonterminal on the left-hand side of that production represents one step in the reverse of the rightmost derivation.
DOWNLOAD SOLUTION HERE
loading...