Alle boeken

Professioneel

Apps Over Coach Inloggen Begin met lezen

Computer Science · Begrippenlijst

Wat is Nullable, FIRST, FOLLOW?

Ook bekend als: nullable · FIRST set · FOLLOW set

Definition 2.2 University Computer Science — Year 3 · Hoofdstuk 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.

Lees in het hoofdstuk →