Tag. LL
Notes (5)
Definition. First Sets in Dependent Lambek Calculus first-set-in-dependent-lambek
The first set of a grammar may be captured in Lambek via the following proposition:
Or perhaps with ones of the grammars
Definition. FollowLast Sets in Dependent Lambek Calculus followlast-set-in-dependent-lambek
The followlast set of a grammar may be captured in Lambek via the following proposition:
Or perhaps with ones of the grammars
Definition. LL(1) Condition ll1-condition
A context-free grammar satisfies the LL(1) condition if it satisfies the following three conditions:
- All of its productions have pairwise disjoint first sets
- If a concatenation of nonterminals appears in a production, then has a disjoint followlast set from the first set of
- At most one production is nullable
This is essentially the type system of [1], which characterizes the LL(1) condition for context-free expressions.
Intutively, an LL(1) grammar can be parsed unambiguously, and without backtracking, by a predictive parser that only needs one token of lookahead.
Definition. Nullability in Dependent Lambek Calculus nullability-in-dependent-lambek
The nullability () of a grammar may be captured in Lambek via the following proposition:
Or perhaps with one of the grammars
Definition. Sequential Unambiguity sequential-unambiguity
Grammars and are sequentially unambiguous if the followlast set of is disjoint from the first set of .
We can understand this intuitively by characterizing the behavior of a left-to-right parser of . First it searches for a parse of , then upon finding a character that is not in it may begin trying search for .
That is, there is a unique boundary between the -parse and the -parse.