Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Shift–reduce parsing, handle?

Também chamado de: shift--reduce parsing · handle

Definition 3.1 University Computer Science — Year 3 · Capítulo 3 — Bottom-Up Parsing

Shift–reduce parsing reads the input from left to right onto a stack, shifting tokens and reducing right sides of productions at the top of the stack to their left sides. A handle of a right sentential form γ\gamma is a production A→βA \to \beta together with a position of β\beta in γ\gamma such that replacing that β\beta by AA gives the previous form of a rightmost derivation of γ\gamma.

The parse tree of id + id * id, each interior node numbered by the reduction that built it. Reduction 8 is the first step of the rightmost derivation on the right, reduction 1 its last.
The parse tree of id + id * id, each interior node numbered by the reduction that built it. Reduction 8 is the first step of the rightmost derivation on the right, reduction 1 its last.
Ler no capítulo →