Simple precedence grammar

From Wikipedia, the free encyclopedia

A simple precedence grammar is a context-free formal grammar that can be parsed with a simple precedence parser.

Contents


[edit] Formal definition

G = (N, Σ, P, S) is a simple precedence grammar if all the production rules in P comply with the following constraints:

[edit] Examples

[edit] Example 1

S \to aSSb | c

precedence table:

S a b c
S \dot = \dot < \dot = \dot <
a \dot = \dot < \dot <
b \dot > \dot > \dot >
c \dot > \dot > \dot >


In other languages