Attribute_grammar Attribute_grammar

Attribute grammar - Definition and Overview

Related Words: Affection, Appositive, Aroma, Badge, Blame, Brand, Cachet, Calendar, Cast

When constructing a language translation tool, such as a compiler, an attribute grammar is the formal expression of the syntax-derived semantic checks associated with a grammar. It represents the rules of a language not explicitly imparted by the syntax. In a practical way, it defines the information that will need to be in the abstract syntax tree in order to successfully perform semantic analysis. This information is stored as attributes of the nodes of the abstract syntax tree. The attributes are divided into two groups, called synthesised attributes and inherited attributes. The synthesised attributes are the result of the attribute evaluation rules also using the values of the inherited attributes. The values of the inherited attributes are inherited from parent nodes.

The strength of attribute grammars is that they can transport information from anywere in the abstract syntax tree to anywhere else, in a controlled way.

Types of Attribute grammars

Copyright 2009 WordIQ.com - Privacy Policy  :: Terms of Use  :: Contact Us  :: About Us
This article is licensed under the GNU Free Documentation License. It uses material from the this Wikipedia article.