diff options
Diffstat (limited to 'tools/d2c/rules/tokens.l')
-rw-r--r-- | tools/d2c/rules/tokens.l | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/d2c/rules/tokens.l b/tools/d2c/rules/tokens.l index 36d6c4a..6b14a85 100644 --- a/tools/d2c/rules/tokens.l +++ b/tools/d2c/rules/tokens.l @@ -23,7 +23,7 @@ %% -\/\/[^\n]+ { printf("SKIP '%s'\n", yytext); } +\/\/[^\n]+ { } "if" { yy_push_state(cond); return IF; } <cond>[ ]+ { } @@ -41,17 +41,24 @@ <cond>";" { yy_pop_state(); return THEN; } -[ ] { } +[ \t\n] { } "see " { yy_push_state(raw_line); return SEE; } "unpredictable" { return UNPREDICTABLE; } "call" { yy_push_state(raw_line); return CALL; } -"chk_call" { yy_push_state(raw_line); return CHK_CALL; } +"check" { yy_push_state(raw_line); return CHK_CALL; } <raw_line>[^\n]+ { yylvalp->cstring = yytext; return RAW_LINE; } <raw_line>"\n" { yy_pop_state(); } +. { + char *msg; + asprintf(&msg, "Unhandled token in d2c rules block: '%s'", yytext); + YY_FATAL_ERROR(msg); + free(msg); + } + %% |