+ # for functions generated below:
+ # * compute list of additional parameters which contains as parameter
+ # any expr fields that cannot be resolved within self and descendants.
+ # * and make sure that they are accessed without prefix within the function.
+ unresolved_fields = resolve_expr_fields_list(list, parents)
+ additional_params = []
+ additional_param_names = set();
+ for f in unresolved_fields:
+ if f.c_field_name not in additional_param_names:
+ # add to the list of additional params
+ additional_params.append((f.c_field_type, f.c_field_name));
+ # make sure that the param is accessed without prefix within the function
+ fields[ f.c_field_name ] = (f.c_field_name, f)
+
+ # internal function to compute the parameterlist with given indentation
+ # such that the formatting of the additional parameters is consistent with
+ # the other parameters.
+ def additional_params_to_str(indent):
+ if len(additional_params) == 0:
+ return ''
+ else:
+ return (',\n' + indent).join([''] + ['%s %s /**< */' % p for p in additional_params])
+