2024-01-12 15:23:43 +00:00
|
|
|
%{
|
|
|
|
#include <addrexp.h>
|
|
|
|
%}
|
|
|
|
%option noyywrap
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
2024-01-15 08:27:37 +00:00
|
|
|
$[a-zA-Z] { }
|
2024-01-13 02:25:01 +00:00
|
|
|
0[xX][0-9a-fA-F]+ { yylval = strtoul(yytext, NULL, 16); return HEX_NUMBER; }
|
|
|
|
[0-9]+ { yylval = strtoul(yytext, NULL, 10); return NUMBER; }
|
2024-01-12 15:23:43 +00:00
|
|
|
[+\-*/()] { return *yytext; }
|
|
|
|
[ \t] { }
|
|
|
|
. { printf("Unexpected character: %s\n", yytext); }
|
|
|
|
%%
|