CSC 4101 Chapter : Homework 3
Document Summary
Homework 3: in order for eq? to be implemented using simple pointer comparison, we must ensure that identifiers are handled such that a new ident object is not created for every occurrence of a symbol. The semantic analysis phase of compilation recognizes when multiple occurrences of the same identifier are meant to refer to the same program entity, and ensures that the uses are consistent. In most languages the semantic analyzer tracks the types of both identifiers and expressions, both to verify consistent usage and to guide the generation of code in later phases. To assist in its work, the semantic analyzer typically builds and maintains a symbol table data structure that maps each identifier to the information known about it. Then, we could modify the code were widget objects are created so that they are initialized to a widgettester class instead. The result is a sequence of theoretically infinite length, where each element is computed only when needed.