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.4 Semantic Analyzer Generators

      A semantic analyzer generator does not follow the table/ driver model developed in the previous chapters. The input, an attribute grammar, is more of a specification language than a true metalanguage.

      Most parser generators allow semantic actions to be attached to the productions in the BNF. A few allow these semantic actions to be described using attribute grammars.

The amount of processing done at generation time depends on the attribute grammar itself. Consider the picture shown in Figure 1:

      In some cases, the evaluator generator will be null, that is, an evaluator will not be generated. If the generator is null, it may be that the attributes were in a form that could be evaluated during parsing. Another possibility is that the attributes are evaluated one. We will discuss all of these possibilities.

Send questions and comments to: Karen Lemone