![]() |
Parsing needs to be performed on a lattice, where the symbols which we need to consider for inclusion in the string, come at random times. This results in appearance of ``spurious'' (i.e. ungrammatical) symbols in the input stream. We need to be able to consider these inputs separately, at different time steps and disregard them if their appearance in the input stream for some derivation is found to be ungrammatical. At the same time, we need to preserve the symbol in the stream for considering it in other possible derivations, perhaps even of a completely different string. The problem is illustrated by figure 3.
One simple approach is to convert the
grammar G to a robust grammar
by first introducing the
SKIP non-terminal which is allowed to match any input symbol
4, and then by
making the following modifications:
| G: | |||
|
|
|
|
|
This process can be performed automatically as a pre-processing step, when the grammar is read in by the parser, so that no modifications to the grammar are explicitly written.