Go to the previous, next section.

Symbols

Symbols are used to refer to variables, labels, and procedures. Each symbol is represented by a unique instance of a simple_sym structure, which records the kind of symbol (VAR_SYM, LABEL_SYM, or PROC_SYM) and the symbol name. For variable symbols, the simple_sym structure includes another field to record the type of the variable. Other information about symbols is not accessible in Simple-SUIF but is recorded in the underlying SUIF symbol structures pointed to by the suif_sym fields in the simple_sym structures.

Rules for manipulating Simple-SUIF symbols are similar to those for types. As the data in a simple_sym structure does not uniquely define the symbol, always refer to symbols by the addresses of their simple_sym structures and use these addresses to test for equality. As with types, you cannot directly modify or create new simple_sym structures. However, the library provides several functions for creating new symbols. The new_label function creates and returns a new label symbol. New local variables are generated by the new_register function (see section Registers). There is currently no way to create new global variables or procedure symbols.

Go to the previous, next section.