op x y
x y op
Ti := x op y
TYPE quad IS
RECORD
op: operator;
arg1: operand;
arg2: operand;
result: operand;
END RECORD;
TYPE expr_kind IS (is_identifier, is_constant, is_operator, is_call);
TYPE expr_block(kind: expr_kind);
TYPE expr_tree IS ACCESS expr_block;
TYPE expr_block(kind: expr_kind) IS
RECORD
CASE kind IS
WHEN is_identifier =>
entry: symbol;
WHEN is_constant =>
value: integer;
WHEN is_operator =>
op: operator;
left, right: expr_tree;
WHEN is_call =>
subprogram: symbol;
arguments: expr_tree_list;
END CASE;
END RECORD;
b: boolean := a and not c or i < k;
IF a and not c or i < k THEN put(i); END IF;
IF exp THEN stmt-list ELSIF expr THEN stmt-list ELSE stmt-list END IF;
LOOP stmt-list END LOOP;
WHILE cond LOOP stmt-list END LOOP;
FOR i IN 1..10 LOOP stmt-list END LOOP;
CASE i IS
WHEN 1 | 3 | 5 =>
put("odd");
WHEN 2 | 4 | 6 =>
put("even");
WHEN OTHERS =>
put("HuH?");
END CASE;