<< Prev | - Up - |
Ex.
Exercise 7.1
Download
leftrec.pl
, the left-recursive grammar that we already saw in the previous chapter. Can the left-corner recognizer cope with it? Why does it not have the same problems with it as the top-down algorithm?
Exercise 7.2
Now, download
epsilon.pl
, the grammar with the empty production that we have seen before, as well. Write a left-corner table for it. (Note:is a kind of terminal symbol.).
Exercise 7.3
[This is tricky] Turn the left-corner recognizer into a parser by adding an extra argument to collect the structure.
Hint: you have to add two arguments
ParseIn
,ParseOut
to the predicatecomplete
.
<< Prev | - Up - |