Jump to content

Simple precedence grammar

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 27.5.118.153 (talk) at 13:11, 31 March 2012 (Formal definition). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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

Formal definition

Theory:

A grammar is said to ge simple precedence grammar if it has no e-productions, no two productions have the same right side, and the relations <. s, = s,and .>s and disjoint. A SMP behaves eaxctlyas an OPM does, but NT’s are kept on the stack and enter into relations.


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

Examples

Example 1

precedence table:

S a b c $
S
a
b
c
$