/** * Removes transitions that are tagged by a NULL symbol. */ Transition* filter_NULL_symbols(Transition* t) { if (t==NULL) return NULL; if (t->label==NULL) { Transition* tmp=t->next; free_Transition(t,NULL); return filter_NULL_symbols(tmp); } t->next=filter_NULL_symbols(t->next); return t; }
/** * We will update the given graph with the given updated graph for which we * have now reliable information. We make sure that the graph is clean after that * (E removal+trim+determinization). */ static void resolve_conditions(GrfCheckInfo* chk,int graph,struct list_int* updated_graphs) { SingleGraph g=chk->condition_graphs[graph]; for (int i=0;i<g->number_of_states;i++) { SingleGraphState state=g->states[i]; Transition** t=&(state->outgoing_transitions); while ((*t)!=NULL) { if ((*t)->tag_number<0) { if (is_in_list(-(*t)->tag_number,updated_graphs)) { /* We only look at graphs that have been updated */ E_MATCHING_STATUS status=chk->graphs_matching_E[-(*t)->tag_number]; switch(status) { case CHK_DONT_KNOW: fatal_error("Unexpected CHK_DONT_KNOW value in resolve_conditions\n"); break; case CHK_MATCHES_E: { /* The graph matches E, we can add an E transition */ Transition* new_E_transition=new_Transition(0,(*t)->state_number,(*t)->next); (*t)->next=new_E_transition; t=&(new_E_transition->next); break; } case CHK_DOES_NOT_MATCH_E: { /* We have to remove this transition */ Transition* next=(*t)->next; free_Transition(*t); (*t)=next; break; } } continue; } } /* Not a transition we are concerned about */ t=&((*t)->next); } } clean_condition_graph(g); }