absyntax_utils/function_param_iterator.cc
changeset 233 3d23a68183d3
parent 202 da1a8186f86f
child 235 ed66dc50f31a
equal deleted inserted replaced
232:29ab33687333 233:3d23a68183d3
   157 identifier_c *function_param_iterator_c::next(void) {
   157 identifier_c *function_param_iterator_c::next(void) {
   158   void *res;
   158   void *res;
   159   identifier_c *identifier;
   159   identifier_c *identifier;
   160  
   160  
   161   param_count = 0;
   161   param_count = 0;
       
   162   en_eno_param_implicit = false;
   162   next_param++;
   163   next_param++;
   163   current_operation = function_param_iterator_c::iterate_op;
   164   current_operation = function_param_iterator_c::iterate_op;
   164   res = f_decl->accept(*this);
   165   res = f_decl->accept(*this);
   165   if (res == NULL) 
   166   if (res == NULL) 
   166     return NULL;
   167     return NULL;
   194 /* Returns the currently referenced parameter's type name. */
   195 /* Returns the currently referenced parameter's type name. */
   195 symbol_c *function_param_iterator_c::param_type(void) {
   196 symbol_c *function_param_iterator_c::param_type(void) {
   196   return current_param_type;
   197   return current_param_type;
   197 }
   198 }
   198 
   199 
       
   200 /* Returns if currently referenced parameter is an implicit defined EN/ENO parameter. */
       
   201 bool function_param_iterator_c::is_en_eno_param_implicit(void) {
       
   202   return en_eno_param_implicit;
       
   203 }
       
   204 
   199 /* Returns the currently referenced parameter's data passing direction.
   205 /* Returns the currently referenced parameter's data passing direction.
   200  * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT
   206  * i.e. VAR_INPUT, VAR_OUTPUT or VAR_INOUT
   201  */
   207  */
   202 function_param_iterator_c::param_direction_t function_param_iterator_c::param_direction(void) {
   208 function_param_iterator_c::param_direction_t function_param_iterator_c::param_direction(void) {
   203   return current_param_direction;
   209   return current_param_direction;
       
   210 }
       
   211 
       
   212 void *function_param_iterator_c::visit(implicit_definition_c *symbol) {
       
   213 	en_eno_param_implicit = current_operation == function_param_iterator_c::iterate_op;
       
   214 	return NULL;
   204 }
   215 }
   205 
   216 
   206 /****************************************/
   217 /****************************************/
   207 /* 1.4.3 - Declaration & Initialisation */
   218 /* 1.4.3 - Declaration & Initialisation */
   208 /****************************************/
   219 /****************************************/
   222    * variables, because if the desired parameter is not in the
   233    * variables, because if the desired parameter is not in the
   223    * variable list we will be analysing, the current_param_XXXX
   234    * variable list we will be analysing, the current_param_XXXX
   224    * variables will get overwritten when we visit the next
   235    * variables will get overwritten when we visit the next
   225    * var1_init_decl_c list!
   236    * var1_init_decl_c list!
   226    */
   237    */
       
   238   symbol->method->accept(*this);
       
   239 
   227   current_param_default_value = symbol->value;
   240   current_param_default_value = symbol->value;
   228   current_param_type = symbol->type;
   241   current_param_type = symbol->type;
   229 
   242 
   230   return handle_single_param(symbol->name);
   243   return handle_single_param(symbol->name);
   231 }
   244 }
   249    * variables, because if the desired parameter is not in the
   262    * variables, because if the desired parameter is not in the
   250    * variable list we will be analysing, the current_param_XXXX
   263    * variable list we will be analysing, the current_param_XXXX
   251    * variables will get overwritten when we visit the next
   264    * variables will get overwritten when we visit the next
   252    * var1_init_decl_c list!
   265    * var1_init_decl_c list!
   253    */
   266    */
       
   267   symbol->method->accept(*this);
       
   268 
   254   current_param_default_value = NULL;
   269   current_param_default_value = NULL;
   255   current_param_type = symbol->type;
   270   current_param_type = symbol->type;
   256 
   271 
   257   return handle_single_param(symbol->name);
   272   return handle_single_param(symbol->name);
   258 #if 0
       
   259   if (eno_declared) ERROR;
       
   260   return (void *)declare_eno_param();
       
   261 #endif
       
   262 }
   273 }
   263 void *function_param_iterator_c::visit(input_output_declarations_c *symbol) {
   274 void *function_param_iterator_c::visit(input_output_declarations_c *symbol) {
   264   TRACE("input_output_declarations_c");
   275   TRACE("input_output_declarations_c");
   265   current_param_direction = direction_inout;
   276   current_param_direction = direction_inout;
   266   return symbol->var_declaration_list->accept(*this);
   277   return symbol->var_declaration_list->accept(*this);