• Aucun résultat trouvé

The splitting of the FOLLOW set is the source of power of LR(1), but this power is not needed in each and every state

N/A
N/A
Protected

Academic year: 2022

Partager "The splitting of the FOLLOW set is the source of power of LR(1), but this power is not needed in each and every state"

Copied!
1
0
0

Texte intégral

(1)

Modern compiler p. 165:

The reason why conflict resolution by FOLLOW set does not work nearly as well as one might wish is that it replaces the look-ahead of single item of rule N in a given LR state by FOLLOW set of N, which is the union of all the look-aheads of all alternatives of N in all states.

LR(1) item sets are more discrimating : a look-ahead set is kept with each separate item, to be used to resolve conflicts when a reduce item has been reached. This greatly

increases the strength of the parser, but also the size of the parsing table.

Page 168 :

We see that the LR(1) automaton is more discrimating than the SLR(1) automaton. In fact, it is so strong that any language that CAN be parsed from left to right with one look- ahead in linear time can be parsed using LR(1) method : LR(1) is the strongest possible linear left-to-right parsing method. The reason is that it can bshown (Knuth 1965) that the set of LR items implements the best possible breadth-first search for handles.

Page 170.

The splitting of the FOLLOW set is the source of power of LR(1), but this power is not needed in each and every state. For instance, we could combine state .. and state .. into … without compromising the discriminatory power of the LR(1) automaton. Note that we combine states with the same core only, and we do this by adding the look-ahead sets of the corresponding items they contain.

1st paragraph, section 2.2.5.6 : LR(1) states are always split up versions of LR(0) states.

Hence the LALR(1) automaton will have the same number of states as the SLR automaton ! The difference is that the FOLLOW stes will have been discriminated.

Also last paragraph page 171 confirms that!

Page 172:

One reason why the LALRL method works so well is that state combination cannot cause shift-reduce conflicts. See explanation on page 172.

See also the Page 173 on resolving shift-reduce conflicts.

Références

Documents relatifs

In the first part, by combining Bochner’s formula and a smooth maximum principle argument, Kr¨ oger in [15] obtained a comparison theorem for the gradient of the eigenfunctions,

Suppose R is a right noetherian, left P-injective, and left min-CS ring such that every nonzero complement left ideal is not small (or not singular).. Then R

Ce but est atteint selon la presente invention grace a un detecteur de pression caracterise par le fait que la jante de la roue est realisee en un materiau amagnetique, le capteur

Le nouveau produit comporte de la sphaigne blanchie en combinaison avec de la pulpe de bois mecanique flnement dlvisee ayant one valeur CSF (Canadian Standart Freeness est

Banica introduced the notions of dephased and undephased de- fects for matrices F G , and showed that they give upper bounds for the tangent spaces at F G to the real algebraic

In order to do so, compare the free energy of a perfectly ordered system with the free energy of a partially disordered case that introduces the less energetic frustrations

9.In 16---, the Pilgrim fathers , the Puritans established the

Poor people cannot afford preventive or curative medical services in countries that do not guarantee health for all; so they not only fall ill (we all do from time to time),