1.5 struct operation

An operation has the following structure:
 
struct operation {
        Operation_Type op_type;
        struct expression *left;
        struct expression *right;
};

op_type

This member specifies the type of the operation. Table 1.5 shows its values.
left,right
These two members represent for the left and right operands in the operation. Both of them are expressions (see section 1.4). For unary operations such as UMINUS,COMPLEMENT,HI, and LO, left is NULL. For binary operations, neither left nor right is NULL.

Table 1.5 Operation Types

Value
Operation
Value
Operation
BIT_OR
left|right
LSHIFT
left<<right
BIT_XOR
left^right
RSHIFT
left>>right
BIT_AND
left&right
PLUS
 left+right
UMINUS
-right
MINUS
left-right
COMPLEMENT
~right
MUL
left*right
HI
%hi(right)
DIV
left/right
LO
%lo(right)
MODULO
left%right

table of content