全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 LL(1) grammar, predictive parsing table?

又称: predictive parsing table · LL(1) grammar

Definition 2.4 University Computer Science — Year 3 · 第 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.
在原文中阅读 →