|
@@ -112,7 +112,7 @@ t_io_infos *file_infos; /* input and output files used by the compiler */
|
|
|
%start program
|
|
|
|
|
|
%token LBRACE RBRACE LPAR RPAR LSQUARE RSQUARE
|
|
|
-%token SEMI COLON PLUS MINUS MUL_OP DIV_OP MOD_OP
|
|
|
+%token SEMI COLON PLUS MINUS MUL_OP DIV_OP MOD_OP SOFT_MUL
|
|
|
%token AND_OP OR_OP NOT_OP
|
|
|
%token ASSIGN LT GT SHL_OP SHR_OP EQ NOTEQ LTEQ GTEQ
|
|
|
%token ANDAND OROR
|
|
@@ -149,7 +149,7 @@ t_io_infos *file_infos; /* input and output files used by the compiler */
|
|
|
%left LT GT LTEQ GTEQ
|
|
|
%left SHL_OP SHR_OP
|
|
|
%left MINUS PLUS
|
|
|
-%left MUL_OP DIV_OP
|
|
|
+%left MUL_OP DIV_OP SOFT_MUL
|
|
|
%right NOT
|
|
|
|
|
|
/*=========================================================================
|
|
@@ -521,6 +521,9 @@ exp: NUMBER { $$ = create_expression ($1, IMMEDIATE); }
|
|
|
| exp MUL_OP exp {
|
|
|
$$ = handle_bin_numeric_op(program, $1, $3, MUL);
|
|
|
}
|
|
|
+ | exp SOFT_MUL exp {
|
|
|
+ $$ = create_expression(0, IMMEDIATE);
|
|
|
+ }
|
|
|
| exp DIV_OP exp {
|
|
|
$$ = handle_bin_numeric_op(program, $1, $3, DIV);
|
|
|
}
|