X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1f3dc5fab0ccdb98c1c77fdb2f96f662ea3e45a2..978e85e4b0b5433f2af4e5d7eb8ac03677995089:/examples/msg/mc/automatonparse_promela.c?ds=sidebyside diff --git a/examples/msg/mc/automatonparse_promela.c b/examples/msg/mc/automatonparse_promela.c index 857ff0e53c..128a87469d 100644 --- a/examples/msg/mc/automatonparse_promela.c +++ b/examples/msg/mc/automatonparse_promela.c @@ -1,5 +1,6 @@ -#include "automatonparse_promela.h" +#include "xbt/automatonparse_promela.h" +xbt_automaton_t automaton; char* state_id_src; void init(){ @@ -10,16 +11,10 @@ void new_state(char* id, int src){ char* id_state = strdup(id); char* first_part = strtok(id,"_"); - int type = 0 ; // -1=état initial, 0=état intermédiaire, 1=état final, 2=état initial/final + int type = 0 ; // -1=état initial, 0=état intermédiaire, 1=état final if(strcmp(first_part,"accept")==0){ - char* second_part = strtok(NULL,"_"); - if(strcmp(second_part,"init")==0){ - type = 2; - }else{ - type = 1; - } - + type = 1; }else{ char* second_part = strtok(NULL,"_"); if(strcmp(second_part,"init")==0){ @@ -33,7 +28,7 @@ void new_state(char* id, int src){ state = xbt_automaton_new_state(automaton, type, id_state); } - if(type==-1 || type==2) + if(type==-1) automaton->current_state = state; if(src) @@ -49,8 +44,8 @@ void new_transition(char* id, xbt_exp_label_t label){ state_dst = xbt_automaton_state_exists(automaton, id_state); xbt_state_t state_src = xbt_automaton_state_exists(automaton, state_id_src); - xbt_transition_t trans = NULL; - trans = xbt_automaton_new_transition(automaton, state_src, state_dst, label); + //xbt_transition_t trans = NULL; + xbt_automaton_new_transition(automaton, state_src, state_dst, label); } @@ -94,8 +89,5 @@ xbt_automaton_t get_automaton(){ return automaton; } -void display_automaton(){ - xbt_automaton_display(automaton); -}