summaryrefslogtreecommitdiff
path: root/tools/d2c/d2c_tok.l
diff options
context:
space:
mode:
Diffstat (limited to 'tools/d2c/d2c_tok.l')
-rw-r--r--tools/d2c/d2c_tok.l11
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/d2c/d2c_tok.l b/tools/d2c/d2c_tok.l
index 50a8d8f..4d31783 100644
--- a/tools/d2c/d2c_tok.l
+++ b/tools/d2c/d2c_tok.l
@@ -33,7 +33,7 @@ void free_flex_memory(void) ;
%x conv_begin conv_content conv_arg conv_arg_binval
-%x rules_begin rules_content rules_cond rules_cond_binval rules_action rules_actin_see
+%x rules_begin rules_content rules_cond rules_cond_binval rules_action rules_action_see
%%
@@ -112,7 +112,7 @@ void free_flex_memory(void) ;
<conv_content>"}" { BEGIN(encoding_content); }
<conv_content>[ \t\n]+ { }
-<conv_content>[A-Za-z][A-Za-z0-9]* {
+<conv_content>[A-Za-z][A-Za-z0-9_]* {
if (strcmp(yytext, "NOT") == 0) return NOT;
else
{
@@ -143,6 +143,7 @@ void free_flex_memory(void) ;
<encoding_content>"@rules" { BEGIN(rules_begin); return RULES; }
+<rules_content>\/\/[^\n]+ { printf("SKIP '%s'\n", yytext); }
<rules_begin>[ ]+ { }
<rules_begin>"{" { BEGIN(rules_content); }
<rules_content>[ \t\n]+ { }
@@ -156,13 +157,15 @@ void free_flex_memory(void) ;
<rules_cond>"'" { BEGIN(rules_cond_binval); }
<rules_cond_binval>[01][01]* { d2c_lval.string = strdup(yytext); return BINVAL; }
<rules_cond_binval>"'" { BEGIN(rules_cond); }
+<rules_cond>[0-9][0-9]* { d2c_lval.string = strdup(yytext); return IMMVAL; }
<rules_cond>")" { return EXPR_END; }
<rules_cond>"&&" { return AND; }
<rules_cond>";" { BEGIN(rules_action); return THEN; }
<rules_action>[ ]+ { }
-<rules_action>"see " { BEGIN(rules_actin_see); return SEE; }
-<rules_actin_see>[^\n]* { d2c_lval.cstring = yytext; BEGIN(rules_content); return INS_DETAILS; }
+<rules_action>"see " { BEGIN(rules_action_see); return SEE; }
+<rules_action_see>[^\n]* { d2c_lval.cstring = yytext; BEGIN(rules_content); return INS_DETAILS; }
+<rules_action>"unpredictable" { BEGIN(rules_content); return UNPREDICTABLE; }
%%