Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Viable prefix, LR(0) automaton » ?

Aussi appelé : viable prefix · LR(0) automaton

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

An item A→β⋅δA \to \beta \cdot \delta is valid for a string γ\gamma of grammar symbols if Start⇒rm∗αAw⇒rmαβδw\mathit{Start} \Rightarrow^*_{\mathrm{rm}} \alpha A w \Rightarrow_{\mathrm{rm}} \alpha\beta\delta w with γ=αβ\gamma = \alpha\beta. A viable prefix is a string for which some item is valid: a prefix of a right sentential form that does not run past the end of its handle. The LR(0) automaton of a grammar has as start state the closure of {Start→⋅ S}\{\mathit{Start} \to \cdot\,S\}, as states every set reachable from it by the goto function, and a transition labelled XX from II to goto(I,X)\mathrm{goto}(I, X) whenever that set is not empty.

The LR(0) automaton of the expression grammar. Each box shows the kernel items (those whose dot is not at the start, and the start rule); the closure adds the others, as in I0. The moves that would cross the picture are written in the box as “also” symbol:target. A state with an item whose dot is at the end (I1, I2, I3, I5, I9, I10, I11) may reduce.
The LR(0) automaton of the expression grammar. Each box shows the kernel items (those whose dot is not at the start, and the start rule); the closure adds the others, as in I0. The moves that would cross the picture are written in the box as “also” symbol:target. A state with an item whose dot is at the end (I1, I2, I3, I5, I9, I10, I11) may reduce.
Lire dans le chapitre →