Next: , Up: Application Defined Implicit Conversions   [Index]


3.13.2.1 Operator Converters Set Definition

The expression evaluator is introduced the set of prefix unary operator converters via a look up function and a look up context. Every time a subexpression type fails to match the type of the function parameters for which it stands, and if the implicit scalar conversions are not enough to convert between the types, the expression evaluator attempts to retrieve a prefix unary operator converter definition through the look up function.

See Implicit Conversion For Scalar Types.

The expression evaluator will attempt to locate a prefix unary operator converter definition only if explicitely intructed so, by the presence of the X1f4_E4_IMPLICIT bit in the flags argument of the called expression parsing function.

See Generation Flags.

The look up function and the look up context are specified via the struct x1f4_e4_type, as implicit_set.get and implicit_set.context, respectively.

See struct x1f4_e4_type.

The C type of the look up function is:

int (*)(const void *, int, int, const struct x1f4_operator_type **)

When called, it is provided with the look up context, the type to match, the type of the subexpression to be matched and an address at which upon successful look up the address of the prefix unary operator converter is to be stored, as arguments, in this order.

It is to return zero if a prefix unary operator converter address was stored, non zero otherwise.

The prefix unary operator definition is to indicate a valid conversion method, one matching the signature of the operator method in the struct x1f4_operator_type definition. The operator type and its parameter type should be set to indicate the conversion it performs. The rest of fields in the struct x1f4_operator_type record are largely irrelevant, at least with respect to expression evaluation. In particular, the operator name is not restricted to the regular operator name character set and may include characters such as letters and digits.

See struct x1f4_operator_type.

As for regular operators, returning one of the error classes when the operator method fails execution will allow for error recovery.

See Error Classes.

See Limiting The Scope Of Errors.


Next: Function Converters Set Definition, Up: Application Defined Implicit Conversions   [Index]