6.0 Introduction

6.1 Static Checking

6.2 Attribute Grammars

6.3 Translation to an IR

6.4 Semantic Analyzer Generators

6.5 More on Attribute Grammars

6.6 Attribute Evaluation

6.7 Summary

Web References

Exercises

6.2.1 Attributes

Attributes are variables to which values are assigned. Each attribute variable is associated with one or more nonterminals or terminals of the grammar.

In the grammar of Section 6.2.2, the attribute Value is associated with the nonterminals E, T, and F as well as with the terminal Constant. For nonterminal E, this is written:

    E.Value

This notation indicates that nonterminal "E" has an attribute called Value attribute names will be italicized.

Send questions and comments to: Karen Lemone