diff --git a/nemu/src/monitor/sdb/addrexp.l b/nemu/src/monitor/sdb/addrexp.l index 979df5a..d294ab8 100644 --- a/nemu/src/monitor/sdb/addrexp.l +++ b/nemu/src/monitor/sdb/addrexp.l @@ -9,6 +9,7 @@ %% 0[xX][0-9a-fA-F]+ { yylval = strtoul(yytext, NULL, 16); return HEX_NUMBER; } +[0-9]+ { yylval = strtoul(yytext, NULL, 10); return NUMBER; } $[a-zA-Z]{2,3} { yylval = isa_reg_str2val(yytext + 1, &success); if(!success) { @@ -16,7 +17,6 @@ $[a-zA-Z]{2,3} { return YYerror; } } -[0-9]+ { yylval = strtoul(yytext, NULL, 10); return NUMBER; } [+\-*/()] { return *yytext; } [ \t] { } . { printf("Unexpected character: %s\n", yytext); return YYerror; }