
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Note that productions output are tracing out a lefmost derivation. The grammar symbols on the stack make up left-sentential forms.
LL(1) Table Construction
Top-down parsing expands a parse tree from the start symbol to the leaves. It always expand the leftmost non-terminal. Consider the state
S? ∗^ β A γ
with b the next token and we are trying to match β b γ. There are two possibilities
Any A? α can be used if α expands to ε. We say that ε ∈ FIRST(A) in this case.
Definition
FIRST(X) = { b | X? ∗^ ba } ∪ { ε | X? ∗^ ε }