Commit 375cecb7 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Fixed OFFSET syntax error.

parent 599fbfc9
......@@ -13,7 +13,7 @@ int [1-9][0-9]*
{reg} { yylval.sval = yytext; return REG; } /* Registry address */
{word}: { yylval.sval = yytext; return LABEL; } /* Label */
{int} { yylval.ival = atoi(yytext); return INT; } /* Integer */
[0-9]+(\({reg}\))? { yylval.sval = yytext; return OFFSET; } /* Registry offset */
{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 */
[,] { return COMMA; } /* Comma */
......
......@@ -23,6 +23,7 @@ symb:
| LABEL {printf("Found a label: %s\n", $1);}
| REF {printf("Found a label reference: %s\n", $1);}
| INT {printf("Found an integer: %d\n", $1);}
| OFFSET {printf("Found an offset registry address: %s\n", $1);}
| INSTR {printf("Found an instruction: %s\n", $1);}
| COMMA {printf("Found a comma\n");}
| NL {printf("Found a newline\n");}
......
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