diff options
Diffstat (limited to 'tools/d2c/id/tokens.l')
-rw-r--r-- | tools/d2c/id/tokens.l | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/tools/d2c/id/tokens.l b/tools/d2c/id/tokens.l new file mode 100644 index 0000000..24f18f1 --- /dev/null +++ b/tools/d2c/id/tokens.l @@ -0,0 +1,33 @@ + +%top { + +#include <stdlib.h> + +#include "grammar.h" + +} + + +%option noyywrap +%option nounput +%option noinput +%option yylineno +%option noyy_top_state + + +%% + + +" " { } + +[0-9_]* { yylvalp->value = strtoul(yytext, NULL, 10); return VALUE; } + +. { + char *msg; + asprintf(&msg, "Unhandled token in d2c id block: '%s'", yytext); + YY_FATAL_ERROR(msg); + free(msg); + } + + +%% |