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 Attribute Grammars

An attribute grammar is a context-free grammar with the addition of attributes and attribute evaluation rules called semantic functions. Thus, an attribute grammar can specify both semantics and syntax while BNF specifies only the syntax.

Attributes

Semantic Functions

A word (or 2) about Example 1

A More Practical Example

Other Static Checks

Send questions and comments to: Karen Lemone