stands for ; this is basically a method of
adding lookahead to parsers as simply as possible.
The technique is based on the following observation:
If we are in a DFA state containing the item:
then a possible action will be to reduce by
this rule. Doing this reduction would involve:
going from a sentential form that looks like: | |
to one that looks like: |
By looking at examples, we can see that the symbol immediately to
the right of the marker in a sentential form should correspond to the
next input symbol: we can rephrase this as: the symbol following
should be the next symbol in the input.
Since we already have a method of characterising the set of symbols which can follow a non-terminal in a sentential form, we can formulate the reduction rule:
This provides a quick and easy way to incorporate lookahead into the parser; however, there are many languages which are not .