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"
80 /* Line 189 of yacc.c */
83 /* Enabling traces. */
88 /* Enabling verbose error messages. */
89 #ifdef YYERROR_VERBOSE
90 # undef YYERROR_VERBOSE
91 # define YYERROR_VERBOSE 1
93 # define YYERROR_VERBOSE 0
96 /* Enabling the token table. */
98 # define YYTOKEN_TABLE 0
105 /* Put the tokens into the symbol table, so that GDB and other debuggers
140 #define RIGHT_PAR 267
143 #define SEMI_COLON 270
144 #define CASE_TRUE 271
145 #define LEFT_BRACE 272
146 #define RIGHT_BRACE 273
148 #define LITT_CHAINE 275
149 #define LITT_REEL 276
155 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
156 typedef union YYSTYPE
159 /* Line 214 of yacc.c */
160 #line 9 "parserPromela.yacc"
165 xbt_exp_label_t label;
169 /* Line 214 of yacc.c */
172 # define YYSTYPE_IS_TRIVIAL 1
173 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
174 # define YYSTYPE_IS_DECLARED 1
178 /* Copy the second part of user declarations. */
181 /* Line 264 of yacc.c */
189 typedef YYTYPE_UINT8 yytype_uint8;
191 typedef unsigned char yytype_uint8;
195 typedef YYTYPE_INT8 yytype_int8;
196 #elif (defined __STDC__ || defined __C99__FUNC__ \
197 || defined __cplusplus || defined _MSC_VER)
198 typedef signed char yytype_int8;
200 typedef short int yytype_int8;
204 typedef YYTYPE_UINT16 yytype_uint16;
206 typedef unsigned short int yytype_uint16;
210 typedef YYTYPE_INT16 yytype_int16;
212 typedef short int yytype_int16;
216 # ifdef __SIZE_TYPE__
217 # define YYSIZE_T __SIZE_TYPE__
218 # elif defined size_t
219 # define YYSIZE_T size_t
220 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
221 || defined __cplusplus || defined _MSC_VER)
222 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
223 # define YYSIZE_T size_t
225 # define YYSIZE_T unsigned int
229 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
234 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
235 # define YY_(msgid) dgettext ("bison-runtime", msgid)
239 # define YY_(msgid) msgid
243 /* Suppress unused-variable warnings by "using" E. */
244 #if ! defined lint || defined __GNUC__
245 # define YYUSE(e) ((void) (e))
247 # define YYUSE(e) /* empty */
250 /* Identity function, used to suppress warnings about constant conditions. */
254 #if (defined __STDC__ || defined __C99__FUNC__ \
255 || defined __cplusplus || defined _MSC_VER)
268 #if ! defined yyoverflow || YYERROR_VERBOSE
270 /* The parser invokes alloca or malloc; define the necessary symbols. */
272 # ifdef YYSTACK_USE_ALLOCA
273 # if YYSTACK_USE_ALLOCA
275 # define YYSTACK_ALLOC __builtin_alloca
276 # elif defined __BUILTIN_VA_ARG_INCR
277 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
279 # define YYSTACK_ALLOC __alloca
280 # elif defined _MSC_VER
281 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
282 # define alloca _alloca
284 # define YYSTACK_ALLOC alloca
285 # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
286 || defined __cplusplus || defined _MSC_VER)
287 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
296 # ifdef YYSTACK_ALLOC
297 /* Pacify GCC's `empty if-body' warning. */
298 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
299 # ifndef YYSTACK_ALLOC_MAXIMUM
300 /* The OS might guarantee only one guard page at the bottom of the stack,
301 and a page size can be as small as 4096 bytes. So we cannot safely
302 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
303 to allow for a few compiler-allocated temporary stack slots. */
304 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
307 # define YYSTACK_ALLOC YYMALLOC
308 # define YYSTACK_FREE YYFREE
309 # ifndef YYSTACK_ALLOC_MAXIMUM
310 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
312 # if (defined __cplusplus && ! defined _STDLIB_H \
313 && ! ((defined YYMALLOC || defined malloc) \
314 && (defined YYFREE || defined free)))
315 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
321 # define YYMALLOC malloc
322 # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
323 || defined __cplusplus || defined _MSC_VER)
324 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
329 # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
330 || defined __cplusplus || defined _MSC_VER)
331 void free (void *); /* INFRINGES ON USER NAME SPACE */
335 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
338 #if (! defined yyoverflow \
339 && (! defined __cplusplus \
340 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
342 /* A type that is properly aligned for any stack member. */
345 yytype_int16 yyss_alloc;
349 /* The size of the maximum gap between one aligned stack and the next. */
350 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
352 /* The size of an array large to enough to hold all stacks, each with
354 # define YYSTACK_BYTES(N) \
355 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
356 + YYSTACK_GAP_MAXIMUM)
358 /* Copy COUNT objects from FROM to TO. The source and destination do
361 # if defined __GNUC__ && 1 < __GNUC__
362 # define YYCOPY(To, From, Count) \
363 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
365 # define YYCOPY(To, From, Count) \
369 for (yyi = 0; yyi < (Count); yyi++) \
370 (To)[yyi] = (From)[yyi]; \
376 /* Relocate STACK from its old location to the new one. The
377 local variables YYSIZE and YYSTACKSIZE give the old and new number of
378 elements in the stack, and YYPTR gives the new location of the
379 stack. Advance YYPTR to a properly aligned location for the next
381 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
384 YYSIZE_T yynewbytes; \
385 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
386 Stack = &yyptr->Stack_alloc; \
387 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
388 yyptr += yynewbytes / sizeof (*yyptr); \
394 /* YYFINAL -- State number of the termination state. */
396 /* YYLAST -- Last index in YYTABLE. */
399 /* YYNTOKENS -- Number of terminals. */
401 /* YYNNTS -- Number of nonterminals. */
403 /* YYNRULES -- Number of rules. */
405 /* YYNRULES -- Number of states. */
408 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
410 #define YYMAXUTOK 277
412 #define YYTRANSLATE(YYX) \
413 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
415 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
416 static const yytype_uint8 yytranslate[] =
418 0, 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, 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, 1, 2, 3, 4,
444 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
445 15, 16, 17, 18, 19, 20, 21, 22
449 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
451 static const yytype_uint8 yyprhs[] =
453 0, 0, 3, 8, 9, 10, 19, 20, 27, 31,
457 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
458 static const yytype_int8 yyrhs[] =
460 24, 0, -1, 3, 17, 25, 18, -1, -1, -1,
461 22, 14, 26, 4, 27, 5, 15, 25, -1, -1,
462 13, 28, 6, 7, 22, 27, -1, 11, 28, 12,
463 -1, 28, 9, 28, -1, 28, 8, 28, -1, 10,
464 28, -1, 16, -1, 22, -1
467 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
468 static const yytype_uint8 yyrline[] =
470 0, 46, 46, 49, 50, 50, 53, 54, 57, 58,
475 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
476 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
477 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
478 static const char *const yytname[] =
480 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
481 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
482 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
483 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
484 "$@1", "option", "exp", 0
489 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
491 static const yytype_uint16 yytoknum[] =
493 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
494 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
499 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
500 static const yytype_uint8 yyr1[] =
502 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
506 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
507 static const yytype_uint8 yyr2[] =
509 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
513 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
514 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
515 means the default is an error. */
516 static const yytype_uint8 yydefact[] =
518 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
519 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
520 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
524 /* YYDEFGOTO[NTERM-NUM]. */
525 static const yytype_int8 yydefgoto[] =
530 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
532 #define YYPACT_NINF -16
533 static const yytype_int8 yypact[] =
535 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
536 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
537 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
541 /* YYPGOTO[NTERM-NUM]. */
542 static const yytype_int8 yypgoto[] =
544 -16, -16, 4, -16, -7, -9
547 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
548 positive, shift that token. If negative, reduce the rule which
549 number is the opposite. If zero, do what YYDEFACT says.
550 If YYTABLE_NINF, syntax error. */
551 #define YYTABLE_NINF -1
552 static const yytype_uint8 yytable[] =
554 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
555 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
556 10, 11, 18, 31, 0, 26, 24, 30, 29
559 static const yytype_int8 yycheck[] =
561 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
562 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
563 4, 13, 5, 30, -1, 7, 15, 22, 24
566 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
567 symbol of state STATE-NUM. */
568 static const yytype_uint8 yystos[] =
570 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
571 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
572 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
576 #define yyerrok (yyerrstatus = 0)
577 #define yyclearin (yychar = YYEMPTY)
581 #define YYACCEPT goto yyacceptlab
582 #define YYABORT goto yyabortlab
583 #define YYERROR goto yyerrorlab
586 /* Like YYERROR except do call yyerror. This remains here temporarily
587 to ease the transition to the new meaning of YYERROR, for GCC.
588 Once GCC version 2 has supplanted version 1, this can go. */
590 #define YYFAIL goto yyerrlab
592 #define YYRECOVERING() (!!yyerrstatus)
594 #define YYBACKUP(Token, Value) \
596 if (yychar == YYEMPTY && yylen == 1) \
600 yytoken = YYTRANSLATE (yychar); \
606 yyerror (YY_("syntax error: cannot back up")); \
613 #define YYERRCODE 256
616 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
617 If N is 0, then set CURRENT to the empty location which ends
618 the previous symbol: RHS[0] (always defined). */
620 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
621 #ifndef YYLLOC_DEFAULT
622 # define YYLLOC_DEFAULT(Current, Rhs, N) \
626 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
627 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
628 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
629 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
633 (Current).first_line = (Current).last_line = \
634 YYRHSLOC (Rhs, 0).last_line; \
635 (Current).first_column = (Current).last_column = \
636 YYRHSLOC (Rhs, 0).last_column; \
642 /* YY_LOCATION_PRINT -- Print the location on the stream.
643 This macro was not mandated originally: define only if we know
644 we won't break user code: when these are the locations we know. */
646 #ifndef YY_LOCATION_PRINT
647 # if YYLTYPE_IS_TRIVIAL
648 # define YY_LOCATION_PRINT(File, Loc) \
649 fprintf (File, "%d.%d-%d.%d", \
650 (Loc).first_line, (Loc).first_column, \
651 (Loc).last_line, (Loc).last_column)
653 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
658 /* YYLEX -- calling `yylex' with the right arguments. */
661 # define YYLEX yylex (YYLEX_PARAM)
663 # define YYLEX yylex ()
666 /* Enable debugging if requested. */
670 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
671 # define YYFPRINTF fprintf
674 # define YYDPRINTF(Args) \
680 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
684 YYFPRINTF (stderr, "%s ", Title); \
685 yy_symbol_print (stderr, \
687 YYFPRINTF (stderr, "\n"); \
692 /*--------------------------------.
693 | Print this symbol on YYOUTPUT. |
694 `--------------------------------*/
697 #if (defined __STDC__ || defined __C99__FUNC__ \
698 || defined __cplusplus || defined _MSC_VER)
700 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
703 yy_symbol_value_print (yyoutput, yytype, yyvaluep)
706 YYSTYPE const * const yyvaluep;
712 if (yytype < YYNTOKENS)
713 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
725 /*--------------------------------.
726 | Print this symbol on YYOUTPUT. |
727 `--------------------------------*/
729 #if (defined __STDC__ || defined __C99__FUNC__ \
730 || defined __cplusplus || defined _MSC_VER)
732 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
735 yy_symbol_print (yyoutput, yytype, yyvaluep)
738 YYSTYPE const * const yyvaluep;
741 if (yytype < YYNTOKENS)
742 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
744 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
746 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
747 YYFPRINTF (yyoutput, ")");
750 /*------------------------------------------------------------------.
751 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
753 `------------------------------------------------------------------*/
755 #if (defined __STDC__ || defined __C99__FUNC__ \
756 || defined __cplusplus || defined _MSC_VER)
758 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
761 yy_stack_print (yybottom, yytop)
762 yytype_int16 *yybottom;
766 YYFPRINTF (stderr, "Stack now");
767 for (; yybottom <= yytop; yybottom++)
769 int yybot = *yybottom;
770 YYFPRINTF (stderr, " %d", yybot);
772 YYFPRINTF (stderr, "\n");
775 # define YY_STACK_PRINT(Bottom, Top) \
778 yy_stack_print ((Bottom), (Top)); \
782 /*------------------------------------------------.
783 | Report that the YYRULE is going to be reduced. |
784 `------------------------------------------------*/
786 #if (defined __STDC__ || defined __C99__FUNC__ \
787 || defined __cplusplus || defined _MSC_VER)
789 yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
792 yy_reduce_print (yyvsp, yyrule)
797 int yynrhs = yyr2[yyrule];
799 unsigned long int yylno = yyrline[yyrule];
800 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
802 /* The symbols being reduced. */
803 for (yyi = 0; yyi < yynrhs; yyi++)
805 YYFPRINTF (stderr, " $%d = ", yyi + 1);
806 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
807 &(yyvsp[(yyi + 1) - (yynrhs)])
809 YYFPRINTF (stderr, "\n");
813 # define YY_REDUCE_PRINT(Rule) \
816 yy_reduce_print (yyvsp, Rule); \
819 /* Nonzero means print parse trace. It is left uninitialized so that
820 multiple parsers can coexist. */
823 # define YYDPRINTF(Args)
824 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
825 # define YY_STACK_PRINT(Bottom, Top)
826 # define YY_REDUCE_PRINT(Rule)
827 #endif /* !YYDEBUG */
830 /* YYINITDEPTH -- initial size of the parser's stacks. */
832 # define YYINITDEPTH 200
835 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
836 if the built-in stack extension method is used).
838 Do not make this value too large; the results are undefined if
839 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
840 evaluated with infinite-precision integer arithmetic. */
843 # define YYMAXDEPTH 10000
851 # if defined __GLIBC__ && defined _STRING_H
852 # define yystrlen strlen
854 /* Return the length of YYSTR. */
855 #if (defined __STDC__ || defined __C99__FUNC__ \
856 || defined __cplusplus || defined _MSC_VER)
858 yystrlen (const char *yystr)
866 for (yylen = 0; yystr[yylen]; yylen++)
874 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
875 # define yystpcpy stpcpy
877 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
879 #if (defined __STDC__ || defined __C99__FUNC__ \
880 || defined __cplusplus || defined _MSC_VER)
882 yystpcpy (char *yydest, const char *yysrc)
885 yystpcpy (yydest, yysrc)
891 const char *yys = yysrc;
893 while ((*yyd++ = *yys++) != '\0')
902 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
903 quotes and backslashes, so that it's suitable for yyerror. The
904 heuristic is that double-quoting is unnecessary unless the string
905 contains an apostrophe, a comma, or backslash (other than
906 backslash-backslash). YYSTR is taken from yytname. If YYRES is
907 null, do not copy; instead, return the length of what the result
910 yytnamerr (char *yyres, const char *yystr)
915 char const *yyp = yystr;
922 goto do_not_strip_quotes;
926 goto do_not_strip_quotes;
939 do_not_strip_quotes: ;
943 return yystrlen (yystr);
945 return yystpcpy (yyres, yystr) - yyres;
949 /* Copy into YYRESULT an error message about the unexpected token
950 YYCHAR while in state YYSTATE. Return the number of bytes copied,
951 including the terminating null byte. If YYRESULT is null, do not
952 copy anything; just return the number of bytes that would be
953 copied. As a special case, return 0 if an ordinary "syntax error"
954 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
957 yysyntax_error (char *yyresult, int yystate, int yychar)
959 int yyn = yypact[yystate];
961 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
965 int yytype = YYTRANSLATE (yychar);
966 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
967 YYSIZE_T yysize = yysize0;
969 int yysize_overflow = 0;
970 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
971 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
975 /* This is so xgettext sees the translatable formats that are
976 constructed on the fly. */
977 YY_("syntax error, unexpected %s");
978 YY_("syntax error, unexpected %s, expecting %s");
979 YY_("syntax error, unexpected %s, expecting %s or %s");
980 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
981 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
985 static char const yyunexpected[] = "syntax error, unexpected %s";
986 static char const yyexpecting[] = ", expecting %s";
987 static char const yyor[] = " or %s";
988 char yyformat[sizeof yyunexpected
989 + sizeof yyexpecting - 1
990 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
991 * (sizeof yyor - 1))];
992 char const *yyprefix = yyexpecting;
994 /* Start YYX at -YYN if negative to avoid negative indexes in
996 int yyxbegin = yyn < 0 ? -yyn : 0;
998 /* Stay within bounds of both yycheck and yytname. */
999 int yychecklim = YYLAST - yyn + 1;
1000 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1003 yyarg[0] = yytname[yytype];
1004 yyfmt = yystpcpy (yyformat, yyunexpected);
1006 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1007 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1009 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1013 yyformat[sizeof yyunexpected - 1] = '\0';
1016 yyarg[yycount++] = yytname[yyx];
1017 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1018 yysize_overflow |= (yysize1 < yysize);
1020 yyfmt = yystpcpy (yyfmt, yyprefix);
1024 yyf = YY_(yyformat);
1025 yysize1 = yysize + yystrlen (yyf);
1026 yysize_overflow |= (yysize1 < yysize);
1029 if (yysize_overflow)
1030 return YYSIZE_MAXIMUM;
1034 /* Avoid sprintf, as that infringes on the user's name space.
1035 Don't have undefined behavior even if the translation
1036 produced a string with the wrong number of "%s"s. */
1037 char *yyp = yyresult;
1039 while ((*yyp = *yyf) != '\0')
1041 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1043 yyp += yytnamerr (yyp, yyarg[yyi++]);
1056 #endif /* YYERROR_VERBOSE */
1059 /*-----------------------------------------------.
1060 | Release the memory associated to this symbol. |
1061 `-----------------------------------------------*/
1064 #if (defined __STDC__ || defined __C99__FUNC__ \
1065 || defined __cplusplus || defined _MSC_VER)
1067 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1070 yydestruct (yymsg, yytype, yyvaluep)
1080 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1090 /* Prevent warnings from -Wmissing-prototypes. */
1091 #ifdef YYPARSE_PARAM
1092 #if defined __STDC__ || defined __cplusplus
1093 int yyparse (void *YYPARSE_PARAM);
1097 #else /* ! YYPARSE_PARAM */
1098 #if defined __STDC__ || defined __cplusplus
1103 #endif /* ! YYPARSE_PARAM */
1106 /* The lookahead symbol. */
1109 /* The semantic value of the lookahead symbol. */
1112 /* Number of syntax errors so far. */
1117 /*-------------------------.
1118 | yyparse or yypush_parse. |
1119 `-------------------------*/
1121 #ifdef YYPARSE_PARAM
1122 #if (defined __STDC__ || defined __C99__FUNC__ \
1123 || defined __cplusplus || defined _MSC_VER)
1125 yyparse (void *YYPARSE_PARAM)
1128 yyparse (YYPARSE_PARAM)
1129 void *YYPARSE_PARAM;
1131 #else /* ! YYPARSE_PARAM */
1132 #if (defined __STDC__ || defined __C99__FUNC__ \
1133 || defined __cplusplus || defined _MSC_VER)
1146 /* Number of tokens to shift before error messages enabled. */
1149 /* The stacks and their tools:
1150 `yyss': related to states.
1151 `yyvs': related to semantic values.
1153 Refer to the stacks thru separate pointers, to allow yyoverflow
1154 to reallocate them elsewhere. */
1156 /* The state stack. */
1157 yytype_int16 yyssa[YYINITDEPTH];
1159 yytype_int16 *yyssp;
1161 /* The semantic value stack. */
1162 YYSTYPE yyvsa[YYINITDEPTH];
1166 YYSIZE_T yystacksize;
1170 /* Lookahead token as an internal (translated) token number. */
1172 /* The variables used to return semantic value and location from the
1177 /* Buffer for error messages, and its allocated size. */
1179 char *yymsg = yymsgbuf;
1180 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1183 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1185 /* The number of symbols on the RHS of the reduced rule.
1186 Keep to zero when no symbol should be popped. */
1192 yystacksize = YYINITDEPTH;
1194 YYDPRINTF ((stderr, "Starting parse\n"));
1199 yychar = YYEMPTY; /* Cause a token to be read. */
1201 /* Initialize stack pointers.
1202 Waste one element of value and location stack
1203 so that they stay on the same level as the state stack.
1204 The wasted elements are never initialized. */
1210 /*------------------------------------------------------------.
1211 | yynewstate -- Push a new state, which is found in yystate. |
1212 `------------------------------------------------------------*/
1214 /* In all cases, when you get here, the value and location stacks
1215 have just been pushed. So pushing a state here evens the stacks. */
1221 if (yyss + yystacksize - 1 <= yyssp)
1223 /* Get the current used size of the three stacks, in elements. */
1224 YYSIZE_T yysize = yyssp - yyss + 1;
1228 /* Give user a chance to reallocate the stack. Use copies of
1229 these so that the &'s don't force the real ones into
1231 YYSTYPE *yyvs1 = yyvs;
1232 yytype_int16 *yyss1 = yyss;
1234 /* Each stack pointer address is followed by the size of the
1235 data in use in that stack, in bytes. This used to be a
1236 conditional around just the two extra args, but that might
1237 be undefined if yyoverflow is a macro. */
1238 yyoverflow (YY_("memory exhausted"),
1239 &yyss1, yysize * sizeof (*yyssp),
1240 &yyvs1, yysize * sizeof (*yyvsp),
1246 #else /* no yyoverflow */
1247 # ifndef YYSTACK_RELOCATE
1248 goto yyexhaustedlab;
1250 /* Extend the stack our own way. */
1251 if (YYMAXDEPTH <= yystacksize)
1252 goto yyexhaustedlab;
1254 if (YYMAXDEPTH < yystacksize)
1255 yystacksize = YYMAXDEPTH;
1258 yytype_int16 *yyss1 = yyss;
1259 union yyalloc *yyptr =
1260 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1262 goto yyexhaustedlab;
1263 YYSTACK_RELOCATE (yyss_alloc, yyss);
1264 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1265 # undef YYSTACK_RELOCATE
1267 YYSTACK_FREE (yyss1);
1270 #endif /* no yyoverflow */
1272 yyssp = yyss + yysize - 1;
1273 yyvsp = yyvs + yysize - 1;
1275 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1276 (unsigned long int) yystacksize));
1278 if (yyss + yystacksize - 1 <= yyssp)
1282 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1284 if (yystate == YYFINAL)
1294 /* Do appropriate processing given the current state. Read a
1295 lookahead token if we need one and don't already have one. */
1297 /* First try to decide what to do without reference to lookahead token. */
1298 yyn = yypact[yystate];
1299 if (yyn == YYPACT_NINF)
1302 /* Not known => get a lookahead token if don't already have one. */
1304 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1305 if (yychar == YYEMPTY)
1307 YYDPRINTF ((stderr, "Reading a token: "));
1311 if (yychar <= YYEOF)
1313 yychar = yytoken = YYEOF;
1314 YYDPRINTF ((stderr, "Now at end of input.\n"));
1318 yytoken = YYTRANSLATE (yychar);
1319 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1322 /* If the proper action on seeing token YYTOKEN is to reduce or to
1323 detect an error, take that action. */
1325 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1330 if (yyn == 0 || yyn == YYTABLE_NINF)
1336 /* Count tokens shifted since error; after three, turn off error
1341 /* Shift the lookahead token. */
1342 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1344 /* Discard the shifted token. */
1353 /*-----------------------------------------------------------.
1354 | yydefault -- do the default action for the current state. |
1355 `-----------------------------------------------------------*/
1357 yyn = yydefact[yystate];
1363 /*-----------------------------.
1364 | yyreduce -- Do a reduction. |
1365 `-----------------------------*/
1367 /* yyn is the number of a rule to reduce with. */
1370 /* If YYLEN is nonzero, implement the default value of the action:
1373 Otherwise, the following line sets YYVAL to garbage.
1374 This behavior is undocumented and Bison
1375 users should not rely upon it. Assigning to YYVAL
1376 unconditionally makes the parser a bit smaller, and it avoids a
1377 GCC warning that YYVAL may be used uninitialized. */
1378 yyval = yyvsp[1-yylen];
1381 YY_REDUCE_PRINT (yyn);
1386 /* Line 1455 of yacc.c */
1387 #line 50 "parserPromela.yacc"
1388 { new_state((yyvsp[(1) - (2)].string), 1);}
1393 /* Line 1455 of yacc.c */
1394 #line 54 "parserPromela.yacc"
1395 { new_transition((yyvsp[(5) - (6)].string), (yyvsp[(2) - (6)].label));}
1400 /* Line 1455 of yacc.c */
1401 #line 57 "parserPromela.yacc"
1402 { (yyval.label) = (yyvsp[(2) - (3)].label); }
1407 /* Line 1455 of yacc.c */
1408 #line 58 "parserPromela.yacc"
1409 { (yyval.label) = new_label(0, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1414 /* Line 1455 of yacc.c */
1415 #line 59 "parserPromela.yacc"
1416 { (yyval.label) = new_label(1, (yyvsp[(1) - (3)].label), (yyvsp[(3) - (3)].label)); }
1421 /* Line 1455 of yacc.c */
1422 #line 60 "parserPromela.yacc"
1423 { (yyval.label) = new_label(2, (yyvsp[(2) - (2)].label)); }
1428 /* Line 1455 of yacc.c */
1429 #line 61 "parserPromela.yacc"
1430 { (yyval.label) = new_label(4); }
1435 /* Line 1455 of yacc.c */
1436 #line 62 "parserPromela.yacc"
1437 { (yyval.label) = new_label(3, (yyvsp[(1) - (1)].string)); }
1442 /* Line 1455 of yacc.c */
1443 #line 1444 "y.tab.c"
1446 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1450 YY_STACK_PRINT (yyss, yyssp);
1454 /* Now `shift' the result of the reduction. Determine what state
1455 that goes to, based on the state we popped back to and the rule
1456 number reduced by. */
1460 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1461 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1462 yystate = yytable[yystate];
1464 yystate = yydefgoto[yyn - YYNTOKENS];
1469 /*------------------------------------.
1470 | yyerrlab -- here on detecting error |
1471 `------------------------------------*/
1473 /* If not already recovering from an error, report this error. */
1477 #if ! YYERROR_VERBOSE
1478 yyerror (YY_("syntax error"));
1481 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
1482 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
1484 YYSIZE_T yyalloc = 2 * yysize;
1485 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
1486 yyalloc = YYSTACK_ALLOC_MAXIMUM;
1487 if (yymsg != yymsgbuf)
1488 YYSTACK_FREE (yymsg);
1489 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
1491 yymsg_alloc = yyalloc;
1495 yymsg_alloc = sizeof yymsgbuf;
1499 if (0 < yysize && yysize <= yymsg_alloc)
1501 (void) yysyntax_error (yymsg, yystate, yychar);
1506 yyerror (YY_("syntax error"));
1508 goto yyexhaustedlab;
1516 if (yyerrstatus == 3)
1518 /* If just tried and failed to reuse lookahead token after an
1519 error, discard it. */
1521 if (yychar <= YYEOF)
1523 /* Return failure if at end of input. */
1524 if (yychar == YYEOF)
1529 yydestruct ("Error: discarding",
1535 /* Else will try to reuse lookahead token after shifting the error
1540 /*---------------------------------------------------.
1541 | yyerrorlab -- error raised explicitly by YYERROR. |
1542 `---------------------------------------------------*/
1545 /* Pacify compilers like GCC when the user code never invokes
1546 YYERROR and the label yyerrorlab therefore never appears in user
1548 if (/*CONSTCOND*/ 0)
1551 /* Do not reclaim the symbols of the rule which action triggered
1555 YY_STACK_PRINT (yyss, yyssp);
1560 /*-------------------------------------------------------------.
1561 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1562 `-------------------------------------------------------------*/
1564 yyerrstatus = 3; /* Each real token shifted decrements this. */
1568 yyn = yypact[yystate];
1569 if (yyn != YYPACT_NINF)
1572 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1580 /* Pop the current state because it cannot handle the error token. */
1585 yydestruct ("Error: popping",
1586 yystos[yystate], yyvsp);
1589 YY_STACK_PRINT (yyss, yyssp);
1595 /* Shift the error token. */
1596 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1602 /*-------------------------------------.
1603 | yyacceptlab -- YYACCEPT comes here. |
1604 `-------------------------------------*/
1609 /*-----------------------------------.
1610 | yyabortlab -- YYABORT comes here. |
1611 `-----------------------------------*/
1616 #if !defined(yyoverflow) || YYERROR_VERBOSE
1617 /*-------------------------------------------------.
1618 | yyexhaustedlab -- memory exhaustion comes here. |
1619 `-------------------------------------------------*/
1621 yyerror (YY_("memory exhausted"));
1627 if (yychar != YYEMPTY)
1628 yydestruct ("Cleanup: discarding lookahead",
1630 /* Do not reclaim the symbols of the rule which action triggered
1631 this YYABORT or YYACCEPT. */
1633 YY_STACK_PRINT (yyss, yyssp);
1634 while (yyssp != yyss)
1636 yydestruct ("Cleanup: popping",
1637 yystos[*yyssp], yyvsp);
1642 YYSTACK_FREE (yyss);
1645 if (yymsg != yymsgbuf)
1646 YYSTACK_FREE (yymsg);
1648 /* Make sure YYID is used. */
1649 return YYID (yyresult);
1654 /* Line 1675 of yacc.c */
1655 #line 65 "parserPromela.yacc"
1658 int yyerror(char *s) {
1659 fprintf(stderr, "%s\n", s);