Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use more explicit identifiers.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Wed, 23 Feb 2022 21:34:09 +0000 (22:34 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 24 Feb 2022 10:54:43 +0000 (11:54 +0100)
src/xbt/automaton/automaton.c
src/xbt/automaton/automatonparse_promela.c

index 0dcec43..5e10956 100644 (file)
@@ -373,15 +373,15 @@ void xbt_automaton_transition_free_voidp(void *t){
 static void xbt_automaton_exp_label_free(xbt_automaton_exp_label_t e){
   if(e){
     switch(e->type){
-    case 0:
-    case 1:
+    case AUT_OR:
+    case AUT_AND:
       xbt_automaton_exp_label_free(e->u.or_and.left_exp);
       xbt_automaton_exp_label_free(e->u.or_and.right_exp);
       break;
-    case 2:
+    case AUT_NOT:
       xbt_automaton_exp_label_free(e->u.exp_not);
       break;
-    case 3:
+    case AUT_PREDICAT:
       xbt_free(e->u.predicat);
       break;
     default:
index 6763a2e..37dd4bd 100644 (file)
@@ -63,8 +63,8 @@ static void new_transition(const char* id, xbt_automaton_exp_label_t label)
 void xbt_automaton_load(xbt_automaton_t a, const char *file)
 {
   parsed_automaton = a;
-  yyin = fopen(file, "r");
-  xbt_assert(yyin != NULL, "Failed to open automaton file `%s': %s", file, strerror(errno));
-  yyparse();
-  fclose(yyin);
+  xbt_automaton_parser_in = fopen(file, "r");
+  xbt_assert(xbt_automaton_parser_in != NULL, "Failed to open automaton file `%s': %s", file, strerror(errno));
+  xbt_automaton_parser_parse();
+  fclose(xbt_automaton_parser_in);
 }