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
64 /* Substitute the variable and function names. */
65 #define yyparse xbt_automaton_parser_parse
66 #define yylex xbt_automaton_parser_lex
67 #define yyerror xbt_automaton_parser_error
68 #define yylval xbt_automaton_parser_lval
69 #define yychar xbt_automaton_parser_char
70 #define yydebug xbt_automaton_parser_debug
71 #define yynerrs xbt_automaton_parser_nerrs
74 /* Copy the first part of user declarations. */
76 /* Line 268 of yacc.c */
77 #line 7 "parserPromela.yacc"
80 #include "automaton_lexer.yy.c"
81 #include <xbt/automaton.h>
83 void yyerror(const char *s);
87 /* Line 268 of yacc.c */
88 #line 89 "parserPromela.tab.cacc"
90 /* Enabling traces. */
95 /* Enabling verbose error messages. */
96 #ifdef YYERROR_VERBOSE
97 # undef YYERROR_VERBOSE
98 # define YYERROR_VERBOSE 1
100 # define YYERROR_VERBOSE 0
103 /* Enabling the token table. */
104 #ifndef YYTOKEN_TABLE
105 # define YYTOKEN_TABLE 0
112 /* Put the tokens into the symbol table, so that GDB and other debuggers
140 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
141 typedef union YYSTYPE
144 /* Line 293 of yacc.c */
145 #line 16 "parserPromela.yacc"
150 xbt_automaton_exp_label_t label;
154 /* Line 293 of yacc.c */
155 #line 156 "parserPromela.tab.cacc"
157 # define YYSTYPE_IS_TRIVIAL 1
158 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
159 # define YYSTYPE_IS_DECLARED 1
163 /* Copy the second part of user declarations. */
166 /* Line 343 of yacc.c */
167 #line 168 "parserPromela.tab.cacc"
174 typedef YYTYPE_UINT8 yytype_uint8;
176 typedef unsigned char yytype_uint8;
180 typedef YYTYPE_INT8 yytype_int8;
181 #elif (defined __STDC__ || defined __C99__FUNC__ \
182 || defined __cplusplus || defined _MSC_VER)
183 typedef signed char yytype_int8;
185 typedef short int yytype_int8;
189 typedef YYTYPE_UINT16 yytype_uint16;
191 typedef unsigned short int yytype_uint16;
195 typedef YYTYPE_INT16 yytype_int16;
197 typedef short int yytype_int16;
201 # ifdef __SIZE_TYPE__
202 # define YYSIZE_T __SIZE_TYPE__
203 # elif defined size_t
204 # define YYSIZE_T size_t
205 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
206 || defined __cplusplus || defined _MSC_VER)
207 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
208 # define YYSIZE_T size_t
210 # define YYSIZE_T unsigned int
214 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
217 # if defined YYENABLE_NLS && YYENABLE_NLS
219 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
220 # define YY_(msgid) dgettext ("bison-runtime", msgid)
224 # define YY_(msgid) msgid
228 /* Suppress unused-variable warnings by "using" E. */
229 #if ! defined lint || defined __GNUC__
230 # define YYUSE(e) ((void) (e))
232 # define YYUSE(e) /* empty */
235 /* Identity function, used to suppress warnings about constant conditions. */
239 #if (defined __STDC__ || defined __C99__FUNC__ \
240 || defined __cplusplus || defined _MSC_VER)
253 #if ! defined yyoverflow || YYERROR_VERBOSE
255 /* The parser invokes alloca or malloc; define the necessary symbols. */
257 # ifdef YYSTACK_USE_ALLOCA
258 # if YYSTACK_USE_ALLOCA
260 # define YYSTACK_ALLOC __builtin_alloca
261 # elif defined __BUILTIN_VA_ARG_INCR
262 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
264 # define YYSTACK_ALLOC __alloca
265 # elif defined _MSC_VER
266 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
267 # define alloca _alloca
269 # define YYSTACK_ALLOC alloca
270 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
271 || defined __cplusplus || defined _MSC_VER)
272 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
273 # ifndef EXIT_SUCCESS
274 # define EXIT_SUCCESS 0
281 # ifdef YYSTACK_ALLOC
282 /* Pacify GCC's `empty if-body' warning. */
283 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
284 # ifndef YYSTACK_ALLOC_MAXIMUM
285 /* The OS might guarantee only one guard page at the bottom of the stack,
286 and a page size can be as small as 4096 bytes. So we cannot safely
287 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
288 to allow for a few compiler-allocated temporary stack slots. */
289 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
292 # define YYSTACK_ALLOC YYMALLOC
293 # define YYSTACK_FREE YYFREE
294 # ifndef YYSTACK_ALLOC_MAXIMUM
295 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
297 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
298 && ! ((defined YYMALLOC || defined malloc) \
299 && (defined YYFREE || defined free)))
300 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
301 # ifndef EXIT_SUCCESS
302 # define EXIT_SUCCESS 0
306 # define YYMALLOC malloc
307 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
308 || defined __cplusplus || defined _MSC_VER)
309 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
314 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
315 || defined __cplusplus || defined _MSC_VER)
316 void free (void *); /* INFRINGES ON USER NAME SPACE */
320 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
323 #if (! defined yyoverflow \
324 && (! defined __cplusplus \
325 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
327 /* A type that is properly aligned for any stack member. */
330 yytype_int16 yyss_alloc;
334 /* The size of the maximum gap between one aligned stack and the next. */
335 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
337 /* The size of an array large to enough to hold all stacks, each with
339 # define YYSTACK_BYTES(N) \
340 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
341 + YYSTACK_GAP_MAXIMUM)
343 # define YYCOPY_NEEDED 1
345 /* Relocate STACK from its old location to the new one. The
346 local variables YYSIZE and YYSTACKSIZE give the old and new number of
347 elements in the stack, and YYPTR gives the new location of the
348 stack. Advance YYPTR to a properly aligned location for the next
350 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
353 YYSIZE_T yynewbytes; \
354 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
355 Stack = &yyptr->Stack_alloc; \
356 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
357 yyptr += yynewbytes / sizeof (*yyptr); \
363 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
364 /* Copy COUNT objects from FROM to TO. The source and destination do
367 # if defined __GNUC__ && 1 < __GNUC__
368 # define YYCOPY(To, From, Count) \
369 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
371 # define YYCOPY(To, From, Count) \
375 for (yyi = 0; yyi < (Count); yyi++) \
376 (To)[yyi] = (From)[yyi]; \
381 #endif /* !YYCOPY_NEEDED */
383 /* YYFINAL -- State number of the termination state. */
385 /* YYLAST -- Last index in YYTABLE. */
388 /* YYNTOKENS -- Number of terminals. */
390 /* YYNNTS -- Number of nonterminals. */
392 /* YYNRULES -- Number of rules. */
394 /* YYNRULES -- Number of states. */
397 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
399 #define YYMAXUTOK 277
401 #define YYTRANSLATE(YYX) \
402 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
404 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
405 static const yytype_uint8 yytranslate[] =
407 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
408 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
409 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
410 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
411 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
412 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
413 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
414 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
415 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
416 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
417 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
418 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
419 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
420 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
421 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
422 2, 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, 1, 2, 3, 4,
433 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
434 15, 16, 17, 18, 19, 20, 21, 22
438 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
440 static const yytype_uint8 yyprhs[] =
442 0, 0, 3, 8, 9, 10, 19, 20, 27, 31,
446 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
447 static const yytype_int8 yyrhs[] =
449 24, 0, -1, 3, 17, 25, 18, -1, -1, -1,
450 22, 14, 26, 4, 27, 5, 15, 25, -1, -1,
451 13, 28, 6, 7, 22, 27, -1, 11, 28, 12,
452 -1, 28, 9, 28, -1, 28, 8, 28, -1, 10,
453 28, -1, 16, -1, 22, -1
456 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
457 static const yytype_uint8 yyrline[] =
459 0, 53, 53, 56, 57, 57, 60, 61, 64, 65,
464 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
465 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
466 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
467 static const char *const yytname[] =
469 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
470 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
471 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
472 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
473 "$@1", "option", "exp", 0
478 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
480 static const yytype_uint16 yytoknum[] =
482 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
483 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
488 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
489 static const yytype_uint8 yyr1[] =
491 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
495 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
496 static const yytype_uint8 yyr2[] =
498 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
502 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
503 Performed when YYTABLE doesn't specify something else to do. Zero
504 means the default is an error. */
505 static const yytype_uint8 yydefact[] =
507 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
508 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
509 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
513 /* YYDEFGOTO[NTERM-NUM]. */
514 static const yytype_int8 yydefgoto[] =
519 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
521 #define YYPACT_NINF -16
522 static const yytype_int8 yypact[] =
524 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
525 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
526 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
530 /* YYPGOTO[NTERM-NUM]. */
531 static const yytype_int8 yypgoto[] =
533 -16, -16, 4, -16, -7, -9
536 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
537 positive, shift that token. If negative, reduce the rule which
538 number is the opposite. If YYTABLE_NINF, syntax error. */
539 #define YYTABLE_NINF -1
540 static const yytype_uint8 yytable[] =
542 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
543 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
544 10, 11, 18, 31, 0, 26, 24, 30, 29
547 #define yypact_value_is_default(yystate) \
550 #define yytable_value_is_error(yytable_value) \
553 static const yytype_int8 yycheck[] =
555 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
556 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
557 4, 13, 5, 30, -1, 7, 15, 22, 24
560 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
561 symbol of state STATE-NUM. */
562 static const yytype_uint8 yystos[] =
564 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
565 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
566 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
570 #define yyerrok (yyerrstatus = 0)
571 #define yyclearin (yychar = YYEMPTY)
575 #define YYACCEPT goto yyacceptlab
576 #define YYABORT goto yyabortlab
577 #define YYERROR goto yyerrorlab
580 /* Like YYERROR except do call yyerror. This remains here temporarily
581 to ease the transition to the new meaning of YYERROR, for GCC.
582 Once GCC version 2 has supplanted version 1, this can go. However,
583 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
584 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
587 #define YYFAIL goto yyerrlab
589 /* This is here to suppress warnings from the GCC cpp's
590 -Wunused-macros. Normally we don't worry about that warning, but
591 some users do, and we want to make it easy for users to remove
592 YYFAIL uses, which will produce warnings from Bison 2.5. */
595 #define YYRECOVERING() (!!yyerrstatus)
597 #define YYBACKUP(Token, Value) \
599 if (yychar == YYEMPTY && yylen == 1) \
608 yyerror (YY_("syntax error: cannot back up")); \
615 #define YYERRCODE 256
618 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
619 If N is 0, then set CURRENT to the empty location which ends
620 the previous symbol: RHS[0] (always defined). */
622 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
623 #ifndef YYLLOC_DEFAULT
624 # define YYLLOC_DEFAULT(Current, Rhs, N) \
628 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
629 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
630 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
631 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
635 (Current).first_line = (Current).last_line = \
636 YYRHSLOC (Rhs, 0).last_line; \
637 (Current).first_column = (Current).last_column = \
638 YYRHSLOC (Rhs, 0).last_column; \
644 /* This macro is provided for backward compatibility. */
646 #ifndef YY_LOCATION_PRINT
647 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
651 /* YYLEX -- calling `yylex' with the right arguments. */
654 # define YYLEX yylex (YYLEX_PARAM)
656 # define YYLEX yylex ()
659 /* Enable debugging if requested. */
663 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
664 # define YYFPRINTF fprintf
667 # define YYDPRINTF(Args) \
673 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
677 YYFPRINTF (stderr, "%s ", Title); \
678 yy_symbol_print (stderr, \
680 YYFPRINTF (stderr, "\n"); \
685 /*--------------------------------.
686 | Print this symbol on YYOUTPUT. |
687 `--------------------------------*/
690 #if (defined __STDC__ || defined __C99__FUNC__ \
691 || defined __cplusplus || defined _MSC_VER)
693 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
696 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
699 YYSTYPE const * const yyvaluep;
705 if (yytype < YYNTOKENS)
706 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
718 /*--------------------------------.
719 | Print this symbol on YYOUTPUT. |
720 `--------------------------------*/
722 #if (defined __STDC__ || defined __C99__FUNC__ \
723 || defined __cplusplus || defined _MSC_VER)
725 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
728 yy_symbol_print (yyoutput, yytype, yyvaluep)
731 YYSTYPE const * const yyvaluep;
734 if (yytype < YYNTOKENS)
735 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
737 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
739 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
740 YYFPRINTF (yyoutput, ")");
743 /*------------------------------------------------------------------.
744 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
746 `------------------------------------------------------------------*/
748 #if (defined __STDC__ || defined __C99__FUNC__ \
749 || defined __cplusplus || defined _MSC_VER)
751 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
754 yy_stack_print (yybottom, yytop)
755 yytype_int16 *yybottom;
759 YYFPRINTF (stderr, "Stack now");
760 for (; yybottom <= yytop; yybottom++)
762 int yybot = *yybottom;
763 YYFPRINTF (stderr, " %d", yybot);
765 YYFPRINTF (stderr, "\n");
768 # define YY_STACK_PRINT(Bottom, Top) \
771 yy_stack_print ((Bottom), (Top)); \
775 /*------------------------------------------------.
776 | Report that the YYRULE is going to be reduced. |
777 `------------------------------------------------*/
779 #if (defined __STDC__ || defined __C99__FUNC__ \
780 || defined __cplusplus || defined _MSC_VER)
782 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
785 yy_reduce_print (yyvsp, yyrule)
790 int yynrhs = yyr2[yyrule];
792 unsigned long int yylno = yyrline[yyrule];
793 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
795 /* The symbols being reduced. */
796 for (yyi = 0; yyi < yynrhs; yyi++)
798 YYFPRINTF (stderr, " $%d = ", yyi + 1);
799 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
800 &(yyvsp[(yyi + 1) - (yynrhs)])
802 YYFPRINTF (stderr, "\n");
806 # define YY_REDUCE_PRINT(Rule) \
809 yy_reduce_print (yyvsp, Rule); \
812 /* Nonzero means print parse trace. It is left uninitialized so that
813 multiple parsers can coexist. */
816 # define YYDPRINTF(Args)
817 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
818 # define YY_STACK_PRINT(Bottom, Top)
819 # define YY_REDUCE_PRINT(Rule)
820 #endif /* !YYDEBUG */
823 /* YYINITDEPTH -- initial size of the parser's stacks. */
825 # define YYINITDEPTH 200
828 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
829 if the built-in stack extension method is used).
831 Do not make this value too large; the results are undefined if
832 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
833 evaluated with infinite-precision integer arithmetic. */
836 # define YYMAXDEPTH 10000
843 # if defined __GLIBC__ && defined _STRING_H
844 # define yystrlen strlen
846 /* Return the length of YYSTR. */
847 #if (defined __STDC__ || defined __C99__FUNC__ \
848 || defined __cplusplus || defined _MSC_VER)
850 yystrlen (const char *yystr)
858 for (yylen = 0; yystr[yylen]; yylen++)
866 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
867 # define yystpcpy stpcpy
869 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
871 #if (defined __STDC__ || defined __C99__FUNC__ \
872 || defined __cplusplus || defined _MSC_VER)
874 yystpcpy (char *yydest, const char *yysrc)
877 yystpcpy (yydest, yysrc)
883 const char *yys = yysrc;
885 while ((*yyd++ = *yys++) != '\0')
894 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
895 quotes and backslashes, so that it's suitable for yyerror. The
896 heuristic is that double-quoting is unnecessary unless the string
897 contains an apostrophe, a comma, or backslash (other than
898 backslash-backslash). YYSTR is taken from yytname. If YYRES is
899 null, do not copy; instead, return the length of what the result
902 yytnamerr (char *yyres, const char *yystr)
907 char const *yyp = yystr;
914 goto do_not_strip_quotes;
918 goto do_not_strip_quotes;
931 do_not_strip_quotes: ;
935 return yystrlen (yystr);
937 return yystpcpy (yyres, yystr) - yyres;
941 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
942 about the unexpected token YYTOKEN for the state stack whose top is
945 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
946 not large enough to hold the message. In that case, also set
947 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
948 required number of bytes is too large to store. */
950 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
951 yytype_int16 *yyssp, int yytoken)
953 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]);
954 YYSIZE_T yysize = yysize0;
956 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
957 /* Internationalized format string. */
958 const char *yyformat = 0;
959 /* Arguments of yyformat. */
960 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
961 /* Number of reported tokens (one for the "unexpected", one per
965 /* There are many possibilities here to consider:
966 - Assume YYFAIL is not used. It's too flawed to consider. See
967 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
968 for details. YYERROR is fine as it does not invoke this
970 - If this state is a consistent state with a default action, then
971 the only way this function was invoked is if the default action
972 is an error action. In that case, don't check for expected
973 tokens because there are none.
974 - The only way there can be no lookahead present (in yychar) is if
975 this state is a consistent state with a default action. Thus,
976 detecting the absence of a lookahead is sufficient to determine
977 that there is no unexpected or expected token to report. In that
978 case, just report a simple "syntax error".
979 - Don't assume there isn't a lookahead just because this state is a
980 consistent state with a default action. There might have been a
981 previous inconsistent state, consistent state with a non-default
982 action, or user semantic action that manipulated yychar.
983 - Of course, the expected token list depends on states to have
984 correct lookahead information, and it depends on the parser not
985 to perform extra reductions after fetching a lookahead from the
986 scanner and before detecting a syntax error. Thus, state merging
987 (from LALR or IELR) and default reductions corrupt the expected
988 token list. However, the list is correct for canonical LR with
989 one exception: it will still contain any token that will not be
990 accepted due to an error action in a later state.
992 if (yytoken != YYEMPTY)
994 int yyn = yypact[*yyssp];
995 yyarg[yycount++] = yytname[yytoken];
996 if (!yypact_value_is_default (yyn))
998 /* Start YYX at -YYN if negative to avoid negative indexes in
999 YYCHECK. In other words, skip the first -YYN actions for
1000 this state because they are default actions. */
1001 int yyxbegin = yyn < 0 ? -yyn : 0;
1002 /* Stay within bounds of both yycheck and yytname. */
1003 int yychecklim = YYLAST - yyn + 1;
1004 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1007 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1008 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1009 && !yytable_value_is_error (yytable[yyx + yyn]))
1011 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1017 yyarg[yycount++] = yytname[yyx];
1018 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1019 if (! (yysize <= yysize1
1020 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1029 # define YYCASE_(N, S) \
1033 YYCASE_(0, YY_("syntax error"));
1034 YYCASE_(1, YY_("syntax error, unexpected %s"));
1035 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1036 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1037 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1038 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1042 yysize1 = yysize + yystrlen (yyformat);
1043 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1047 if (*yymsg_alloc < yysize)
1049 *yymsg_alloc = 2 * yysize;
1050 if (! (yysize <= *yymsg_alloc
1051 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1052 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1056 /* Avoid sprintf, as that infringes on the user's name space.
1057 Don't have undefined behavior even if the translation
1058 produced a string with the wrong number of "%s"s. */
1062 while ((*yyp = *yyformat) != '\0')
1063 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1065 yyp += yytnamerr (yyp, yyarg[yyi++]);
1076 #endif /* YYERROR_VERBOSE */
1078 /*-----------------------------------------------.
1079 | Release the memory associated to this symbol. |
1080 `-----------------------------------------------*/
1083 #if (defined __STDC__ || defined __C99__FUNC__ \
1084 || defined __cplusplus || defined _MSC_VER)
1086 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1089 yydestruct (yymsg, yytype, yyvaluep)
1099 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1110 /* Prevent warnings from -Wmissing-prototypes. */
1111 #ifdef YYPARSE_PARAM
1112 #if defined __STDC__ || defined __cplusplus
1113 int yyparse (void *YYPARSE_PARAM);
1117 #else /* ! YYPARSE_PARAM */
1118 #if defined __STDC__ || defined __cplusplus
1123 #endif /* ! YYPARSE_PARAM */
1126 /* The lookahead symbol. */
1129 /* The semantic value of the lookahead symbol. */
1132 /* Number of syntax errors so far. */
1140 #ifdef YYPARSE_PARAM
1141 #if (defined __STDC__ || defined __C99__FUNC__ \
1142 || defined __cplusplus || defined _MSC_VER)
1144 yyparse (void *YYPARSE_PARAM)
1147 yyparse (YYPARSE_PARAM)
1148 void *YYPARSE_PARAM;
1150 #else /* ! YYPARSE_PARAM */
1151 #if (defined __STDC__ || defined __C99__FUNC__ \
1152 || defined __cplusplus || defined _MSC_VER)
1163 /* Number of tokens to shift before error messages enabled. */
1166 /* The stacks and their tools:
1167 `yyss': related to states.
1168 `yyvs': related to semantic values.
1170 Refer to the stacks thru separate pointers, to allow yyoverflow
1171 to reallocate them elsewhere. */
1173 /* The state stack. */
1174 yytype_int16 yyssa[YYINITDEPTH];
1176 yytype_int16 *yyssp;
1178 /* The semantic value stack. */
1179 YYSTYPE yyvsa[YYINITDEPTH];
1183 YYSIZE_T yystacksize;
1187 /* Lookahead token as an internal (translated) token number. */
1189 /* The variables used to return semantic value and location from the
1194 /* Buffer for error messages, and its allocated size. */
1196 char *yymsg = yymsgbuf;
1197 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1200 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1202 /* The number of symbols on the RHS of the reduced rule.
1203 Keep to zero when no symbol should be popped. */
1209 yystacksize = YYINITDEPTH;
1211 YYDPRINTF ((stderr, "Starting parse\n"));
1216 yychar = YYEMPTY; /* Cause a token to be read. */
1218 /* Initialize stack pointers.
1219 Waste one element of value and location stack
1220 so that they stay on the same level as the state stack.
1221 The wasted elements are never initialized. */
1227 /*------------------------------------------------------------.
1228 | yynewstate -- Push a new state, which is found in yystate. |
1229 `------------------------------------------------------------*/
1231 /* In all cases, when you get here, the value and location stacks
1232 have just been pushed. So pushing a state here evens the stacks. */
1238 if (yyss + yystacksize - 1 <= yyssp)
1240 /* Get the current used size of the three stacks, in elements. */
1241 YYSIZE_T yysize = yyssp - yyss + 1;
1245 /* Give user a chance to reallocate the stack. Use copies of
1246 these so that the &'s don't force the real ones into
1248 YYSTYPE *yyvs1 = yyvs;
1249 yytype_int16 *yyss1 = yyss;
1251 /* Each stack pointer address is followed by the size of the
1252 data in use in that stack, in bytes. This used to be a
1253 conditional around just the two extra args, but that might
1254 be undefined if yyoverflow is a macro. */
1255 yyoverflow (YY_("memory exhausted"),
1256 &yyss1, yysize * sizeof (*yyssp),
1257 &yyvs1, yysize * sizeof (*yyvsp),
1263 #else /* no yyoverflow */
1264 # ifndef YYSTACK_RELOCATE
1265 goto yyexhaustedlab;
1267 /* Extend the stack our own way. */
1268 if (YYMAXDEPTH <= yystacksize)
1269 goto yyexhaustedlab;
1271 if (YYMAXDEPTH < yystacksize)
1272 yystacksize = YYMAXDEPTH;
1275 yytype_int16 *yyss1 = yyss;
1276 union yyalloc *yyptr =
1277 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1279 goto yyexhaustedlab;
1280 YYSTACK_RELOCATE (yyss_alloc, yyss);
1281 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1282 # undef YYSTACK_RELOCATE
1284 YYSTACK_FREE (yyss1);
1287 #endif /* no yyoverflow */
1289 yyssp = yyss + yysize - 1;
1290 yyvsp = yyvs + yysize - 1;
1292 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1293 (unsigned long int) yystacksize));
1295 if (yyss + yystacksize - 1 <= yyssp)
1299 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1301 if (yystate == YYFINAL)
1311 /* Do appropriate processing given the current state. Read a
1312 lookahead token if we need one and don't already have one. */
1314 /* First try to decide what to do without reference to lookahead token. */
1315 yyn = yypact[yystate];
1316 if (yypact_value_is_default (yyn))
1319 /* Not known => get a lookahead token if don't already have one. */
1321 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1322 if (yychar == YYEMPTY)
1324 YYDPRINTF ((stderr, "Reading a token: "));
1328 if (yychar <= YYEOF)
1330 yychar = yytoken = YYEOF;
1331 YYDPRINTF ((stderr, "Now at end of input.\n"));
1335 yytoken = YYTRANSLATE (yychar);
1336 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1339 /* If the proper action on seeing token YYTOKEN is to reduce or to
1340 detect an error, take that action. */
1342 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1347 if (yytable_value_is_error (yyn))
1353 /* Count tokens shifted since error; after three, turn off error
1358 /* Shift the lookahead token. */
1359 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1361 /* Discard the shifted token. */
1370 /*-----------------------------------------------------------.
1371 | yydefault -- do the default action for the current state. |
1372 `-----------------------------------------------------------*/
1374 yyn = yydefact[yystate];
1380 /*-----------------------------.
1381 | yyreduce -- Do a reduction. |
1382 `-----------------------------*/
1384 /* yyn is the number of a rule to reduce with. */
1387 /* If YYLEN is nonzero, implement the default value of the action:
1390 Otherwise, the following line sets YYVAL to garbage.
1391 This behavior is undocumented and Bison
1392 users should not rely upon it. Assigning to YYVAL
1393 unconditionally makes the parser a bit smaller, and it avoids a
1394 GCC warning that YYVAL may be used uninitialized. */
1395 yyval = yyvsp[1-yylen];
1398 YY_REDUCE_PRINT (yyn);
1403 /* Line 1806 of yacc.c */
1404 #line 57 "parserPromela.yacc"
1405 { new_state((yyvsp[(1) - (2)].string), 1);}
1410 /* Line 1806 of yacc.c */
1411 #line 61 "parserPromela.yacc"
1412 { new_transition((yyvsp[(5) - (6)].string), (yyvsp[(2) - (6)].label));}
1417 /* Line 1806 of yacc.c */
1418 #line 64 "parserPromela.yacc"
1419 { (yyval.label) = (yyvsp[(2) - (3)].label); }
1424 /* Line 1806 of yacc.c */
1425 #line 65 "parserPromela.yacc"
1426 { (yyval.label) = new_label(0, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1431 /* Line 1806 of yacc.c */
1432 #line 66 "parserPromela.yacc"
1433 { (yyval.label) = new_label(1, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1438 /* Line 1806 of yacc.c */
1439 #line 67 "parserPromela.yacc"
1440 { (yyval.label) = new_label(2, (yyvsp[(2) - (2)].label)); }
1445 /* Line 1806 of yacc.c */
1446 #line 68 "parserPromela.yacc"
1447 { (yyval.label) = new_label(4); }
1452 /* Line 1806 of yacc.c */
1453 #line 69 "parserPromela.yacc"
1454 { (yyval.label) = new_label(3, (yyvsp[(1) - (1)].string)); }
1459 /* Line 1806 of yacc.c */
1460 #line 1461 "parserPromela.tab.cacc"
1463 /* User semantic actions sometimes alter yychar, and that requires
1464 that yytoken be updated with the new translation. We take the
1465 approach of translating immediately before every use of yytoken.
1466 One alternative is translating here after every semantic action,
1467 but that translation would be missed if the semantic action invokes
1468 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1469 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1470 incorrect destructor might then be invoked immediately. In the
1471 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1472 to an incorrect destructor call or verbose syntax error message
1473 before the lookahead is translated. */
1474 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1478 YY_STACK_PRINT (yyss, yyssp);
1482 /* Now `shift' the result of the reduction. Determine what state
1483 that goes to, based on the state we popped back to and the rule
1484 number reduced by. */
1488 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1489 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1490 yystate = yytable[yystate];
1492 yystate = yydefgoto[yyn - YYNTOKENS];
1497 /*------------------------------------.
1498 | yyerrlab -- here on detecting error |
1499 `------------------------------------*/
1501 /* Make sure we have latest lookahead translation. See comments at
1502 user semantic actions for why this is necessary. */
1503 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1505 /* If not already recovering from an error, report this error. */
1509 #if ! YYERROR_VERBOSE
1510 yyerror (YY_("syntax error"));
1512 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1515 char const *yymsgp = YY_("syntax error");
1516 int yysyntax_error_status;
1517 yysyntax_error_status = YYSYNTAX_ERROR;
1518 if (yysyntax_error_status == 0)
1520 else if (yysyntax_error_status == 1)
1522 if (yymsg != yymsgbuf)
1523 YYSTACK_FREE (yymsg);
1524 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1528 yymsg_alloc = sizeof yymsgbuf;
1529 yysyntax_error_status = 2;
1533 yysyntax_error_status = YYSYNTAX_ERROR;
1538 if (yysyntax_error_status == 2)
1539 goto yyexhaustedlab;
1541 # undef YYSYNTAX_ERROR
1547 if (yyerrstatus == 3)
1549 /* If just tried and failed to reuse lookahead token after an
1550 error, discard it. */
1552 if (yychar <= YYEOF)
1554 /* Return failure if at end of input. */
1555 if (yychar == YYEOF)
1560 yydestruct ("Error: discarding",
1566 /* Else will try to reuse lookahead token after shifting the error
1571 /*---------------------------------------------------.
1572 | yyerrorlab -- error raised explicitly by YYERROR. |
1573 `---------------------------------------------------*/
1576 /* Pacify compilers like GCC when the user code never invokes
1577 YYERROR and the label yyerrorlab therefore never appears in user
1579 if (/*CONSTCOND*/ 0)
1582 /* Do not reclaim the symbols of the rule which action triggered
1586 YY_STACK_PRINT (yyss, yyssp);
1591 /*-------------------------------------------------------------.
1592 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1593 `-------------------------------------------------------------*/
1595 yyerrstatus = 3; /* Each real token shifted decrements this. */
1599 yyn = yypact[yystate];
1600 if (!yypact_value_is_default (yyn))
1603 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1611 /* Pop the current state because it cannot handle the error token. */
1616 yydestruct ("Error: popping",
1617 yystos[yystate], yyvsp);
1620 YY_STACK_PRINT (yyss, yyssp);
1626 /* Shift the error token. */
1627 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1633 /*-------------------------------------.
1634 | yyacceptlab -- YYACCEPT comes here. |
1635 `-------------------------------------*/
1640 /*-----------------------------------.
1641 | yyabortlab -- YYABORT comes here. |
1642 `-----------------------------------*/
1647 #if !defined(yyoverflow) || YYERROR_VERBOSE
1648 /*-------------------------------------------------.
1649 | yyexhaustedlab -- memory exhaustion comes here. |
1650 `-------------------------------------------------*/
1652 yyerror (YY_("memory exhausted"));
1658 if (yychar != YYEMPTY)
1660 /* Make sure we have latest lookahead translation. See comments at
1661 user semantic actions for why this is necessary. */
1662 yytoken = YYTRANSLATE (yychar);
1663 yydestruct ("Cleanup: discarding lookahead",
1666 /* Do not reclaim the symbols of the rule which action triggered
1667 this YYABORT or YYACCEPT. */
1669 YY_STACK_PRINT (yyss, yyssp);
1670 while (yyssp != yyss)
1672 yydestruct ("Cleanup: popping",
1673 yystos[*yyssp], yyvsp);
1678 YYSTACK_FREE (yyss);
1681 if (yymsg != yymsgbuf)
1682 YYSTACK_FREE (yymsg);
1684 /* Make sure YYID is used. */
1685 return YYID (yyresult);
1690 /* Line 2067 of yacc.c */
1691 #line 72 "parserPromela.yacc"
1696 void yyerror(const char *s){
1697 fprintf (stderr, "%s\n", s);