Effective project viable prefix set

1, defined set of effective project viable prefix

 

2, simple to understand
this concept appeared in the LR analysis, LR analysis can be seen as a symbolic simulation analysis leftmost Statute, we assume that we are doing the most left when the statute, there is a sign we read stack storage symbol

 

Effective project viable prefix set, that is, when symbols within the stack is the rule of the viable prefix when at this depth, the next most likely to use the left statute.

 

3, an example of
a good example of a book on compiler theory

At this point there E + T * symbol stack
(skip this deeper depth Reduction process)
if the next symbol is read is F, it is possible to use T-> T * .F
if the read symbol is a next cluster (E) you can use F -.> (E)
if the next symbol is read i, you can use F -> i.
no other rules leftmost legal statute may apply, so only these three are the living effective project prefix.

4, quickly find viable prefix method
first to find the final rule should apply when the current state statute, the point of playing the part of a living prefix boundary.
For the example above, i.e. T-> T * .F.
Then for. "" Sign in the back of the rightmost nonterminal, it lists all the rules put. "" I hit the top.
For the example above, that is F -.> (E), F -> i.

Guess you like

Origin www.cnblogs.com/Asterism12/p/12045923.html