Previous: Indications, Up: PreDefOps


3.2 Relating operators to indications

An operator is represented by a unique definition table key. Properties of the operator are stored as properties of that key. Operators are related to operator indications.

PreDefOpr(`ind',`opr',`sig') specifies an operator and relates it to an operator indication. That operator indication might or might not be associated with a literal terminal symbol of the source grammar:

`ind'
The known definition table key representing the operator indication.
`opr'
The known definition table key representing the name of an operator that can be identified by `ind'.
`sig'
The signature of the specified operator.

Two PreDefOpr invocations with the same `opr' values are not allowed. Associating several operators with the same indication is legal (see Overloaded Indications and Procedures).

Here is a specification for Mystery:

     PreDefOpr(PlusInd, iAddOp, (intType,intType):  intType)
     PreDefOpr(GrtrInd, iGtrOp, (intType,intType):  boolType)
     PreDefOpr(AndInd,  bAndOp, (boolType,boolType):boolType)

iAddOp, iGtrOp, and bAndOp are automatically defined as known keys by the module. No further specification is necessary.