Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « SLR table, shift–reduce and reduce–reduce conflicts » ?

Aussi appelé : SLR table · shift--reduce conflict · reduce--reduce conflict

Definition 3.6 University Computer Science — Year 3 · Chapitre 3 — Bottom-Up Parsing

The SLR table of a grammar has a row per state of its LR(0) automaton. Its action part has a column per terminal and $: cell [I,a][I, a] holds shift JJ if the automaton moves from II to JJ on aa, reduce A→βA \to \beta if A→β ⋅A \to \beta\,\cdot is in II and a∈FOLLOW(A)a \in \mathrm{FOLLOW}(A), and accept if a=$a = \$ and Start→S ⋅\mathit{Start} \to S\,\cdot is in II. Its goto part has a column per nonterminal, read from the automaton’s moves. A cell with a shift and a reduce is a shift–reduce conflict; a cell with two reduces is a reduce–reduce conflict. A grammar is SLR if its table has no conflict.

Lire dans le chapitre →