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. */
13 #include "parserPromela.tab.hacc"
15 extern YYSTYPE yylval;
25 reel {entier}("."{entier})
26 caractere [a-zA-Z0-9_]
30 chaine \"({caractere}*|\n|\\|\"|{espace}*)*\"
32 commentaire "/*"([^\*\/]*{nouv_ligne}*[^\*\/]*)*"*/"
36 "never" { return (NEVER); }
39 "->" { return (IMPLIES); }
40 "goto" { return (GOTO); }
41 "&&" { return (AND); }
44 "(" { return (LEFT_PAR); }
45 ")" { return (RIGHT_PAR); }
46 "::" { return (CASE); }
47 ":" { return (COLON); }
48 ";" { return (SEMI_COLON); }
49 "1" { return (CASE_TRUE); }
50 "{" { return (LEFT_BRACE); }
51 "}" { return (RIGHT_BRACE); }
59 {reel} { sscanf(yytext,"%lf",&yylval.real);
62 {entier} { sscanf(yytext,"%d",&yylval.integer);
65 {chaine} { yylval.string=(char *)malloc(strlen(yytext)+1);
66 sscanf(yytext,"%s",yylval.string);
67 return (LITT_CHAINE); }
69 [a-zA-Z]{caractere}* { yylval.string=(char *)malloc(strlen(yytext)+1);
70 sscanf(yytext,"%s",yylval.string);