> 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 10:25:01 up 1 day 10:40, 2 users, load average: 0.54, 0.43, 0.46
This commit is contained in:
parent
0fd2cb98d4
commit
5016ef5266
2 changed files with 3 additions and 3 deletions
|
@ -5,8 +5,8 @@
|
|||
|
||||
%%
|
||||
|
||||
0[xX][0-9a-fA-F]+ { yylval = strtol(yytext, NULL, 16); return HEX_NUMBER; }
|
||||
[0-9]+ { yylval = atoi(yytext); return NUMBER; }
|
||||
0[xX][0-9a-fA-F]+ { yylval = strtoul(yytext, NULL, 16); return HEX_NUMBER; }
|
||||
[0-9]+ { yylval = strtoul(yytext, NULL, 10); return NUMBER; }
|
||||
[+\-*/()] { return *yytext; }
|
||||
[ \t] { }
|
||||
. { printf("Unexpected character: %s\n", yytext); }
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <stdint.h>
|
||||
extern int yylex(void);
|
||||
void yyerror(uint32_t *result, const char *err) {
|
||||
// fprintf(stderr, "Error: %s\n", err);
|
||||
fprintf(stderr, "Error: %s\n", err);
|
||||
}
|
||||
%}
|
||||
|
||||
|
|
Loading…
Reference in a new issue