Recursive descent parsing

warning: Creating default object from empty value in /usr/share/drupal6/modules/taxonomy/taxonomy.pages.inc on line 33.

Lab 3-4 (en): recursive descent parsing

The previous lab involved writing a calculator for the postfix notation (RPN). This time we wrtie a calculator for the infix (i.e. ordinary) notation.
In the first sessions we write a correctness-checking parser, then extend it to build and iterpret a parse tree.

Starting with the expression grammar

\[ E \to E + E \mid E - E \mid E * E \mid E / E \mid (E) \mid n \]

Transform it first to unambiguous form, then to LL(1).

Then write a recursive descent parser.

Subskrybuje zawartość