1 /* Copyright (c) 2012-2021. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
8 #include "simgrid/config.h"
10 #define YY_NO_UNISTD_H /* hello Windows */
13 #include "automaton_lexer.yy.c"
14 #include <xbt/automaton.h>
16 void yyerror(const char *s);
18 static void new_state(const char* id, int src);
19 static void new_transition(const char* id, xbt_automaton_exp_label_t label);
27 xbt_automaton_exp_label_t label;
46 %token <integer> LITT_ENT
47 %token <string> LITT_CHAINE
48 %token <real> LITT_REEL
60 automaton : NEVER LEFT_BRACE stateseq RIGHT_BRACE
64 | ID COLON { new_state($1, 1);} IF option FI SEMI_COLON stateseq
68 | CASE exp IMPLIES GOTO ID option { new_transition($5, $2);}
71 exp : LEFT_PAR exp RIGHT_PAR { $$ = $2; }
72 | exp OR exp { $$ = xbt_automaton_exp_label_new_or($1, $3); }
73 | exp AND exp { $$ = xbt_automaton_exp_label_new_and($1, $3); }
74 | NOT exp { $$ = xbt_automaton_exp_label_new_not($2); }
75 | CASE_TRUE { $$ = xbt_automaton_exp_label_new_one(); }
76 | ID { $$ = xbt_automaton_exp_label_new_predicat($1); }
83 void yyerror(const char *s){
84 fprintf (stderr, "%s\n", s);