diff options
Diffstat (limited to 'lexer.l')
-rw-r--r-- | lexer.l | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -35,7 +35,7 @@ HEX [0-9a-f] %% <INITIAL>{SP}+ { BEGIN(inst); return T_SPACE; } -<INITIAL>{LABEL} { SETSTR(yytext); return T_LABEL; } +<INITIAL,args>{LABEL} { SETSTR(yytext); return T_LABEL; } <INITIAL>:{SP}* { BEGIN(inst); return T_COLON; } <inst>add/{EOI} { BEGIN(args); return T_ADD; } @@ -74,12 +74,10 @@ HEX [0-9a-f] <inst>addpc/{EOI} { BEGIN(args); return T_ADDPC; } <inst>nop/{EOI} { BEGIN(args); return T_NOP; } -<args>r{REGNUM} { SETVALUE(yytext[1]-'0'); return T_REG; } -<args>@r{REGNUM} { SETVALUE(yytext[2]-'0'); return T_REGPTR; } +<args>@ { return T_DEREF; } <args>[-+]?{DEC}+ { return intlit(yytext, 10, &yylval.lval); } <args>0x{HEX}+ { return intlit(yytext+2, 16, &yylval.lval); } <args>{SP}*,{SP}* { return T_COMMA; } -<args>{LABEL} { SETSTR(yytext); return T_LABEL; } {SP}*{COMMENT}?\n { BEGIN(INITIAL); return T_EOL; } {SP}*{COMMENT} { BEGIN(INITIAL); return T_EOL; } |