stage4/generate_c/generate_c_il.cc
changeset 1041 56ebe2a31b5b
parent 1016 91bef6704b44
equal deleted inserted replaced
1040:e8563dcaefca 1041:56ebe2a31b5b
   659   for (int i =  0; i < symbol->n; i++) {
   659   for (int i =  0; i < symbol->n; i++) {
   660     symbol_c* dimension = array_dimension_iterator->next();
   660     symbol_c* dimension = array_dimension_iterator->next();
   661     if (dimension == NULL) ERROR;
   661     if (dimension == NULL) ERROR;
   662 
   662 
   663     s4o.print("[(");
   663     s4o.print("[(");
   664     symbol->elements[i]->accept(*this);
   664     symbol->get_element(i)->accept(*this);
   665     s4o.print(") - (");
   665     s4o.print(") - (");
   666     dimension->accept(*this);
   666     dimension->accept(*this);
   667     s4o.print(")]");
   667     s4o.print(")]");
   668   }
   668   }
   669   delete array_dimension_iterator;
   669   delete array_dimension_iterator;
   709 
   709 
   710   /* Declare the backup to the IL implicit variable, that will store the result of the IL operations executed inside a parenthesis... */
   710   /* Declare the backup to the IL implicit variable, that will store the result of the IL operations executed inside a parenthesis... */
   711   declare_implicit_variable_back();
   711   declare_implicit_variable_back();
   712   
   712   
   713   for(int i = 0; i < symbol->n; i++) {
   713   for(int i = 0; i < symbol->n; i++) {
   714     print_line_directive(symbol->elements[i]);
   714     print_line_directive(symbol->get_element(i));
   715     s4o.print(s4o.indent_spaces);
   715     s4o.print(s4o.indent_spaces);
   716     symbol->elements[i]->accept(*this);
   716     symbol->get_element(i)->accept(*this);
   717     s4o.print(";\n");
   717     s4o.print(";\n");
   718   }
   718   }
   719   return NULL;
   719   return NULL;
   720 }
   720 }
   721 
   721