Menu
Home Explore People Places Arts History Plants & Animals Science Life & Culture Technology
On this page
Simple precedence grammar

A simple precedence grammar is a context-free formal grammar that can be parsed with a simple precedence parser. The concept was first created in 1964 by Claude Pair, and was later rediscovered, from ideas due to Robert Floyd, by Niklaus Wirth and Helmut Weber who published a paper, entitled EULER: a generalization of ALGOL, and its formal definition, published in 1966 in the Communications of the ACM.

We don't have any images related to Simple precedence grammar yet.
We don't have any YouTube videos related to Simple precedence grammar yet.
We don't have any PDF documents related to Simple precedence grammar yet.
We don't have any Books related to Simple precedence grammar yet.
We don't have any archived web articles related to Simple precedence grammar yet.

Formal definition

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

Examples

S → a S S b | c {\displaystyle S\to aSSb|c} precedence table S a b c $ S = ˙ ⋖ = ˙ ⋖ a = ˙ ⋖ ⋖ b ⋗ ⋗ ⋗ c ⋗ ⋗ ⋗ ⋗ $ ⋖ ⋖ {\displaystyle {\begin{array}{c|ccccc}&S&a&b&c&\$\\\hline S&{\dot {=}}&\lessdot &{\dot {=}}&\lessdot &\\a&{\dot {=}}&\lessdot &&\lessdot &\\b&&\gtrdot &&\gtrdot &\gtrdot \\c&&\gtrdot &\gtrdot &\gtrdot &\gtrdot \\\$&&\lessdot &&\lessdot &\end{array}}}

Notes

  • Alfred V. Aho, Jeffrey D. Ullman (1977). Principles of Compiler Design. 1st Edition. Addison–Wesley.
  • William A. Barrett, John D. Couch (1979). Compiler construction: Theory and Practice. Science Research Associate.
  • Jean-Paul Tremblay, P. G. Sorenson (1985). The Theory and Practice of Compiler Writing. McGraw–Hill.

References

  1. The Theory of Parsing, Translation, and Compiling: Compiling, Alfred V. Aho, Jeffrey D. Ullman, Prentice–Hall, 1972.

  2. Claude Pair (1964). "Arbres, piles et compilation". Revue française de traitement de l'information., in English Trees, stacks and compiling

  3. Machines, Languages, and Computation, Prentice–Hall, 1978, ISBN 9780135422588, Wirth and Weber [1966] generalized Floyd's precedence grammars, obtaining the simple precedence grammars. 9780135422588