Subtopic 4 of 4
3.4FIRST and FOLLOW
FIRST(α) = terminals that can begin a string derived from α (plus ε if α is nullable). FOLLOW(A) = terminals that can appear right after A in some sentential form; the start symbol has $.
Load example
| Non-terminal | Nullable | FIRST | FOLLOW |
|---|---|---|---|
| E | no | { (, id } | { $, ) } |
| E' | yes | { +, ε } | { $, ) } |
| T | no | { (, id } | { $, ), + } |
| T' | yes | { *, ε } | { $, ), + } |
| F | no | { (, id } | { $, ), *, + } |
Previous year questions: Grammars, Derivations & FIRST/FOLLOW (8)
PYQs are grouped by topic, so this is the full set for Grammars, Derivations & FIRST/FOLLOW; try the ones that match this subtopic. Open all 8 on the topic page.