LR-attributed grammar

LR-attributed grammar

LR-attributed grammars are a special type of attribute grammars. They allow the attributes to be evaluated on LR parsing. As a result, attribute evaluation in LR-attributed grammars can be incorporated conveniently in bottom-up parsing. zyacc is based on LR-attributed grammars. They are a subset of the L-attributed grammars, where the attributes can be evaluated in one left-to-right traversal of the abstract syntax tree. They are a superset of the S-attributed grammars, which allow only synthesized attributes. In yacc, a common hack is to use global variables to simulate some kind of inherited attributes and thus LR-attribution.

External links

* http://www.cs.binghamton.edu/~zdu/zyacc/doc/zyacc_4.html
* Reinhard Wilhelm: LL- and LR-Attributed Grammars. "Programmiersprachen und Programmentwicklung, 7. Fachtagung, veranstaltet vom Fachausschuß 2 der GI" (1982), 151–164, Informatik-Fachberichte volume 53.
* J. van Katwijk: A preprocessor for YACC or A poor man's approach to parsing attributed grammars. "Sigplan Notices" 18:10 (1983), 12–15.


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • ECLR-attributed grammar — ECLR attributed grammars are a special type of attribute grammars. They are a variant of LR attributed grammars where an equivalence relation on inherited attributes is used to optimize attribute evaluation. EC stands for equivalence class. Rie… …   Wikipedia

  • S-attributed grammar — S attributed grammars are a class of attribute grammars characterized by having no inherited attributes. Inherited attributes, which must be passed down from parent nodes to children nodes of the abstract syntax tree during the semantic analysis… …   Wikipedia

  • L-attributed grammar — L attributed grammars are a special type of attribute grammars. They allow the attributes to be evaluated in one left to right traversal of the abstract syntax tree. As a result, attribute evaluation in L attributed grammars can be incorporated… …   Wikipedia

  • Grammar — is the field of linguistics that covers the rules governing the use of any given natural language. It includes morphology and syntax, often complemented by phonetics, phonology, semantics, and pragmatics. Each language has its own distinct… …   Wikipedia

  • attributed — at·trib·ute || É™ trɪbjuːt n. quality, characteristic; adjective (Grammar) v. ascribe to; credit with …   English contemporary dictionary

  • Attribute grammar — An Attribute grammar is a formal way to define attributes for the productions of a formal grammar, associating these attributes to values. The evaluation occurs in the nodes of the abstract syntax tree, when the language is processed by some… …   Wikipedia

  • HEBREW GRAMMAR — The following entry is divided into two sections: an Introduction for the non specialist and (II) a detailed survey. [i] HEBREW GRAMMAR: AN INTRODUCTION There are four main phases in the history of the Hebrew language: the biblical or classical,… …   Encyclopedia of Judaism

  • Colchester Royal Grammar School — For other schools with the name RGS, see Royal Grammar School. Colchester Royal Grammar School Motto Vitae Corona Fides (Faith is the Crown of Life) Established By 1206 Refounded 1539 Refounded 1584 Type …   Wikipedia

  • Dover Grammar School for Boys — Motto Fiat lux (Let there be light) Genesis 1:3 Established 1904 Type Grammar school Religion Non denominational Headteacher Dr Richard Moxham …   Wikipedia

  • The Portsmouth Grammar School — Infobox UK school name = The Portsmouth Grammar School size = 100px dms = motto = Praemia Virtutis Honores motto pl = established = 1732 approx = closed = c approx = type = Public school religion = Church of England president = head label = Head… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”