Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es SLR table, shift–reduce and reduce–reduce conflicts?

También llamado: SLR table · shift--reduce conflict · reduce--reduce conflict

Definition 3.6 University Computer Science — Year 3 · Capítulo 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.

Leer en el capítulo →