FACTOID # 93: Saudi diplomats have 367 unpaid parking fines in Britain.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

SEARCH ALL

FACTS & STATISTICS    Advanced view

Search encyclopedia, statistics and forums:

 

 

(* = Graphable)

 

 


Encyclopedia > Attribute grammar

The attribute modifies any noun or noun phrase irrespective of what part it play in the sentence. The antecedent of the attribute may be the subject,object,predicative or part of an adverbial phrase. It can even itself serve as an attribute to another noun:Italic textJohn,Bold texta rosy cheeked young lad, Italic textanswered the question. 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. A diagram of the operation of a typical multi-language compiler. ...


In a practical way, an attribute grammar 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. Basically, synthesized attributes are used to pass semantic information up the parse tree, while inherited attributes are used to pass semantic information down the parse tree. Lloyd smells. ...


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


Types of attribute grammars

  • L-attributed grammar
  • S-attributed grammar

L-attributed grammars are a special type of attribute grammars. ... S-attributed grammars are a class of attribute grammars, comparable with L-attributed grammars but characterized by having no inherited attributes at all. ...

External links

  • Why Attribute Grammars Matter, The Monad Reader, Issue 4, July 5th 2005
  • Semantics of context-free grammars, by Don Knuth, is the original paper introducing attributed grammars.

  Results from FactBites:
 
Cover Pages: XML and Attribute Grammars (4034 words)
Attribute grammars provide a mechanism for annotating the nodes of a tree with so-called 'attributes', by means of so-called 'semantic rules' which can work either bottom-up (for so-called 'synthesized' attribute values) or top-down (for so-called 'inherited' attribute values).
Attribute grammars, on the other hand, are a declarative formalism, whose evaluation visits each node of the input tree only a constant number of times (once for each attribute).
Attribute grammars provide a mechanism for annotating the nodes of a tree with so-called 'attributes', by means of so-called 'semantic rules' which can work either bottom-up (for so- called 'synthesized' attribute values) or top-down (for so- called 'inherited' attribute values).
  More results at FactBites »


 
 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms, 1022, m