summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/d2c/conv.c6
-rw-r--r--tools/d2c/d2c_tok.l12
2 files changed, 11 insertions, 7 deletions
diff --git a/tools/d2c/conv.c b/tools/d2c/conv.c
index 6676edc..e103c93 100644
--- a/tools/d2c/conv.c
+++ b/tools/d2c/conv.c
@@ -686,7 +686,11 @@ static bool ensure_conv_expr_content_fully_declared(conv_expr_t *expr, int fd, c
if (found && func != NULL)
{
- dprintf(_f, "\t\tuint%u_t val_%s;\n", _wide, name);
+ if (func->is_expr)
+ dprintf(_f, "\t\tuint%u_t val_%s;\n", _wide, name);
+ else
+ dprintf(_f, "\t\tGArchOperand *val_%s;\n", name);
+
printf("========= DECLARE for '%s'\n", name);
found = declare_conv_func(func, _f, _bts, _lst, _wide);
printf("========= END DECLARE for '%s'\n", name);
diff --git a/tools/d2c/d2c_tok.l b/tools/d2c/d2c_tok.l
index 78abfd3..7e1571c 100644
--- a/tools/d2c/d2c_tok.l
+++ b/tools/d2c/d2c_tok.l
@@ -66,7 +66,7 @@ void free_flex_memory(void) ;
<encoding>"(" { BEGIN(encoding_type); }
<encoding_type>[A-Za-z] { d2c_lval.string = strdup(yytext); return TYPE; }
-<encoding_type>[0-9] { d2c_lval.integer = atoi(yytext); return NUMBER; }
+<encoding_type>[0-9]+ { d2c_lval.integer = atoi(yytext); return NUMBER; }
<encoding_type>")" { BEGIN(encoding); }
<encoding>"{" { BEGIN(encoding_content); }
@@ -134,10 +134,10 @@ void free_flex_memory(void) ;
return NAME;
}
}
-<conv_arg>[0-9][0-9]* { d2c_lval.integer = atoi(yytext); return NUMBER; }
-<conv_arg>"'" { BEGIN(conv_arg_binval); }
-<conv_arg_binval>[01][01]* { d2c_lval.string = strdup(yytext); return BINVAL; }
-<conv_arg_binval>"'" { BEGIN(conv_arg); }
+<conv_arg>[0-9][0-9]* { d2c_lval.integer = atoi(yytext); return NUMBER; }
+<conv_arg>"'" { BEGIN(conv_arg_binval); }
+<conv_arg_binval>[01][01]* { d2c_lval.string = strdup(yytext); return BINVAL; }
+<conv_arg_binval>"'" { BEGIN(conv_arg); }
<conv_arg>"," { return COMMA; }
<conv_arg>":" { return COLON; }
<conv_arg>[ ]+ { }
@@ -160,7 +160,7 @@ 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>[0-9][0-9]* { d2c_lval.string = strdup(yytext); return IMMVAL; }
<rules_cond>")" { return EXPR_END; }
<rules_cond>"&&" { return AND; }