1 /* A Bison parser, made by GNU Bison 2.7.12-4996. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 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.7.12-4996"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yyparse xbt_automaton_parser_parse
64 #define yylex xbt_automaton_parser_lex
65 #define yyerror xbt_automaton_parser_error
66 #define yylval xbt_automaton_parser_lval
67 #define yychar xbt_automaton_parser_char
68 #define yydebug xbt_automaton_parser_debug
69 #define yynerrs xbt_automaton_parser_nerrs
71 /* Copy the first part of user declarations. */
72 /* Line 371 of yacc.c */
73 #line 1 "parserPromela.yacc"
76 #include "automaton_lexer.yy.c"
77 #include <xbt/automaton.h>
79 void yyerror(const char *s);
82 /* Line 371 of yacc.c */
83 #line 84 "parserPromela.tab.cacc"
86 # if defined __cplusplus && 201103L <= __cplusplus
87 # define YY_NULL nullptr
93 /* Enabling verbose error messages. */
94 #ifdef YYERROR_VERBOSE
95 # undef YYERROR_VERBOSE
96 # define YYERROR_VERBOSE 1
98 # define YYERROR_VERBOSE 0
101 /* In a future release of Bison, this section will be replaced
102 by #include "parserPromela.tab.hacc". */
103 #ifndef YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
104 # define YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
105 /* Enabling traces. */
110 extern int xbt_automaton_parser_debug;
116 /* Put the tokens into the symbol table, so that GDB and other debuggers
143 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
144 typedef union YYSTYPE
146 /* Line 387 of yacc.c */
147 #line 10 "parserPromela.yacc"
152 xbt_automaton_exp_label_t label;
155 /* Line 387 of yacc.c */
156 #line 157 "parserPromela.tab.cacc"
158 # define YYSTYPE_IS_TRIVIAL 1
159 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
160 # define YYSTYPE_IS_DECLARED 1
163 extern YYSTYPE xbt_automaton_parser_lval;
166 #if defined __STDC__ || defined __cplusplus
167 int xbt_automaton_parser_parse (void *YYPARSE_PARAM);
169 int xbt_automaton_parser_parse ();
171 #else /* ! YYPARSE_PARAM */
172 #if defined __STDC__ || defined __cplusplus
173 int xbt_automaton_parser_parse (void);
175 int xbt_automaton_parser_parse ();
177 #endif /* ! YYPARSE_PARAM */
179 #endif /* !YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED */
181 /* Copy the second part of user declarations. */
183 /* Line 390 of yacc.c */
184 #line 185 "parserPromela.tab.cacc"
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 #ifndef __attribute__
246 /* This feature is available in gcc versions 2.5 and later. */
247 # if (! defined __GNUC__ || __GNUC__ < 2 \
248 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
249 # define __attribute__(Spec) /* empty */
253 /* Suppress unused-variable warnings by "using" E. */
254 #if ! defined lint || defined __GNUC__
255 # define YYUSE(E) ((void) (E))
257 # define YYUSE(E) /* empty */
261 /* Identity function, used to suppress warnings about constant conditions. */
265 #if (defined __STDC__ || defined __C99__FUNC__ \
266 || defined __cplusplus || defined _MSC_VER)
279 #if ! defined yyoverflow || YYERROR_VERBOSE
281 /* The parser invokes alloca or malloc; define the necessary symbols. */
283 # ifdef YYSTACK_USE_ALLOCA
284 # if YYSTACK_USE_ALLOCA
286 # define YYSTACK_ALLOC __builtin_alloca
287 # elif defined __BUILTIN_VA_ARG_INCR
288 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
290 # define YYSTACK_ALLOC __alloca
291 # elif defined _MSC_VER
292 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
293 # define alloca _alloca
295 # define YYSTACK_ALLOC alloca
296 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
297 || defined __cplusplus || defined _MSC_VER)
298 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
299 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
300 # ifndef EXIT_SUCCESS
301 # define EXIT_SUCCESS 0
308 # ifdef YYSTACK_ALLOC
309 /* Pacify GCC's `empty if-body' warning. */
310 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
311 # ifndef YYSTACK_ALLOC_MAXIMUM
312 /* The OS might guarantee only one guard page at the bottom of the stack,
313 and a page size can be as small as 4096 bytes. So we cannot safely
314 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
315 to allow for a few compiler-allocated temporary stack slots. */
316 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
319 # define YYSTACK_ALLOC YYMALLOC
320 # define YYSTACK_FREE YYFREE
321 # ifndef YYSTACK_ALLOC_MAXIMUM
322 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
324 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
325 && ! ((defined YYMALLOC || defined malloc) \
326 && (defined YYFREE || defined free)))
327 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
328 # ifndef EXIT_SUCCESS
329 # define EXIT_SUCCESS 0
333 # define YYMALLOC malloc
334 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
335 || defined __cplusplus || defined _MSC_VER)
336 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
341 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
342 || defined __cplusplus || defined _MSC_VER)
343 void free (void *); /* INFRINGES ON USER NAME SPACE */
347 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
350 #if (! defined yyoverflow \
351 && (! defined __cplusplus \
352 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
354 /* A type that is properly aligned for any stack member. */
357 yytype_int16 yyss_alloc;
361 /* The size of the maximum gap between one aligned stack and the next. */
362 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
364 /* The size of an array large to enough to hold all stacks, each with
366 # define YYSTACK_BYTES(N) \
367 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
368 + YYSTACK_GAP_MAXIMUM)
370 # define YYCOPY_NEEDED 1
372 /* Relocate STACK from its old location to the new one. The
373 local variables YYSIZE and YYSTACKSIZE give the old and new number of
374 elements in the stack, and YYPTR gives the new location of the
375 stack. Advance YYPTR to a properly aligned location for the next
377 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
380 YYSIZE_T yynewbytes; \
381 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
382 Stack = &yyptr->Stack_alloc; \
383 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
384 yyptr += yynewbytes / sizeof (*yyptr); \
390 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
391 /* Copy COUNT objects from SRC to DST. The source and destination do
394 # if defined __GNUC__ && 1 < __GNUC__
395 # define YYCOPY(Dst, Src, Count) \
396 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
398 # define YYCOPY(Dst, Src, Count) \
402 for (yyi = 0; yyi < (Count); yyi++) \
403 (Dst)[yyi] = (Src)[yyi]; \
408 #endif /* !YYCOPY_NEEDED */
410 /* YYFINAL -- State number of the termination state. */
412 /* YYLAST -- Last index in YYTABLE. */
415 /* YYNTOKENS -- Number of terminals. */
417 /* YYNNTS -- Number of nonterminals. */
419 /* YYNRULES -- Number of rules. */
421 /* YYNRULES -- Number of states. */
424 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
426 #define YYMAXUTOK 277
428 #define YYTRANSLATE(YYX) \
429 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
431 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
432 static const yytype_uint8 yytranslate[] =
434 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
460 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
461 15, 16, 17, 18, 19, 20, 21, 22
465 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
467 static const yytype_uint8 yyprhs[] =
469 0, 0, 3, 8, 9, 10, 19, 20, 27, 31,
473 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
474 static const yytype_int8 yyrhs[] =
476 24, 0, -1, 3, 17, 25, 18, -1, -1, -1,
477 22, 14, 26, 4, 27, 5, 15, 25, -1, -1,
478 13, 28, 6, 7, 22, 27, -1, 11, 28, 12,
479 -1, 28, 9, 28, -1, 28, 8, 28, -1, 10,
480 28, -1, 16, -1, 22, -1
483 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
484 static const yytype_uint8 yyrline[] =
486 0, 47, 47, 50, 51, 51, 54, 55, 58, 59,
491 #if YYDEBUG || YYERROR_VERBOSE || 0
492 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
493 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
494 static const char *const yytname[] =
496 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
497 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
498 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
499 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
500 "$@1", "option", "exp", YY_NULL
505 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
507 static const yytype_uint16 yytoknum[] =
509 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
510 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
515 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
516 static const yytype_uint8 yyr1[] =
518 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
522 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
523 static const yytype_uint8 yyr2[] =
525 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
529 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
530 Performed when YYTABLE doesn't specify something else to do. Zero
531 means the default is an error. */
532 static const yytype_uint8 yydefact[] =
534 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
535 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
536 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
540 /* YYDEFGOTO[NTERM-NUM]. */
541 static const yytype_int8 yydefgoto[] =
546 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
548 #define YYPACT_NINF -16
549 static const yytype_int8 yypact[] =
551 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
552 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
553 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
557 /* YYPGOTO[NTERM-NUM]. */
558 static const yytype_int8 yypgoto[] =
560 -16, -16, 4, -16, -7, -9
563 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
564 positive, shift that token. If negative, reduce the rule which
565 number is the opposite. If YYTABLE_NINF, syntax error. */
566 #define YYTABLE_NINF -1
567 static const yytype_uint8 yytable[] =
569 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
570 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
571 10, 11, 18, 31, 0, 26, 24, 30, 29
574 #define yypact_value_is_default(Yystate) \
575 (!!((Yystate) == (-16)))
577 #define yytable_value_is_error(Yytable_value) \
580 static const yytype_int8 yycheck[] =
582 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
583 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
584 4, 13, 5, 30, -1, 7, 15, 22, 24
587 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
588 symbol of state STATE-NUM. */
589 static const yytype_uint8 yystos[] =
591 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
592 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
593 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
597 #define yyerrok (yyerrstatus = 0)
598 #define yyclearin (yychar = YYEMPTY)
602 #define YYACCEPT goto yyacceptlab
603 #define YYABORT goto yyabortlab
604 #define YYERROR goto yyerrorlab
607 /* Like YYERROR except do call yyerror. This remains here temporarily
608 to ease the transition to the new meaning of YYERROR, for GCC.
609 Once GCC version 2 has supplanted version 1, this can go. However,
610 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
611 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
614 #define YYFAIL goto yyerrlab
616 /* This is here to suppress warnings from the GCC cpp's
617 -Wunused-macros. Normally we don't worry about that warning, but
618 some users do, and we want to make it easy for users to remove
619 YYFAIL uses, which will produce warnings from Bison 2.5. */
622 #define YYRECOVERING() (!!yyerrstatus)
624 #define YYBACKUP(Token, Value) \
626 if (yychar == YYEMPTY) \
630 YYPOPSTACK (yylen); \
636 yyerror (YY_("syntax error: cannot back up")); \
641 /* Error token number */
643 #define YYERRCODE 256
646 /* This macro is provided for backward compatibility. */
647 #ifndef YY_LOCATION_PRINT
648 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
652 /* 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;
702 FILE *yyo = yyoutput;
707 if (yytype < YYNTOKENS)
708 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
716 /*--------------------------------.
717 | Print this symbol on YYOUTPUT. |
718 `--------------------------------*/
720 #if (defined __STDC__ || defined __C99__FUNC__ \
721 || defined __cplusplus || defined _MSC_VER)
723 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
726 yy_symbol_print (yyoutput, yytype, yyvaluep)
729 YYSTYPE const * const yyvaluep;
732 if (yytype < YYNTOKENS)
733 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
735 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
737 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
738 YYFPRINTF (yyoutput, ")");
741 /*------------------------------------------------------------------.
742 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
744 `------------------------------------------------------------------*/
746 #if (defined __STDC__ || defined __C99__FUNC__ \
747 || defined __cplusplus || defined _MSC_VER)
749 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
752 yy_stack_print (yybottom, yytop)
753 yytype_int16 *yybottom;
757 YYFPRINTF (stderr, "Stack now");
758 for (; yybottom <= yytop; yybottom++)
760 int yybot = *yybottom;
761 YYFPRINTF (stderr, " %d", yybot);
763 YYFPRINTF (stderr, "\n");
766 # define YY_STACK_PRINT(Bottom, Top) \
769 yy_stack_print ((Bottom), (Top)); \
773 /*------------------------------------------------.
774 | Report that the YYRULE is going to be reduced. |
775 `------------------------------------------------*/
777 #if (defined __STDC__ || defined __C99__FUNC__ \
778 || defined __cplusplus || defined _MSC_VER)
780 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
783 yy_reduce_print (yyvsp, yyrule)
788 int yynrhs = yyr2[yyrule];
790 unsigned long int yylno = yyrline[yyrule];
791 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
793 /* The symbols being reduced. */
794 for (yyi = 0; yyi < yynrhs; yyi++)
796 YYFPRINTF (stderr, " $%d = ", yyi + 1);
797 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
798 &(yyvsp[(yyi + 1) - (yynrhs)])
800 YYFPRINTF (stderr, "\n");
804 # define YY_REDUCE_PRINT(Rule) \
807 yy_reduce_print (yyvsp, Rule); \
810 /* Nonzero means print parse trace. It is left uninitialized so that
811 multiple parsers can coexist. */
814 # define YYDPRINTF(Args)
815 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
816 # define YY_STACK_PRINT(Bottom, Top)
817 # define YY_REDUCE_PRINT(Rule)
818 #endif /* !YYDEBUG */
821 /* YYINITDEPTH -- initial size of the parser's stacks. */
823 # define YYINITDEPTH 200
826 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
827 if the built-in stack extension method is used).
829 Do not make this value too large; the results are undefined if
830 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
831 evaluated with infinite-precision integer arithmetic. */
834 # define YYMAXDEPTH 10000
841 # if defined __GLIBC__ && defined _STRING_H
842 # define yystrlen strlen
844 /* Return the length of YYSTR. */
845 #if (defined __STDC__ || defined __C99__FUNC__ \
846 || defined __cplusplus || defined _MSC_VER)
848 yystrlen (const char *yystr)
856 for (yylen = 0; yystr[yylen]; yylen++)
864 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
865 # define yystpcpy stpcpy
867 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
869 #if (defined __STDC__ || defined __C99__FUNC__ \
870 || defined __cplusplus || defined _MSC_VER)
872 yystpcpy (char *yydest, const char *yysrc)
875 yystpcpy (yydest, yysrc)
881 const char *yys = yysrc;
883 while ((*yyd++ = *yys++) != '\0')
892 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
893 quotes and backslashes, so that it's suitable for yyerror. The
894 heuristic is that double-quoting is unnecessary unless the string
895 contains an apostrophe, a comma, or backslash (other than
896 backslash-backslash). YYSTR is taken from yytname. If YYRES is
897 null, do not copy; instead, return the length of what the result
900 yytnamerr (char *yyres, const char *yystr)
905 char const *yyp = yystr;
912 goto do_not_strip_quotes;
916 goto do_not_strip_quotes;
929 do_not_strip_quotes: ;
933 return yystrlen (yystr);
935 return yystpcpy (yyres, yystr) - yyres;
939 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
940 about the unexpected token YYTOKEN for the state stack whose top is
943 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
944 not large enough to hold the message. In that case, also set
945 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
946 required number of bytes is too large to store. */
948 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
949 yytype_int16 *yyssp, int yytoken)
951 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
952 YYSIZE_T yysize = yysize0;
953 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
954 /* Internationalized format string. */
955 const char *yyformat = YY_NULL;
956 /* Arguments of yyformat. */
957 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
958 /* Number of reported tokens (one for the "unexpected", one per
962 /* There are many possibilities here to consider:
963 - Assume YYFAIL is not used. It's too flawed to consider. See
964 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
965 for details. YYERROR is fine as it does not invoke this
967 - If this state is a consistent state with a default action, then
968 the only way this function was invoked is if the default action
969 is an error action. In that case, don't check for expected
970 tokens because there are none.
971 - The only way there can be no lookahead present (in yychar) is if
972 this state is a consistent state with a default action. Thus,
973 detecting the absence of a lookahead is sufficient to determine
974 that there is no unexpected or expected token to report. In that
975 case, just report a simple "syntax error".
976 - Don't assume there isn't a lookahead just because this state is a
977 consistent state with a default action. There might have been a
978 previous inconsistent state, consistent state with a non-default
979 action, or user semantic action that manipulated yychar.
980 - Of course, the expected token list depends on states to have
981 correct lookahead information, and it depends on the parser not
982 to perform extra reductions after fetching a lookahead from the
983 scanner and before detecting a syntax error. Thus, state merging
984 (from LALR or IELR) and default reductions corrupt the expected
985 token list. However, the list is correct for canonical LR with
986 one exception: it will still contain any token that will not be
987 accepted due to an error action in a later state.
989 if (yytoken != YYEMPTY)
991 int yyn = yypact[*yyssp];
992 yyarg[yycount++] = yytname[yytoken];
993 if (!yypact_value_is_default (yyn))
995 /* Start YYX at -YYN if negative to avoid negative indexes in
996 YYCHECK. In other words, skip the first -YYN actions for
997 this state because they are default actions. */
998 int yyxbegin = yyn < 0 ? -yyn : 0;
999 /* Stay within bounds of both yycheck and yytname. */
1000 int yychecklim = YYLAST - yyn + 1;
1001 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1004 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1005 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1006 && !yytable_value_is_error (yytable[yyx + yyn]))
1008 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1014 yyarg[yycount++] = yytname[yyx];
1016 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1017 if (! (yysize <= yysize1
1018 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1028 # define YYCASE_(N, S) \
1032 YYCASE_(0, YY_("syntax error"));
1033 YYCASE_(1, YY_("syntax error, unexpected %s"));
1034 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1035 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1036 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1037 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1042 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1043 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1048 if (*yymsg_alloc < yysize)
1050 *yymsg_alloc = 2 * yysize;
1051 if (! (yysize <= *yymsg_alloc
1052 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1053 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1057 /* Avoid sprintf, as that infringes on the user's name space.
1058 Don't have undefined behavior even if the translation
1059 produced a string with the wrong number of "%s"s. */
1063 while ((*yyp = *yyformat) != '\0')
1064 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1066 yyp += yytnamerr (yyp, yyarg[yyi++]);
1077 #endif /* YYERROR_VERBOSE */
1079 /*-----------------------------------------------.
1080 | Release the memory associated to this symbol. |
1081 `-----------------------------------------------*/
1084 #if (defined __STDC__ || defined __C99__FUNC__ \
1085 || defined __cplusplus || defined _MSC_VER)
1087 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1090 yydestruct (yymsg, yytype, yyvaluep)
1100 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1108 /* The lookahead symbol. */
1112 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1113 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1114 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
1116 #ifndef YY_INITIAL_VALUE
1117 # define YY_INITIAL_VALUE(Value) /* Nothing. */
1120 /* The semantic value of the lookahead symbol. */
1121 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
1123 /* Number of syntax errors so far. */
1131 #ifdef YYPARSE_PARAM
1132 #if (defined __STDC__ || defined __C99__FUNC__ \
1133 || defined __cplusplus || defined _MSC_VER)
1135 yyparse (void *YYPARSE_PARAM)
1138 yyparse (YYPARSE_PARAM)
1139 void *YYPARSE_PARAM;
1141 #else /* ! YYPARSE_PARAM */
1142 #if (defined __STDC__ || defined __C99__FUNC__ \
1143 || defined __cplusplus || defined _MSC_VER)
1154 /* Number of tokens to shift before error messages enabled. */
1157 /* The stacks and their tools:
1158 `yyss': related to states.
1159 `yyvs': related to semantic values.
1161 Refer to the stacks through separate pointers, to allow yyoverflow
1162 to reallocate them elsewhere. */
1164 /* The state stack. */
1165 yytype_int16 yyssa[YYINITDEPTH];
1167 yytype_int16 *yyssp;
1169 /* The semantic value stack. */
1170 YYSTYPE yyvsa[YYINITDEPTH];
1174 YYSIZE_T yystacksize;
1178 /* Lookahead token as an internal (translated) token number. */
1180 /* The variables used to return semantic value and location from the
1185 /* Buffer for error messages, and its allocated size. */
1187 char *yymsg = yymsgbuf;
1188 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1191 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1193 /* The number of symbols on the RHS of the reduced rule.
1194 Keep to zero when no symbol should be popped. */
1197 yyssp = yyss = yyssa;
1198 yyvsp = yyvs = yyvsa;
1199 yystacksize = YYINITDEPTH;
1201 YYDPRINTF ((stderr, "Starting parse\n"));
1206 yychar = YYEMPTY; /* Cause a token to be read. */
1209 /*------------------------------------------------------------.
1210 | yynewstate -- Push a new state, which is found in yystate. |
1211 `------------------------------------------------------------*/
1213 /* In all cases, when you get here, the value and location stacks
1214 have just been pushed. So pushing a state here evens the stacks. */
1220 if (yyss + yystacksize - 1 <= yyssp)
1222 /* Get the current used size of the three stacks, in elements. */
1223 YYSIZE_T yysize = yyssp - yyss + 1;
1227 /* Give user a chance to reallocate the stack. Use copies of
1228 these so that the &'s don't force the real ones into
1230 YYSTYPE *yyvs1 = yyvs;
1231 yytype_int16 *yyss1 = yyss;
1233 /* Each stack pointer address is followed by the size of the
1234 data in use in that stack, in bytes. This used to be a
1235 conditional around just the two extra args, but that might
1236 be undefined if yyoverflow is a macro. */
1237 yyoverflow (YY_("memory exhausted"),
1238 &yyss1, yysize * sizeof (*yyssp),
1239 &yyvs1, yysize * sizeof (*yyvsp),
1245 #else /* no yyoverflow */
1246 # ifndef YYSTACK_RELOCATE
1247 goto yyexhaustedlab;
1249 /* Extend the stack our own way. */
1250 if (YYMAXDEPTH <= yystacksize)
1251 goto yyexhaustedlab;
1253 if (YYMAXDEPTH < yystacksize)
1254 yystacksize = YYMAXDEPTH;
1257 yytype_int16 *yyss1 = yyss;
1258 union yyalloc *yyptr =
1259 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1261 goto yyexhaustedlab;
1262 YYSTACK_RELOCATE (yyss_alloc, yyss);
1263 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1264 # undef YYSTACK_RELOCATE
1266 YYSTACK_FREE (yyss1);
1269 #endif /* no yyoverflow */
1271 yyssp = yyss + yysize - 1;
1272 yyvsp = yyvs + yysize - 1;
1274 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1275 (unsigned long int) yystacksize));
1277 if (yyss + yystacksize - 1 <= yyssp)
1281 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1283 if (yystate == YYFINAL)
1293 /* Do appropriate processing given the current state. Read a
1294 lookahead token if we need one and don't already have one. */
1296 /* First try to decide what to do without reference to lookahead token. */
1297 yyn = yypact[yystate];
1298 if (yypact_value_is_default (yyn))
1301 /* Not known => get a lookahead token if don't already have one. */
1303 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1304 if (yychar == YYEMPTY)
1306 YYDPRINTF ((stderr, "Reading a token: "));
1310 if (yychar <= YYEOF)
1312 yychar = yytoken = YYEOF;
1313 YYDPRINTF ((stderr, "Now at end of input.\n"));
1317 yytoken = YYTRANSLATE (yychar);
1318 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1321 /* If the proper action on seeing token YYTOKEN is to reduce or to
1322 detect an error, take that action. */
1324 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1329 if (yytable_value_is_error (yyn))
1335 /* Count tokens shifted since error; after three, turn off error
1340 /* Shift the lookahead token. */
1341 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1343 /* Discard the shifted token. */
1347 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1349 YY_IGNORE_MAYBE_UNINITIALIZED_END
1354 /*-----------------------------------------------------------.
1355 | yydefault -- do the default action for the current state. |
1356 `-----------------------------------------------------------*/
1358 yyn = yydefact[yystate];
1364 /*-----------------------------.
1365 | yyreduce -- Do a reduction. |
1366 `-----------------------------*/
1368 /* yyn is the number of a rule to reduce with. */
1371 /* If YYLEN is nonzero, implement the default value of the action:
1374 Otherwise, the following line sets YYVAL to garbage.
1375 This behavior is undocumented and Bison
1376 users should not rely upon it. Assigning to YYVAL
1377 unconditionally makes the parser a bit smaller, and it avoids a
1378 GCC warning that YYVAL may be used uninitialized. */
1379 yyval = yyvsp[1-yylen];
1382 YY_REDUCE_PRINT (yyn);
1386 /* Line 1787 of yacc.c */
1387 #line 51 "parserPromela.yacc"
1388 { new_state((yyvsp[(1) - (2)].string), 1);}
1392 /* Line 1787 of yacc.c */
1393 #line 55 "parserPromela.yacc"
1394 { new_transition((yyvsp[(5) - (6)].string), (yyvsp[(2) - (6)].label));}
1398 /* Line 1787 of yacc.c */
1399 #line 58 "parserPromela.yacc"
1400 { (yyval.label) = (yyvsp[(2) - (3)].label); }
1404 /* Line 1787 of yacc.c */
1405 #line 59 "parserPromela.yacc"
1406 { (yyval.label) = new_label(0, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1410 /* Line 1787 of yacc.c */
1411 #line 60 "parserPromela.yacc"
1412 { (yyval.label) = new_label(1, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1416 /* Line 1787 of yacc.c */
1417 #line 61 "parserPromela.yacc"
1418 { (yyval.label) = new_label(2, (yyvsp[(2) - (2)].label)); }
1422 /* Line 1787 of yacc.c */
1423 #line 62 "parserPromela.yacc"
1424 { (yyval.label) = new_label(4); }
1428 /* Line 1787 of yacc.c */
1429 #line 63 "parserPromela.yacc"
1430 { (yyval.label) = new_label(3, (yyvsp[(1) - (1)].string)); }
1434 /* Line 1787 of yacc.c */
1435 #line 1436 "parserPromela.tab.cacc"
1438 /* User semantic actions sometimes alter yychar, and that requires
1439 that yytoken be updated with the new translation. We take the
1440 approach of translating immediately before every use of yytoken.
1441 One alternative is translating here after every semantic action,
1442 but that translation would be missed if the semantic action invokes
1443 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1444 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1445 incorrect destructor might then be invoked immediately. In the
1446 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1447 to an incorrect destructor call or verbose syntax error message
1448 before the lookahead is translated. */
1449 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1453 YY_STACK_PRINT (yyss, yyssp);
1457 /* Now `shift' the result of the reduction. Determine what state
1458 that goes to, based on the state we popped back to and the rule
1459 number reduced by. */
1463 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1464 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1465 yystate = yytable[yystate];
1467 yystate = yydefgoto[yyn - YYNTOKENS];
1472 /*------------------------------------.
1473 | yyerrlab -- here on detecting error |
1474 `------------------------------------*/
1476 /* Make sure we have latest lookahead translation. See comments at
1477 user semantic actions for why this is necessary. */
1478 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1480 /* If not already recovering from an error, report this error. */
1484 #if ! YYERROR_VERBOSE
1485 yyerror (YY_("syntax error"));
1487 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1490 char const *yymsgp = YY_("syntax error");
1491 int yysyntax_error_status;
1492 yysyntax_error_status = YYSYNTAX_ERROR;
1493 if (yysyntax_error_status == 0)
1495 else if (yysyntax_error_status == 1)
1497 if (yymsg != yymsgbuf)
1498 YYSTACK_FREE (yymsg);
1499 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1503 yymsg_alloc = sizeof yymsgbuf;
1504 yysyntax_error_status = 2;
1508 yysyntax_error_status = YYSYNTAX_ERROR;
1513 if (yysyntax_error_status == 2)
1514 goto yyexhaustedlab;
1516 # undef YYSYNTAX_ERROR
1522 if (yyerrstatus == 3)
1524 /* If just tried and failed to reuse lookahead token after an
1525 error, discard it. */
1527 if (yychar <= YYEOF)
1529 /* Return failure if at end of input. */
1530 if (yychar == YYEOF)
1535 yydestruct ("Error: discarding",
1541 /* Else will try to reuse lookahead token after shifting the error
1546 /*---------------------------------------------------.
1547 | yyerrorlab -- error raised explicitly by YYERROR. |
1548 `---------------------------------------------------*/
1551 /* Pacify compilers like GCC when the user code never invokes
1552 YYERROR and the label yyerrorlab therefore never appears in user
1554 if (/*CONSTCOND*/ 0)
1557 /* Do not reclaim the symbols of the rule which action triggered
1561 YY_STACK_PRINT (yyss, yyssp);
1566 /*-------------------------------------------------------------.
1567 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1568 `-------------------------------------------------------------*/
1570 yyerrstatus = 3; /* Each real token shifted decrements this. */
1574 yyn = yypact[yystate];
1575 if (!yypact_value_is_default (yyn))
1578 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1586 /* Pop the current state because it cannot handle the error token. */
1591 yydestruct ("Error: popping",
1592 yystos[yystate], yyvsp);
1595 YY_STACK_PRINT (yyss, yyssp);
1598 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1600 YY_IGNORE_MAYBE_UNINITIALIZED_END
1603 /* Shift the error token. */
1604 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1610 /*-------------------------------------.
1611 | yyacceptlab -- YYACCEPT comes here. |
1612 `-------------------------------------*/
1617 /*-----------------------------------.
1618 | yyabortlab -- YYABORT comes here. |
1619 `-----------------------------------*/
1624 #if !defined yyoverflow || YYERROR_VERBOSE
1625 /*-------------------------------------------------.
1626 | yyexhaustedlab -- memory exhaustion comes here. |
1627 `-------------------------------------------------*/
1629 yyerror (YY_("memory exhausted"));
1635 if (yychar != YYEMPTY)
1637 /* Make sure we have latest lookahead translation. See comments at
1638 user semantic actions for why this is necessary. */
1639 yytoken = YYTRANSLATE (yychar);
1640 yydestruct ("Cleanup: discarding lookahead",
1643 /* Do not reclaim the symbols of the rule which action triggered
1644 this YYABORT or YYACCEPT. */
1646 YY_STACK_PRINT (yyss, yyssp);
1647 while (yyssp != yyss)
1649 yydestruct ("Cleanup: popping",
1650 yystos[*yyssp], yyvsp);
1655 YYSTACK_FREE (yyss);
1658 if (yymsg != yymsgbuf)
1659 YYSTACK_FREE (yymsg);
1661 /* Make sure YYID is used. */
1662 return YYID (yyresult);
1666 /* Line 2050 of yacc.c */
1667 #line 66 "parserPromela.yacc"
1672 void yyerror(const char *s){
1673 fprintf (stderr, "%s\n", s);