The Expression module provides default error reporting associated
with the following roles:
ExpressionSymbolType
attribute to a value of the type specified by the Required
attribute.
ExpMsg, ExpErr, ExpError
OperatorSymbolOprMsg, OprErr, OprError
ArgumentListRootLstMsg, LstErr, LstError
ArgumentListElemArgMsg, ArgErr, ArgError
This error reporting can be changed by overriding computations for the
`xxx'Msg attribute.
The `xxx'Err attribute has the value 1
if the error condition is met, 0
otherwise.
Thus the overriding computation might be of the form:
`s'.`xxx'Msg= IF(`s'.`xxx'Err,message(ERROR,"My report",0,COORDREF));
Because `s'.`xxx'Msg is of type VOID,
you can remove a report completely by
setting `s'.`xxx'Msg to "no".
If you wish to override the message in every context,
write the overriding computation as a symbol computation
in the lower context of the override symbol specified above.
In this case, `xxx' would be SYNT.
Here is an example, changing the error report for invalid operators in all
contexts:
SYMBOL OprError COMPUTE
SYNT.OprMsg=
IF(SYNT.OprErr,message(ERROR,"Invalid operator",0,COORDREF));
END;
If you wish to override the message in a few specific contexts, write the overriding computation as a rule computation in the lower context of a symbol inheriting the computational role. In this case, `xxx' would be the symbol on the left-hand side of the rule. Here is an example, changing the error report for procedure arguments of the wrong type in Mystery:
RULE: Actual ::= Expr
COMPUTE
Actual.ExpMsg=
IF(Actual.ExpErr,message(ERROR,"Wrong argument type",0,COORDREF));
END;