summaryrefslogtreecommitdiffstats
path: root/src/cli/scanner.l
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli/scanner.l')
-rw-r--r--src/cli/scanner.l9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cli/scanner.l b/src/cli/scanner.l
index 757376e..2839f83 100644
--- a/src/cli/scanner.l
+++ b/src/cli/scanner.l
@@ -3,9 +3,10 @@
%option nounput
%{
#include "parser.h"
+ #include "hexfile.h"
%}
%%
-[0-9]+ { yylval = atoi(yytext); return NUMBER;}
+[0-9]+ { yylval.number = asciihex2int(yytext); return NUMBER; }
[h?] return TOK_HELP;
sb return TOK_SB;
rb return TOK_RB;
@@ -15,8 +16,6 @@ di return TOK_DI;
dp return TOK_DP;
dr return TOK_DR;
r return TOK_RUN;
-pc return TOK_PC;
-all return TOK_ALL;
me return TOK_MOD_EXT;
mi return TOK_MOD_INT;
mp return TOK_MOD_PROG;
@@ -26,7 +25,9 @@ s return TOK_STEP;
u return TOK_UNASM;
z return TOK_RST;
zt return TOK_RST_TIMER;
+all return TOK_ALL;
+[a-z0-9]+ { yylval.string = strdup(yytext); return WORD; }
[\n] return TOK_ENTER;
[ \t]+ { /* ignore whitespace */ }
-. { return yytext[0];}
+. { return yytext[0]; }
%%