Difference between revisions of "Attribute Grammars"

From Wiki**3

(New page: Topics: attributes in grammar symbols; syntax-directed evaluation. Synthesized attributes: passed from child nodes to parent nodes. Inherited attributes: may be passed from parent- to ch...)
 
Line 5: Line 5:
 
Inherited attributes: may be passed from parent- to child nodes or between siblings.
 
Inherited attributes: may be passed from parent- to child nodes or between siblings.
  
S-grammars: only synthesized attributes.
+
S-attributed grammars: only synthesized attributes.
  
L-grammars: inherited attributes are only dependent on the parents' attributes or on the older brothers' (i.e., when evaluating left-to-right, only previously seen attributes are needed).
+
L-attributed grammars: inherited attributes are only dependent on the parents' attributes or on the older brothers' (i.e., when evaluating left-to-right, only previously seen attributes are needed).

Revision as of 18:35, 22 April 2008

Topics: attributes in grammar symbols; syntax-directed evaluation.

Synthesized attributes: passed from child nodes to parent nodes.

Inherited attributes: may be passed from parent- to child nodes or between siblings.

S-attributed grammars: only synthesized attributes.

L-attributed grammars: inherited attributes are only dependent on the parents' attributes or on the older brothers' (i.e., when evaluating left-to-right, only previously seen attributes are needed).