1 /* A Bison parser, made by GNU Bison 3.2.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Undocumented macros, especially those whose name start with YY_,
44 are private implementation details. Do not rely on them. */
46 /* Identify Bison output. */
50 #define YYBISON_VERSION "3.2.2"
53 #define YYSKELETON_NAME "yacc.c"
65 /* Substitute the variable and function names. */
66 #define yyparse xbt_automaton_parser_parse
67 #define yylex xbt_automaton_parser_lex
68 #define yyerror xbt_automaton_parser_error
69 #define yydebug xbt_automaton_parser_debug
70 #define yynerrs xbt_automaton_parser_nerrs
72 #define yylval xbt_automaton_parser_lval
73 #define yychar xbt_automaton_parser_char
75 /* First part of user prologue. */
76 #line 7 "parserPromela.yacc" /* yacc.c:338 */
78 #include "simgrid/config.h"
80 #define YY_NO_UNISTD_H /* hello Windows */
83 #include "automaton_lexer.yy.c"
84 #include <xbt/automaton.h>
86 void yyerror(const char *s);
89 #line 90 "parserPromela.tab.cacc" /* yacc.c:338 */
91 # if defined __cplusplus
92 # if 201103L <= __cplusplus
93 # define YY_NULLPTR nullptr
98 # define YY_NULLPTR ((void*)0)
102 /* Enabling verbose error messages. */
103 #ifdef YYERROR_VERBOSE
104 # undef YYERROR_VERBOSE
105 # define YYERROR_VERBOSE 1
107 # define YYERROR_VERBOSE 0
110 /* In a future release of Bison, this section will be replaced
111 by #include "parserPromela.tab.hacc". */
112 #ifndef YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
113 # define YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
119 extern int xbt_automaton_parser_debug;
151 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
155 #line 20 "parserPromela.yacc" /* yacc.c:353 */
160 xbt_automaton_exp_label_t label;
162 #line 163 "parserPromela.tab.cacc" /* yacc.c:353 */
165 typedef union YYSTYPE YYSTYPE;
166 # define YYSTYPE_IS_TRIVIAL 1
167 # define YYSTYPE_IS_DECLARED 1
171 extern YYSTYPE xbt_automaton_parser_lval;
173 int xbt_automaton_parser_parse (void);
175 #endif /* !YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED */
184 typedef YYTYPE_UINT8 yytype_uint8;
186 typedef unsigned char yytype_uint8;
190 typedef YYTYPE_INT8 yytype_int8;
192 typedef signed char yytype_int8;
196 typedef YYTYPE_UINT16 yytype_uint16;
198 typedef unsigned short yytype_uint16;
202 typedef YYTYPE_INT16 yytype_int16;
204 typedef short yytype_int16;
208 # ifdef __SIZE_TYPE__
209 # define YYSIZE_T __SIZE_TYPE__
210 # elif defined size_t
211 # define YYSIZE_T size_t
212 # elif ! defined YYSIZE_T
213 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
214 # define YYSIZE_T size_t
216 # define YYSIZE_T unsigned
220 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
223 # if defined YYENABLE_NLS && YYENABLE_NLS
225 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
226 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
230 # define YY_(Msgid) Msgid
235 # if (defined __GNUC__ \
236 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
237 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
238 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
240 # define YY_ATTRIBUTE(Spec) /* empty */
244 #ifndef YY_ATTRIBUTE_PURE
245 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
248 #ifndef YY_ATTRIBUTE_UNUSED
249 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
252 /* Suppress unused-variable warnings by "using" E. */
253 #if ! defined lint || defined __GNUC__
254 # define YYUSE(E) ((void) (E))
256 # define YYUSE(E) /* empty */
259 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
260 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
261 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
262 _Pragma ("GCC diagnostic push") \
263 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
264 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
265 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
266 _Pragma ("GCC diagnostic pop")
268 # define YY_INITIAL_VALUE(Value) Value
270 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
271 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
272 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
274 #ifndef YY_INITIAL_VALUE
275 # define YY_INITIAL_VALUE(Value) /* Nothing. */
279 #if ! defined yyoverflow || YYERROR_VERBOSE
281 /* The parser invokes alloca or malloc; define the necessary symbols. */
283 # ifdef YYSTACK_USE_ALLOCA
284 # if YYSTACK_USE_ALLOCA
286 # define YYSTACK_ALLOC __builtin_alloca
287 # elif defined __BUILTIN_VA_ARG_INCR
288 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
290 # define YYSTACK_ALLOC __alloca
291 # elif defined _MSC_VER
292 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
293 # define alloca _alloca
295 # define YYSTACK_ALLOC alloca
296 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
297 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
298 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
299 # ifndef EXIT_SUCCESS
300 # define EXIT_SUCCESS 0
307 # ifdef YYSTACK_ALLOC
308 /* Pacify GCC's 'empty if-body' warning. */
309 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
310 # ifndef YYSTACK_ALLOC_MAXIMUM
311 /* The OS might guarantee only one guard page at the bottom of the stack,
312 and a page size can be as small as 4096 bytes. So we cannot safely
313 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
314 to allow for a few compiler-allocated temporary stack slots. */
315 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
318 # define YYSTACK_ALLOC YYMALLOC
319 # define YYSTACK_FREE YYFREE
320 # ifndef YYSTACK_ALLOC_MAXIMUM
321 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
323 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
324 && ! ((defined YYMALLOC || defined malloc) \
325 && (defined YYFREE || defined free)))
326 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
327 # ifndef EXIT_SUCCESS
328 # define EXIT_SUCCESS 0
332 # define YYMALLOC malloc
333 # if ! defined malloc && ! defined EXIT_SUCCESS
334 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
339 # if ! defined free && ! defined EXIT_SUCCESS
340 void free (void *); /* INFRINGES ON USER NAME SPACE */
344 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
347 #if (! defined yyoverflow \
348 && (! defined __cplusplus \
349 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
351 /* A type that is properly aligned for any stack member. */
354 yytype_int16 yyss_alloc;
358 /* The size of the maximum gap between one aligned stack and the next. */
359 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
361 /* The size of an array large to enough to hold all stacks, each with
363 # define YYSTACK_BYTES(N) \
364 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
365 + YYSTACK_GAP_MAXIMUM)
367 # define YYCOPY_NEEDED 1
369 /* Relocate STACK from its old location to the new one. The
370 local variables YYSIZE and YYSTACKSIZE give the old and new number of
371 elements in the stack, and YYPTR gives the new location of the
372 stack. Advance YYPTR to a properly aligned location for the next
374 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
377 YYSIZE_T yynewbytes; \
378 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
379 Stack = &yyptr->Stack_alloc; \
380 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
381 yyptr += yynewbytes / sizeof (*yyptr); \
387 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
388 /* Copy COUNT objects from SRC to DST. The source and destination do
391 # if defined __GNUC__ && 1 < __GNUC__
392 # define YYCOPY(Dst, Src, Count) \
393 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
395 # define YYCOPY(Dst, Src, Count) \
399 for (yyi = 0; yyi < (Count); yyi++) \
400 (Dst)[yyi] = (Src)[yyi]; \
405 #endif /* !YYCOPY_NEEDED */
407 /* YYFINAL -- State number of the termination state. */
409 /* YYLAST -- Last index in YYTABLE. */
412 /* YYNTOKENS -- Number of terminals. */
414 /* YYNNTS -- Number of nonterminals. */
416 /* YYNRULES -- Number of rules. */
418 /* YYNSTATES -- Number of states. */
421 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
422 by yylex, with out-of-bounds checking. */
424 #define YYMAXUTOK 277
426 #define YYTRANSLATE(YYX) \
427 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
429 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
430 as returned by yylex, without out-of-bounds checking. */
431 static const yytype_uint8 yytranslate[] =
433 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
459 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
460 15, 16, 17, 18, 19, 20, 21, 22
464 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
465 static const yytype_uint8 yyrline[] =
467 0, 57, 57, 60, 61, 61, 64, 65, 68, 69,
472 #if YYDEBUG || YYERROR_VERBOSE || 0
473 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
474 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
475 static const char *const yytname[] =
477 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
478 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
479 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
480 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
481 "$@1", "option", "exp", YY_NULLPTR
486 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
487 (internal) symbol number NUM (which must be that of a token). */
488 static const yytype_uint16 yytoknum[] =
490 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
491 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
496 #define YYPACT_NINF -16
498 #define yypact_value_is_default(Yystate) \
499 (!!((Yystate) == (-16)))
501 #define YYTABLE_NINF -1
503 #define yytable_value_is_error(Yytable_value) \
506 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
508 static const yytype_int8 yypact[] =
510 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
511 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
512 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
516 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
517 Performed when YYTABLE does not specify something else to do. Zero
518 means the default is an error. */
519 static const yytype_uint8 yydefact[] =
521 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
522 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
523 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
527 /* YYPGOTO[NTERM-NUM]. */
528 static const yytype_int8 yypgoto[] =
530 -16, -16, 4, -16, -7, -9
533 /* YYDEFGOTO[NTERM-NUM]. */
534 static const yytype_int8 yydefgoto[] =
539 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
540 positive, shift that token. If negative, reduce the rule whose
541 number is the opposite. If YYTABLE_NINF, syntax error. */
542 static const yytype_uint8 yytable[] =
544 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
545 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
546 10, 11, 18, 31, 0, 26, 24, 30, 29
549 static const yytype_int8 yycheck[] =
551 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
552 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
553 4, 13, 5, 30, -1, 7, 15, 22, 24
556 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
557 symbol of state STATE-NUM. */
558 static const yytype_uint8 yystos[] =
560 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
561 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
562 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
566 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
567 static const yytype_uint8 yyr1[] =
569 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
573 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
574 static const yytype_uint8 yyr2[] =
576 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
581 #define yyerrok (yyerrstatus = 0)
582 #define yyclearin (yychar = YYEMPTY)
586 #define YYACCEPT goto yyacceptlab
587 #define YYABORT goto yyabortlab
588 #define YYERROR goto yyerrorlab
591 #define YYRECOVERING() (!!yyerrstatus)
593 #define YYBACKUP(Token, Value) \
595 if (yychar == YYEMPTY) \
599 YYPOPSTACK (yylen); \
605 yyerror (YY_("syntax error: cannot back up")); \
610 /* Error token number */
612 #define YYERRCODE 256
616 /* Enable debugging if requested. */
620 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
621 # define YYFPRINTF fprintf
624 # define YYDPRINTF(Args) \
630 /* This macro is provided for backward compatibility. */
631 #ifndef YY_LOCATION_PRINT
632 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
636 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
640 YYFPRINTF (stderr, "%s ", Title); \
641 yy_symbol_print (stderr, \
643 YYFPRINTF (stderr, "\n"); \
648 /*-----------------------------------.
649 | Print this symbol's value on YYO. |
650 `-----------------------------------*/
653 yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
655 FILE *yyoutput = yyo;
660 if (yytype < YYNTOKENS)
661 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
667 /*---------------------------.
668 | Print this symbol on YYO. |
669 `---------------------------*/
672 yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
674 YYFPRINTF (yyo, "%s %s (",
675 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
677 yy_symbol_value_print (yyo, yytype, yyvaluep);
678 YYFPRINTF (yyo, ")");
681 /*------------------------------------------------------------------.
682 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
684 `------------------------------------------------------------------*/
687 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
689 YYFPRINTF (stderr, "Stack now");
690 for (; yybottom <= yytop; yybottom++)
692 int yybot = *yybottom;
693 YYFPRINTF (stderr, " %d", yybot);
695 YYFPRINTF (stderr, "\n");
698 # define YY_STACK_PRINT(Bottom, Top) \
701 yy_stack_print ((Bottom), (Top)); \
705 /*------------------------------------------------.
706 | Report that the YYRULE is going to be reduced. |
707 `------------------------------------------------*/
710 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
712 unsigned long yylno = yyrline[yyrule];
713 int yynrhs = yyr2[yyrule];
715 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
717 /* The symbols being reduced. */
718 for (yyi = 0; yyi < yynrhs; yyi++)
720 YYFPRINTF (stderr, " $%d = ", yyi + 1);
721 yy_symbol_print (stderr,
722 yystos[yyssp[yyi + 1 - yynrhs]],
723 &(yyvsp[(yyi + 1) - (yynrhs)])
725 YYFPRINTF (stderr, "\n");
729 # define YY_REDUCE_PRINT(Rule) \
732 yy_reduce_print (yyssp, yyvsp, Rule); \
735 /* Nonzero means print parse trace. It is left uninitialized so that
736 multiple parsers can coexist. */
739 # define YYDPRINTF(Args)
740 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
741 # define YY_STACK_PRINT(Bottom, Top)
742 # define YY_REDUCE_PRINT(Rule)
743 #endif /* !YYDEBUG */
746 /* YYINITDEPTH -- initial size of the parser's stacks. */
748 # define YYINITDEPTH 200
751 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
752 if the built-in stack extension method is used).
754 Do not make this value too large; the results are undefined if
755 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
756 evaluated with infinite-precision integer arithmetic. */
759 # define YYMAXDEPTH 10000
766 # if defined __GLIBC__ && defined _STRING_H
767 # define yystrlen strlen
769 /* Return the length of YYSTR. */
771 yystrlen (const char *yystr)
774 for (yylen = 0; yystr[yylen]; yylen++)
782 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
783 # define yystpcpy stpcpy
785 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
788 yystpcpy (char *yydest, const char *yysrc)
791 const char *yys = yysrc;
793 while ((*yyd++ = *yys++) != '\0')
802 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
803 quotes and backslashes, so that it's suitable for yyerror. The
804 heuristic is that double-quoting is unnecessary unless the string
805 contains an apostrophe, a comma, or backslash (other than
806 backslash-backslash). YYSTR is taken from yytname. If YYRES is
807 null, do not copy; instead, return the length of what the result
810 yytnamerr (char *yyres, const char *yystr)
815 char const *yyp = yystr;
822 goto do_not_strip_quotes;
826 goto do_not_strip_quotes;
839 do_not_strip_quotes: ;
843 return yystrlen (yystr);
845 return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
849 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
850 about the unexpected token YYTOKEN for the state stack whose top is
853 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
854 not large enough to hold the message. In that case, also set
855 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
856 required number of bytes is too large to store. */
858 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
859 yytype_int16 *yyssp, int yytoken)
861 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
862 YYSIZE_T yysize = yysize0;
863 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
864 /* Internationalized format string. */
865 const char *yyformat = YY_NULLPTR;
866 /* Arguments of yyformat. */
867 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
868 /* Number of reported tokens (one for the "unexpected", one per
872 /* There are many possibilities here to consider:
873 - If this state is a consistent state with a default action, then
874 the only way this function was invoked is if the default action
875 is an error action. In that case, don't check for expected
876 tokens because there are none.
877 - The only way there can be no lookahead present (in yychar) is if
878 this state is a consistent state with a default action. Thus,
879 detecting the absence of a lookahead is sufficient to determine
880 that there is no unexpected or expected token to report. In that
881 case, just report a simple "syntax error".
882 - Don't assume there isn't a lookahead just because this state is a
883 consistent state with a default action. There might have been a
884 previous inconsistent state, consistent state with a non-default
885 action, or user semantic action that manipulated yychar.
886 - Of course, the expected token list depends on states to have
887 correct lookahead information, and it depends on the parser not
888 to perform extra reductions after fetching a lookahead from the
889 scanner and before detecting a syntax error. Thus, state merging
890 (from LALR or IELR) and default reductions corrupt the expected
891 token list. However, the list is correct for canonical LR with
892 one exception: it will still contain any token that will not be
893 accepted due to an error action in a later state.
895 if (yytoken != YYEMPTY)
897 int yyn = yypact[*yyssp];
898 yyarg[yycount++] = yytname[yytoken];
899 if (!yypact_value_is_default (yyn))
901 /* Start YYX at -YYN if negative to avoid negative indexes in
902 YYCHECK. In other words, skip the first -YYN actions for
903 this state because they are default actions. */
904 int yyxbegin = yyn < 0 ? -yyn : 0;
905 /* Stay within bounds of both yycheck and yytname. */
906 int yychecklim = YYLAST - yyn + 1;
907 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
910 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
911 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
912 && !yytable_value_is_error (yytable[yyx + yyn]))
914 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
920 yyarg[yycount++] = yytname[yyx];
922 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
923 if (! (yysize <= yysize1
924 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
934 # define YYCASE_(N, S) \
938 default: /* Avoid compiler warnings. */
939 YYCASE_(0, YY_("syntax error"));
940 YYCASE_(1, YY_("syntax error, unexpected %s"));
941 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
942 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
943 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
944 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
949 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
950 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
955 if (*yymsg_alloc < yysize)
957 *yymsg_alloc = 2 * yysize;
958 if (! (yysize <= *yymsg_alloc
959 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
960 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
964 /* Avoid sprintf, as that infringes on the user's name space.
965 Don't have undefined behavior even if the translation
966 produced a string with the wrong number of "%s"s. */
970 while ((*yyp = *yyformat) != '\0')
971 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
973 yyp += yytnamerr (yyp, yyarg[yyi++]);
984 #endif /* YYERROR_VERBOSE */
986 /*-----------------------------------------------.
987 | Release the memory associated to this symbol. |
988 `-----------------------------------------------*/
991 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
996 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
998 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1000 YY_IGNORE_MAYBE_UNINITIALIZED_END
1006 /* The lookahead symbol. */
1009 /* The semantic value of the lookahead symbol. */
1011 /* Number of syntax errors so far. */
1023 /* Number of tokens to shift before error messages enabled. */
1026 /* The stacks and their tools:
1027 'yyss': related to states.
1028 'yyvs': related to semantic values.
1030 Refer to the stacks through separate pointers, to allow yyoverflow
1031 to reallocate them elsewhere. */
1033 /* The state stack. */
1034 yytype_int16 yyssa[YYINITDEPTH];
1036 yytype_int16 *yyssp;
1038 /* The semantic value stack. */
1039 YYSTYPE yyvsa[YYINITDEPTH];
1043 YYSIZE_T yystacksize;
1047 /* Lookahead token as an internal (translated) token number. */
1049 /* The variables used to return semantic value and location from the
1054 /* Buffer for error messages, and its allocated size. */
1056 char *yymsg = yymsgbuf;
1057 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1060 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1062 /* The number of symbols on the RHS of the reduced rule.
1063 Keep to zero when no symbol should be popped. */
1066 yyssp = yyss = yyssa;
1067 yyvsp = yyvs = yyvsa;
1068 yystacksize = YYINITDEPTH;
1070 YYDPRINTF ((stderr, "Starting parse\n"));
1075 yychar = YYEMPTY; /* Cause a token to be read. */
1078 /*------------------------------------------------------------.
1079 | yynewstate -- Push a new state, which is found in yystate. |
1080 `------------------------------------------------------------*/
1082 /* In all cases, when you get here, the value and location stacks
1083 have just been pushed. So pushing a state here evens the stacks. */
1087 *yyssp = (yytype_int16) yystate;
1089 if (yyss + yystacksize - 1 <= yyssp)
1091 /* Get the current used size of the three stacks, in elements. */
1092 YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
1096 /* Give user a chance to reallocate the stack. Use copies of
1097 these so that the &'s don't force the real ones into
1099 YYSTYPE *yyvs1 = yyvs;
1100 yytype_int16 *yyss1 = yyss;
1102 /* Each stack pointer address is followed by the size of the
1103 data in use in that stack, in bytes. This used to be a
1104 conditional around just the two extra args, but that might
1105 be undefined if yyoverflow is a macro. */
1106 yyoverflow (YY_("memory exhausted"),
1107 &yyss1, yysize * sizeof (*yyssp),
1108 &yyvs1, yysize * sizeof (*yyvsp),
1113 #else /* no yyoverflow */
1114 # ifndef YYSTACK_RELOCATE
1115 goto yyexhaustedlab;
1117 /* Extend the stack our own way. */
1118 if (YYMAXDEPTH <= yystacksize)
1119 goto yyexhaustedlab;
1121 if (YYMAXDEPTH < yystacksize)
1122 yystacksize = YYMAXDEPTH;
1125 yytype_int16 *yyss1 = yyss;
1126 union yyalloc *yyptr =
1127 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1129 goto yyexhaustedlab;
1130 YYSTACK_RELOCATE (yyss_alloc, yyss);
1131 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1132 # undef YYSTACK_RELOCATE
1134 YYSTACK_FREE (yyss1);
1137 #endif /* no yyoverflow */
1139 yyssp = yyss + yysize - 1;
1140 yyvsp = yyvs + yysize - 1;
1142 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1143 (unsigned long) yystacksize));
1145 if (yyss + yystacksize - 1 <= yyssp)
1149 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1151 if (yystate == YYFINAL)
1161 /* Do appropriate processing given the current state. Read a
1162 lookahead token if we need one and don't already have one. */
1164 /* First try to decide what to do without reference to lookahead token. */
1165 yyn = yypact[yystate];
1166 if (yypact_value_is_default (yyn))
1169 /* Not known => get a lookahead token if don't already have one. */
1171 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1172 if (yychar == YYEMPTY)
1174 YYDPRINTF ((stderr, "Reading a token: "));
1178 if (yychar <= YYEOF)
1180 yychar = yytoken = YYEOF;
1181 YYDPRINTF ((stderr, "Now at end of input.\n"));
1185 yytoken = YYTRANSLATE (yychar);
1186 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1189 /* If the proper action on seeing token YYTOKEN is to reduce or to
1190 detect an error, take that action. */
1192 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1197 if (yytable_value_is_error (yyn))
1203 /* Count tokens shifted since error; after three, turn off error
1208 /* Shift the lookahead token. */
1209 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1211 /* Discard the shifted token. */
1215 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1217 YY_IGNORE_MAYBE_UNINITIALIZED_END
1222 /*-----------------------------------------------------------.
1223 | yydefault -- do the default action for the current state. |
1224 `-----------------------------------------------------------*/
1226 yyn = yydefact[yystate];
1232 /*-----------------------------.
1233 | yyreduce -- Do a reduction. |
1234 `-----------------------------*/
1236 /* yyn is the number of a rule to reduce with. */
1239 /* If YYLEN is nonzero, implement the default value of the action:
1242 Otherwise, the following line sets YYVAL to garbage.
1243 This behavior is undocumented and Bison
1244 users should not rely upon it. Assigning to YYVAL
1245 unconditionally makes the parser a bit smaller, and it avoids a
1246 GCC warning that YYVAL may be used uninitialized. */
1247 yyval = yyvsp[1-yylen];
1250 YY_REDUCE_PRINT (yyn);
1254 #line 61 "parserPromela.yacc" /* yacc.c:1645 */
1255 { new_state((yyvsp[-1].string), 1);}
1256 #line 1257 "parserPromela.tab.cacc" /* yacc.c:1645 */
1260 #line 65 "parserPromela.yacc" /* yacc.c:1645 */
1261 { new_transition((yyvsp[-1].string), (yyvsp[-4].label));}
1262 #line 1263 "parserPromela.tab.cacc" /* yacc.c:1645 */
1266 #line 68 "parserPromela.yacc" /* yacc.c:1645 */
1267 { (yyval.label) = (yyvsp[-1].label); }
1268 #line 1269 "parserPromela.tab.cacc" /* yacc.c:1645 */
1272 #line 69 "parserPromela.yacc" /* yacc.c:1645 */
1273 { (yyval.label) = xbt_automaton_exp_label_new_or((yyvsp[-2].label), (yyvsp[0].label)); }
1274 #line 1275 "parserPromela.tab.cacc" /* yacc.c:1645 */
1278 #line 70 "parserPromela.yacc" /* yacc.c:1645 */
1279 { (yyval.label) = xbt_automaton_exp_label_new_and((yyvsp[-2].label), (yyvsp[0].label)); }
1280 #line 1281 "parserPromela.tab.cacc" /* yacc.c:1645 */
1284 #line 71 "parserPromela.yacc" /* yacc.c:1645 */
1285 { (yyval.label) = xbt_automaton_exp_label_new_not((yyvsp[0].label)); }
1286 #line 1287 "parserPromela.tab.cacc" /* yacc.c:1645 */
1290 #line 72 "parserPromela.yacc" /* yacc.c:1645 */
1291 { (yyval.label) = xbt_automaton_exp_label_new_one(); }
1292 #line 1293 "parserPromela.tab.cacc" /* yacc.c:1645 */
1296 #line 73 "parserPromela.yacc" /* yacc.c:1645 */
1297 { (yyval.label) = xbt_automaton_exp_label_new_predicat((yyvsp[0].string)); }
1298 #line 1299 "parserPromela.tab.cacc" /* yacc.c:1645 */
1302 #line 1303 "parserPromela.tab.cacc" /* yacc.c:1645 */
1305 /* User semantic actions sometimes alter yychar, and that requires
1306 that yytoken be updated with the new translation. We take the
1307 approach of translating immediately before every use of yytoken.
1308 One alternative is translating here after every semantic action,
1309 but that translation would be missed if the semantic action invokes
1310 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1311 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1312 incorrect destructor might then be invoked immediately. In the
1313 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1314 to an incorrect destructor call or verbose syntax error message
1315 before the lookahead is translated. */
1316 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1320 YY_STACK_PRINT (yyss, yyssp);
1324 /* Now 'shift' the result of the reduction. Determine what state
1325 that goes to, based on the state we popped back to and the rule
1326 number reduced by. */
1328 const int yylhs = yyr1[yyn] - YYNTOKENS;
1329 const int yyi = yypgoto[yylhs] + *yyssp;
1330 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1332 : yydefgoto[yylhs]);
1338 /*--------------------------------------.
1339 | yyerrlab -- here on detecting error. |
1340 `--------------------------------------*/
1342 /* Make sure we have latest lookahead translation. See comments at
1343 user semantic actions for why this is necessary. */
1344 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1346 /* If not already recovering from an error, report this error. */
1350 #if ! YYERROR_VERBOSE
1351 yyerror (YY_("syntax error"));
1353 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1356 char const *yymsgp = YY_("syntax error");
1357 int yysyntax_error_status;
1358 yysyntax_error_status = YYSYNTAX_ERROR;
1359 if (yysyntax_error_status == 0)
1361 else if (yysyntax_error_status == 1)
1363 if (yymsg != yymsgbuf)
1364 YYSTACK_FREE (yymsg);
1365 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1369 yymsg_alloc = sizeof yymsgbuf;
1370 yysyntax_error_status = 2;
1374 yysyntax_error_status = YYSYNTAX_ERROR;
1379 if (yysyntax_error_status == 2)
1380 goto yyexhaustedlab;
1382 # undef YYSYNTAX_ERROR
1388 if (yyerrstatus == 3)
1390 /* If just tried and failed to reuse lookahead token after an
1391 error, discard it. */
1393 if (yychar <= YYEOF)
1395 /* Return failure if at end of input. */
1396 if (yychar == YYEOF)
1401 yydestruct ("Error: discarding",
1407 /* Else will try to reuse lookahead token after shifting the error
1412 /*---------------------------------------------------.
1413 | yyerrorlab -- error raised explicitly by YYERROR. |
1414 `---------------------------------------------------*/
1417 /* Pacify compilers like GCC when the user code never invokes
1418 YYERROR and the label yyerrorlab therefore never appears in user
1420 if (/*CONSTCOND*/ 0)
1423 /* Do not reclaim the symbols of the rule whose action triggered
1427 YY_STACK_PRINT (yyss, yyssp);
1432 /*-------------------------------------------------------------.
1433 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1434 `-------------------------------------------------------------*/
1436 yyerrstatus = 3; /* Each real token shifted decrements this. */
1440 yyn = yypact[yystate];
1441 if (!yypact_value_is_default (yyn))
1444 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1452 /* Pop the current state because it cannot handle the error token. */
1457 yydestruct ("Error: popping",
1458 yystos[yystate], yyvsp);
1461 YY_STACK_PRINT (yyss, yyssp);
1464 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1466 YY_IGNORE_MAYBE_UNINITIALIZED_END
1469 /* Shift the error token. */
1470 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1476 /*-------------------------------------.
1477 | yyacceptlab -- YYACCEPT comes here. |
1478 `-------------------------------------*/
1483 /*-----------------------------------.
1484 | yyabortlab -- YYABORT comes here. |
1485 `-----------------------------------*/
1490 #if !defined yyoverflow || YYERROR_VERBOSE
1491 /*-------------------------------------------------.
1492 | yyexhaustedlab -- memory exhaustion comes here. |
1493 `-------------------------------------------------*/
1495 yyerror (YY_("memory exhausted"));
1501 if (yychar != YYEMPTY)
1503 /* Make sure we have latest lookahead translation. See comments at
1504 user semantic actions for why this is necessary. */
1505 yytoken = YYTRANSLATE (yychar);
1506 yydestruct ("Cleanup: discarding lookahead",
1509 /* Do not reclaim the symbols of the rule whose action triggered
1510 this YYABORT or YYACCEPT. */
1512 YY_STACK_PRINT (yyss, yyssp);
1513 while (yyssp != yyss)
1515 yydestruct ("Cleanup: popping",
1516 yystos[*yyssp], yyvsp);
1521 YYSTACK_FREE (yyss);
1524 if (yymsg != yymsgbuf)
1525 YYSTACK_FREE (yymsg);
1529 #line 76 "parserPromela.yacc" /* yacc.c:1903 */
1534 void yyerror(const char *s){
1535 fprintf (stderr, "%s\n", s);