Next: struct x1f4_postmark_type, Previous: struct x1f4_function_type, Up: Types [Index]
typedef struct x1f4_operator_type { const char *name; int (*operator)(void *, void **), priority, type; const int *args; unsigned flags, length; const void *extension1, *extension2; } x1f4_operator_type;
The struct x1f4_operator_type
record describes symbolic operators.
name
The name
field is the operator name.
length
The length
field is the operator name length, i.e. the number of
characters (not including the terminal null) making up the operator name.
type
The type
field is the operator symbolic type, i.e. the type to which it
evaluates. It may be one of X1f4_E4_BILL
, X1f4_E4_MODE
,
X1f4_E4_REAL
and X1f4_E4_TEXT
or it may indicate an application
defined opaque type, case in which it is greater than X1f4_E4_LAST
.
See Symbolic Types.
flags
The flags
field is a bitwise OR of zero or more operator and function
flag bits and infix binary operator flag bits or prefix unary operator flag.
See Operator And Function Flags.
See Operator Flags.
args
The args
field indicates the type of operator arguments. It should
point a memory location at which an int
array of 1 for prefix unary
operators and 2 for binary infix operators elements
is stored. The type of one operator argument is indicated by the corresponding
array element, i.e. the type of the first operator argument is indicated by the
first array element, the type of the second operator argument is indicated by
the second array element. The type of operator arguments may be one
of X1f4_E4_BILL
, X1f4_E4_MODE
, X1f4_E4_REAL
and
X1f4_E4_TEXT
or it may indicate an application defined opaque type, case
in which it is greater than X1f4_E4_LAST
.
See Symbolic Types.
operator
The operator
field is the address of the routine performing the symbolic
operator logic.
The routine is supplied two arguments when called. The first is the address at which the operator result is to be stored. The second is an array of addresses from which the operator arguments are to be read.
The routine is expected to return 0
if it completes execution
successfully, non zero otherwise. In the latter case the expression evaluation
will be terminated.
Returning one of the error class indications for non successful execution will allow error recovery for the constructs capable of.
See Error Classes.
priority
The priority
field regulates the expression evaluation when different
infix binary operators occur in the same expression evaluation scope. The
operators are evaluated starting with the ones having the lowest priority
values to the ones having the highest priority values.
The lowest priority (and the highest operator precedence) is 128, and it is reserved for binary operators associating left to right.
The priority
field has not much meaning for prefix unary operators, as
they are applied always right to left. It is to be set to 136.
extension1
The extension1
field describes various operator extensions. It is only
interpreted if the X1f4_E4_E1ST_LINK
bit is included in the value of the
flags
attribute.
When present, it points a struct x1f4_1stscope_type
record.
See struct x1f4_1stscope_type.
See Operator Flags.
extension2
The extension2
field describes various operator extensions. It is only
interpreted if the X1f4_E4_E2ND_LINK
bit is included in the value of the
flags
attribute.
When present, it points a struct x1f4_2ndscope_type
record.
See struct x1f4_2ndscope_type.
See Operator Flags.
See Expressive Operators.
Next: struct x1f4_postmark_type, Previous: struct x1f4_function_type, Up: Types [Index]