SUIF symbols are stored in the symbol tables (see section Symbol Tables) to
represent variables, labels, and procedures. The sym_node
class
is the base class for all SUIF symbols. This is an abstract class so it
cannot be used directly. The library also defines the
sym_node_list
class for lists of pointers to symbols. Classes
are derived from the sym_node
class for each kind of symbol.
Given an arbitrary symbol, the kind
method identifies the kind of
symbol and thus the derived class to which it belongs. This method
returns a value from the sym_kinds
enumerated type. The
following values are defined in that enumeration:
SYM_VAR
var_sym
class represents variable symbols.
SYM_LABEL
label_sym
class represents label symbols.
SYM_PROC
proc_sym
class represents procedure symbols.
All symbols share some common fields including the symbol names. These are described in the first section below. Each kind of symbol also uses additional fields that are specific to that kind. For example, variable symbols specify the types of the variables. The subsequent sections describe the specific features of each kind of symbol.
The `symbols.h' and `symbols.cc' files contain the source code for SUIF symbols.