Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu LL(1) grammar, predictive parsing table?

Dikenal juga sebagai: predictive parsing table · LL(1) grammar

Definition 2.4 University Computer Science — Year 3 · Bab 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.
Baca dalam konteks →