> compile NEMU

ysyx_22040000 李心杨
Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux
 03:14:31  up 1 day  3:30,  2 users,  load average: 0.50, 0.51, 0.56
This commit is contained in:
tracer-ysyx 2024-01-13 03:14:31 +08:00 committed by xinyangli
parent 816ab15a75
commit dca6a95b84

View file

@ -25,7 +25,7 @@ expression
| expression '+' expression { $$ = $1 + $3; } | expression '+' expression { $$ = $1 + $3; }
| expression '-' expression { $$ = $1 - $3; } | expression '-' expression { $$ = $1 - $3; }
| expression '*' expression { $$ = $1 * $3; } | expression '*' expression { $$ = $1 * $3; }
| expression '/' expression { $$ = $1 / $3; } | expression '/' expression { $$ = $1 / $3; if($3 == 0) perror("Devide by 0\n");}
// | '-' number { $$ = -$2; } // | '-' number { $$ = -$2; }
| '(' expression ')' { $$ = $2; } | '(' expression ')' { $$ = $2; }