Part of a production rule in a context-free grammar
In formal language theory, the left corner of a production rule in a context-free grammar is the left-most symbol on the right side of the rule.[1]
For example, in the rule A→Xα, X is the left corner.
The left corner table associates to a symbol all possible left corners for that symbol, and the left corners of those symbols, etc.
Given the grammar
- S → VP
- S → NP VP
- VP → V NP
- NP → DET N
the left corner table is as follows.
Symbol
|
Left corner(s)
|
S
|
VP, NP, V, DET
|
NP
|
DET
|
VP
|
V
|
Left corners are used to add bottom-up filtering to a top-down parser, or top-down filtering to a bottom-up parser.
References