Todos os livros

Profissional

Apps Sobre Coach Entrar Começar a ler

Computer Science · Glossário

O que é Nullable, FIRST, FOLLOW?

Também chamado de: nullable · FIRST set · FOLLOW set

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

Ler no capítulo →