1 /* A Bison parser, made by GNU Bison 3.4.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21 /* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
31 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
34 /* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
37 /* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
44 /* Undocumented macros, especially those whose name start with YY_,
45 are private implementation details. Do not rely on them. */
47 /* Identify Bison output. */
51 #define YYBISON_VERSION "3.4.2"
54 #define YYSKELETON_NAME "yacc.c"
66 /* Substitute the variable and function names. */
67 #define yyparse xbt_automaton_parser_parse
68 #define yylex xbt_automaton_parser_lex
69 #define yyerror xbt_automaton_parser_error
70 #define yydebug xbt_automaton_parser_debug
71 #define yynerrs xbt_automaton_parser_nerrs
73 #define yylval xbt_automaton_parser_lval
74 #define yychar xbt_automaton_parser_char
76 /* First part of user prologue. */
77 #line 7 "parserPromela.yacc"
79 #include "simgrid/config.h"
81 #define YY_NO_UNISTD_H /* hello Windows */
84 #include "automaton_lexer.yy.c"
85 #include <xbt/automaton.h>
87 void yyerror(const char *s);
89 static void new_state(char* id, int src);
90 static void new_transition(char* id, xbt_automaton_exp_label_t label);
93 #line 94 "parserPromela.tab.cacc"
96 # if defined __cplusplus
97 # if 201103L <= __cplusplus
98 # define YY_NULLPTR nullptr
100 # define YY_NULLPTR 0
103 # define YY_NULLPTR ((void*)0)
107 /* Enabling verbose error messages. */
108 #ifdef YYERROR_VERBOSE
109 # undef YYERROR_VERBOSE
110 # define YYERROR_VERBOSE 1
112 # define YYERROR_VERBOSE 0
115 /* Use api.header.include to #include this header
116 instead of duplicating it here. */
117 #ifndef YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
118 # define YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED
124 extern int xbt_automaton_parser_debug;
156 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
159 #line 23 "parserPromela.yacc"
164 xbt_automaton_exp_label_t label;
166 #line 167 "parserPromela.tab.cacc"
169 typedef union YYSTYPE YYSTYPE;
170 # define YYSTYPE_IS_TRIVIAL 1
171 # define YYSTYPE_IS_DECLARED 1
175 extern YYSTYPE xbt_automaton_parser_lval;
177 int xbt_automaton_parser_parse (void);
179 #endif /* !YY_XBT_AUTOMATON_PARSER_PARSERPROMELA_TAB_HACC_INCLUDED */
188 typedef YYTYPE_UINT8 yytype_uint8;
190 typedef unsigned char yytype_uint8;
194 typedef YYTYPE_INT8 yytype_int8;
196 typedef signed char yytype_int8;
200 typedef YYTYPE_UINT16 yytype_uint16;
202 typedef unsigned short yytype_uint16;
206 typedef YYTYPE_INT16 yytype_int16;
208 typedef short yytype_int16;
212 # ifdef __SIZE_TYPE__
213 # define YYSIZE_T __SIZE_TYPE__
214 # elif defined size_t
215 # define YYSIZE_T size_t
216 # elif ! defined YYSIZE_T
217 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
218 # define YYSIZE_T size_t
220 # define YYSIZE_T unsigned
224 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
227 # if defined YYENABLE_NLS && YYENABLE_NLS
229 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
230 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
234 # define YY_(Msgid) Msgid
239 # if (defined __GNUC__ \
240 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
241 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
242 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
244 # define YY_ATTRIBUTE(Spec) /* empty */
248 #ifndef YY_ATTRIBUTE_PURE
249 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
252 #ifndef YY_ATTRIBUTE_UNUSED
253 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
256 /* Suppress unused-variable warnings by "using" E. */
257 #if ! defined lint || defined __GNUC__
258 # define YYUSE(E) ((void) (E))
260 # define YYUSE(E) /* empty */
263 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
264 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
265 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
266 _Pragma ("GCC diagnostic push") \
267 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
268 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
269 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
270 _Pragma ("GCC diagnostic pop")
272 # define YY_INITIAL_VALUE(Value) Value
274 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
275 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
276 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
278 #ifndef YY_INITIAL_VALUE
279 # define YY_INITIAL_VALUE(Value) /* Nothing. */
283 #define YY_ASSERT(E) ((void) (0 && (E)))
285 #if ! defined yyoverflow || YYERROR_VERBOSE
287 /* The parser invokes alloca or malloc; define the necessary symbols. */
289 # ifdef YYSTACK_USE_ALLOCA
290 # if YYSTACK_USE_ALLOCA
292 # define YYSTACK_ALLOC __builtin_alloca
293 # elif defined __BUILTIN_VA_ARG_INCR
294 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
296 # define YYSTACK_ALLOC __alloca
297 # elif defined _MSC_VER
298 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
299 # define alloca _alloca
301 # define YYSTACK_ALLOC alloca
302 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
303 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
304 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
305 # ifndef EXIT_SUCCESS
306 # define EXIT_SUCCESS 0
313 # ifdef YYSTACK_ALLOC
314 /* Pacify GCC's 'empty if-body' warning. */
315 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
316 # ifndef YYSTACK_ALLOC_MAXIMUM
317 /* The OS might guarantee only one guard page at the bottom of the stack,
318 and a page size can be as small as 4096 bytes. So we cannot safely
319 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
320 to allow for a few compiler-allocated temporary stack slots. */
321 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
324 # define YYSTACK_ALLOC YYMALLOC
325 # define YYSTACK_FREE YYFREE
326 # ifndef YYSTACK_ALLOC_MAXIMUM
327 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
329 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
330 && ! ((defined YYMALLOC || defined malloc) \
331 && (defined YYFREE || defined free)))
332 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
333 # ifndef EXIT_SUCCESS
334 # define EXIT_SUCCESS 0
338 # define YYMALLOC malloc
339 # if ! defined malloc && ! defined EXIT_SUCCESS
340 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
345 # if ! defined free && ! defined EXIT_SUCCESS
346 void free (void *); /* INFRINGES ON USER NAME SPACE */
350 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
353 #if (! defined yyoverflow \
354 && (! defined __cplusplus \
355 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
357 /* A type that is properly aligned for any stack member. */
360 yytype_int16 yyss_alloc;
364 /* The size of the maximum gap between one aligned stack and the next. */
365 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
367 /* The size of an array large to enough to hold all stacks, each with
369 # define YYSTACK_BYTES(N) \
370 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
371 + YYSTACK_GAP_MAXIMUM)
373 # define YYCOPY_NEEDED 1
375 /* Relocate STACK from its old location to the new one. The
376 local variables YYSIZE and YYSTACKSIZE give the old and new number of
377 elements in the stack, and YYPTR gives the new location of the
378 stack. Advance YYPTR to a properly aligned location for the next
380 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
383 YYSIZE_T yynewbytes; \
384 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
385 Stack = &yyptr->Stack_alloc; \
386 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
387 yyptr += yynewbytes / sizeof (*yyptr); \
393 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
394 /* Copy COUNT objects from SRC to DST. The source and destination do
397 # if defined __GNUC__ && 1 < __GNUC__
398 # define YYCOPY(Dst, Src, Count) \
399 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
401 # define YYCOPY(Dst, Src, Count) \
405 for (yyi = 0; yyi < (Count); yyi++) \
406 (Dst)[yyi] = (Src)[yyi]; \
411 #endif /* !YYCOPY_NEEDED */
413 /* YYFINAL -- State number of the termination state. */
415 /* YYLAST -- Last index in YYTABLE. */
418 /* YYNTOKENS -- Number of terminals. */
420 /* YYNNTS -- Number of nonterminals. */
422 /* YYNRULES -- Number of rules. */
424 /* YYNSTATES -- Number of states. */
428 #define YYMAXUTOK 277
430 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
431 as returned by yylex, with out-of-bounds checking. */
432 #define YYTRANSLATE(YYX) \
433 ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
435 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
436 as returned by yylex. */
437 static const yytype_uint8 yytranslate[] =
439 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
440 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
441 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
442 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
443 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
444 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
445 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
446 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
447 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
448 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
449 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
450 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
451 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
452 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
453 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
454 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
455 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
456 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
457 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
458 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
459 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
460 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
461 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
462 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
463 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
464 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
465 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
466 15, 16, 17, 18, 19, 20, 21, 22
470 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
471 static const yytype_uint8 yyrline[] =
473 0, 60, 60, 63, 64, 64, 67, 68, 71, 72,
478 #if YYDEBUG || YYERROR_VERBOSE || 0
479 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
480 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
481 static const char *const yytname[] =
483 "$end", "error", "$undefined", "NEVER", "IF", "FI", "IMPLIES", "GOTO",
484 "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE", "COLON",
485 "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE", "LITT_ENT",
486 "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton", "stateseq",
487 "$@1", "option", "exp", YY_NULLPTR
492 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
493 (internal) symbol number NUM (which must be that of a token). */
494 static const yytype_uint16 yytoknum[] =
496 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
497 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
502 #define YYPACT_NINF -16
504 #define yypact_value_is_default(Yystate) \
505 (!!((Yystate) == (-16)))
507 #define YYTABLE_NINF -1
509 #define yytable_value_is_error(Yytable_value) \
512 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
514 static const yytype_int8 yypact[] =
516 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
517 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
518 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
522 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
523 Performed when YYTABLE does not specify something else to do. Zero
524 means the default is an error. */
525 static const yytype_uint8 yydefact[] =
527 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
528 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
529 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
533 /* YYPGOTO[NTERM-NUM]. */
534 static const yytype_int8 yypgoto[] =
536 -16, -16, 4, -16, -7, -9
539 /* YYDEFGOTO[NTERM-NUM]. */
540 static const yytype_int8 yydefgoto[] =
545 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
546 positive, shift that token. If negative, reduce the rule whose
547 number is the opposite. If YYTABLE_NINF, syntax error. */
548 static const yytype_uint8 yytable[] =
550 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
551 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
552 10, 11, 18, 31, 0, 26, 24, 30, 29
555 static const yytype_int8 yycheck[] =
557 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
558 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
559 4, 13, 5, 30, -1, 7, 15, 22, 24
562 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
563 symbol of state STATE-NUM. */
564 static const yytype_uint8 yystos[] =
566 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
567 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
568 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
572 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
573 static const yytype_uint8 yyr1[] =
575 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
579 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
580 static const yytype_uint8 yyr2[] =
582 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
587 #define yyerrok (yyerrstatus = 0)
588 #define yyclearin (yychar = YYEMPTY)
592 #define YYACCEPT goto yyacceptlab
593 #define YYABORT goto yyabortlab
594 #define YYERROR goto yyerrorlab
597 #define YYRECOVERING() (!!yyerrstatus)
599 #define YYBACKUP(Token, Value) \
601 if (yychar == YYEMPTY) \
605 YYPOPSTACK (yylen); \
611 yyerror (YY_("syntax error: cannot back up")); \
616 /* Error token number */
618 #define YYERRCODE 256
622 /* Enable debugging if requested. */
626 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
627 # define YYFPRINTF fprintf
630 # define YYDPRINTF(Args) \
636 /* This macro is provided for backward compatibility. */
637 #ifndef YY_LOCATION_PRINT
638 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
642 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
646 YYFPRINTF (stderr, "%s ", Title); \
647 yy_symbol_print (stderr, \
649 YYFPRINTF (stderr, "\n"); \
654 /*-----------------------------------.
655 | Print this symbol's value on YYO. |
656 `-----------------------------------*/
659 yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
661 FILE *yyoutput = yyo;
666 if (yytype < YYNTOKENS)
667 YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
669 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
671 YY_IGNORE_MAYBE_UNINITIALIZED_END
675 /*---------------------------.
676 | Print this symbol on YYO. |
677 `---------------------------*/
680 yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep)
682 YYFPRINTF (yyo, "%s %s (",
683 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
685 yy_symbol_value_print (yyo, yytype, yyvaluep);
686 YYFPRINTF (yyo, ")");
689 /*------------------------------------------------------------------.
690 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
692 `------------------------------------------------------------------*/
695 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
697 YYFPRINTF (stderr, "Stack now");
698 for (; yybottom <= yytop; yybottom++)
700 int yybot = *yybottom;
701 YYFPRINTF (stderr, " %d", yybot);
703 YYFPRINTF (stderr, "\n");
706 # define YY_STACK_PRINT(Bottom, Top) \
709 yy_stack_print ((Bottom), (Top)); \
713 /*------------------------------------------------.
714 | Report that the YYRULE is going to be reduced. |
715 `------------------------------------------------*/
718 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
720 unsigned long yylno = yyrline[yyrule];
721 int yynrhs = yyr2[yyrule];
723 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
725 /* The symbols being reduced. */
726 for (yyi = 0; yyi < yynrhs; yyi++)
728 YYFPRINTF (stderr, " $%d = ", yyi + 1);
729 yy_symbol_print (stderr,
730 yystos[yyssp[yyi + 1 - yynrhs]],
731 &yyvsp[(yyi + 1) - (yynrhs)]
733 YYFPRINTF (stderr, "\n");
737 # define YY_REDUCE_PRINT(Rule) \
740 yy_reduce_print (yyssp, yyvsp, Rule); \
743 /* Nonzero means print parse trace. It is left uninitialized so that
744 multiple parsers can coexist. */
747 # define YYDPRINTF(Args)
748 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
749 # define YY_STACK_PRINT(Bottom, Top)
750 # define YY_REDUCE_PRINT(Rule)
751 #endif /* !YYDEBUG */
754 /* YYINITDEPTH -- initial size of the parser's stacks. */
756 # define YYINITDEPTH 200
759 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
760 if the built-in stack extension method is used).
762 Do not make this value too large; the results are undefined if
763 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
764 evaluated with infinite-precision integer arithmetic. */
767 # define YYMAXDEPTH 10000
774 # if defined __GLIBC__ && defined _STRING_H
775 # define yystrlen strlen
777 /* Return the length of YYSTR. */
779 yystrlen (const char *yystr)
782 for (yylen = 0; yystr[yylen]; yylen++)
790 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
791 # define yystpcpy stpcpy
793 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
796 yystpcpy (char *yydest, const char *yysrc)
799 const char *yys = yysrc;
801 while ((*yyd++ = *yys++) != '\0')
810 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
811 quotes and backslashes, so that it's suitable for yyerror. The
812 heuristic is that double-quoting is unnecessary unless the string
813 contains an apostrophe, a comma, or backslash (other than
814 backslash-backslash). YYSTR is taken from yytname. If YYRES is
815 null, do not copy; instead, return the length of what the result
818 yytnamerr (char *yyres, const char *yystr)
823 char const *yyp = yystr;
830 goto do_not_strip_quotes;
834 goto do_not_strip_quotes;
850 do_not_strip_quotes: ;
854 return yystrlen (yystr);
856 return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
860 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
861 about the unexpected token YYTOKEN for the state stack whose top is
864 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
865 not large enough to hold the message. In that case, also set
866 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
867 required number of bytes is too large to store. */
869 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
870 yytype_int16 *yyssp, int yytoken)
872 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
873 YYSIZE_T yysize = yysize0;
874 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
875 /* Internationalized format string. */
876 const char *yyformat = YY_NULLPTR;
877 /* Arguments of yyformat. */
878 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
879 /* Number of reported tokens (one for the "unexpected", one per
883 /* There are many possibilities here to consider:
884 - If this state is a consistent state with a default action, then
885 the only way this function was invoked is if the default action
886 is an error action. In that case, don't check for expected
887 tokens because there are none.
888 - The only way there can be no lookahead present (in yychar) is if
889 this state is a consistent state with a default action. Thus,
890 detecting the absence of a lookahead is sufficient to determine
891 that there is no unexpected or expected token to report. In that
892 case, just report a simple "syntax error".
893 - Don't assume there isn't a lookahead just because this state is a
894 consistent state with a default action. There might have been a
895 previous inconsistent state, consistent state with a non-default
896 action, or user semantic action that manipulated yychar.
897 - Of course, the expected token list depends on states to have
898 correct lookahead information, and it depends on the parser not
899 to perform extra reductions after fetching a lookahead from the
900 scanner and before detecting a syntax error. Thus, state merging
901 (from LALR or IELR) and default reductions corrupt the expected
902 token list. However, the list is correct for canonical LR with
903 one exception: it will still contain any token that will not be
904 accepted due to an error action in a later state.
906 if (yytoken != YYEMPTY)
908 int yyn = yypact[*yyssp];
909 yyarg[yycount++] = yytname[yytoken];
910 if (!yypact_value_is_default (yyn))
912 /* Start YYX at -YYN if negative to avoid negative indexes in
913 YYCHECK. In other words, skip the first -YYN actions for
914 this state because they are default actions. */
915 int yyxbegin = yyn < 0 ? -yyn : 0;
916 /* Stay within bounds of both yycheck and yytname. */
917 int yychecklim = YYLAST - yyn + 1;
918 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
921 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
922 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
923 && !yytable_value_is_error (yytable[yyx + yyn]))
925 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
931 yyarg[yycount++] = yytname[yyx];
933 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
934 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
945 # define YYCASE_(N, S) \
949 default: /* Avoid compiler warnings. */
950 YYCASE_(0, YY_("syntax error"));
951 YYCASE_(1, YY_("syntax error, unexpected %s"));
952 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
953 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
954 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
955 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
960 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
961 if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
967 if (*yymsg_alloc < yysize)
969 *yymsg_alloc = 2 * yysize;
970 if (! (yysize <= *yymsg_alloc
971 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
972 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
976 /* Avoid sprintf, as that infringes on the user's name space.
977 Don't have undefined behavior even if the translation
978 produced a string with the wrong number of "%s"s. */
982 while ((*yyp = *yyformat) != '\0')
983 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
985 yyp += yytnamerr (yyp, yyarg[yyi++]);
996 #endif /* YYERROR_VERBOSE */
998 /*-----------------------------------------------.
999 | Release the memory associated to this symbol. |
1000 `-----------------------------------------------*/
1003 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
1008 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1010 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1012 YY_IGNORE_MAYBE_UNINITIALIZED_END
1018 /* The lookahead symbol. */
1021 /* The semantic value of the lookahead symbol. */
1023 /* Number of syntax errors so far. */
1035 /* Number of tokens to shift before error messages enabled. */
1038 /* The stacks and their tools:
1039 'yyss': related to states.
1040 'yyvs': related to semantic values.
1042 Refer to the stacks through separate pointers, to allow yyoverflow
1043 to reallocate them elsewhere. */
1045 /* The state stack. */
1046 yytype_int16 yyssa[YYINITDEPTH];
1048 yytype_int16 *yyssp;
1050 /* The semantic value stack. */
1051 YYSTYPE yyvsa[YYINITDEPTH];
1055 YYSIZE_T yystacksize;
1059 /* Lookahead token as an internal (translated) token number. */
1061 /* The variables used to return semantic value and location from the
1066 /* Buffer for error messages, and its allocated size. */
1068 char *yymsg = yymsgbuf;
1069 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1072 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1074 /* The number of symbols on the RHS of the reduced rule.
1075 Keep to zero when no symbol should be popped. */
1078 yyssp = yyss = yyssa;
1079 yyvsp = yyvs = yyvsa;
1080 yystacksize = YYINITDEPTH;
1082 YYDPRINTF ((stderr, "Starting parse\n"));
1087 yychar = YYEMPTY; /* Cause a token to be read. */
1091 /*------------------------------------------------------------.
1092 | yynewstate -- push a new state, which is found in yystate. |
1093 `------------------------------------------------------------*/
1095 /* In all cases, when you get here, the value and location stacks
1096 have just been pushed. So pushing a state here evens the stacks. */
1100 /*--------------------------------------------------------------------.
1101 | yynewstate -- set current state (the top of the stack) to yystate. |
1102 `--------------------------------------------------------------------*/
1104 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1105 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1106 *yyssp = (yytype_int16) yystate;
1108 if (yyss + yystacksize - 1 <= yyssp)
1109 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1110 goto yyexhaustedlab;
1113 /* Get the current used size of the three stacks, in elements. */
1114 YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
1116 # if defined yyoverflow
1118 /* Give user a chance to reallocate the stack. Use copies of
1119 these so that the &'s don't force the real ones into
1121 YYSTYPE *yyvs1 = yyvs;
1122 yytype_int16 *yyss1 = yyss;
1124 /* Each stack pointer address is followed by the size of the
1125 data in use in that stack, in bytes. This used to be a
1126 conditional around just the two extra args, but that might
1127 be undefined if yyoverflow is a macro. */
1128 yyoverflow (YY_("memory exhausted"),
1129 &yyss1, yysize * sizeof (*yyssp),
1130 &yyvs1, yysize * sizeof (*yyvsp),
1135 # else /* defined YYSTACK_RELOCATE */
1136 /* Extend the stack our own way. */
1137 if (YYMAXDEPTH <= yystacksize)
1138 goto yyexhaustedlab;
1140 if (YYMAXDEPTH < yystacksize)
1141 yystacksize = YYMAXDEPTH;
1144 yytype_int16 *yyss1 = yyss;
1145 union yyalloc *yyptr =
1146 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1148 goto yyexhaustedlab;
1149 YYSTACK_RELOCATE (yyss_alloc, yyss);
1150 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1151 # undef YYSTACK_RELOCATE
1153 YYSTACK_FREE (yyss1);
1157 yyssp = yyss + yysize - 1;
1158 yyvsp = yyvs + yysize - 1;
1160 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1161 (unsigned long) yystacksize));
1163 if (yyss + yystacksize - 1 <= yyssp)
1166 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1168 if (yystate == YYFINAL)
1178 /* Do appropriate processing given the current state. Read a
1179 lookahead token if we need one and don't already have one. */
1181 /* First try to decide what to do without reference to lookahead token. */
1182 yyn = yypact[yystate];
1183 if (yypact_value_is_default (yyn))
1186 /* Not known => get a lookahead token if don't already have one. */
1188 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1189 if (yychar == YYEMPTY)
1191 YYDPRINTF ((stderr, "Reading a token: "));
1195 if (yychar <= YYEOF)
1197 yychar = yytoken = YYEOF;
1198 YYDPRINTF ((stderr, "Now at end of input.\n"));
1202 yytoken = YYTRANSLATE (yychar);
1203 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1206 /* If the proper action on seeing token YYTOKEN is to reduce or to
1207 detect an error, take that action. */
1209 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1214 if (yytable_value_is_error (yyn))
1220 /* Count tokens shifted since error; after three, turn off error
1225 /* Shift the lookahead token. */
1226 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1228 /* Discard the shifted token. */
1232 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1234 YY_IGNORE_MAYBE_UNINITIALIZED_END
1238 /*-----------------------------------------------------------.
1239 | yydefault -- do the default action for the current state. |
1240 `-----------------------------------------------------------*/
1242 yyn = yydefact[yystate];
1248 /*-----------------------------.
1249 | yyreduce -- do a reduction. |
1250 `-----------------------------*/
1252 /* yyn is the number of a rule to reduce with. */
1255 /* If YYLEN is nonzero, implement the default value of the action:
1258 Otherwise, the following line sets YYVAL to garbage.
1259 This behavior is undocumented and Bison
1260 users should not rely upon it. Assigning to YYVAL
1261 unconditionally makes the parser a bit smaller, and it avoids a
1262 GCC warning that YYVAL may be used uninitialized. */
1263 yyval = yyvsp[1-yylen];
1266 YY_REDUCE_PRINT (yyn);
1270 #line 64 "parserPromela.yacc"
1271 { new_state((yyvsp[-1].string), 1);}
1272 #line 1273 "parserPromela.tab.cacc"
1276 #line 68 "parserPromela.yacc"
1277 { new_transition((yyvsp[-1].string), (yyvsp[-4].label));}
1278 #line 1279 "parserPromela.tab.cacc"
1282 #line 71 "parserPromela.yacc"
1283 { (yyval.label) = (yyvsp[-1].label); }
1284 #line 1285 "parserPromela.tab.cacc"
1288 #line 72 "parserPromela.yacc"
1289 { (yyval.label) = xbt_automaton_exp_label_new_or((yyvsp[-2].label), (yyvsp[0].label)); }
1290 #line 1291 "parserPromela.tab.cacc"
1294 #line 73 "parserPromela.yacc"
1295 { (yyval.label) = xbt_automaton_exp_label_new_and((yyvsp[-2].label), (yyvsp[0].label)); }
1296 #line 1297 "parserPromela.tab.cacc"
1300 #line 74 "parserPromela.yacc"
1301 { (yyval.label) = xbt_automaton_exp_label_new_not((yyvsp[0].label)); }
1302 #line 1303 "parserPromela.tab.cacc"
1306 #line 75 "parserPromela.yacc"
1307 { (yyval.label) = xbt_automaton_exp_label_new_one(); }
1308 #line 1309 "parserPromela.tab.cacc"
1312 #line 76 "parserPromela.yacc"
1313 { (yyval.label) = xbt_automaton_exp_label_new_predicat((yyvsp[0].string)); }
1314 #line 1315 "parserPromela.tab.cacc"
1318 #line 1319 "parserPromela.tab.cacc"
1322 /* User semantic actions sometimes alter yychar, and that requires
1323 that yytoken be updated with the new translation. We take the
1324 approach of translating immediately before every use of yytoken.
1325 One alternative is translating here after every semantic action,
1326 but that translation would be missed if the semantic action invokes
1327 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1328 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1329 incorrect destructor might then be invoked immediately. In the
1330 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1331 to an incorrect destructor call or verbose syntax error message
1332 before the lookahead is translated. */
1333 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1337 YY_STACK_PRINT (yyss, yyssp);
1341 /* Now 'shift' the result of the reduction. Determine what state
1342 that goes to, based on the state we popped back to and the rule
1343 number reduced by. */
1345 const int yylhs = yyr1[yyn] - YYNTOKENS;
1346 const int yyi = yypgoto[yylhs] + *yyssp;
1347 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1349 : yydefgoto[yylhs]);
1355 /*--------------------------------------.
1356 | yyerrlab -- here on detecting error. |
1357 `--------------------------------------*/
1359 /* Make sure we have latest lookahead translation. See comments at
1360 user semantic actions for why this is necessary. */
1361 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1363 /* If not already recovering from an error, report this error. */
1367 #if ! YYERROR_VERBOSE
1368 yyerror (YY_("syntax error"));
1370 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1373 char const *yymsgp = YY_("syntax error");
1374 int yysyntax_error_status;
1375 yysyntax_error_status = YYSYNTAX_ERROR;
1376 if (yysyntax_error_status == 0)
1378 else if (yysyntax_error_status == 1)
1380 if (yymsg != yymsgbuf)
1381 YYSTACK_FREE (yymsg);
1382 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1386 yymsg_alloc = sizeof yymsgbuf;
1387 yysyntax_error_status = 2;
1391 yysyntax_error_status = YYSYNTAX_ERROR;
1396 if (yysyntax_error_status == 2)
1397 goto yyexhaustedlab;
1399 # undef YYSYNTAX_ERROR
1405 if (yyerrstatus == 3)
1407 /* If just tried and failed to reuse lookahead token after an
1408 error, discard it. */
1410 if (yychar <= YYEOF)
1412 /* Return failure if at end of input. */
1413 if (yychar == YYEOF)
1418 yydestruct ("Error: discarding",
1424 /* Else will try to reuse lookahead token after shifting the error
1429 /*---------------------------------------------------.
1430 | yyerrorlab -- error raised explicitly by YYERROR. |
1431 `---------------------------------------------------*/
1433 /* Pacify compilers when the user code never invokes YYERROR and the
1434 label yyerrorlab therefore never appears in user code. */
1438 /* Do not reclaim the symbols of the rule whose action triggered
1442 YY_STACK_PRINT (yyss, yyssp);
1447 /*-------------------------------------------------------------.
1448 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1449 `-------------------------------------------------------------*/
1451 yyerrstatus = 3; /* Each real token shifted decrements this. */
1455 yyn = yypact[yystate];
1456 if (!yypact_value_is_default (yyn))
1459 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1467 /* Pop the current state because it cannot handle the error token. */
1472 yydestruct ("Error: popping",
1473 yystos[yystate], yyvsp);
1476 YY_STACK_PRINT (yyss, yyssp);
1479 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1481 YY_IGNORE_MAYBE_UNINITIALIZED_END
1484 /* Shift the error token. */
1485 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1491 /*-------------------------------------.
1492 | yyacceptlab -- YYACCEPT comes here. |
1493 `-------------------------------------*/
1499 /*-----------------------------------.
1500 | yyabortlab -- YYABORT comes here. |
1501 `-----------------------------------*/
1507 #if !defined yyoverflow || YYERROR_VERBOSE
1508 /*-------------------------------------------------.
1509 | yyexhaustedlab -- memory exhaustion comes here. |
1510 `-------------------------------------------------*/
1512 yyerror (YY_("memory exhausted"));
1518 /*-----------------------------------------------------.
1519 | yyreturn -- parsing is finished, return the result. |
1520 `-----------------------------------------------------*/
1522 if (yychar != YYEMPTY)
1524 /* Make sure we have latest lookahead translation. See comments at
1525 user semantic actions for why this is necessary. */
1526 yytoken = YYTRANSLATE (yychar);
1527 yydestruct ("Cleanup: discarding lookahead",
1530 /* Do not reclaim the symbols of the rule whose action triggered
1531 this YYABORT or YYACCEPT. */
1533 YY_STACK_PRINT (yyss, yyssp);
1534 while (yyssp != yyss)
1536 yydestruct ("Cleanup: popping",
1537 yystos[*yyssp], yyvsp);
1542 YYSTACK_FREE (yyss);
1545 if (yymsg != yymsgbuf)
1546 YYSTACK_FREE (yymsg);
1550 #line 79 "parserPromela.yacc"
1555 void yyerror(const char *s){
1556 fprintf (stderr, "%s\n", s);