Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is LL(1) grammar, predictive parsing table?

Ook bekend als: predictive parsing table · LL(1) grammar

Definition 2.4 University Computer Science — Year 3 · Hoofdstuk 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.
Lees in het hoofdstuk →