--- a/generate_IEC_std.py Wed Sep 16 12:00:58 2009 +0200
+++ b/generate_IEC_std.py Mon Sep 21 12:06:15 2009 +0200
@@ -231,7 +231,14 @@
result_type_rule = fdecl["return_type_rule"]
res += {
- "copy_input" : "symbol_c * return_type_symbol = last_type_symbol;\n",
+ "copy_input" : """symbol_c * return_type_symbol;
+if (search_expression_type->is_literal_integer_type(last_type_symbol))
+ return_type_symbol = &search_constant_type_c::%s_type_name;
+else
+ return_type_symbol = last_type_symbol;
+"""%({True: "lword", False: """lint_type_name;
+else if (search_expression_type->is_literal_real_type(last_type_symbol))
+ return_type_symbol = &search_constant_type_c::lreal"""}[reduce(lambda x, y: x or y, [paramtype == "ANY_BIT" for paramname,paramtype,unused in fdecl["inputs"]], False)]),
"defined" : "symbol_c * return_type_symbol = &search_constant_type_c::%s_type_name;\n"%fdecl["outputs"][0][1].lower(),
}.get(result_type_rule, "symbol_c * return_type_symbol = %s;\n"%result_type_rule)