|
@@ -121,6 +121,7 @@ t_io_infos *file_infos; /* input and output files used by the compiler */
|
|
|
%token RETURN
|
|
|
%token READ
|
|
|
%token WRITE
|
|
|
+%token MERGE
|
|
|
|
|
|
%token <label> DO
|
|
|
%token <while_stmt> WHILE
|
|
@@ -141,6 +142,7 @@ t_io_infos *file_infos; /* input and output files used by the compiler */
|
|
|
|
|
|
%left COMMA
|
|
|
%left ASSIGN
|
|
|
+%left MERGE
|
|
|
%left OROR
|
|
|
%left ANDAND
|
|
|
%left OR_OP
|
|
@@ -565,6 +567,15 @@ exp: NUMBER { $$ = create_expression ($1, IMMEDIATE); }
|
|
|
(program, exp_r0, $2, SUB);
|
|
|
}
|
|
|
}
|
|
|
+ | MERGE exp COMMA exp COMMA exp
|
|
|
+ {
|
|
|
+ t_axe_expression tmp = handle_bin_numeric_op(program, $2, $6, MUL);
|
|
|
+ t_axe_expression zero = create_expression(0, IMMEDIATE);
|
|
|
+ t_axe_expression inv = handle_binary_comparison(program, $6, zero,
|
|
|
+ _EQ_);
|
|
|
+ t_axe_expression tmp2 = handle_bin_numeric_op(program, $4, inv, MUL);
|
|
|
+ $$ = handle_bin_numeric_op(program, tmp, tmp2, ORB);
|
|
|
+ }
|
|
|
;
|
|
|
|
|
|
%%
|