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 number 1
- precedence table:
S a b c S a b c
- As there is no conflict present in the table, and there is no Useless Rules nor Erasing Rules, and the grammar is Uniquely Inversible, this grammar is a Simple precedence grammar