Difference between revisions of "Inherited attributes"

From eplmediawiki
Jump to: navigation, search
Line 5: Line 5:
 
''Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman''</p>
 
''Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman''</p>
  
<br><br>
+
<br>
  
 
'''See also:''' Synthesized attributes [inserir link]
 
'''See also:''' Synthesized attributes [inserir link]
  
 
[[Category:Basic Concepts]]
 
[[Category:Basic Concepts]]

Revision as of 03:14, 28 November 2012

An inherited attribute is one whose value at a node in a parse tree is defined in terms of attributes at the parent and/or sibling of that node. Inherited attributes are convenient for express the dependence of a programming language construct on the context in which it appears. For example, we can use an inherited attribute to keep track of whether an identifier appears on the left or right side of an assignment in order to decide whether the adress or the value of the identifier is needed. Although it is always possible to rewrite a syntax-directed definition to use only synthesized attributes, it is often more natural to use syntax-directed definitions with inherited attributes.

in "Compilers: Principles, Techniques and Tools"
Alfred V. Aho, Ravi Sethi, Jeffrey D. Ullman


See also: Synthesized attributes [inserir link]

Personal tools
Namespaces

Variants
Actions
Navigation
extras
Toolbox