1 /* A Bison parser, made by GNU Bison 3.0.2. */
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 "3.0.2"
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 yydebug xbt_automaton_parser_debug
67 #define yynerrs xbt_automaton_parser_nerrs
69 #define yylval xbt_automaton_parser_lval
70 #define yychar xbt_automaton_parser_char
72 /* Copy the first part of user declarations. */
73 #line 7 "parserPromela.yacc" /* yacc.c:339 */
76 #include "automaton_lexer.yy.c"
77 #include <xbt/automaton.h>
79 void yyerror(const char *s);
82 #line 83 "parserPromela.tab.cacc" /* yacc.c:339 */
85 # if defined __cplusplus && 201103L <= __cplusplus
86 # define YY_NULLPTR nullptr
92 /* Enabling verbose error messages. */
93 #ifdef YYERROR_VERBOSE
94 # undef YYERROR_VERBOSE
95 # define YYERROR_VERBOSE 1
97 # define YYERROR_VERBOSE 0
100 /* In a future release of Bison, this section will be replaced
101 by #include "parserPromela.tab.hacc". */
102 #ifndef YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
103 # define YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
109 extern int xbt_automaton_parser_debug;
141 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
142 typedef union YYSTYPE YYSTYPE;
145 #line 16 "parserPromela.yacc" /* yacc.c:355 */
150 xbt_automaton_exp_label_t label;
152 #line 153 "parserPromela.tab.cacc" /* yacc.c:355 */
154 # define YYSTYPE_IS_TRIVIAL 1
155 # define YYSTYPE_IS_DECLARED 1
159 extern YYSTYPE xbt_automaton_parser_lval;
161 int xbt_automaton_parser_parse (void);
163 #endif /* !YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED */
165 /* Copy the second part of user declarations. */
167 #line 168 "parserPromela.tab.cacc" /* yacc.c:358 */
174 typedef YYTYPE_UINT8 yytype_uint8;
176 typedef unsigned char yytype_uint8;
180 typedef YYTYPE_INT8 yytype_int8;
182 typedef signed char yytype_int8;
186 typedef YYTYPE_UINT16 yytype_uint16;
188 typedef unsigned short int yytype_uint16;
192 typedef YYTYPE_INT16 yytype_int16;
194 typedef short int yytype_int16;
198 # ifdef __SIZE_TYPE__
199 # define YYSIZE_T __SIZE_TYPE__
200 # elif defined size_t
201 # define YYSIZE_T size_t
202 # elif ! defined YYSIZE_T
203 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
204 # define YYSIZE_T size_t
206 # define YYSIZE_T unsigned int
210 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
213 # if defined YYENABLE_NLS && YYENABLE_NLS
215 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
216 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
220 # define YY_(Msgid) Msgid
225 # if (defined __GNUC__ \
226 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
227 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
228 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
230 # define YY_ATTRIBUTE(Spec) /* empty */
234 #ifndef YY_ATTRIBUTE_PURE
235 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
238 #ifndef YY_ATTRIBUTE_UNUSED
239 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
242 #if !defined _Noreturn \
243 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
244 # if defined _MSC_VER && 1200 <= _MSC_VER
245 # define _Noreturn __declspec (noreturn)
247 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
251 /* Suppress unused-variable warnings by "using" E. */
252 #if ! defined lint || defined __GNUC__
253 # define YYUSE(E) ((void) (E))
255 # define YYUSE(E) /* empty */
258 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
259 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
260 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
261 _Pragma ("GCC diagnostic push") \
262 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
263 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
264 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
265 _Pragma ("GCC diagnostic pop")
267 # define YY_INITIAL_VALUE(Value) Value
269 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
270 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
271 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
273 #ifndef YY_INITIAL_VALUE
274 # define YY_INITIAL_VALUE(Value) /* Nothing. */
278 #if ! defined yyoverflow || YYERROR_VERBOSE
280 /* The parser invokes alloca or malloc; define the necessary symbols. */
282 # ifdef YYSTACK_USE_ALLOCA
283 # if YYSTACK_USE_ALLOCA
285 # define YYSTACK_ALLOC __builtin_alloca
286 # elif defined __BUILTIN_VA_ARG_INCR
287 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
289 # define YYSTACK_ALLOC __alloca
290 # elif defined _MSC_VER
291 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
292 # define alloca _alloca
294 # define YYSTACK_ALLOC alloca
295 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
296 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
297 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
298 # ifndef EXIT_SUCCESS
299 # define EXIT_SUCCESS 0
306 # ifdef YYSTACK_ALLOC
307 /* Pacify GCC's 'empty if-body' warning. */
308 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
309 # ifndef YYSTACK_ALLOC_MAXIMUM
310 /* The OS might guarantee only one guard page at the bottom of the stack,
311 and a page size can be as small as 4096 bytes. So we cannot safely
312 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
313 to allow for a few compiler-allocated temporary stack slots. */
314 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
317 # define YYSTACK_ALLOC YYMALLOC
318 # define YYSTACK_FREE YYFREE
319 # ifndef YYSTACK_ALLOC_MAXIMUM
320 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
322 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
323 && ! ((defined YYMALLOC || defined malloc) \
324 && (defined YYFREE || defined free)))
325 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
326 # ifndef EXIT_SUCCESS
327 # define EXIT_SUCCESS 0
331 # define YYMALLOC malloc
332 # if ! defined malloc && ! defined EXIT_SUCCESS
333 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
338 # if ! defined free && ! defined EXIT_SUCCESS
339 void free (void *); /* INFRINGES ON USER NAME SPACE */
343 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
346 #if (! defined yyoverflow \
347 && (! defined __cplusplus \
348 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
350 /* A type that is properly aligned for any stack member. */
353 yytype_int16 yyss_alloc;
357 /* The size of the maximum gap between one aligned stack and the next. */
358 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
360 /* The size of an array large to enough to hold all stacks, each with
362 # define YYSTACK_BYTES(N) \
363 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
364 + YYSTACK_GAP_MAXIMUM)
366 # define YYCOPY_NEEDED 1
368 /* Relocate STACK from its old location to the new one. The
369 local variables YYSIZE and YYSTACKSIZE give the old and new number of
370 elements in the stack, and YYPTR gives the new location of the
371 stack. Advance YYPTR to a properly aligned location for the next
373 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
376 YYSIZE_T yynewbytes; \
377 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
378 Stack = &yyptr->Stack_alloc; \
379 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
380 yyptr += yynewbytes / sizeof (*yyptr); \
386 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
387 /* Copy COUNT objects from SRC to DST. The source and destination do
390 # if defined __GNUC__ && 1 < __GNUC__
391 # define YYCOPY(Dst, Src, Count) \
392 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
394 # define YYCOPY(Dst, Src, Count) \
398 for (yyi = 0; yyi < (Count); yyi++) \
399 (Dst)[yyi] = (Src)[yyi]; \
404 #endif /* !YYCOPY_NEEDED */
406 /* YYFINAL -- State number of the termination state. */
408 /* YYLAST -- Last index in YYTABLE. */
411 /* YYNTOKENS -- Number of terminals. */
413 /* YYNNTS -- Number of nonterminals. */
415 /* YYNRULES -- Number of rules. */
417 /* YYNSTATES -- Number of states. */
420 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
421 by yylex, with out-of-bounds checking. */
423 #define YYMAXUTOK 277
425 #define YYTRANSLATE(YYX) \
426 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
428 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
429 as returned by yylex, without out-of-bounds checking. */
430 static const yytype_uint8 yytranslate[] =
432 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
433 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
434 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
435 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
436 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
437 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
438 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
439 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 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, 1, 2, 3, 4,
458 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
459 15, 16, 17, 18, 19, 20, 21, 22
463 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
464 static const yytype_uint8 yyrline[] =
466 0, 53, 53, 56, 57, 57, 60, 61, 64, 65,
471 #if YYDEBUG || YYERROR_VERBOSE || 0
472 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
473 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
474 static const char *const yytname[] =
476 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
477 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
478 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
479 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
480 "$@1", "option", "exp", YY_NULLPTR
485 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
486 (internal) symbol number NUM (which must be that of a token). */
487 static const yytype_uint16 yytoknum[] =
489 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
490 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
495 #define YYPACT_NINF -16
497 #define yypact_value_is_default(Yystate) \
498 (!!((Yystate) == (-16)))
500 #define YYTABLE_NINF -1
502 #define yytable_value_is_error(Yytable_value) \
505 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
507 static const yytype_int8 yypact[] =
509 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
510 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
511 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
515 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
516 Performed when YYTABLE does not 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 /* YYPGOTO[NTERM-NUM]. */
527 static const yytype_int8 yypgoto[] =
529 -16, -16, 4, -16, -7, -9
532 /* YYDEFGOTO[NTERM-NUM]. */
533 static const yytype_int8 yydefgoto[] =
538 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
539 positive, shift that token. If negative, reduce the rule whose
540 number is the opposite. If YYTABLE_NINF, syntax error. */
541 static const yytype_uint8 yytable[] =
543 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
544 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
545 10, 11, 18, 31, 0, 26, 24, 30, 29
548 static const yytype_int8 yycheck[] =
550 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
551 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
552 4, 13, 5, 30, -1, 7, 15, 22, 24
555 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
556 symbol of state STATE-NUM. */
557 static const yytype_uint8 yystos[] =
559 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
560 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
561 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
565 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
566 static const yytype_uint8 yyr1[] =
568 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
572 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
573 static const yytype_uint8 yyr2[] =
575 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
580 #define yyerrok (yyerrstatus = 0)
581 #define yyclearin (yychar = YYEMPTY)
585 #define YYACCEPT goto yyacceptlab
586 #define YYABORT goto yyabortlab
587 #define YYERROR goto yyerrorlab
590 #define YYRECOVERING() (!!yyerrstatus)
592 #define YYBACKUP(Token, Value) \
594 if (yychar == YYEMPTY) \
598 YYPOPSTACK (yylen); \
604 yyerror (YY_("syntax error: cannot back up")); \
609 /* Error token number */
611 #define YYERRCODE 256
615 /* Enable debugging if requested. */
619 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
620 # define YYFPRINTF fprintf
623 # define YYDPRINTF(Args) \
629 /* This macro is provided for backward compatibility. */
630 #ifndef YY_LOCATION_PRINT
631 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
635 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
639 YYFPRINTF (stderr, "%s ", Title); \
640 yy_symbol_print (stderr, \
642 YYFPRINTF (stderr, "\n"); \
647 /*----------------------------------------.
648 | Print this symbol's value on YYOUTPUT. |
649 `----------------------------------------*/
652 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
654 FILE *yyo = yyoutput;
659 if (yytype < YYNTOKENS)
660 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
666 /*--------------------------------.
667 | Print this symbol on YYOUTPUT. |
668 `--------------------------------*/
671 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
673 YYFPRINTF (yyoutput, "%s %s (",
674 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
676 yy_symbol_value_print (yyoutput, yytype, yyvaluep);
677 YYFPRINTF (yyoutput, ")");
680 /*------------------------------------------------------------------.
681 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
683 `------------------------------------------------------------------*/
686 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
688 YYFPRINTF (stderr, "Stack now");
689 for (; yybottom <= yytop; yybottom++)
691 int yybot = *yybottom;
692 YYFPRINTF (stderr, " %d", yybot);
694 YYFPRINTF (stderr, "\n");
697 # define YY_STACK_PRINT(Bottom, Top) \
700 yy_stack_print ((Bottom), (Top)); \
704 /*------------------------------------------------.
705 | Report that the YYRULE is going to be reduced. |
706 `------------------------------------------------*/
709 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
711 unsigned long int yylno = yyrline[yyrule];
712 int yynrhs = yyr2[yyrule];
714 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
716 /* The symbols being reduced. */
717 for (yyi = 0; yyi < yynrhs; yyi++)
719 YYFPRINTF (stderr, " $%d = ", yyi + 1);
720 yy_symbol_print (stderr,
721 yystos[yyssp[yyi + 1 - yynrhs]],
722 &(yyvsp[(yyi + 1) - (yynrhs)])
724 YYFPRINTF (stderr, "\n");
728 # define YY_REDUCE_PRINT(Rule) \
731 yy_reduce_print (yyssp, yyvsp, Rule); \
734 /* Nonzero means print parse trace. It is left uninitialized so that
735 multiple parsers can coexist. */
738 # define YYDPRINTF(Args)
739 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
740 # define YY_STACK_PRINT(Bottom, Top)
741 # define YY_REDUCE_PRINT(Rule)
742 #endif /* !YYDEBUG */
745 /* YYINITDEPTH -- initial size of the parser's stacks. */
747 # define YYINITDEPTH 200
750 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
751 if the built-in stack extension method is used).
753 Do not make this value too large; the results are undefined if
754 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
755 evaluated with infinite-precision integer arithmetic. */
758 # define YYMAXDEPTH 10000
765 # if defined __GLIBC__ && defined _STRING_H
766 # define yystrlen strlen
768 /* Return the length of YYSTR. */
770 yystrlen (const char *yystr)
773 for (yylen = 0; yystr[yylen]; yylen++)
781 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
782 # define yystpcpy stpcpy
784 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
787 yystpcpy (char *yydest, const char *yysrc)
790 const char *yys = yysrc;
792 while ((*yyd++ = *yys++) != '\0')
801 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
802 quotes and backslashes, so that it's suitable for yyerror. The
803 heuristic is that double-quoting is unnecessary unless the string
804 contains an apostrophe, a comma, or backslash (other than
805 backslash-backslash). YYSTR is taken from yytname. If YYRES is
806 null, do not copy; instead, return the length of what the result
809 yytnamerr (char *yyres, const char *yystr)
814 char const *yyp = yystr;
821 goto do_not_strip_quotes;
825 goto do_not_strip_quotes;
838 do_not_strip_quotes: ;
842 return yystrlen (yystr);
844 return yystpcpy (yyres, yystr) - yyres;
848 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
849 about the unexpected token YYTOKEN for the state stack whose top is
852 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
853 not large enough to hold the message. In that case, also set
854 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
855 required number of bytes is too large to store. */
857 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
858 yytype_int16 *yyssp, int yytoken)
860 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
861 YYSIZE_T yysize = yysize0;
862 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
863 /* Internationalized format string. */
864 const char *yyformat = YY_NULLPTR;
865 /* Arguments of yyformat. */
866 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
867 /* Number of reported tokens (one for the "unexpected", one per
871 /* There are many possibilities here to consider:
872 - If this state is a consistent state with a default action, then
873 the only way this function was invoked is if the default action
874 is an error action. In that case, don't check for expected
875 tokens because there are none.
876 - The only way there can be no lookahead present (in yychar) is if
877 this state is a consistent state with a default action. Thus,
878 detecting the absence of a lookahead is sufficient to determine
879 that there is no unexpected or expected token to report. In that
880 case, just report a simple "syntax error".
881 - Don't assume there isn't a lookahead just because this state is a
882 consistent state with a default action. There might have been a
883 previous inconsistent state, consistent state with a non-default
884 action, or user semantic action that manipulated yychar.
885 - Of course, the expected token list depends on states to have
886 correct lookahead information, and it depends on the parser not
887 to perform extra reductions after fetching a lookahead from the
888 scanner and before detecting a syntax error. Thus, state merging
889 (from LALR or IELR) and default reductions corrupt the expected
890 token list. However, the list is correct for canonical LR with
891 one exception: it will still contain any token that will not be
892 accepted due to an error action in a later state.
894 if (yytoken != YYEMPTY)
896 int yyn = yypact[*yyssp];
897 yyarg[yycount++] = yytname[yytoken];
898 if (!yypact_value_is_default (yyn))
900 /* Start YYX at -YYN if negative to avoid negative indexes in
901 YYCHECK. In other words, skip the first -YYN actions for
902 this state because they are default actions. */
903 int yyxbegin = yyn < 0 ? -yyn : 0;
904 /* Stay within bounds of both yycheck and yytname. */
905 int yychecklim = YYLAST - yyn + 1;
906 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
909 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
910 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
911 && !yytable_value_is_error (yytable[yyx + yyn]))
913 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
919 yyarg[yycount++] = yytname[yyx];
921 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
922 if (! (yysize <= yysize1
923 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
933 # define YYCASE_(N, S) \
937 YYCASE_(0, YY_("syntax error"));
938 YYCASE_(1, YY_("syntax error, unexpected %s"));
939 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
940 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
941 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
942 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
947 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
948 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
953 if (*yymsg_alloc < yysize)
955 *yymsg_alloc = 2 * yysize;
956 if (! (yysize <= *yymsg_alloc
957 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
958 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
962 /* Avoid sprintf, as that infringes on the user's name space.
963 Don't have undefined behavior even if the translation
964 produced a string with the wrong number of "%s"s. */
968 while ((*yyp = *yyformat) != '\0')
969 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
971 yyp += yytnamerr (yyp, yyarg[yyi++]);
982 #endif /* YYERROR_VERBOSE */
984 /*-----------------------------------------------.
985 | Release the memory associated to this symbol. |
986 `-----------------------------------------------*/
989 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
994 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
996 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
998 YY_IGNORE_MAYBE_UNINITIALIZED_END
1004 /* The lookahead symbol. */
1007 /* The semantic value of the lookahead symbol. */
1009 /* Number of syntax errors so far. */
1021 /* Number of tokens to shift before error messages enabled. */
1024 /* The stacks and their tools:
1025 'yyss': related to states.
1026 'yyvs': related to semantic values.
1028 Refer to the stacks through separate pointers, to allow yyoverflow
1029 to reallocate them elsewhere. */
1031 /* The state stack. */
1032 yytype_int16 yyssa[YYINITDEPTH];
1034 yytype_int16 *yyssp;
1036 /* The semantic value stack. */
1037 YYSTYPE yyvsa[YYINITDEPTH];
1041 YYSIZE_T yystacksize;
1045 /* Lookahead token as an internal (translated) token number. */
1047 /* The variables used to return semantic value and location from the
1052 /* Buffer for error messages, and its allocated size. */
1054 char *yymsg = yymsgbuf;
1055 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1058 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1060 /* The number of symbols on the RHS of the reduced rule.
1061 Keep to zero when no symbol should be popped. */
1064 yyssp = yyss = yyssa;
1065 yyvsp = yyvs = yyvsa;
1066 yystacksize = YYINITDEPTH;
1068 YYDPRINTF ((stderr, "Starting parse\n"));
1073 yychar = YYEMPTY; /* Cause a token to be read. */
1076 /*------------------------------------------------------------.
1077 | yynewstate -- Push a new state, which is found in yystate. |
1078 `------------------------------------------------------------*/
1080 /* In all cases, when you get here, the value and location stacks
1081 have just been pushed. So pushing a state here evens the stacks. */
1087 if (yyss + yystacksize - 1 <= yyssp)
1089 /* Get the current used size of the three stacks, in elements. */
1090 YYSIZE_T yysize = yyssp - yyss + 1;
1094 /* Give user a chance to reallocate the stack. Use copies of
1095 these so that the &'s don't force the real ones into
1097 YYSTYPE *yyvs1 = yyvs;
1098 yytype_int16 *yyss1 = yyss;
1100 /* Each stack pointer address is followed by the size of the
1101 data in use in that stack, in bytes. This used to be a
1102 conditional around just the two extra args, but that might
1103 be undefined if yyoverflow is a macro. */
1104 yyoverflow (YY_("memory exhausted"),
1105 &yyss1, yysize * sizeof (*yyssp),
1106 &yyvs1, yysize * sizeof (*yyvsp),
1112 #else /* no yyoverflow */
1113 # ifndef YYSTACK_RELOCATE
1114 goto yyexhaustedlab;
1116 /* Extend the stack our own way. */
1117 if (YYMAXDEPTH <= yystacksize)
1118 goto yyexhaustedlab;
1120 if (YYMAXDEPTH < yystacksize)
1121 yystacksize = YYMAXDEPTH;
1124 yytype_int16 *yyss1 = yyss;
1125 union yyalloc *yyptr =
1126 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1128 goto yyexhaustedlab;
1129 YYSTACK_RELOCATE (yyss_alloc, yyss);
1130 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1131 # undef YYSTACK_RELOCATE
1133 YYSTACK_FREE (yyss1);
1136 #endif /* no yyoverflow */
1138 yyssp = yyss + yysize - 1;
1139 yyvsp = yyvs + yysize - 1;
1141 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1142 (unsigned long int) yystacksize));
1144 if (yyss + yystacksize - 1 <= yyssp)
1148 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1150 if (yystate == YYFINAL)
1160 /* Do appropriate processing given the current state. Read a
1161 lookahead token if we need one and don't already have one. */
1163 /* First try to decide what to do without reference to lookahead token. */
1164 yyn = yypact[yystate];
1165 if (yypact_value_is_default (yyn))
1168 /* Not known => get a lookahead token if don't already have one. */
1170 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1171 if (yychar == YYEMPTY)
1173 YYDPRINTF ((stderr, "Reading a token: "));
1177 if (yychar <= YYEOF)
1179 yychar = yytoken = YYEOF;
1180 YYDPRINTF ((stderr, "Now at end of input.\n"));
1184 yytoken = YYTRANSLATE (yychar);
1185 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1188 /* If the proper action on seeing token YYTOKEN is to reduce or to
1189 detect an error, take that action. */
1191 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1196 if (yytable_value_is_error (yyn))
1202 /* Count tokens shifted since error; after three, turn off error
1207 /* Shift the lookahead token. */
1208 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1210 /* Discard the shifted token. */
1214 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1216 YY_IGNORE_MAYBE_UNINITIALIZED_END
1221 /*-----------------------------------------------------------.
1222 | yydefault -- do the default action for the current state. |
1223 `-----------------------------------------------------------*/
1225 yyn = yydefact[yystate];
1231 /*-----------------------------.
1232 | yyreduce -- Do a reduction. |
1233 `-----------------------------*/
1235 /* yyn is the number of a rule to reduce with. */
1238 /* If YYLEN is nonzero, implement the default value of the action:
1241 Otherwise, the following line sets YYVAL to garbage.
1242 This behavior is undocumented and Bison
1243 users should not rely upon it. Assigning to YYVAL
1244 unconditionally makes the parser a bit smaller, and it avoids a
1245 GCC warning that YYVAL may be used uninitialized. */
1246 yyval = yyvsp[1-yylen];
1249 YY_REDUCE_PRINT (yyn);
1253 #line 57 "parserPromela.yacc" /* yacc.c:1646 */
1254 { new_state((yyvsp[-1].string), 1);}
1255 #line 1256 "parserPromela.tab.cacc" /* yacc.c:1646 */
1259 #line 61 "parserPromela.yacc" /* yacc.c:1646 */
1260 { new_transition((yyvsp[-1].string), (yyvsp[-4].label));}
1261 #line 1262 "parserPromela.tab.cacc" /* yacc.c:1646 */
1265 #line 64 "parserPromela.yacc" /* yacc.c:1646 */
1266 { (yyval.label) = (yyvsp[-1].label); }
1267 #line 1268 "parserPromela.tab.cacc" /* yacc.c:1646 */
1271 #line 65 "parserPromela.yacc" /* yacc.c:1646 */
1272 { (yyval.label) = new_label(0, (yyvsp[-2].label), (yyvsp[0].label)); }
1273 #line 1274 "parserPromela.tab.cacc" /* yacc.c:1646 */
1277 #line 66 "parserPromela.yacc" /* yacc.c:1646 */
1278 { (yyval.label) = new_label(1, (yyvsp[-2].label), (yyvsp[0].label)); }
1279 #line 1280 "parserPromela.tab.cacc" /* yacc.c:1646 */
1283 #line 67 "parserPromela.yacc" /* yacc.c:1646 */
1284 { (yyval.label) = new_label(2, (yyvsp[0].label)); }
1285 #line 1286 "parserPromela.tab.cacc" /* yacc.c:1646 */
1289 #line 68 "parserPromela.yacc" /* yacc.c:1646 */
1290 { (yyval.label) = new_label(4); }
1291 #line 1292 "parserPromela.tab.cacc" /* yacc.c:1646 */
1295 #line 69 "parserPromela.yacc" /* yacc.c:1646 */
1296 { (yyval.label) = new_label(3, (yyvsp[0].string)); }
1297 #line 1298 "parserPromela.tab.cacc" /* yacc.c:1646 */
1301 #line 1302 "parserPromela.tab.cacc" /* yacc.c:1646 */
1304 /* User semantic actions sometimes alter yychar, and that requires
1305 that yytoken be updated with the new translation. We take the
1306 approach of translating immediately before every use of yytoken.
1307 One alternative is translating here after every semantic action,
1308 but that translation would be missed if the semantic action invokes
1309 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1310 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1311 incorrect destructor might then be invoked immediately. In the
1312 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1313 to an incorrect destructor call or verbose syntax error message
1314 before the lookahead is translated. */
1315 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1319 YY_STACK_PRINT (yyss, yyssp);
1323 /* Now 'shift' the result of the reduction. Determine what state
1324 that goes to, based on the state we popped back to and the rule
1325 number reduced by. */
1329 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1330 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1331 yystate = yytable[yystate];
1333 yystate = yydefgoto[yyn - YYNTOKENS];
1338 /*--------------------------------------.
1339 | yyerrlab -- here on detecting error. |
1340 `--------------------------------------*/
1342 /* Make sure we have latest lookahead translation. See comments at
1343 user semantic actions for why this is necessary. */
1344 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1346 /* If not already recovering from an error, report this error. */
1350 #if ! YYERROR_VERBOSE
1351 yyerror (YY_("syntax error"));
1353 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1356 char const *yymsgp = YY_("syntax error");
1357 int yysyntax_error_status;
1358 yysyntax_error_status = YYSYNTAX_ERROR;
1359 if (yysyntax_error_status == 0)
1361 else if (yysyntax_error_status == 1)
1363 if (yymsg != yymsgbuf)
1364 YYSTACK_FREE (yymsg);
1365 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1369 yymsg_alloc = sizeof yymsgbuf;
1370 yysyntax_error_status = 2;
1374 yysyntax_error_status = YYSYNTAX_ERROR;
1379 if (yysyntax_error_status == 2)
1380 goto yyexhaustedlab;
1382 # undef YYSYNTAX_ERROR
1388 if (yyerrstatus == 3)
1390 /* If just tried and failed to reuse lookahead token after an
1391 error, discard it. */
1393 if (yychar <= YYEOF)
1395 /* Return failure if at end of input. */
1396 if (yychar == YYEOF)
1401 yydestruct ("Error: discarding",
1407 /* Else will try to reuse lookahead token after shifting the error
1412 /*---------------------------------------------------.
1413 | yyerrorlab -- error raised explicitly by YYERROR. |
1414 `---------------------------------------------------*/
1417 /* Pacify compilers like GCC when the user code never invokes
1418 YYERROR and the label yyerrorlab therefore never appears in user
1420 if (/*CONSTCOND*/ 0)
1423 /* Do not reclaim the symbols of the rule whose action triggered
1427 YY_STACK_PRINT (yyss, yyssp);
1432 /*-------------------------------------------------------------.
1433 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1434 `-------------------------------------------------------------*/
1436 yyerrstatus = 3; /* Each real token shifted decrements this. */
1440 yyn = yypact[yystate];
1441 if (!yypact_value_is_default (yyn))
1444 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1452 /* Pop the current state because it cannot handle the error token. */
1457 yydestruct ("Error: popping",
1458 yystos[yystate], yyvsp);
1461 YY_STACK_PRINT (yyss, yyssp);
1464 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1466 YY_IGNORE_MAYBE_UNINITIALIZED_END
1469 /* Shift the error token. */
1470 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1476 /*-------------------------------------.
1477 | yyacceptlab -- YYACCEPT comes here. |
1478 `-------------------------------------*/
1483 /*-----------------------------------.
1484 | yyabortlab -- YYABORT comes here. |
1485 `-----------------------------------*/
1490 #if !defined yyoverflow || YYERROR_VERBOSE
1491 /*-------------------------------------------------.
1492 | yyexhaustedlab -- memory exhaustion comes here. |
1493 `-------------------------------------------------*/
1495 yyerror (YY_("memory exhausted"));
1501 if (yychar != YYEMPTY)
1503 /* Make sure we have latest lookahead translation. See comments at
1504 user semantic actions for why this is necessary. */
1505 yytoken = YYTRANSLATE (yychar);
1506 yydestruct ("Cleanup: discarding lookahead",
1509 /* Do not reclaim the symbols of the rule whose action triggered
1510 this YYABORT or YYACCEPT. */
1512 YY_STACK_PRINT (yyss, yyssp);
1513 while (yyssp != yyss)
1515 yydestruct ("Cleanup: popping",
1516 yystos[*yyssp], yyvsp);
1521 YYSTACK_FREE (yyss);
1524 if (yymsg != yymsgbuf)
1525 YYSTACK_FREE (yymsg);
1529 #line 72 "parserPromela.yacc" /* yacc.c:1906 */
1534 void yyerror(const char *s){
1535 fprintf (stderr, "%s\n", s);