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:
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);
}