void SofaConfiguration::updateConditions() { for (unsigned int i=0; i<options.size(); ++i) { std::vector< CONDITION > &conditions=options[i]->option.conditions; for (unsigned int c=0; c<conditions.size(); ++c) { processCondition(options[i],conditions[c]); } } }
void processStatement(SymbolTable *table, Node *ptr) { Node *p; char label1[LABEL_SIZE]={0}, label2[LABEL_SIZE]={0}; switch(ptr->token.tokenNumber) { case COMPOUND_ST: p = ptr->son->next; p = p->son; while (p) { processStatement(table, p); p = p->next; } break; case EXP_ST: if (ptr->son != NULL) { processOperator(table, ptr->son); } break; case RETURN_ST: if (ptr->son != NULL) { p = ptr->son; if (p->noderep == NONTERM) { processOperator(table, p); } else { rv_emit(table, p); } emit0("retv"); } else emit0("ret"); flag_returned=1; break; case IF_ST: genLabel(label1); processCondition(table, ptr->son); emitJump("fjp", label1); processStatement(table, ptr->son->next); emitLabel(label1); break; case IF_ELSE_ST: genLabel(label1); genLabel(label2); processCondition(table, ptr->son); emitJump("fjp", label1); processStatement(table, ptr->son->next); emitJump("ujp", label2); emitLabel(label1); processStatement(table, ptr->son->next->next); emitLabel(label2); break; case WHILE_ST: genLabel(label1); genLabel(label2); emitLabel(label1); processCondition(table, ptr->son); emitJump("fjp", label2); processStatement(table, ptr->son->next); emitJump("ujp", label1); emitLabel(label2); break; default: fprintf(file, "not yet implemented.\n"); break; } }