Name analysis establishes a meaning (possibly ``no meaning'', if certain errors have been made) for each identifier in the program. In the process, it decorates the nodes of the abstract syntax tree with attributes and stores properties of entities in the definition table. These attributes and properties provide the basis for constraint checking, and can also be used to guide a translation of the program.
Every identifier occurrence requires an integer-valued Sym attribute specifying its string table index. The string table index is provided by the lexical analyzer as the value of the terminal symbol identifer (see Section 1.1.3). IdentOcc defines a computation setting the Sym attribute from the terminal symbol value; that computation can be inherited by any nonterminal representing an identifier occurrence:
Many of the computations used during semantic analysis are common to many trees, and have been captured in library modules. Modules actually used in the semantic analysis of C programs must be instantiated: