全部书籍

专业

应用 关于 Coach 登录 开始阅读

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

Computer Science · 术语表

什么是 Nullable, FIRST, FOLLOW?

又称: nullable · FIRST set · FOLLOW set

Definition 2.2 University Computer Science — Year 3 · 第 2 章 — Top-Down Parsing

Let GG be a grammar and α\alpha a string of terminals and nonterminals. α\alpha is nullable if α⇒∗ε\alpha \Rightarrow^* \varepsilon. The FIRST set FIRST(α)\mathrm{FIRST}(\alpha) is the set of terminals aa such that α⇒∗aβ\alpha \Rightarrow^* a\beta for some β\beta. For a nonterminal AA, the FOLLOW set FOLLOW(A)\mathrm{FOLLOW}(A) is the set of terminals aa such that S⇒∗βAaγS \Rightarrow^* \beta A a \gamma for some β,γ\beta, \gamma, where SS is the start symbol; it contains the end marker $ if S⇒∗βAS \Rightarrow^* \beta A.

在原文中阅读 →