next up previous contents
Next: ValueBlock Up: ScopedObject Previous: FileBlock   Contents


DefinitionBlock

Each definition block owns a sequence of variable definitions and a sequence of procedure definitions. Notification is given to the definition whenever the definition is added and removed from the definition block.

    concrete DefinitionBlock : ScopedObject
      {
        list<VariableDefinition* owner> variable_definitions notify;
        list<ProcedureDefinition* owner> procedure_definitions notify;
      };

    concrete VariableDefinition : ScopedObject
      {
        VariableSymbol* reference variable_symbol;
        int bit_alignment;
        ValueBlock* owner initialization;
        bool is_static default {false};
      };

    concrete ProcedureDefinition : ScopedObject
      {
        ProcedureSymbol* reference procedure_symbol build {0};
        ExecutionObject* owner body build {0};
        SymbolTable* owner symbol_table build {
          ::create_basic_symbol_table( get_suif_environment() )};
        DefinitionBlock* owner definition_block build {
          ::create_definition_block(get_suif_environment())};
        list<ParameterSymbol* reference> formal_parameters;
      };

A VariableDefinition represents the storage associated with a variable. For variables that are statically allocated, the is_static field is true. In this case, the variable is always bound to a single storage location. When the is_static field is false, the VariableDefinition represents an initialization for a variable that is executed when the variable's enclosing scope is executed.

variable_symbol reference to the associated variable
bit_alignment the alignment requirements of the storage location in bits
initialization represents the initial value of the storage location.
is_static If true, this is an initialization for static storage. Otherwise, this is a variable initialization within a scope.

A ProcedureDefinition represents the definition of a procedure.

procedure_symbol reference to the procedure symbol.
body code in the body of the procedure
symbol_table symbol table for the procedure scope
definition_block definitions local to the procedure. Currently, no nested procedures are allowed, so only VariableDefinitions will occur in the definition_block for the procedure.
formal_parameters list of formal parameters.


next up previous contents
Next: ValueBlock Up: ScopedObject Previous: FileBlock   Contents
SUIF Nightly Build
2000-08-14