1 /* A Bison parser, made by GNU Bison 2.5. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2011 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 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.5"
50 #define YYSKELETON_NAME "yacc.c"
61 /* Using locations. */
62 #define YYLSP_NEEDED 0
66 /* Copy the first part of user declarations. */
68 /* Line 268 of yacc.c */
69 #line 1 "parserPromela.yacc"
72 #include "automaton_parse.yy.c"
73 #include <xbt/automaton.h>
74 #include <xbt/automatonparse_promela.h>
76 void yyerror(const char *s);
80 /* Line 268 of yacc.c */
83 /* Enabling traces. */
88 /* Enabling verbose error messages. */
89 #ifdef YYERROR_VERBOSE
90 # undef YYERROR_VERBOSE
91 # define YYERROR_VERBOSE 1
93 # define YYERROR_VERBOSE 0
96 /* Enabling the token table. */
98 # define YYTOKEN_TABLE 0
105 /* Put the tokens into the symbol table, so that GDB and other debuggers
140 #define RIGHT_PAR 267
143 #define SEMI_COLON 270
144 #define CASE_TRUE 271
145 #define LEFT_BRACE 272
146 #define RIGHT_BRACE 273
148 #define LITT_CHAINE 275
149 #define LITT_REEL 276
155 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
156 typedef union YYSTYPE
159 /* Line 293 of yacc.c */
160 #line 11 "parserPromela.yacc"
165 xbt_exp_label_t label;
169 /* Line 293 of yacc.c */
172 # define YYSTYPE_IS_TRIVIAL 1
173 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
174 # define YYSTYPE_IS_DECLARED 1
178 /* Copy the second part of user declarations. */
181 /* Line 343 of yacc.c */
189 typedef YYTYPE_UINT8 yytype_uint8;
191 typedef unsigned char yytype_uint8;
195 typedef YYTYPE_INT8 yytype_int8;
196 #elif (defined __STDC__ || defined __C99__FUNC__ \
197 || defined __cplusplus || defined _MSC_VER)
198 typedef signed char yytype_int8;
200 typedef short int yytype_int8;
204 typedef YYTYPE_UINT16 yytype_uint16;
206 typedef unsigned short int yytype_uint16;
210 typedef YYTYPE_INT16 yytype_int16;
212 typedef short int yytype_int16;
216 # ifdef __SIZE_TYPE__
217 # define YYSIZE_T __SIZE_TYPE__
218 # elif defined size_t
219 # define YYSIZE_T size_t
220 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
221 || defined __cplusplus || defined _MSC_VER)
222 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
223 # define YYSIZE_T size_t
225 # define YYSIZE_T unsigned int
229 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
232 # if defined YYENABLE_NLS && YYENABLE_NLS
234 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
235 # define YY_(msgid) dgettext ("bison-runtime", msgid)
239 # define YY_(msgid) msgid
243 /* Suppress unused-variable warnings by "using" E. */
244 #if ! defined lint || defined __GNUC__
245 # define YYUSE(e) ((void) (e))
247 # define YYUSE(e) /* empty */
250 /* Identity function, used to suppress warnings about constant conditions. */
254 #if (defined __STDC__ || defined __C99__FUNC__ \
255 || defined __cplusplus || defined _MSC_VER)
268 #if ! defined yyoverflow || YYERROR_VERBOSE
270 /* The parser invokes alloca or malloc; define the necessary symbols. */
272 # ifdef YYSTACK_USE_ALLOCA
273 # if YYSTACK_USE_ALLOCA
275 # define YYSTACK_ALLOC __builtin_alloca
276 # elif defined __BUILTIN_VA_ARG_INCR
277 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
279 # define YYSTACK_ALLOC __alloca
280 # elif defined _MSC_VER
281 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
282 # define alloca _alloca
284 # define YYSTACK_ALLOC alloca
285 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
286 || defined __cplusplus || defined _MSC_VER)
287 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
288 # ifndef EXIT_SUCCESS
289 # define EXIT_SUCCESS 0
296 # ifdef YYSTACK_ALLOC
297 /* Pacify GCC's `empty if-body' warning. */
298 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
299 # ifndef YYSTACK_ALLOC_MAXIMUM
300 /* The OS might guarantee only one guard page at the bottom of the stack,
301 and a page size can be as small as 4096 bytes. So we cannot safely
302 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
303 to allow for a few compiler-allocated temporary stack slots. */
304 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
307 # define YYSTACK_ALLOC YYMALLOC
308 # define YYSTACK_FREE YYFREE
309 # ifndef YYSTACK_ALLOC_MAXIMUM
310 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
312 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
313 && ! ((defined YYMALLOC || defined malloc) \
314 && (defined YYFREE || defined free)))
315 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
316 # ifndef EXIT_SUCCESS
317 # define EXIT_SUCCESS 0
321 # define YYMALLOC malloc
322 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
323 || defined __cplusplus || defined _MSC_VER)
324 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
329 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
330 || defined __cplusplus || defined _MSC_VER)
331 void free (void *); /* INFRINGES ON USER NAME SPACE */
335 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
338 #if (! defined yyoverflow \
339 && (! defined __cplusplus \
340 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
342 /* A type that is properly aligned for any stack member. */
345 yytype_int16 yyss_alloc;
349 /* The size of the maximum gap between one aligned stack and the next. */
350 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
352 /* The size of an array large to enough to hold all stacks, each with
354 # define YYSTACK_BYTES(N) \
355 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
356 + YYSTACK_GAP_MAXIMUM)
358 # define YYCOPY_NEEDED 1
360 /* Relocate STACK from its old location to the new one. The
361 local variables YYSIZE and YYSTACKSIZE give the old and new number of
362 elements in the stack, and YYPTR gives the new location of the
363 stack. Advance YYPTR to a properly aligned location for the next
365 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
368 YYSIZE_T yynewbytes; \
369 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
370 Stack = &yyptr->Stack_alloc; \
371 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
372 yyptr += yynewbytes / sizeof (*yyptr); \
378 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
379 /* Copy COUNT objects from FROM to TO. The source and destination do
382 # if defined __GNUC__ && 1 < __GNUC__
383 # define YYCOPY(To, From, Count) \
384 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
386 # define YYCOPY(To, From, Count) \
390 for (yyi = 0; yyi < (Count); yyi++) \
391 (To)[yyi] = (From)[yyi]; \
396 #endif /* !YYCOPY_NEEDED */
398 /* YYFINAL -- State number of the termination state. */
400 /* YYLAST -- Last index in YYTABLE. */
403 /* YYNTOKENS -- Number of terminals. */
405 /* YYNNTS -- Number of nonterminals. */
407 /* YYNRULES -- Number of rules. */
409 /* YYNRULES -- Number of states. */
412 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
414 #define YYMAXUTOK 277
416 #define YYTRANSLATE(YYX) \
417 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
419 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
420 static const yytype_uint8 yytranslate[] =
422 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
423 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
424 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
425 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
426 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
427 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
428 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
429 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
430 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
431 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
432 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 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, 1, 2, 3, 4,
448 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
449 15, 16, 17, 18, 19, 20, 21, 22
453 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
455 static const yytype_uint8 yyprhs[] =
457 0, 0, 3, 8, 9, 10, 19, 20, 27, 31,
461 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
462 static const yytype_int8 yyrhs[] =
464 24, 0, -1, 3, 17, 25, 18, -1, -1, -1,
465 22, 14, 26, 4, 27, 5, 15, 25, -1, -1,
466 13, 28, 6, 7, 22, 27, -1, 11, 28, 12,
467 -1, 28, 9, 28, -1, 28, 8, 28, -1, 10,
468 28, -1, 16, -1, 22, -1
471 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
472 static const yytype_uint8 yyrline[] =
474 0, 48, 48, 51, 52, 52, 55, 56, 59, 60,
479 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
480 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
481 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
482 static const char *const yytname[] =
484 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
485 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
486 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
487 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
488 "$@1", "option", "exp", 0
493 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
495 static const yytype_uint16 yytoknum[] =
497 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
498 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
503 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
504 static const yytype_uint8 yyr1[] =
506 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
510 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
511 static const yytype_uint8 yyr2[] =
513 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
517 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
518 Performed when YYTABLE doesn't specify something else to do. Zero
519 means the default is an error. */
520 static const yytype_uint8 yydefact[] =
522 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
523 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
524 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
528 /* YYDEFGOTO[NTERM-NUM]. */
529 static const yytype_int8 yydefgoto[] =
534 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
536 #define YYPACT_NINF -16
537 static const yytype_int8 yypact[] =
539 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
540 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
541 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
545 /* YYPGOTO[NTERM-NUM]. */
546 static const yytype_int8 yypgoto[] =
548 -16, -16, 4, -16, -7, -9
551 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
552 positive, shift that token. If negative, reduce the rule which
553 number is the opposite. If YYTABLE_NINF, syntax error. */
554 #define YYTABLE_NINF -1
555 static const yytype_uint8 yytable[] =
557 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
558 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
559 10, 11, 18, 31, 0, 26, 24, 30, 29
562 #define yypact_value_is_default(yystate) \
565 #define yytable_value_is_error(yytable_value) \
568 static const yytype_int8 yycheck[] =
570 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
571 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
572 4, 13, 5, 30, -1, 7, 15, 22, 24
575 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
576 symbol of state STATE-NUM. */
577 static const yytype_uint8 yystos[] =
579 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
580 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
581 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
585 #define yyerrok (yyerrstatus = 0)
586 #define yyclearin (yychar = YYEMPTY)
590 #define YYACCEPT goto yyacceptlab
591 #define YYABORT goto yyabortlab
592 #define YYERROR goto yyerrorlab
595 /* Like YYERROR except do call yyerror. This remains here temporarily
596 to ease the transition to the new meaning of YYERROR, for GCC.
597 Once GCC version 2 has supplanted version 1, this can go. However,
598 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
599 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
602 #define YYFAIL goto yyerrlab
604 /* This is here to suppress warnings from the GCC cpp's
605 -Wunused-macros. Normally we don't worry about that warning, but
606 some users do, and we want to make it easy for users to remove
607 YYFAIL uses, which will produce warnings from Bison 2.5. */
610 #define YYRECOVERING() (!!yyerrstatus)
612 #define YYBACKUP(Token, Value) \
614 if (yychar == YYEMPTY && yylen == 1) \
623 yyerror (YY_("syntax error: cannot back up")); \
630 #define YYERRCODE 256
633 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
634 If N is 0, then set CURRENT to the empty location which ends
635 the previous symbol: RHS[0] (always defined). */
637 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
638 #ifndef YYLLOC_DEFAULT
639 # define YYLLOC_DEFAULT(Current, Rhs, N) \
643 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
644 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
645 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
646 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
650 (Current).first_line = (Current).last_line = \
651 YYRHSLOC (Rhs, 0).last_line; \
652 (Current).first_column = (Current).last_column = \
653 YYRHSLOC (Rhs, 0).last_column; \
659 /* This macro is provided for backward compatibility. */
661 #ifndef YY_LOCATION_PRINT
662 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
666 /* YYLEX -- calling `yylex' with the right arguments. */
669 # define YYLEX yylex (YYLEX_PARAM)
671 # define YYLEX yylex ()
674 /* Enable debugging if requested. */
678 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
679 # define YYFPRINTF fprintf
682 # define YYDPRINTF(Args) \
688 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
692 YYFPRINTF (stderr, "%s ", Title); \
693 yy_symbol_print (stderr, \
695 YYFPRINTF (stderr, "\n"); \
700 /*--------------------------------.
701 | Print this symbol on YYOUTPUT. |
702 `--------------------------------*/
705 #if (defined __STDC__ || defined __C99__FUNC__ \
706 || defined __cplusplus || defined _MSC_VER)
708 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
711 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
714 YYSTYPE const * const yyvaluep;
720 if (yytype < YYNTOKENS)
721 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
733 /*--------------------------------.
734 | Print this symbol on YYOUTPUT. |
735 `--------------------------------*/
737 #if (defined __STDC__ || defined __C99__FUNC__ \
738 || defined __cplusplus || defined _MSC_VER)
740 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
743 yy_symbol_print (yyoutput, yytype, yyvaluep)
746 YYSTYPE const * const yyvaluep;
749 if (yytype < YYNTOKENS)
750 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
752 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
754 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
755 YYFPRINTF (yyoutput, ")");
758 /*------------------------------------------------------------------.
759 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
761 `------------------------------------------------------------------*/
763 #if (defined __STDC__ || defined __C99__FUNC__ \
764 || defined __cplusplus || defined _MSC_VER)
766 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
769 yy_stack_print (yybottom, yytop)
770 yytype_int16 *yybottom;
774 YYFPRINTF (stderr, "Stack now");
775 for (; yybottom <= yytop; yybottom++)
777 int yybot = *yybottom;
778 YYFPRINTF (stderr, " %d", yybot);
780 YYFPRINTF (stderr, "\n");
783 # define YY_STACK_PRINT(Bottom, Top) \
786 yy_stack_print ((Bottom), (Top)); \
790 /*------------------------------------------------.
791 | Report that the YYRULE is going to be reduced. |
792 `------------------------------------------------*/
794 #if (defined __STDC__ || defined __C99__FUNC__ \
795 || defined __cplusplus || defined _MSC_VER)
797 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
800 yy_reduce_print (yyvsp, yyrule)
805 int yynrhs = yyr2[yyrule];
807 unsigned long int yylno = yyrline[yyrule];
808 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
810 /* The symbols being reduced. */
811 for (yyi = 0; yyi < yynrhs; yyi++)
813 YYFPRINTF (stderr, " $%d = ", yyi + 1);
814 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
815 &(yyvsp[(yyi + 1) - (yynrhs)])
817 YYFPRINTF (stderr, "\n");
821 # define YY_REDUCE_PRINT(Rule) \
824 yy_reduce_print (yyvsp, Rule); \
827 /* Nonzero means print parse trace. It is left uninitialized so that
828 multiple parsers can coexist. */
831 # define YYDPRINTF(Args)
832 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
833 # define YY_STACK_PRINT(Bottom, Top)
834 # define YY_REDUCE_PRINT(Rule)
835 #endif /* !YYDEBUG */
838 /* YYINITDEPTH -- initial size of the parser's stacks. */
840 # define YYINITDEPTH 200
843 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
844 if the built-in stack extension method is used).
846 Do not make this value too large; the results are undefined if
847 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
848 evaluated with infinite-precision integer arithmetic. */
851 # define YYMAXDEPTH 10000
858 # if defined __GLIBC__ && defined _STRING_H
859 # define yystrlen strlen
861 /* Return the length of YYSTR. */
862 #if (defined __STDC__ || defined __C99__FUNC__ \
863 || defined __cplusplus || defined _MSC_VER)
865 yystrlen (const char *yystr)
873 for (yylen = 0; yystr[yylen]; yylen++)
881 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
882 # define yystpcpy stpcpy
884 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
886 #if (defined __STDC__ || defined __C99__FUNC__ \
887 || defined __cplusplus || defined _MSC_VER)
889 yystpcpy (char *yydest, const char *yysrc)
892 yystpcpy (yydest, yysrc)
898 const char *yys = yysrc;
900 while ((*yyd++ = *yys++) != '\0')
909 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
910 quotes and backslashes, so that it's suitable for yyerror. The
911 heuristic is that double-quoting is unnecessary unless the string
912 contains an apostrophe, a comma, or backslash (other than
913 backslash-backslash). YYSTR is taken from yytname. If YYRES is
914 null, do not copy; instead, return the length of what the result
917 yytnamerr (char *yyres, const char *yystr)
922 char const *yyp = yystr;
929 goto do_not_strip_quotes;
933 goto do_not_strip_quotes;
946 do_not_strip_quotes: ;
950 return yystrlen (yystr);
952 return yystpcpy (yyres, yystr) - yyres;
956 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
957 about the unexpected token YYTOKEN for the state stack whose top is
960 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
961 not large enough to hold the message. In that case, also set
962 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
963 required number of bytes is too large to store. */
965 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
966 yytype_int16 *yyssp, int yytoken)
968 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
969 YYSIZE_T yysize = yysize0;
971 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
972 /* Internationalized format string. */
973 const char *yyformat = 0;
974 /* Arguments of yyformat. */
975 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
976 /* Number of reported tokens (one for the "unexpected", one per
980 /* There are many possibilities here to consider:
981 - Assume YYFAIL is not used. It's too flawed to consider. See
982 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
983 for details. YYERROR is fine as it does not invoke this
985 - If this state is a consistent state with a default action, then
986 the only way this function was invoked is if the default action
987 is an error action. In that case, don't check for expected
988 tokens because there are none.
989 - The only way there can be no lookahead present (in yychar) is if
990 this state is a consistent state with a default action. Thus,
991 detecting the absence of a lookahead is sufficient to determine
992 that there is no unexpected or expected token to report. In that
993 case, just report a simple "syntax error".
994 - Don't assume there isn't a lookahead just because this state is a
995 consistent state with a default action. There might have been a
996 previous inconsistent state, consistent state with a non-default
997 action, or user semantic action that manipulated yychar.
998 - Of course, the expected token list depends on states to have
999 correct lookahead information, and it depends on the parser not
1000 to perform extra reductions after fetching a lookahead from the
1001 scanner and before detecting a syntax error. Thus, state merging
1002 (from LALR or IELR) and default reductions corrupt the expected
1003 token list. However, the list is correct for canonical LR with
1004 one exception: it will still contain any token that will not be
1005 accepted due to an error action in a later state.
1007 if (yytoken != YYEMPTY)
1009 int yyn = yypact[*yyssp];
1010 yyarg[yycount++] = yytname[yytoken];
1011 if (!yypact_value_is_default (yyn))
1013 /* Start YYX at -YYN if negative to avoid negative indexes in
1014 YYCHECK. In other words, skip the first -YYN actions for
1015 this state because they are default actions. */
1016 int yyxbegin = yyn < 0 ? -yyn : 0;
1017 /* Stay within bounds of both yycheck and yytname. */
1018 int yychecklim = YYLAST - yyn + 1;
1019 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1022 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1023 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1024 && !yytable_value_is_error (yytable[yyx + yyn]))
1026 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1032 yyarg[yycount++] = yytname[yyx];
1033 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1034 if (! (yysize <= yysize1
1035 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1044 # define YYCASE_(N, S) \
1048 YYCASE_(0, YY_("syntax error"));
1049 YYCASE_(1, YY_("syntax error, unexpected %s"));
1050 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1051 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1052 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1053 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1057 yysize1 = yysize + yystrlen (yyformat);
1058 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1062 if (*yymsg_alloc < yysize)
1064 *yymsg_alloc = 2 * yysize;
1065 if (! (yysize <= *yymsg_alloc
1066 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1067 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1071 /* Avoid sprintf, as that infringes on the user's name space.
1072 Don't have undefined behavior even if the translation
1073 produced a string with the wrong number of "%s"s. */
1077 while ((*yyp = *yyformat) != '\0')
1078 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1080 yyp += yytnamerr (yyp, yyarg[yyi++]);
1091 #endif /* YYERROR_VERBOSE */
1093 /*-----------------------------------------------.
1094 | Release the memory associated to this symbol. |
1095 `-----------------------------------------------*/
1098 #if (defined __STDC__ || defined __C99__FUNC__ \
1099 || defined __cplusplus || defined _MSC_VER)
1101 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1104 yydestruct (yymsg, yytype, yyvaluep)
1114 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1125 /* Prevent warnings from -Wmissing-prototypes. */
1126 #ifdef YYPARSE_PARAM
1127 #if defined __STDC__ || defined __cplusplus
1128 int yyparse (void *YYPARSE_PARAM);
1132 #else /* ! YYPARSE_PARAM */
1133 #if defined __STDC__ || defined __cplusplus
1138 #endif /* ! YYPARSE_PARAM */
1141 /* The lookahead symbol. */
1144 /* The semantic value of the lookahead symbol. */
1147 /* Number of syntax errors so far. */
1155 #ifdef YYPARSE_PARAM
1156 #if (defined __STDC__ || defined __C99__FUNC__ \
1157 || defined __cplusplus || defined _MSC_VER)
1159 yyparse (void *YYPARSE_PARAM)
1162 yyparse (YYPARSE_PARAM)
1163 void *YYPARSE_PARAM;
1165 #else /* ! YYPARSE_PARAM */
1166 #if (defined __STDC__ || defined __C99__FUNC__ \
1167 || defined __cplusplus || defined _MSC_VER)
1178 /* Number of tokens to shift before error messages enabled. */
1181 /* The stacks and their tools:
1182 `yyss': related to states.
1183 `yyvs': related to semantic values.
1185 Refer to the stacks thru separate pointers, to allow yyoverflow
1186 to reallocate them elsewhere. */
1188 /* The state stack. */
1189 yytype_int16 yyssa[YYINITDEPTH];
1191 yytype_int16 *yyssp;
1193 /* The semantic value stack. */
1194 YYSTYPE yyvsa[YYINITDEPTH];
1198 YYSIZE_T yystacksize;
1202 /* Lookahead token as an internal (translated) token number. */
1204 /* The variables used to return semantic value and location from the
1209 /* Buffer for error messages, and its allocated size. */
1211 char *yymsg = yymsgbuf;
1212 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1215 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1217 /* The number of symbols on the RHS of the reduced rule.
1218 Keep to zero when no symbol should be popped. */
1224 yystacksize = YYINITDEPTH;
1226 YYDPRINTF ((stderr, "Starting parse\n"));
1231 yychar = YYEMPTY; /* Cause a token to be read. */
1233 /* Initialize stack pointers.
1234 Waste one element of value and location stack
1235 so that they stay on the same level as the state stack.
1236 The wasted elements are never initialized. */
1242 /*------------------------------------------------------------.
1243 | yynewstate -- Push a new state, which is found in yystate. |
1244 `------------------------------------------------------------*/
1246 /* In all cases, when you get here, the value and location stacks
1247 have just been pushed. So pushing a state here evens the stacks. */
1253 if (yyss + yystacksize - 1 <= yyssp)
1255 /* Get the current used size of the three stacks, in elements. */
1256 YYSIZE_T yysize = yyssp - yyss + 1;
1260 /* Give user a chance to reallocate the stack. Use copies of
1261 these so that the &'s don't force the real ones into
1263 YYSTYPE *yyvs1 = yyvs;
1264 yytype_int16 *yyss1 = yyss;
1266 /* Each stack pointer address is followed by the size of the
1267 data in use in that stack, in bytes. This used to be a
1268 conditional around just the two extra args, but that might
1269 be undefined if yyoverflow is a macro. */
1270 yyoverflow (YY_("memory exhausted"),
1271 &yyss1, yysize * sizeof (*yyssp),
1272 &yyvs1, yysize * sizeof (*yyvsp),
1278 #else /* no yyoverflow */
1279 # ifndef YYSTACK_RELOCATE
1280 goto yyexhaustedlab;
1282 /* Extend the stack our own way. */
1283 if (YYMAXDEPTH <= yystacksize)
1284 goto yyexhaustedlab;
1286 if (YYMAXDEPTH < yystacksize)
1287 yystacksize = YYMAXDEPTH;
1290 yytype_int16 *yyss1 = yyss;
1291 union yyalloc *yyptr =
1292 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1294 goto yyexhaustedlab;
1295 YYSTACK_RELOCATE (yyss_alloc, yyss);
1296 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1297 # undef YYSTACK_RELOCATE
1299 YYSTACK_FREE (yyss1);
1302 #endif /* no yyoverflow */
1304 yyssp = yyss + yysize - 1;
1305 yyvsp = yyvs + yysize - 1;
1307 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1308 (unsigned long int) yystacksize));
1310 if (yyss + yystacksize - 1 <= yyssp)
1314 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1316 if (yystate == YYFINAL)
1326 /* Do appropriate processing given the current state. Read a
1327 lookahead token if we need one and don't already have one. */
1329 /* First try to decide what to do without reference to lookahead token. */
1330 yyn = yypact[yystate];
1331 if (yypact_value_is_default (yyn))
1334 /* Not known => get a lookahead token if don't already have one. */
1336 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1337 if (yychar == YYEMPTY)
1339 YYDPRINTF ((stderr, "Reading a token: "));
1343 if (yychar <= YYEOF)
1345 yychar = yytoken = YYEOF;
1346 YYDPRINTF ((stderr, "Now at end of input.\n"));
1350 yytoken = YYTRANSLATE (yychar);
1351 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1354 /* If the proper action on seeing token YYTOKEN is to reduce or to
1355 detect an error, take that action. */
1357 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1362 if (yytable_value_is_error (yyn))
1368 /* Count tokens shifted since error; after three, turn off error
1373 /* Shift the lookahead token. */
1374 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1376 /* Discard the shifted token. */
1385 /*-----------------------------------------------------------.
1386 | yydefault -- do the default action for the current state. |
1387 `-----------------------------------------------------------*/
1389 yyn = yydefact[yystate];
1395 /*-----------------------------.
1396 | yyreduce -- Do a reduction. |
1397 `-----------------------------*/
1399 /* yyn is the number of a rule to reduce with. */
1402 /* If YYLEN is nonzero, implement the default value of the action:
1405 Otherwise, the following line sets YYVAL to garbage.
1406 This behavior is undocumented and Bison
1407 users should not rely upon it. Assigning to YYVAL
1408 unconditionally makes the parser a bit smaller, and it avoids a
1409 GCC warning that YYVAL may be used uninitialized. */
1410 yyval = yyvsp[1-yylen];
1413 YY_REDUCE_PRINT (yyn);
1418 /* Line 1806 of yacc.c */
1419 #line 52 "parserPromela.yacc"
1420 { new_state((yyvsp[(1) - (2)].string), 1);}
1425 /* Line 1806 of yacc.c */
1426 #line 56 "parserPromela.yacc"
1427 { new_transition((yyvsp[(5) - (6)].string), (yyvsp[(2) - (6)].label));}
1432 /* Line 1806 of yacc.c */
1433 #line 59 "parserPromela.yacc"
1434 { (yyval.label) = (yyvsp[(2) - (3)].label); }
1439 /* Line 1806 of yacc.c */
1440 #line 60 "parserPromela.yacc"
1441 { (yyval.label) = new_label(0, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1446 /* Line 1806 of yacc.c */
1447 #line 61 "parserPromela.yacc"
1448 { (yyval.label) = new_label(1, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1453 /* Line 1806 of yacc.c */
1454 #line 62 "parserPromela.yacc"
1455 { (yyval.label) = new_label(2, (yyvsp[(2) - (2)].label)); }
1460 /* Line 1806 of yacc.c */
1461 #line 63 "parserPromela.yacc"
1462 { (yyval.label) = new_label(4); }
1467 /* Line 1806 of yacc.c */
1468 #line 64 "parserPromela.yacc"
1469 { (yyval.label) = new_label(3, (yyvsp[(1) - (1)].string)); }
1474 /* Line 1806 of yacc.c */
1475 #line 1476 "y.tab.c"
1478 /* User semantic actions sometimes alter yychar, and that requires
1479 that yytoken be updated with the new translation. We take the
1480 approach of translating immediately before every use of yytoken.
1481 One alternative is translating here after every semantic action,
1482 but that translation would be missed if the semantic action invokes
1483 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1484 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1485 incorrect destructor might then be invoked immediately. In the
1486 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1487 to an incorrect destructor call or verbose syntax error message
1488 before the lookahead is translated. */
1489 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1493 YY_STACK_PRINT (yyss, yyssp);
1497 /* Now `shift' the result of the reduction. Determine what state
1498 that goes to, based on the state we popped back to and the rule
1499 number reduced by. */
1503 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1504 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1505 yystate = yytable[yystate];
1507 yystate = yydefgoto[yyn - YYNTOKENS];
1512 /*------------------------------------.
1513 | yyerrlab -- here on detecting error |
1514 `------------------------------------*/
1516 /* Make sure we have latest lookahead translation. See comments at
1517 user semantic actions for why this is necessary. */
1518 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1520 /* If not already recovering from an error, report this error. */
1524 #if ! YYERROR_VERBOSE
1525 yyerror (YY_("syntax error"));
1527 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1530 char const *yymsgp = YY_("syntax error");
1531 int yysyntax_error_status;
1532 yysyntax_error_status = YYSYNTAX_ERROR;
1533 if (yysyntax_error_status == 0)
1535 else if (yysyntax_error_status == 1)
1537 if (yymsg != yymsgbuf)
1538 YYSTACK_FREE (yymsg);
1539 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1543 yymsg_alloc = sizeof yymsgbuf;
1544 yysyntax_error_status = 2;
1548 yysyntax_error_status = YYSYNTAX_ERROR;
1553 if (yysyntax_error_status == 2)
1554 goto yyexhaustedlab;
1556 # undef YYSYNTAX_ERROR
1562 if (yyerrstatus == 3)
1564 /* If just tried and failed to reuse lookahead token after an
1565 error, discard it. */
1567 if (yychar <= YYEOF)
1569 /* Return failure if at end of input. */
1570 if (yychar == YYEOF)
1575 yydestruct ("Error: discarding",
1581 /* Else will try to reuse lookahead token after shifting the error
1586 /*---------------------------------------------------.
1587 | yyerrorlab -- error raised explicitly by YYERROR. |
1588 `---------------------------------------------------*/
1591 /* Pacify compilers like GCC when the user code never invokes
1592 YYERROR and the label yyerrorlab therefore never appears in user
1594 if (/*CONSTCOND*/ 0)
1597 /* Do not reclaim the symbols of the rule which action triggered
1601 YY_STACK_PRINT (yyss, yyssp);
1606 /*-------------------------------------------------------------.
1607 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1608 `-------------------------------------------------------------*/
1610 yyerrstatus = 3; /* Each real token shifted decrements this. */
1614 yyn = yypact[yystate];
1615 if (!yypact_value_is_default (yyn))
1618 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1626 /* Pop the current state because it cannot handle the error token. */
1631 yydestruct ("Error: popping",
1632 yystos[yystate], yyvsp);
1635 YY_STACK_PRINT (yyss, yyssp);
1641 /* Shift the error token. */
1642 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1648 /*-------------------------------------.
1649 | yyacceptlab -- YYACCEPT comes here. |
1650 `-------------------------------------*/
1655 /*-----------------------------------.
1656 | yyabortlab -- YYABORT comes here. |
1657 `-----------------------------------*/
1662 #if !defined(yyoverflow) || YYERROR_VERBOSE
1663 /*-------------------------------------------------.
1664 | yyexhaustedlab -- memory exhaustion comes here. |
1665 `-------------------------------------------------*/
1667 yyerror (YY_("memory exhausted"));
1673 if (yychar != YYEMPTY)
1675 /* Make sure we have latest lookahead translation. See comments at
1676 user semantic actions for why this is necessary. */
1677 yytoken = YYTRANSLATE (yychar);
1678 yydestruct ("Cleanup: discarding lookahead",
1681 /* Do not reclaim the symbols of the rule which action triggered
1682 this YYABORT or YYACCEPT. */
1684 YY_STACK_PRINT (yyss, yyssp);
1685 while (yyssp != yyss)
1687 yydestruct ("Cleanup: popping",
1688 yystos[*yyssp], yyvsp);
1693 YYSTACK_FREE (yyss);
1696 if (yymsg != yymsgbuf)
1697 YYSTACK_FREE (yymsg);
1699 /* Make sure YYID is used. */
1700 return YYID (yyresult);
1705 /* Line 2067 of yacc.c */
1706 #line 67 "parserPromela.yacc"
1711 void yyerror(const char *s){
1712 fprintf (stderr, "%s\n", s);