2 /* A Bison parser, made by GNU Bison 2.4.1. */
4 /* Skeleton implementation for Bison's Yacc-like parsers in C
6 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
35 /* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
38 /* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
45 /* Identify Bison output. */
49 #define YYBISON_VERSION "2.4.1"
52 #define YYSKELETON_NAME "yacc.c"
63 /* Using locations. */
64 #define YYLSP_NEEDED 0
68 /* Copy the first part of user declarations. */
70 /* Line 189 of yacc.c */
71 #line 1 "parserPromela.yacc"
74 #include "automaton.h"
75 #include "automatonparse_promela.h"
78 void yyerror(const char *s);
82 /* Line 189 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 214 of yacc.c */
162 #line 11 "parserPromela.yacc"
167 xbt_exp_label_t label;
171 /* Line 214 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 264 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)
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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
288 || defined __cplusplus || defined _MSC_VER)
289 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
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 _STDLIB_H \
315 && ! ((defined YYMALLOC || defined malloc) \
316 && (defined YYFREE || defined free)))
317 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
323 # define YYMALLOC malloc
324 # if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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 /* Copy COUNT objects from FROM to TO. The source and destination do
363 # if defined __GNUC__ && 1 < __GNUC__
364 # define YYCOPY(To, From, Count) \
365 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
367 # define YYCOPY(To, From, Count) \
371 for (yyi = 0; yyi < (Count); yyi++) \
372 (To)[yyi] = (From)[yyi]; \
378 /* Relocate STACK from its old location to the new one. The
379 local variables YYSIZE and YYSTACKSIZE give the old and new number of
380 elements in the stack, and YYPTR gives the new location of the
381 stack. Advance YYPTR to a properly aligned location for the next
383 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
386 YYSIZE_T yynewbytes; \
387 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
388 Stack = &yyptr->Stack_alloc; \
389 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
390 yyptr += yynewbytes / sizeof (*yyptr); \
396 /* YYFINAL -- State number of the termination state. */
398 /* YYLAST -- Last index in YYTABLE. */
401 /* YYNTOKENS -- Number of terminals. */
403 /* YYNNTS -- Number of nonterminals. */
405 /* YYNRULES -- Number of rules. */
407 /* YYNRULES -- Number of states. */
410 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
412 #define YYMAXUTOK 277
414 #define YYTRANSLATE(YYX) \
415 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
417 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
418 static const yytype_uint8 yytranslate[] =
420 0, 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, 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, 1, 2, 3, 4,
446 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
447 15, 16, 17, 18, 19, 20, 21, 22
451 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
453 static const yytype_uint8 yyprhs[] =
455 0, 0, 3, 8, 9, 10, 19, 20, 27, 31,
459 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
460 static const yytype_int8 yyrhs[] =
462 24, 0, -1, 3, 17, 25, 18, -1, -1, -1,
463 22, 14, 26, 4, 27, 5, 15, 25, -1, -1,
464 13, 28, 6, 7, 22, 27, -1, 11, 28, 12,
465 -1, 28, 9, 28, -1, 28, 8, 28, -1, 10,
466 28, -1, 16, -1, 22, -1
469 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
470 static const yytype_uint8 yyrline[] =
472 0, 48, 48, 51, 52, 52, 55, 56, 59, 60,
477 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
478 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
479 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
480 static const char *const yytname[] =
482 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
483 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
484 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
485 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
486 "$@1", "option", "exp", 0
491 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
493 static const yytype_uint16 yytoknum[] =
495 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
496 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
501 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
502 static const yytype_uint8 yyr1[] =
504 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
508 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
509 static const yytype_uint8 yyr2[] =
511 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
515 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
516 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
517 means the default is an error. */
518 static const yytype_uint8 yydefact[] =
520 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
521 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
522 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
526 /* YYDEFGOTO[NTERM-NUM]. */
527 static const yytype_int8 yydefgoto[] =
532 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
534 #define YYPACT_NINF -16
535 static const yytype_int8 yypact[] =
537 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
538 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
539 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
543 /* YYPGOTO[NTERM-NUM]. */
544 static const yytype_int8 yypgoto[] =
546 -16, -16, 4, -16, -7, -9
549 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
550 positive, shift that token. If negative, reduce the rule which
551 number is the opposite. If zero, do what YYDEFACT says.
552 If YYTABLE_NINF, syntax error. */
553 #define YYTABLE_NINF -1
554 static const yytype_uint8 yytable[] =
556 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
557 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
558 10, 11, 18, 31, 0, 26, 24, 30, 29
561 static const yytype_int8 yycheck[] =
563 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
564 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
565 4, 13, 5, 30, -1, 7, 15, 22, 24
568 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
569 symbol of state STATE-NUM. */
570 static const yytype_uint8 yystos[] =
572 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
573 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
574 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
578 #define yyerrok (yyerrstatus = 0)
579 #define yyclearin (yychar = YYEMPTY)
583 #define YYACCEPT goto yyacceptlab
584 #define YYABORT goto yyabortlab
585 #define YYERROR goto yyerrorlab
588 /* Like YYERROR except do call yyerror. This remains here temporarily
589 to ease the transition to the new meaning of YYERROR, for GCC.
590 Once GCC version 2 has supplanted version 1, this can go. */
592 #define YYFAIL goto yyerrlab
594 #define YYRECOVERING() (!!yyerrstatus)
596 #define YYBACKUP(Token, Value) \
598 if (yychar == YYEMPTY && yylen == 1) \
602 yytoken = YYTRANSLATE (yychar); \
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 /* YY_LOCATION_PRINT -- Print the location on the stream.
645 This macro was not mandated originally: define only if we know
646 we won't break user code: when these are the locations we know. */
648 #ifndef YY_LOCATION_PRINT
649 # if YYLTYPE_IS_TRIVIAL
650 # define YY_LOCATION_PRINT(File, Loc) \
651 fprintf (File, "%d.%d-%d.%d", \
652 (Loc).first_line, (Loc).first_column, \
653 (Loc).last_line, (Loc).last_column)
655 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
660 /* YYLEX -- calling `yylex' with the right arguments. */
663 # define YYLEX yylex (YYLEX_PARAM)
665 # define YYLEX yylex ()
668 /* Enable debugging if requested. */
672 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
673 # define YYFPRINTF fprintf
676 # define YYDPRINTF(Args) \
682 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
686 YYFPRINTF (stderr, "%s ", Title); \
687 yy_symbol_print (stderr, \
689 YYFPRINTF (stderr, "\n"); \
694 /*--------------------------------.
695 | Print this symbol on YYOUTPUT. |
696 `--------------------------------*/
699 #if (defined __STDC__ || defined __C99__FUNC__ \
700 || defined __cplusplus || defined _MSC_VER)
702 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
705 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
708 YYSTYPE const * const yyvaluep;
714 if (yytype < YYNTOKENS)
715 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
727 /*--------------------------------.
728 | Print this symbol on YYOUTPUT. |
729 `--------------------------------*/
731 #if (defined __STDC__ || defined __C99__FUNC__ \
732 || defined __cplusplus || defined _MSC_VER)
734 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
737 yy_symbol_print (yyoutput, yytype, yyvaluep)
740 YYSTYPE const * const yyvaluep;
743 if (yytype < YYNTOKENS)
744 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
746 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
748 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
749 YYFPRINTF (yyoutput, ")");
752 /*------------------------------------------------------------------.
753 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
755 `------------------------------------------------------------------*/
757 #if (defined __STDC__ || defined __C99__FUNC__ \
758 || defined __cplusplus || defined _MSC_VER)
760 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
763 yy_stack_print (yybottom, yytop)
764 yytype_int16 *yybottom;
768 YYFPRINTF (stderr, "Stack now");
769 for (; yybottom <= yytop; yybottom++)
771 int yybot = *yybottom;
772 YYFPRINTF (stderr, " %d", yybot);
774 YYFPRINTF (stderr, "\n");
777 # define YY_STACK_PRINT(Bottom, Top) \
780 yy_stack_print ((Bottom), (Top)); \
784 /*------------------------------------------------.
785 | Report that the YYRULE is going to be reduced. |
786 `------------------------------------------------*/
788 #if (defined __STDC__ || defined __C99__FUNC__ \
789 || defined __cplusplus || defined _MSC_VER)
791 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
794 yy_reduce_print (yyvsp, yyrule)
799 int yynrhs = yyr2[yyrule];
801 unsigned long int yylno = yyrline[yyrule];
802 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
804 /* The symbols being reduced. */
805 for (yyi = 0; yyi < yynrhs; yyi++)
807 YYFPRINTF (stderr, " $%d = ", yyi + 1);
808 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
809 &(yyvsp[(yyi + 1) - (yynrhs)])
811 YYFPRINTF (stderr, "\n");
815 # define YY_REDUCE_PRINT(Rule) \
818 yy_reduce_print (yyvsp, Rule); \
821 /* Nonzero means print parse trace. It is left uninitialized so that
822 multiple parsers can coexist. */
825 # define YYDPRINTF(Args)
826 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
827 # define YY_STACK_PRINT(Bottom, Top)
828 # define YY_REDUCE_PRINT(Rule)
829 #endif /* !YYDEBUG */
832 /* YYINITDEPTH -- initial size of the parser's stacks. */
834 # define YYINITDEPTH 200
837 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
838 if the built-in stack extension method is used).
840 Do not make this value too large; the results are undefined if
841 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
842 evaluated with infinite-precision integer arithmetic. */
845 # define YYMAXDEPTH 10000
853 # if defined __GLIBC__ && defined _STRING_H
854 # define yystrlen strlen
856 /* Return the length of YYSTR. */
857 #if (defined __STDC__ || defined __C99__FUNC__ \
858 || defined __cplusplus || defined _MSC_VER)
860 yystrlen (const char *yystr)
868 for (yylen = 0; yystr[yylen]; yylen++)
876 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
877 # define yystpcpy stpcpy
879 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
881 #if (defined __STDC__ || defined __C99__FUNC__ \
882 || defined __cplusplus || defined _MSC_VER)
884 yystpcpy (char *yydest, const char *yysrc)
887 yystpcpy (yydest, yysrc)
893 const char *yys = yysrc;
895 while ((*yyd++ = *yys++) != '\0')
904 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
905 quotes and backslashes, so that it's suitable for yyerror. The
906 heuristic is that double-quoting is unnecessary unless the string
907 contains an apostrophe, a comma, or backslash (other than
908 backslash-backslash). YYSTR is taken from yytname. If YYRES is
909 null, do not copy; instead, return the length of what the result
912 yytnamerr (char *yyres, const char *yystr)
917 char const *yyp = yystr;
924 goto do_not_strip_quotes;
928 goto do_not_strip_quotes;
941 do_not_strip_quotes: ;
945 return yystrlen (yystr);
947 return yystpcpy (yyres, yystr) - yyres;
951 /* Copy into YYRESULT an error message about the unexpected token
952 YYCHAR while in state YYSTATE. Return the number of bytes copied,
953 including the terminating null byte. If YYRESULT is null, do not
954 copy anything; just return the number of bytes that would be
955 copied. As a special case, return 0 if an ordinary "syntax error"
956 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
959 yysyntax_error (char *yyresult, int yystate, int yychar)
961 int yyn = yypact[yystate];
963 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
967 int yytype = YYTRANSLATE (yychar);
968 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
969 YYSIZE_T yysize = yysize0;
971 int yysize_overflow = 0;
972 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
973 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
977 /* This is so xgettext sees the translatable formats that are
978 constructed on the fly. */
979 YY_("syntax error, unexpected %s");
980 YY_("syntax error, unexpected %s, expecting %s");
981 YY_("syntax error, unexpected %s, expecting %s or %s");
982 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
983 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
987 static char const yyunexpected[] = "syntax error, unexpected %s";
988 static char const yyexpecting[] = ", expecting %s";
989 static char const yyor[] = " or %s";
990 char yyformat[sizeof yyunexpected
991 + sizeof yyexpecting - 1
992 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
993 * (sizeof yyor - 1))];
994 char const *yyprefix = yyexpecting;
996 /* Start YYX at -YYN if negative to avoid negative indexes in
998 int yyxbegin = yyn < 0 ? -yyn : 0;
1000 /* Stay within bounds of both yycheck and yytname. */
1001 int yychecklim = YYLAST - yyn + 1;
1002 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1005 yyarg[0] = yytname[yytype];
1006 yyfmt = yystpcpy (yyformat, yyunexpected);
1008 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1009 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1011 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1015 yyformat[sizeof yyunexpected - 1] = '\0';
1018 yyarg[yycount++] = yytname[yyx];
1019 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1020 yysize_overflow |= (yysize1 < yysize);
1022 yyfmt = yystpcpy (yyfmt, yyprefix);
1026 yyf = YY_(yyformat);
1027 yysize1 = yysize + yystrlen (yyf);
1028 yysize_overflow |= (yysize1 < yysize);
1031 if (yysize_overflow)
1032 return YYSIZE_MAXIMUM;
1036 /* Avoid sprintf, as that infringes on the user's name space.
1037 Don't have undefined behavior even if the translation
1038 produced a string with the wrong number of "%s"s. */
1039 char *yyp = yyresult;
1041 while ((*yyp = *yyf) != '\0')
1043 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1045 yyp += yytnamerr (yyp, yyarg[yyi++]);
1058 #endif /* YYERROR_VERBOSE */
1061 /*-----------------------------------------------.
1062 | Release the memory associated to this symbol. |
1063 `-----------------------------------------------*/
1066 #if (defined __STDC__ || defined __C99__FUNC__ \
1067 || defined __cplusplus || defined _MSC_VER)
1069 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1072 yydestruct (yymsg, yytype, yyvaluep)
1082 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1092 /* Prevent warnings from -Wmissing-prototypes. */
1093 #ifdef YYPARSE_PARAM
1094 #if defined __STDC__ || defined __cplusplus
1095 int yyparse (void *YYPARSE_PARAM);
1099 #else /* ! YYPARSE_PARAM */
1100 #if defined __STDC__ || defined __cplusplus
1105 #endif /* ! YYPARSE_PARAM */
1108 /* The lookahead symbol. */
1111 /* The semantic value of the lookahead symbol. */
1114 /* Number of syntax errors so far. */
1119 /*-------------------------.
1120 | yyparse or yypush_parse. |
1121 `-------------------------*/
1123 #ifdef YYPARSE_PARAM
1124 #if (defined __STDC__ || defined __C99__FUNC__ \
1125 || defined __cplusplus || defined _MSC_VER)
1127 yyparse (void *YYPARSE_PARAM)
1130 yyparse (YYPARSE_PARAM)
1131 void *YYPARSE_PARAM;
1133 #else /* ! YYPARSE_PARAM */
1134 #if (defined __STDC__ || defined __C99__FUNC__ \
1135 || defined __cplusplus || defined _MSC_VER)
1148 /* Number of tokens to shift before error messages enabled. */
1151 /* The stacks and their tools:
1152 `yyss': related to states.
1153 `yyvs': related to semantic values.
1155 Refer to the stacks thru separate pointers, to allow yyoverflow
1156 to reallocate them elsewhere. */
1158 /* The state stack. */
1159 yytype_int16 yyssa[YYINITDEPTH];
1161 yytype_int16 *yyssp;
1163 /* The semantic value stack. */
1164 YYSTYPE yyvsa[YYINITDEPTH];
1168 YYSIZE_T yystacksize;
1172 /* Lookahead token as an internal (translated) token number. */
1174 /* The variables used to return semantic value and location from the
1179 /* Buffer for error messages, and its allocated size. */
1181 char *yymsg = yymsgbuf;
1182 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1185 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1187 /* The number of symbols on the RHS of the reduced rule.
1188 Keep to zero when no symbol should be popped. */
1194 yystacksize = YYINITDEPTH;
1196 YYDPRINTF ((stderr, "Starting parse\n"));
1201 yychar = YYEMPTY; /* Cause a token to be read. */
1203 /* Initialize stack pointers.
1204 Waste one element of value and location stack
1205 so that they stay on the same level as the state stack.
1206 The wasted elements are never initialized. */
1212 /*------------------------------------------------------------.
1213 | yynewstate -- Push a new state, which is found in yystate. |
1214 `------------------------------------------------------------*/
1216 /* In all cases, when you get here, the value and location stacks
1217 have just been pushed. So pushing a state here evens the stacks. */
1223 if (yyss + yystacksize - 1 <= yyssp)
1225 /* Get the current used size of the three stacks, in elements. */
1226 YYSIZE_T yysize = yyssp - yyss + 1;
1230 /* Give user a chance to reallocate the stack. Use copies of
1231 these so that the &'s don't force the real ones into
1233 YYSTYPE *yyvs1 = yyvs;
1234 yytype_int16 *yyss1 = yyss;
1236 /* Each stack pointer address is followed by the size of the
1237 data in use in that stack, in bytes. This used to be a
1238 conditional around just the two extra args, but that might
1239 be undefined if yyoverflow is a macro. */
1240 yyoverflow (YY_("memory exhausted"),
1241 &yyss1, yysize * sizeof (*yyssp),
1242 &yyvs1, yysize * sizeof (*yyvsp),
1248 #else /* no yyoverflow */
1249 # ifndef YYSTACK_RELOCATE
1250 goto yyexhaustedlab;
1252 /* Extend the stack our own way. */
1253 if (YYMAXDEPTH <= yystacksize)
1254 goto yyexhaustedlab;
1256 if (YYMAXDEPTH < yystacksize)
1257 yystacksize = YYMAXDEPTH;
1260 yytype_int16 *yyss1 = yyss;
1261 union yyalloc *yyptr =
1262 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1264 goto yyexhaustedlab;
1265 YYSTACK_RELOCATE (yyss_alloc, yyss);
1266 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1267 # undef YYSTACK_RELOCATE
1269 YYSTACK_FREE (yyss1);
1272 #endif /* no yyoverflow */
1274 yyssp = yyss + yysize - 1;
1275 yyvsp = yyvs + yysize - 1;
1277 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1278 (unsigned long int) yystacksize));
1280 if (yyss + yystacksize - 1 <= yyssp)
1284 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1286 if (yystate == YYFINAL)
1296 /* Do appropriate processing given the current state. Read a
1297 lookahead token if we need one and don't already have one. */
1299 /* First try to decide what to do without reference to lookahead token. */
1300 yyn = yypact[yystate];
1301 if (yyn == YYPACT_NINF)
1304 /* Not known => get a lookahead token if don't already have one. */
1306 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1307 if (yychar == YYEMPTY)
1309 YYDPRINTF ((stderr, "Reading a token: "));
1313 if (yychar <= YYEOF)
1315 yychar = yytoken = YYEOF;
1316 YYDPRINTF ((stderr, "Now at end of input.\n"));
1320 yytoken = YYTRANSLATE (yychar);
1321 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1324 /* If the proper action on seeing token YYTOKEN is to reduce or to
1325 detect an error, take that action. */
1327 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1332 if (yyn == 0 || yyn == YYTABLE_NINF)
1338 /* Count tokens shifted since error; after three, turn off error
1343 /* Shift the lookahead token. */
1344 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1346 /* Discard the shifted token. */
1355 /*-----------------------------------------------------------.
1356 | yydefault -- do the default action for the current state. |
1357 `-----------------------------------------------------------*/
1359 yyn = yydefact[yystate];
1365 /*-----------------------------.
1366 | yyreduce -- Do a reduction. |
1367 `-----------------------------*/
1369 /* yyn is the number of a rule to reduce with. */
1372 /* If YYLEN is nonzero, implement the default value of the action:
1375 Otherwise, the following line sets YYVAL to garbage.
1376 This behavior is undocumented and Bison
1377 users should not rely upon it. Assigning to YYVAL
1378 unconditionally makes the parser a bit smaller, and it avoids a
1379 GCC warning that YYVAL may be used uninitialized. */
1380 yyval = yyvsp[1-yylen];
1383 YY_REDUCE_PRINT (yyn);
1388 /* Line 1455 of yacc.c */
1389 #line 52 "parserPromela.yacc"
1390 { new_state((yyvsp[(1) - (2)].string), 1);}
1395 /* Line 1455 of yacc.c */
1396 #line 56 "parserPromela.yacc"
1397 { new_transition((yyvsp[(5) - (6)].string), (yyvsp[(2) - (6)].label));}
1402 /* Line 1455 of yacc.c */
1403 #line 59 "parserPromela.yacc"
1404 { (yyval.label) = (yyvsp[(2) - (3)].label); }
1409 /* Line 1455 of yacc.c */
1410 #line 60 "parserPromela.yacc"
1411 { (yyval.label) = new_label(0, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1416 /* Line 1455 of yacc.c */
1417 #line 61 "parserPromela.yacc"
1418 { (yyval.label) = new_label(1, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1423 /* Line 1455 of yacc.c */
1424 #line 62 "parserPromela.yacc"
1425 { (yyval.label) = new_label(2, (yyvsp[(2) - (2)].label)); }
1430 /* Line 1455 of yacc.c */
1431 #line 63 "parserPromela.yacc"
1432 { (yyval.label) = new_label(4); }
1437 /* Line 1455 of yacc.c */
1438 #line 64 "parserPromela.yacc"
1439 { (yyval.label) = new_label(3, (yyvsp[(1) - (1)].string)); }
1444 /* Line 1455 of yacc.c */
1445 #line 1446 "y.tab.c"
1448 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1452 YY_STACK_PRINT (yyss, yyssp);
1456 /* Now `shift' the result of the reduction. Determine what state
1457 that goes to, based on the state we popped back to and the rule
1458 number reduced by. */
1462 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1463 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1464 yystate = yytable[yystate];
1466 yystate = yydefgoto[yyn - YYNTOKENS];
1471 /*------------------------------------.
1472 | yyerrlab -- here on detecting error |
1473 `------------------------------------*/
1475 /* If not already recovering from an error, report this error. */
1479 #if ! YYERROR_VERBOSE
1480 yyerror (YY_("syntax error"));
1483 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1484 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1486 YYSIZE_T yyalloc = 2 * yysize;
1487 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1488 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1489 if (yymsg != yymsgbuf)
1490 YYSTACK_FREE (yymsg);
1491 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1493 yymsg_alloc = yyalloc;
1497 yymsg_alloc = sizeof yymsgbuf;
1501 if (0 < yysize && yysize <= yymsg_alloc)
1503 (void) yysyntax_error (yymsg, yystate, yychar);
1508 yyerror (YY_("syntax error"));
1510 goto yyexhaustedlab;
1518 if (yyerrstatus == 3)
1520 /* If just tried and failed to reuse lookahead token after an
1521 error, discard it. */
1523 if (yychar <= YYEOF)
1525 /* Return failure if at end of input. */
1526 if (yychar == YYEOF)
1531 yydestruct ("Error: discarding",
1537 /* Else will try to reuse lookahead token after shifting the error
1542 /*---------------------------------------------------.
1543 | yyerrorlab -- error raised explicitly by YYERROR. |
1544 `---------------------------------------------------*/
1547 /* Pacify compilers like GCC when the user code never invokes
1548 YYERROR and the label yyerrorlab therefore never appears in user
1550 if (/*CONSTCOND*/ 0)
1553 /* Do not reclaim the symbols of the rule which action triggered
1557 YY_STACK_PRINT (yyss, yyssp);
1562 /*-------------------------------------------------------------.
1563 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1564 `-------------------------------------------------------------*/
1566 yyerrstatus = 3; /* Each real token shifted decrements this. */
1570 yyn = yypact[yystate];
1571 if (yyn != YYPACT_NINF)
1574 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1582 /* Pop the current state because it cannot handle the error token. */
1587 yydestruct ("Error: popping",
1588 yystos[yystate], yyvsp);
1591 YY_STACK_PRINT (yyss, yyssp);
1597 /* Shift the error token. */
1598 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1604 /*-------------------------------------.
1605 | yyacceptlab -- YYACCEPT comes here. |
1606 `-------------------------------------*/
1611 /*-----------------------------------.
1612 | yyabortlab -- YYABORT comes here. |
1613 `-----------------------------------*/
1618 #if !defined(yyoverflow) || YYERROR_VERBOSE
1619 /*-------------------------------------------------.
1620 | yyexhaustedlab -- memory exhaustion comes here. |
1621 `-------------------------------------------------*/
1623 yyerror (YY_("memory exhausted"));
1629 if (yychar != YYEMPTY)
1630 yydestruct ("Cleanup: discarding lookahead",
1632 /* Do not reclaim the symbols of the rule which action triggered
1633 this YYABORT or YYACCEPT. */
1635 YY_STACK_PRINT (yyss, yyssp);
1636 while (yyssp != yyss)
1638 yydestruct ("Cleanup: popping",
1639 yystos[*yyssp], yyvsp);
1644 YYSTACK_FREE (yyss);
1647 if (yymsg != yymsgbuf)
1648 YYSTACK_FREE (yymsg);
1650 /* Make sure YYID is used. */
1651 return YYID (yyresult);
1656 /* Line 1675 of yacc.c */
1657 #line 67 "parserPromela.yacc"
1662 void yyerror(const char *s){
1663 fprintf (stderr, "%s\n", s);