11.1 Preparation for Code Generation

11.2 Generation of Directives

11.3 Simple Code Generation from AST's

11.4 Standard Code Generation Strategies

11.5 Code Generator Generators

11.6 Register Allocation

11.7 A Better Code Generation Algorithm from AST's 11.8 Code Generation from DAG's

11.9 Retargetable Code Generation

11.10 Peephole Optimization

11.11 Summary

Web References

Exercises

11.2 Generation of Directives from the Symbol Table

The symbol table is used to generate directives. Thus if A is entered in the symbol table with class equal to variable, and attribute type equal to integer, then the directive which allocates space for an integer is generated.

Example 1 shows directives for integers for a number of machines.

Example 1 Directives from a symbol table entry for a name with class = variable, type = integer, and character string A

 	On an 86-family:	A	DW	?
 	On a M68000:		A	DS.L