absyntax_utils/function_call_param_iterator.cc
changeset 1041 56ebe2a31b5b
parent 844 39c755f41ee8
equal deleted inserted replaced
1040:e8563dcaefca 1041:56ebe2a31b5b
    65 
    65 
    66 void *function_call_param_iterator_c::search_list(list_c *list) {
    66 void *function_call_param_iterator_c::search_list(list_c *list) {
    67   switch (current_operation) {
    67   switch (current_operation) {
    68     case iterate_nf_op:
    68     case iterate_nf_op:
    69       for(int i = 0; i < list->n; i++) {
    69       for(int i = 0; i < list->n; i++) {
    70         void *res = list->elements[i]->accept(*this);
    70         void *res = list->get_element(i)->accept(*this);
    71         if (NULL != res) {
    71         if (NULL != res) {
    72           /* It went through the handle_parameter_assignment() function,
    72           /* It went through the handle_parameter_assignment() function,
    73            * and is therefore a parameter assignment (<param> = <value>),
    73            * and is therefore a parameter assignment (<param> = <value>),
    74            * and not a simple expression (<value>).
    74            * and not a simple expression (<value>).
    75            */
    75            */
    76           /* we do nothing... */
    76           /* we do nothing... */
    77         } else {
    77         } else {
    78           param_count++;
    78           param_count++;
    79           if (param_count == iterate_nf_next_param) {
    79           if (param_count == iterate_nf_next_param) {
    80             return list->elements[i];
    80             return list->get_element(i);
    81           }
    81           }
    82         }
    82         }
    83       }
    83       }
    84       return NULL;
    84       return NULL;
    85       break;
    85       break;
    86 
    86 
    87     case iterate_f_op:
    87     case iterate_f_op:
    88       for(int i = 0; i < list->n; i++) {
    88       for(int i = 0; i < list->n; i++) {
    89         void *res = list->elements[i]->accept(*this);
    89         void *res = list->get_element(i)->accept(*this);
    90         if (NULL != res) {
    90         if (NULL != res) {
    91           /* It went through the handle_parameter_assignment() function,
    91           /* It went through the handle_parameter_assignment() function,
    92            * and is therefore a parameter assignment (<param> = <value>),
    92            * and is therefore a parameter assignment (<param> = <value>),
    93            * and not a simple expression (<value>).
    93            * and not a simple expression (<value>).
    94            */
    94            */
   103       return NULL;
   103       return NULL;
   104       break;
   104       break;
   105 
   105 
   106     case search_f_op:
   106     case search_f_op:
   107       for(int i = 0; i < list->n; i++) {
   107       for(int i = 0; i < list->n; i++) {
   108         void *res = list->elements[i]->accept(*this);
   108         void *res = list->get_element(i)->accept(*this);
   109         if (res != NULL)
   109         if (res != NULL)
   110           return res;
   110           return res;
   111       }
   111       }
   112       return NULL;
   112       return NULL;
   113       break;
   113       break;