1 /* Copyright (c) 2012-2014. 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. */
9 #include "automaton_lexer.yy.c"
10 #include <xbt/automaton.h>
12 void yyerror(const char *s);
20 xbt_automaton_exp_label_t label;
39 %token <integer> LITT_ENT
40 %token <string> LITT_CHAINE
41 %token <real> LITT_REEL
53 automaton : NEVER LEFT_BRACE stateseq RIGHT_BRACE
57 | ID COLON { new_state($1, 1);} IF option FI SEMI_COLON stateseq
61 | CASE exp IMPLIES GOTO ID option { new_transition($5, $2);}
64 exp : LEFT_PAR exp RIGHT_PAR { $$ = $2; }
65 | exp OR exp { $$ = new_label(0, $1, $3); }
66 | exp AND exp { $$ = new_label(1, $1, $3); }
67 | NOT exp { $$ = new_label(2, $2); }
68 | CASE_TRUE { $$ = new_label(4); }
69 | ID { $$ = new_label(3, $1); }
76 void yyerror(const char *s){
77 fprintf (stderr, "%s\n", s);