# HG changeset patch # User laurent # Date 1259509108 -3600 # Node ID 6e4ad5af894df8b0ced0e8a6dacaf7ff395aba6c # Parent 91b28dd0c9c95c5bf805f87c0a564630dcc2ff3f Adding support for declare, init, get and set macros diff -r 91b28dd0c9c9 -r 6e4ad5af894d generate_IEC_std.py --- a/generate_IEC_std.py Mon Nov 02 18:51:27 2009 +0100 +++ b/generate_IEC_std.py Sun Nov 29 16:38:28 2009 +0100 @@ -138,6 +138,7 @@ {""" if not do_type_search_only: res += """ + identifier_c %(input_name)s_param_name("%(input_name)s"); /* Get the value from a foo( = ) style call */ symbol_c *%(input_name)s_param_value = &this->default_variable_name; """%{"input_name":Paramname} @@ -148,9 +149,9 @@ else: res += """ { - identifier_c param_name("%(input_name)s"); + identifier_c %(input_name)s_param_name("%(input_name)s"); /* Get the value from a foo( = ) style call */ - symbol_c *%(input_name)s_param_value = function_call_param_iterator.search_f(¶m_name); + symbol_c *%(input_name)s_param_value = function_call_param_iterator.search_f(&%(input_name)s_param_name); symbol_c *%(input_name)s_type_symbol = NULL; /* Get the value from a foo() style call */ @@ -195,13 +196,14 @@ nb_param = %(min_nb_param)d; char* nb_param_str = new char[10]; sprintf(nb_param_str, "%%d", nb_param); -ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) +identifier_c nb_param_name("nb_param"); +ADD_PARAM_LIST(&nb_param_name, (symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in) """%{"min_nb_param" : len(fdecl["inputs"])} for paramname,paramtype,unused in fdecl["inputs"]: res += """ if (%(input_name)s_type_symbol == NULL) %(input_name)s_type_symbol = last_type_symbol; -ADD_PARAM_LIST(%(input_name)s_param_value, %(input_name)s_type_symbol, function_param_iterator_c::direction_in) +ADD_PARAM_LIST(&%(input_name)s_param_name, %(input_name)s_param_value, %(input_name)s_type_symbol, function_param_iterator_c::direction_in) """%{"input_name" : paramname} if fdecl["extensible"]: res += """ @@ -223,7 +225,7 @@ last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ; /*Function specific CODE */ - ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in) + ADD_PARAM_LIST(¶m_name, param_value, current_type_symbol, function_param_iterator_c::direction_in) } }while(param_value != NULL);