Commit 5c2de5e5 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Updated match names.

parent d76fe212
......@@ -3,19 +3,19 @@
#include "y.tab.h"
%}
reg \$[a-zA-Z0-9]+
word [a-zA-Z0-9_\.]+
label [a-zA-Z0-9_\.]+
int [0-9]+
%%
[\n] { return NL; } /* Newline */
#.* { yylval.sval = yytext; return COMMENT; } /* Comment */
\..* { yylval.sval = yytext; return DIRECTIVE; } /* Assembly directive */
{word}: { yylval.sval = yytext; return LABEL; } /* Label */
{label}: { yylval.sval = yytext; return LABEL; } /* Label */
{reg} { yylval.sval = yytext; return REG; } /* Registry address */
{int} { yylval.ival = atoi(yytext); return INT; } /* Integer */
{int}(\({reg}\))? { yylval.sval = yytext; return OFFSET; } /* Registry offset */
[a-z\.]+ { yylval.sval = yytext; return INSTR; } /* Instruction */
{word} { yylval.sval = yytext; return REF; } /* Label reference */
[a-z0-9\.]+ { yylval.sval = yytext; return INSTR; } /* Instruction */
{label} { yylval.sval = yytext; return REF; } /* Label reference */
[,] { return COMMA; } /* Comma */
[ \t]+ ; /* Ignore whitespace */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment