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 "../../../include/xbt/automatonparse_promela.h"
73 //#include "../../../include/xbt/automaton.h"
74 #include "automaton_parse.yy.c"
75 #include <xbt/automaton.h>
76 #include <xbt/automatonparse_promela.h>
78 void yyerror(const char *s);
82 /* Line 268 of yacc.c */
85 /* Enabling traces. */
90 /* Enabling verbose error messages. */
91 #ifdef YYERROR_VERBOSE
92 # undef YYERROR_VERBOSE
93 # define YYERROR_VERBOSE 1
95 # define YYERROR_VERBOSE 0
98 /* Enabling the token table. */
100 # define YYTOKEN_TABLE 0
107 /* Put the tokens into the symbol table, so that GDB and other debuggers
142 #define RIGHT_PAR 267
145 #define SEMI_COLON 270
146 #define CASE_TRUE 271
147 #define LEFT_BRACE 272
148 #define RIGHT_BRACE 273
150 #define LITT_CHAINE 275
151 #define LITT_REEL 276
157 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
158 typedef union YYSTYPE
161 /* Line 293 of yacc.c */
162 #line 13 "parserPromela.yacc"
167 xbt_exp_label_t label;
171 /* Line 293 of yacc.c */
174 # define YYSTYPE_IS_TRIVIAL 1
175 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
176 # define YYSTYPE_IS_DECLARED 1
180 /* Copy the second part of user declarations. */
183 /* Line 343 of yacc.c */
191 typedef YYTYPE_UINT8 yytype_uint8;
193 typedef unsigned char yytype_uint8;
197 typedef YYTYPE_INT8 yytype_int8;
198 #elif (defined __STDC__ || defined __C99__FUNC__ \
199 || defined __cplusplus || defined _MSC_VER)
200 typedef signed char yytype_int8;
202 typedef short int yytype_int8;
206 typedef YYTYPE_UINT16 yytype_uint16;
208 typedef unsigned short int yytype_uint16;
212 typedef YYTYPE_INT16 yytype_int16;
214 typedef short int yytype_int16;
218 # ifdef __SIZE_TYPE__
219 # define YYSIZE_T __SIZE_TYPE__
220 # elif defined size_t
221 # define YYSIZE_T size_t
222 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
223 || defined __cplusplus || defined _MSC_VER)
224 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
225 # define YYSIZE_T size_t
227 # define YYSIZE_T unsigned int
231 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
234 # if defined YYENABLE_NLS && YYENABLE_NLS
236 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
237 # define YY_(msgid) dgettext ("bison-runtime", msgid)
241 # define YY_(msgid) msgid
245 /* Suppress unused-variable warnings by "using" E. */
246 #if ! defined lint || defined __GNUC__
247 # define YYUSE(e) ((void) (e))
249 # define YYUSE(e) /* empty */
252 /* Identity function, used to suppress warnings about constant conditions. */
256 #if (defined __STDC__ || defined __C99__FUNC__ \
257 || defined __cplusplus || defined _MSC_VER)
270 #if ! defined yyoverflow || YYERROR_VERBOSE
272 /* The parser invokes alloca or malloc; define the necessary symbols. */
274 # ifdef YYSTACK_USE_ALLOCA
275 # if YYSTACK_USE_ALLOCA
277 # define YYSTACK_ALLOC __builtin_alloca
278 # elif defined __BUILTIN_VA_ARG_INCR
279 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
281 # define YYSTACK_ALLOC __alloca
282 # elif defined _MSC_VER
283 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
284 # define alloca _alloca
286 # define YYSTACK_ALLOC alloca
287 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
288 || defined __cplusplus || defined _MSC_VER)
289 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
290 # ifndef EXIT_SUCCESS
291 # define EXIT_SUCCESS 0
298 # ifdef YYSTACK_ALLOC
299 /* Pacify GCC's `empty if-body' warning. */
300 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
301 # ifndef YYSTACK_ALLOC_MAXIMUM
302 /* The OS might guarantee only one guard page at the bottom of the stack,
303 and a page size can be as small as 4096 bytes. So we cannot safely
304 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
305 to allow for a few compiler-allocated temporary stack slots. */
306 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
309 # define YYSTACK_ALLOC YYMALLOC
310 # define YYSTACK_FREE YYFREE
311 # ifndef YYSTACK_ALLOC_MAXIMUM
312 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
314 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
315 && ! ((defined YYMALLOC || defined malloc) \
316 && (defined YYFREE || defined free)))
317 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
318 # ifndef EXIT_SUCCESS
319 # define EXIT_SUCCESS 0
323 # define YYMALLOC malloc
324 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
325 || defined __cplusplus || defined _MSC_VER)
326 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
331 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
332 || defined __cplusplus || defined _MSC_VER)
333 void free (void *); /* INFRINGES ON USER NAME SPACE */
337 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
340 #if (! defined yyoverflow \
341 && (! defined __cplusplus \
342 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
344 /* A type that is properly aligned for any stack member. */
347 yytype_int16 yyss_alloc;
351 /* The size of the maximum gap between one aligned stack and the next. */
352 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
354 /* The size of an array large to enough to hold all stacks, each with
356 # define YYSTACK_BYTES(N) \
357 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
358 + YYSTACK_GAP_MAXIMUM)
360 # define YYCOPY_NEEDED 1
362 /* Relocate STACK from its old location to the new one. The
363 local variables YYSIZE and YYSTACKSIZE give the old and new number of
364 elements in the stack, and YYPTR gives the new location of the
365 stack. Advance YYPTR to a properly aligned location for the next
367 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
370 YYSIZE_T yynewbytes; \
371 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
372 Stack = &yyptr->Stack_alloc; \
373 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
374 yyptr += yynewbytes / sizeof (*yyptr); \
380 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
381 /* Copy COUNT objects from FROM to TO. The source and destination do
384 # if defined __GNUC__ && 1 < __GNUC__
385 # define YYCOPY(To, From, Count) \
386 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
388 # define YYCOPY(To, From, Count) \
392 for (yyi = 0; yyi < (Count); yyi++) \
393 (To)[yyi] = (From)[yyi]; \
398 #endif /* !YYCOPY_NEEDED */
400 /* YYFINAL -- State number of the termination state. */
402 /* YYLAST -- Last index in YYTABLE. */
405 /* YYNTOKENS -- Number of terminals. */
407 /* YYNNTS -- Number of nonterminals. */
409 /* YYNRULES -- Number of rules. */
411 /* YYNRULES -- Number of states. */
414 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
416 #define YYMAXUTOK 277
418 #define YYTRANSLATE(YYX) \
419 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
421 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
422 static const yytype_uint8 yytranslate[] =
424 0, 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, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
450 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
451 15, 16, 17, 18, 19, 20, 21, 22
455 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
457 static const yytype_uint8 yyprhs[] =
459 0, 0, 3, 8, 9, 10, 19, 20, 27, 31,
463 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
464 static const yytype_int8 yyrhs[] =
466 24, 0, -1, 3, 17, 25, 18, -1, -1, -1,
467 22, 14, 26, 4, 27, 5, 15, 25, -1, -1,
468 13, 28, 6, 7, 22, 27, -1, 11, 28, 12,
469 -1, 28, 9, 28, -1, 28, 8, 28, -1, 10,
470 28, -1, 16, -1, 22, -1
473 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
474 static const yytype_uint8 yyrline[] =
476 0, 50, 50, 53, 54, 54, 57, 58, 61, 62,
481 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
482 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
483 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
484 static const char *const yytname[] =
486 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
487 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
488 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
489 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
490 "$@1", "option", "exp", 0
495 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
497 static const yytype_uint16 yytoknum[] =
499 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
500 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
505 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
506 static const yytype_uint8 yyr1[] =
508 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
512 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
513 static const yytype_uint8 yyr2[] =
515 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
519 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
520 Performed when YYTABLE doesn't specify something else to do. Zero
521 means the default is an error. */
522 static const yytype_uint8 yydefact[] =
524 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
525 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
526 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
530 /* YYDEFGOTO[NTERM-NUM]. */
531 static const yytype_int8 yydefgoto[] =
536 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
538 #define YYPACT_NINF -16
539 static const yytype_int8 yypact[] =
541 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
542 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
543 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
547 /* YYPGOTO[NTERM-NUM]. */
548 static const yytype_int8 yypgoto[] =
550 -16, -16, 4, -16, -7, -9
553 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
554 positive, shift that token. If negative, reduce the rule which
555 number is the opposite. If YYTABLE_NINF, syntax error. */
556 #define YYTABLE_NINF -1
557 static const yytype_uint8 yytable[] =
559 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
560 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
561 10, 11, 18, 31, 0, 26, 24, 30, 29
564 #define yypact_value_is_default(yystate) \
567 #define yytable_value_is_error(yytable_value) \
570 static const yytype_int8 yycheck[] =
572 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
573 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
574 4, 13, 5, 30, -1, 7, 15, 22, 24
577 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
578 symbol of state STATE-NUM. */
579 static const yytype_uint8 yystos[] =
581 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
582 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
583 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
587 #define yyerrok (yyerrstatus = 0)
588 #define yyclearin (yychar = YYEMPTY)
592 #define YYACCEPT goto yyacceptlab
593 #define YYABORT goto yyabortlab
594 #define YYERROR goto yyerrorlab
597 /* Like YYERROR except do call yyerror. This remains here temporarily
598 to ease the transition to the new meaning of YYERROR, for GCC.
599 Once GCC version 2 has supplanted version 1, this can go. However,
600 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
601 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
604 #define YYFAIL goto yyerrlab
606 /* This is here to suppress warnings from the GCC cpp's
607 -Wunused-macros. Normally we don't worry about that warning, but
608 some users do, and we want to make it easy for users to remove
609 YYFAIL uses, which will produce warnings from Bison 2.5. */
612 #define YYRECOVERING() (!!yyerrstatus)
614 #define YYBACKUP(Token, Value) \
616 if (yychar == YYEMPTY && yylen == 1) \
625 yyerror (YY_("syntax error: cannot back up")); \
632 #define YYERRCODE 256
635 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
636 If N is 0, then set CURRENT to the empty location which ends
637 the previous symbol: RHS[0] (always defined). */
639 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
640 #ifndef YYLLOC_DEFAULT
641 # define YYLLOC_DEFAULT(Current, Rhs, N) \
645 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
646 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
647 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
648 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
652 (Current).first_line = (Current).last_line = \
653 YYRHSLOC (Rhs, 0).last_line; \
654 (Current).first_column = (Current).last_column = \
655 YYRHSLOC (Rhs, 0).last_column; \
661 /* This macro is provided for backward compatibility. */
663 #ifndef YY_LOCATION_PRINT
664 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
668 /* YYLEX -- calling `yylex' with the right arguments. */
671 # define YYLEX yylex (YYLEX_PARAM)
673 # define YYLEX yylex ()
676 /* Enable debugging if requested. */
680 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
681 # define YYFPRINTF fprintf
684 # define YYDPRINTF(Args) \
690 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
694 YYFPRINTF (stderr, "%s ", Title); \
695 yy_symbol_print (stderr, \
697 YYFPRINTF (stderr, "\n"); \
702 /*--------------------------------.
703 | Print this symbol on YYOUTPUT. |
704 `--------------------------------*/
707 #if (defined __STDC__ || defined __C99__FUNC__ \
708 || defined __cplusplus || defined _MSC_VER)
710 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
713 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
716 YYSTYPE const * const yyvaluep;
722 if (yytype < YYNTOKENS)
723 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
735 /*--------------------------------.
736 | Print this symbol on YYOUTPUT. |
737 `--------------------------------*/
739 #if (defined __STDC__ || defined __C99__FUNC__ \
740 || defined __cplusplus || defined _MSC_VER)
742 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
745 yy_symbol_print (yyoutput, yytype, yyvaluep)
748 YYSTYPE const * const yyvaluep;
751 if (yytype < YYNTOKENS)
752 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
754 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
756 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
757 YYFPRINTF (yyoutput, ")");
760 /*------------------------------------------------------------------.
761 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
763 `------------------------------------------------------------------*/
765 #if (defined __STDC__ || defined __C99__FUNC__ \
766 || defined __cplusplus || defined _MSC_VER)
768 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
771 yy_stack_print (yybottom, yytop)
772 yytype_int16 *yybottom;
776 YYFPRINTF (stderr, "Stack now");
777 for (; yybottom <= yytop; yybottom++)
779 int yybot = *yybottom;
780 YYFPRINTF (stderr, " %d", yybot);
782 YYFPRINTF (stderr, "\n");
785 # define YY_STACK_PRINT(Bottom, Top) \
788 yy_stack_print ((Bottom), (Top)); \
792 /*------------------------------------------------.
793 | Report that the YYRULE is going to be reduced. |
794 `------------------------------------------------*/
796 #if (defined __STDC__ || defined __C99__FUNC__ \
797 || defined __cplusplus || defined _MSC_VER)
799 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
802 yy_reduce_print (yyvsp, yyrule)
807 int yynrhs = yyr2[yyrule];
809 unsigned long int yylno = yyrline[yyrule];
810 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
812 /* The symbols being reduced. */
813 for (yyi = 0; yyi < yynrhs; yyi++)
815 YYFPRINTF (stderr, " $%d = ", yyi + 1);
816 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
817 &(yyvsp[(yyi + 1) - (yynrhs)])
819 YYFPRINTF (stderr, "\n");
823 # define YY_REDUCE_PRINT(Rule) \
826 yy_reduce_print (yyvsp, Rule); \
829 /* Nonzero means print parse trace. It is left uninitialized so that
830 multiple parsers can coexist. */
833 # define YYDPRINTF(Args)
834 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
835 # define YY_STACK_PRINT(Bottom, Top)
836 # define YY_REDUCE_PRINT(Rule)
837 #endif /* !YYDEBUG */
840 /* YYINITDEPTH -- initial size of the parser's stacks. */
842 # define YYINITDEPTH 200
845 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
846 if the built-in stack extension method is used).
848 Do not make this value too large; the results are undefined if
849 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
850 evaluated with infinite-precision integer arithmetic. */
853 # define YYMAXDEPTH 10000
860 # if defined __GLIBC__ && defined _STRING_H
861 # define yystrlen strlen
863 /* Return the length of YYSTR. */
864 #if (defined __STDC__ || defined __C99__FUNC__ \
865 || defined __cplusplus || defined _MSC_VER)
867 yystrlen (const char *yystr)
875 for (yylen = 0; yystr[yylen]; yylen++)
883 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
884 # define yystpcpy stpcpy
886 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
888 #if (defined __STDC__ || defined __C99__FUNC__ \
889 || defined __cplusplus || defined _MSC_VER)
891 yystpcpy (char *yydest, const char *yysrc)
894 yystpcpy (yydest, yysrc)
900 const char *yys = yysrc;
902 while ((*yyd++ = *yys++) != '\0')
911 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
912 quotes and backslashes, so that it's suitable for yyerror. The
913 heuristic is that double-quoting is unnecessary unless the string
914 contains an apostrophe, a comma, or backslash (other than
915 backslash-backslash). YYSTR is taken from yytname. If YYRES is
916 null, do not copy; instead, return the length of what the result
919 yytnamerr (char *yyres, const char *yystr)
924 char const *yyp = yystr;
931 goto do_not_strip_quotes;
935 goto do_not_strip_quotes;
948 do_not_strip_quotes: ;
952 return yystrlen (yystr);
954 return yystpcpy (yyres, yystr) - yyres;
958 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
959 about the unexpected token YYTOKEN for the state stack whose top is
962 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
963 not large enough to hold the message. In that case, also set
964 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
965 required number of bytes is too large to store. */
967 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
968 yytype_int16 *yyssp, int yytoken)
970 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
971 YYSIZE_T yysize = yysize0;
973 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
974 /* Internationalized format string. */
975 const char *yyformat = 0;
976 /* Arguments of yyformat. */
977 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
978 /* Number of reported tokens (one for the "unexpected", one per
982 /* There are many possibilities here to consider:
983 - Assume YYFAIL is not used. It's too flawed to consider. See
984 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
985 for details. YYERROR is fine as it does not invoke this
987 - If this state is a consistent state with a default action, then
988 the only way this function was invoked is if the default action
989 is an error action. In that case, don't check for expected
990 tokens because there are none.
991 - The only way there can be no lookahead present (in yychar) is if
992 this state is a consistent state with a default action. Thus,
993 detecting the absence of a lookahead is sufficient to determine
994 that there is no unexpected or expected token to report. In that
995 case, just report a simple "syntax error".
996 - Don't assume there isn't a lookahead just because this state is a
997 consistent state with a default action. There might have been a
998 previous inconsistent state, consistent state with a non-default
999 action, or user semantic action that manipulated yychar.
1000 - Of course, the expected token list depends on states to have
1001 correct lookahead information, and it depends on the parser not
1002 to perform extra reductions after fetching a lookahead from the
1003 scanner and before detecting a syntax error. Thus, state merging
1004 (from LALR or IELR) and default reductions corrupt the expected
1005 token list. However, the list is correct for canonical LR with
1006 one exception: it will still contain any token that will not be
1007 accepted due to an error action in a later state.
1009 if (yytoken != YYEMPTY)
1011 int yyn = yypact[*yyssp];
1012 yyarg[yycount++] = yytname[yytoken];
1013 if (!yypact_value_is_default (yyn))
1015 /* Start YYX at -YYN if negative to avoid negative indexes in
1016 YYCHECK. In other words, skip the first -YYN actions for
1017 this state because they are default actions. */
1018 int yyxbegin = yyn < 0 ? -yyn : 0;
1019 /* Stay within bounds of both yycheck and yytname. */
1020 int yychecklim = YYLAST - yyn + 1;
1021 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1024 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1025 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1026 && !yytable_value_is_error (yytable[yyx + yyn]))
1028 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1034 yyarg[yycount++] = yytname[yyx];
1035 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1036 if (! (yysize <= yysize1
1037 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1046 # define YYCASE_(N, S) \
1050 YYCASE_(0, YY_("syntax error"));
1051 YYCASE_(1, YY_("syntax error, unexpected %s"));
1052 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1053 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1054 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1055 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1059 yysize1 = yysize + yystrlen (yyformat);
1060 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1064 if (*yymsg_alloc < yysize)
1066 *yymsg_alloc = 2 * yysize;
1067 if (! (yysize <= *yymsg_alloc
1068 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1069 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1073 /* Avoid sprintf, as that infringes on the user's name space.
1074 Don't have undefined behavior even if the translation
1075 produced a string with the wrong number of "%s"s. */
1079 while ((*yyp = *yyformat) != '\0')
1080 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1082 yyp += yytnamerr (yyp, yyarg[yyi++]);
1093 #endif /* YYERROR_VERBOSE */
1095 /*-----------------------------------------------.
1096 | Release the memory associated to this symbol. |
1097 `-----------------------------------------------*/
1100 #if (defined __STDC__ || defined __C99__FUNC__ \
1101 || defined __cplusplus || defined _MSC_VER)
1103 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1106 yydestruct (yymsg, yytype, yyvaluep)
1116 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1127 /* Prevent warnings from -Wmissing-prototypes. */
1128 #ifdef YYPARSE_PARAM
1129 #if defined __STDC__ || defined __cplusplus
1130 int yyparse (void *YYPARSE_PARAM);
1134 #else /* ! YYPARSE_PARAM */
1135 #if defined __STDC__ || defined __cplusplus
1140 #endif /* ! YYPARSE_PARAM */
1143 /* The lookahead symbol. */
1146 /* The semantic value of the lookahead symbol. */
1149 /* Number of syntax errors so far. */
1157 #ifdef YYPARSE_PARAM
1158 #if (defined __STDC__ || defined __C99__FUNC__ \
1159 || defined __cplusplus || defined _MSC_VER)
1161 yyparse (void *YYPARSE_PARAM)
1164 yyparse (YYPARSE_PARAM)
1165 void *YYPARSE_PARAM;
1167 #else /* ! YYPARSE_PARAM */
1168 #if (defined __STDC__ || defined __C99__FUNC__ \
1169 || defined __cplusplus || defined _MSC_VER)
1180 /* Number of tokens to shift before error messages enabled. */
1183 /* The stacks and their tools:
1184 `yyss': related to states.
1185 `yyvs': related to semantic values.
1187 Refer to the stacks thru separate pointers, to allow yyoverflow
1188 to reallocate them elsewhere. */
1190 /* The state stack. */
1191 yytype_int16 yyssa[YYINITDEPTH];
1193 yytype_int16 *yyssp;
1195 /* The semantic value stack. */
1196 YYSTYPE yyvsa[YYINITDEPTH];
1200 YYSIZE_T yystacksize;
1204 /* Lookahead token as an internal (translated) token number. */
1206 /* The variables used to return semantic value and location from the
1211 /* Buffer for error messages, and its allocated size. */
1213 char *yymsg = yymsgbuf;
1214 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1217 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1219 /* The number of symbols on the RHS of the reduced rule.
1220 Keep to zero when no symbol should be popped. */
1226 yystacksize = YYINITDEPTH;
1228 YYDPRINTF ((stderr, "Starting parse\n"));
1233 yychar = YYEMPTY; /* Cause a token to be read. */
1235 /* Initialize stack pointers.
1236 Waste one element of value and location stack
1237 so that they stay on the same level as the state stack.
1238 The wasted elements are never initialized. */
1244 /*------------------------------------------------------------.
1245 | yynewstate -- Push a new state, which is found in yystate. |
1246 `------------------------------------------------------------*/
1248 /* In all cases, when you get here, the value and location stacks
1249 have just been pushed. So pushing a state here evens the stacks. */
1255 if (yyss + yystacksize - 1 <= yyssp)
1257 /* Get the current used size of the three stacks, in elements. */
1258 YYSIZE_T yysize = yyssp - yyss + 1;
1262 /* Give user a chance to reallocate the stack. Use copies of
1263 these so that the &'s don't force the real ones into
1265 YYSTYPE *yyvs1 = yyvs;
1266 yytype_int16 *yyss1 = yyss;
1268 /* Each stack pointer address is followed by the size of the
1269 data in use in that stack, in bytes. This used to be a
1270 conditional around just the two extra args, but that might
1271 be undefined if yyoverflow is a macro. */
1272 yyoverflow (YY_("memory exhausted"),
1273 &yyss1, yysize * sizeof (*yyssp),
1274 &yyvs1, yysize * sizeof (*yyvsp),
1280 #else /* no yyoverflow */
1281 # ifndef YYSTACK_RELOCATE
1282 goto yyexhaustedlab;
1284 /* Extend the stack our own way. */
1285 if (YYMAXDEPTH <= yystacksize)
1286 goto yyexhaustedlab;
1288 if (YYMAXDEPTH < yystacksize)
1289 yystacksize = YYMAXDEPTH;
1292 yytype_int16 *yyss1 = yyss;
1293 union yyalloc *yyptr =
1294 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1296 goto yyexhaustedlab;
1297 YYSTACK_RELOCATE (yyss_alloc, yyss);
1298 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1299 # undef YYSTACK_RELOCATE
1301 YYSTACK_FREE (yyss1);
1304 #endif /* no yyoverflow */
1306 yyssp = yyss + yysize - 1;
1307 yyvsp = yyvs + yysize - 1;
1309 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1310 (unsigned long int) yystacksize));
1312 if (yyss + yystacksize - 1 <= yyssp)
1316 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1318 if (yystate == YYFINAL)
1328 /* Do appropriate processing given the current state. Read a
1329 lookahead token if we need one and don't already have one. */
1331 /* First try to decide what to do without reference to lookahead token. */
1332 yyn = yypact[yystate];
1333 if (yypact_value_is_default (yyn))
1336 /* Not known => get a lookahead token if don't already have one. */
1338 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1339 if (yychar == YYEMPTY)
1341 YYDPRINTF ((stderr, "Reading a token: "));
1345 if (yychar <= YYEOF)
1347 yychar = yytoken = YYEOF;
1348 YYDPRINTF ((stderr, "Now at end of input.\n"));
1352 yytoken = YYTRANSLATE (yychar);
1353 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1356 /* If the proper action on seeing token YYTOKEN is to reduce or to
1357 detect an error, take that action. */
1359 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1364 if (yytable_value_is_error (yyn))
1370 /* Count tokens shifted since error; after three, turn off error
1375 /* Shift the lookahead token. */
1376 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1378 /* Discard the shifted token. */
1387 /*-----------------------------------------------------------.
1388 | yydefault -- do the default action for the current state. |
1389 `-----------------------------------------------------------*/
1391 yyn = yydefact[yystate];
1397 /*-----------------------------.
1398 | yyreduce -- Do a reduction. |
1399 `-----------------------------*/
1401 /* yyn is the number of a rule to reduce with. */
1404 /* If YYLEN is nonzero, implement the default value of the action:
1407 Otherwise, the following line sets YYVAL to garbage.
1408 This behavior is undocumented and Bison
1409 users should not rely upon it. Assigning to YYVAL
1410 unconditionally makes the parser a bit smaller, and it avoids a
1411 GCC warning that YYVAL may be used uninitialized. */
1412 yyval = yyvsp[1-yylen];
1415 YY_REDUCE_PRINT (yyn);
1420 /* Line 1806 of yacc.c */
1421 #line 54 "parserPromela.yacc"
1422 { new_state((yyvsp[(1) - (2)].string), 1);}
1427 /* Line 1806 of yacc.c */
1428 #line 58 "parserPromela.yacc"
1429 { new_transition((yyvsp[(5) - (6)].string), (yyvsp[(2) - (6)].label));}
1434 /* Line 1806 of yacc.c */
1435 #line 61 "parserPromela.yacc"
1436 { (yyval.label) = (yyvsp[(2) - (3)].label); }
1441 /* Line 1806 of yacc.c */
1442 #line 62 "parserPromela.yacc"
1443 { (yyval.label) = new_label(0, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1448 /* Line 1806 of yacc.c */
1449 #line 63 "parserPromela.yacc"
1450 { (yyval.label) = new_label(1, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1455 /* Line 1806 of yacc.c */
1456 #line 64 "parserPromela.yacc"
1457 { (yyval.label) = new_label(2, (yyvsp[(2) - (2)].label)); }
1462 /* Line 1806 of yacc.c */
1463 #line 65 "parserPromela.yacc"
1464 { (yyval.label) = new_label(4); }
1469 /* Line 1806 of yacc.c */
1470 #line 66 "parserPromela.yacc"
1471 { (yyval.label) = new_label(3, (yyvsp[(1) - (1)].string)); }
1476 /* Line 1806 of yacc.c */
1477 #line 1478 "y.tab.c"
1480 /* User semantic actions sometimes alter yychar, and that requires
1481 that yytoken be updated with the new translation. We take the
1482 approach of translating immediately before every use of yytoken.
1483 One alternative is translating here after every semantic action,
1484 but that translation would be missed if the semantic action invokes
1485 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1486 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1487 incorrect destructor might then be invoked immediately. In the
1488 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1489 to an incorrect destructor call or verbose syntax error message
1490 before the lookahead is translated. */
1491 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1495 YY_STACK_PRINT (yyss, yyssp);
1499 /* Now `shift' the result of the reduction. Determine what state
1500 that goes to, based on the state we popped back to and the rule
1501 number reduced by. */
1505 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1506 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1507 yystate = yytable[yystate];
1509 yystate = yydefgoto[yyn - YYNTOKENS];
1514 /*------------------------------------.
1515 | yyerrlab -- here on detecting error |
1516 `------------------------------------*/
1518 /* Make sure we have latest lookahead translation. See comments at
1519 user semantic actions for why this is necessary. */
1520 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1522 /* If not already recovering from an error, report this error. */
1526 #if ! YYERROR_VERBOSE
1527 yyerror (YY_("syntax error"));
1529 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1532 char const *yymsgp = YY_("syntax error");
1533 int yysyntax_error_status;
1534 yysyntax_error_status = YYSYNTAX_ERROR;
1535 if (yysyntax_error_status == 0)
1537 else if (yysyntax_error_status == 1)
1539 if (yymsg != yymsgbuf)
1540 YYSTACK_FREE (yymsg);
1541 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1545 yymsg_alloc = sizeof yymsgbuf;
1546 yysyntax_error_status = 2;
1550 yysyntax_error_status = YYSYNTAX_ERROR;
1555 if (yysyntax_error_status == 2)
1556 goto yyexhaustedlab;
1558 # undef YYSYNTAX_ERROR
1564 if (yyerrstatus == 3)
1566 /* If just tried and failed to reuse lookahead token after an
1567 error, discard it. */
1569 if (yychar <= YYEOF)
1571 /* Return failure if at end of input. */
1572 if (yychar == YYEOF)
1577 yydestruct ("Error: discarding",
1583 /* Else will try to reuse lookahead token after shifting the error
1588 /*---------------------------------------------------.
1589 | yyerrorlab -- error raised explicitly by YYERROR. |
1590 `---------------------------------------------------*/
1593 /* Pacify compilers like GCC when the user code never invokes
1594 YYERROR and the label yyerrorlab therefore never appears in user
1596 if (/*CONSTCOND*/ 0)
1599 /* Do not reclaim the symbols of the rule which action triggered
1603 YY_STACK_PRINT (yyss, yyssp);
1608 /*-------------------------------------------------------------.
1609 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1610 `-------------------------------------------------------------*/
1612 yyerrstatus = 3; /* Each real token shifted decrements this. */
1616 yyn = yypact[yystate];
1617 if (!yypact_value_is_default (yyn))
1620 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1628 /* Pop the current state because it cannot handle the error token. */
1633 yydestruct ("Error: popping",
1634 yystos[yystate], yyvsp);
1637 YY_STACK_PRINT (yyss, yyssp);
1643 /* Shift the error token. */
1644 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1650 /*-------------------------------------.
1651 | yyacceptlab -- YYACCEPT comes here. |
1652 `-------------------------------------*/
1657 /*-----------------------------------.
1658 | yyabortlab -- YYABORT comes here. |
1659 `-----------------------------------*/
1664 #if !defined(yyoverflow) || YYERROR_VERBOSE
1665 /*-------------------------------------------------.
1666 | yyexhaustedlab -- memory exhaustion comes here. |
1667 `-------------------------------------------------*/
1669 yyerror (YY_("memory exhausted"));
1675 if (yychar != YYEMPTY)
1677 /* Make sure we have latest lookahead translation. See comments at
1678 user semantic actions for why this is necessary. */
1679 yytoken = YYTRANSLATE (yychar);
1680 yydestruct ("Cleanup: discarding lookahead",
1683 /* Do not reclaim the symbols of the rule which action triggered
1684 this YYABORT or YYACCEPT. */
1686 YY_STACK_PRINT (yyss, yyssp);
1687 while (yyssp != yyss)
1689 yydestruct ("Cleanup: popping",
1690 yystos[*yyssp], yyvsp);
1695 YYSTACK_FREE (yyss);
1698 if (yymsg != yymsgbuf)
1699 YYSTACK_FREE (yymsg);
1701 /* Make sure YYID is used. */
1702 return YYID (yyresult);
1707 /* Line 2067 of yacc.c */
1708 #line 69 "parserPromela.yacc"
1713 void yyerror(const char *s){
1714 fprintf (stderr, "%s\n", s);