Jump to content

Simple precedence grammar

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Colonel Warden (talk | contribs) at 13:46, 16 July 2012 (re Wirth and Weber). 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.[1] The concept was first developed by Niklaus Wirth and Helmut Weber from the ideas of Robert Floyd in their paper, EULER: a generalization of ALGOL, and its formal definition, in the Communications of the ACM in 1966.[2]

Formal definition

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

Examples

precedence table:

S a b c $
S
a
b
c
$

References

  1. ^ The Theory of Parsing, Translation, and Compiling: Compiling, Alfred V. Aho, Jeffrey D. Ullman, Prentice-Hall, 1972.
  2. ^ Machines, Languages, and Computation, Prentice-Hall, 1978, ISBN 9780135422588, Wirth and Weber [1966] generalized Floyd's precedence grammars, obtaining the simple precedence grammars.
  • [1] at Clemson University