Simple precedence grammar
Appearance
A Simple precedence grammar is a context-free formal grammar that can be parsed with Simple precedence parser.
Formal definition
G = (N, Σ, P, S) is a Simple precedence grammar such that all the productions rules in P complies with the following constraints:
- There is no Erasing Rules (ε-productions)
- There is no Useless Rules (unreacheable symbols or unproductives rules)
- For each pair of symbols X, Y (X, Y (N ∪ Σ)) there is only one Wirth-Weber precedence relation.
- G is Uniquely Inversible
Examples
Example 1
precedence table:
S | a | b | c | |
S | ||||
a | ||||
b | ||||
c |