X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6de03ecc4e630732984a0673512a5d15fd75e270..0fca8a1497fff4bb22f715f851ddbea4073ad3c2:/src/xbt/automaton/parserPromela.yacc diff --git a/src/xbt/automaton/parserPromela.yacc b/src/xbt/automaton/parserPromela.yacc index 57468b65df..699b732d51 100644 --- a/src/xbt/automaton/parserPromela.yacc +++ b/src/xbt/automaton/parserPromela.yacc @@ -1,10 +1,14 @@ -/* Copyright (c) 2012-2014. The SimGrid Team. +/* Copyright (c) 2012-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ %{ +#include "simgrid/config.h" +#if !HAVE_UNISTD_H +#define YY_NO_UNISTD_H /* hello Windows */ +#endif #include "automaton_lexer.yy.c" #include @@ -50,11 +54,11 @@ void yyerror(const char *s); %% -automaton : NEVER LEFT_BRACE stateseq RIGHT_BRACE +automaton : NEVER LEFT_BRACE stateseq RIGHT_BRACE ; -stateseq : - | ID COLON { new_state($1, 1);} IF option FI SEMI_COLON stateseq +stateseq : + | ID COLON { new_state($1, 1);} IF option FI SEMI_COLON stateseq ; option : @@ -62,13 +66,13 @@ option : ; exp : LEFT_PAR exp RIGHT_PAR { $$ = $2; } - | exp OR exp { $$ = new_label(0, $1, $3); } - | exp AND exp { $$ = new_label(1, $1, $3); } - | NOT exp { $$ = new_label(2, $2); } - | CASE_TRUE { $$ = new_label(4); } - | ID { $$ = new_label(3, $1); } + | exp OR exp { $$ = xbt_automaton_exp_label_new_or($1, $3); } + | exp AND exp { $$ = xbt_automaton_exp_label_new_and($1, $3); } + | NOT exp { $$ = xbt_automaton_exp_label_new_not($2); } + | CASE_TRUE { $$ = xbt_automaton_exp_label_new_one(); } + | ID { $$ = xbt_automaton_exp_label_new_predicat($1); } ; - + %%