<< Prev | - Up - | Next >> |
Download leftrec.pl
, the left-recursive grammar that we already saw in the previous section. Can the left-corner recognizer cope with it? Why does it not have the same problems with it as the top-down algorithm?
Now, download epsilon.pl
, the grammar with the empty production that we already saw in the chapter in bottom-up recognition. Write a left-corner table for it. (Note: is a kind of terminal symbol.) Now, change leftcorner_recognizer_table.pl
so that you can use it with epsilon.pl
. Next, compare how leftcorner_recognizer_table.pl
, the left-corner recognizer using left-corner tables, and leftcorner_recognizer.pl
, the left-corner recognizer not using left-corner tables, behave when working with grammar epsilon.pl
.
Turn the left-corner recognizer into a parser by adding an extra argument to collect the structure.
Extend ourEng.pl
so that it accepts coordination of noun phrases. It should e.g. accept the man and the woman danced or marsellus and mia and the robber laughed. Could your grammar also be processed by a top-down or a bottom-up recognizer?
<< Prev | - Up - | Next >> |