Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é LL(1) grammar, predictive parsing table?

Também chamado de: predictive parsing table · LL(1) grammar

Definition 2.4 University Computer Science — Year 3 · Capítulo 2 — Top-Down Parsing

The predictive parsing table of a grammar has a row per nonterminal and a column per terminal (and $). Production A→αA \to \alpha is put in cell [A,a][A, a] for every a∈FIRST(α)a \in \mathrm{FIRST}(\alpha), and, if α\alpha is nullable, for every a∈FOLLOW(A)a \in \mathrm{FOLLOW}(A). A grammar is an LL(1) grammar if no cell of its table holds two productions.

The first eight stacks of the predictive parser, bottom to top: each column is the stack after the action written under it. Predicting a production replaces a nonterminal by its right side; matching pops a terminal.
The first eight stacks of the predictive parser, bottom to top: each column is the stack after the action written under it. Predicting a production replaces a nonterminal by its right side; matching pops a terminal.
Ler no capítulo →