Next: ProcInd, Up: Procedures
The Expression module exports computational roles
to support procedure and array definition:
ProcedureDenotationOper attribute is a new, unique, definition table key.
ParameterListRootParameterTypeList attribute is set by a module computation to a
DefTableKeyList value containing the ParameterListElem.Type
attribute values (in reverse order).
ParameterListElemParameterListRoot.
Its Type attribute must be set by user computation to the
definition table key representing the type of the parameter.
The same grammar symbol may inherit both the ProcedureDenotation role
and the ParameterListRoot role.
Information characterizing a procedure is often stored as properties of the
definition table key that is the value of ProcedureDenotation.Oper.
The post-condition ProcedureDenotation.GotProp establishes the fact
that such properties have been set, but it can only be used for
computations that are themselves independent of all aspects of type
analysis
(see Dependence on the operator database).
Information characterizing an array is usually stored as properties of the
typed entity that names the array
(see Establishing the type of an entity),
or as properties of the array type
(see User-Defined Types).
Only information specifically related to the array access operation should
be stored as properties of the definition table key that is the value of
ProcedureDenotation.Oper.
Here is the specification for Mystery procedure and array denotations:
SYMBOL ArrayTy INHERITS ProcedureDenotation END;
SYMBOL Procedure INHERITS ProcedureDenotation END;
SYMBOL Formals INHERITS ParameterListRoot END;
SYMBOL Formal INHERITS ParameterListElem END;
RULE: Formal ::= VarIdDef ':' Type
COMPUTE Formal.Type=Type.Type;
END;