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


3.13.2.2 Function Converters Set Definition

The expression evaluator is introduced the set of single parameter function 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 and the application introduced prefix unary operator implicit convertions are not enough to convert between the types, the expression evaluator attempts to retrieve a single parameter function converter definition through the look up function.

See Implicit Conversion For Scalar Types.

See Operator Converters Set Definition.

The expression evaluator will attempt to locate a single parameter function converter definition only if explicitely intructed so, by the presence of the X1f4_E4_COMPOSER 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 composer_set.get and composer_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_linetext_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 single parameter function converter is to be stored, as arguments, in this order.

It is to return zero if a single parameter function converter address was stored, non zero otherwise.

The single parameter function definition is to indicate a valid conversion method, one matching the signature of the function.function method in the struct x1f4_linetext_type definition. The function type and its parameters list should be set to indicate the conversion it performs. If the function definition includes the X1f4_E4_TEXT_LINK in its flags attribute, the function execution context is assumed the context field in the struct x1f4_linetext_type definition. The rest of fields in the struct x1f4_linetext_type record are largely irrelevant, at least with respect to expression evaluation. In particular, the function name is not restricted to the regular function name character set and may include characters other than letters and digits.

See struct x1f4_function_type.

See struct x1f4_linetext_type.

See Function Flags.

See Per Function Execution Context.

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

See Error Classes.

See Limiting The Scope Of Errors.


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