1 /* A Bison parser, made by GNU Bison 3.8.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 <https://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 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 especially those whose name start with YY_ or yy_. They are
39 private implementation details that can be changed or removed. */
41 /* All symbols defined below should begin with yy or YY, to avoid
42 infringing on user name space. This should be done even for local
43 variables, as they might otherwise be expanded by user macros.
44 There are some unavoidable exceptions within include files to
45 define necessary library symbols; they are noted "INFRINGES ON
46 USER NAME SPACE" below. */
48 /* Identify Bison output, and Bison version. */
51 /* Bison version string. */
52 #define YYBISON_VERSION "3.8.2"
55 #define YYSKELETON_NAME "yacc.c"
67 /* Substitute the variable and function names. */
68 #define yyparse xbt_automaton_parser_parse
69 #define yylex xbt_automaton_parser_lex
70 #define yyerror xbt_automaton_parser_error
71 #define yydebug xbt_automaton_parser_debug
72 #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(const char* id, int src);
90 static void new_transition(const char* id, xbt_automaton_exp_label_t label);
93 #line 94 "parserPromela.tab.cacc"
97 # define YY_CAST(Type, Val) static_cast<Type> (Val)
98 # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
100 # define YY_CAST(Type, Val) ((Type) (Val))
101 # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
105 # if defined __cplusplus
106 # if 201103L <= __cplusplus
107 # define YY_NULLPTR nullptr
109 # define YY_NULLPTR 0
112 # define YY_NULLPTR ((void*)0)
116 #include "parserPromela.tab.hacc"
120 YYSYMBOL_YYEMPTY = -2,
121 YYSYMBOL_YYEOF = 0, /* "end of file" */
122 YYSYMBOL_YYerror = 1, /* error */
123 YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
124 YYSYMBOL_NEVER = 3, /* NEVER */
125 YYSYMBOL_IF = 4, /* IF */
126 YYSYMBOL_FI = 5, /* FI */
127 YYSYMBOL_IMPLIES = 6, /* IMPLIES */
128 YYSYMBOL_GOTO = 7, /* GOTO */
129 YYSYMBOL_AND = 8, /* AND */
130 YYSYMBOL_OR = 9, /* OR */
131 YYSYMBOL_NOT = 10, /* NOT */
132 YYSYMBOL_LEFT_PAR = 11, /* LEFT_PAR */
133 YYSYMBOL_RIGHT_PAR = 12, /* RIGHT_PAR */
134 YYSYMBOL_CASE = 13, /* CASE */
135 YYSYMBOL_COLON = 14, /* COLON */
136 YYSYMBOL_SEMI_COLON = 15, /* SEMI_COLON */
137 YYSYMBOL_CASE_TRUE = 16, /* CASE_TRUE */
138 YYSYMBOL_LEFT_BRACE = 17, /* LEFT_BRACE */
139 YYSYMBOL_RIGHT_BRACE = 18, /* RIGHT_BRACE */
140 YYSYMBOL_LITT_ENT = 19, /* LITT_ENT */
141 YYSYMBOL_LITT_CHAINE = 20, /* LITT_CHAINE */
142 YYSYMBOL_LITT_REEL = 21, /* LITT_REEL */
143 YYSYMBOL_ID = 22, /* ID */
144 YYSYMBOL_YYACCEPT = 23, /* $accept */
145 YYSYMBOL_automaton = 24, /* automaton */
146 YYSYMBOL_stateseq = 25, /* stateseq */
147 YYSYMBOL_26_1 = 26, /* $@1 */
148 YYSYMBOL_option = 27, /* option */
149 YYSYMBOL_exp = 28 /* exp */
151 typedef enum yysymbol_kind_t yysymbol_kind_t;
160 /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
161 <limits.h> and (if available) <stdint.h> are included
162 so that the code can choose integer types of a good width. */
164 #ifndef __PTRDIFF_MAX__
165 # include <limits.h> /* INFRINGES ON USER NAME SPACE */
166 # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
167 # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
172 /* Narrow types that promote to a signed type and that can represent a
173 signed or unsigned integer of at least N bits. In tables they can
174 save space and decrease cache pressure. Promoting to a signed type
175 helps avoid bugs in integer arithmetic. */
177 #ifdef __INT_LEAST8_MAX__
178 typedef __INT_LEAST8_TYPE__ yytype_int8;
179 #elif defined YY_STDINT_H
180 typedef int_least8_t yytype_int8;
182 typedef signed char yytype_int8;
185 #ifdef __INT_LEAST16_MAX__
186 typedef __INT_LEAST16_TYPE__ yytype_int16;
187 #elif defined YY_STDINT_H
188 typedef int_least16_t yytype_int16;
190 typedef short yytype_int16;
193 /* Work around bug in HP-UX 11.23, which defines these macros
194 incorrectly for preprocessor constants. This workaround can likely
195 be removed in 2023, as HPE has promised support for HP-UX 11.23
196 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
197 <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
199 # undef UINT_LEAST8_MAX
200 # undef UINT_LEAST16_MAX
201 # define UINT_LEAST8_MAX 255
202 # define UINT_LEAST16_MAX 65535
205 #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
206 typedef __UINT_LEAST8_TYPE__ yytype_uint8;
207 #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
208 && UINT_LEAST8_MAX <= INT_MAX)
209 typedef uint_least8_t yytype_uint8;
210 #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
211 typedef unsigned char yytype_uint8;
213 typedef short yytype_uint8;
216 #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
217 typedef __UINT_LEAST16_TYPE__ yytype_uint16;
218 #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
219 && UINT_LEAST16_MAX <= INT_MAX)
220 typedef uint_least16_t yytype_uint16;
221 #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
222 typedef unsigned short yytype_uint16;
224 typedef int yytype_uint16;
228 # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
229 # define YYPTRDIFF_T __PTRDIFF_TYPE__
230 # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
231 # elif defined PTRDIFF_MAX
233 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
235 # define YYPTRDIFF_T ptrdiff_t
236 # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
238 # define YYPTRDIFF_T long
239 # define YYPTRDIFF_MAXIMUM LONG_MAX
244 # ifdef __SIZE_TYPE__
245 # define YYSIZE_T __SIZE_TYPE__
246 # elif defined size_t
247 # define YYSIZE_T size_t
248 # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
249 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
250 # define YYSIZE_T size_t
252 # define YYSIZE_T unsigned
256 #define YYSIZE_MAXIMUM \
257 YY_CAST (YYPTRDIFF_T, \
258 (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
259 ? YYPTRDIFF_MAXIMUM \
260 : YY_CAST (YYSIZE_T, -1)))
262 #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
265 /* Stored state numbers (used for stacks). */
266 typedef yytype_int8 yy_state_t;
268 /* State numbers in computations. */
269 typedef int yy_state_fast_t;
272 # if defined YYENABLE_NLS && YYENABLE_NLS
274 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
275 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
279 # define YY_(Msgid) Msgid
284 #ifndef YY_ATTRIBUTE_PURE
285 # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
286 # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
288 # define YY_ATTRIBUTE_PURE
292 #ifndef YY_ATTRIBUTE_UNUSED
293 # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
294 # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
296 # define YY_ATTRIBUTE_UNUSED
300 /* Suppress unused-variable warnings by "using" E. */
301 #if ! defined lint || defined __GNUC__
302 # define YY_USE(E) ((void) (E))
304 # define YY_USE(E) /* empty */
307 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
308 #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
309 # if __GNUC__ * 100 + __GNUC_MINOR__ < 407
310 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
311 _Pragma ("GCC diagnostic push") \
312 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
314 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
315 _Pragma ("GCC diagnostic push") \
316 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
317 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
319 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
320 _Pragma ("GCC diagnostic pop")
322 # define YY_INITIAL_VALUE(Value) Value
324 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
325 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
326 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
328 #ifndef YY_INITIAL_VALUE
329 # define YY_INITIAL_VALUE(Value) /* Nothing. */
332 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
333 # define YY_IGNORE_USELESS_CAST_BEGIN \
334 _Pragma ("GCC diagnostic push") \
335 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
336 # define YY_IGNORE_USELESS_CAST_END \
337 _Pragma ("GCC diagnostic pop")
339 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
340 # define YY_IGNORE_USELESS_CAST_BEGIN
341 # define YY_IGNORE_USELESS_CAST_END
345 #define YY_ASSERT(E) ((void) (0 && (E)))
347 #if !defined yyoverflow
349 /* The parser invokes alloca or malloc; define the necessary symbols. */
351 # ifdef YYSTACK_USE_ALLOCA
352 # if YYSTACK_USE_ALLOCA
354 # define YYSTACK_ALLOC __builtin_alloca
355 # elif defined __BUILTIN_VA_ARG_INCR
356 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
358 # define YYSTACK_ALLOC __alloca
359 # elif defined _MSC_VER
360 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
361 # define alloca _alloca
363 # define YYSTACK_ALLOC alloca
364 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
365 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
366 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
367 # ifndef EXIT_SUCCESS
368 # define EXIT_SUCCESS 0
375 # ifdef YYSTACK_ALLOC
376 /* Pacify GCC's 'empty if-body' warning. */
377 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
378 # ifndef YYSTACK_ALLOC_MAXIMUM
379 /* The OS might guarantee only one guard page at the bottom of the stack,
380 and a page size can be as small as 4096 bytes. So we cannot safely
381 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
382 to allow for a few compiler-allocated temporary stack slots. */
383 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
386 # define YYSTACK_ALLOC YYMALLOC
387 # define YYSTACK_FREE YYFREE
388 # ifndef YYSTACK_ALLOC_MAXIMUM
389 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
391 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
392 && ! ((defined YYMALLOC || defined malloc) \
393 && (defined YYFREE || defined free)))
394 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
395 # ifndef EXIT_SUCCESS
396 # define EXIT_SUCCESS 0
400 # define YYMALLOC malloc
401 # if ! defined malloc && ! defined EXIT_SUCCESS
402 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
407 # if ! defined free && ! defined EXIT_SUCCESS
408 void free (void *); /* INFRINGES ON USER NAME SPACE */
412 #endif /* !defined yyoverflow */
414 #if (! defined yyoverflow \
415 && (! defined __cplusplus \
416 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
418 /* A type that is properly aligned for any stack member. */
421 yy_state_t yyss_alloc;
425 /* The size of the maximum gap between one aligned stack and the next. */
426 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
428 /* The size of an array large to enough to hold all stacks, each with
430 # define YYSTACK_BYTES(N) \
431 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
432 + YYSTACK_GAP_MAXIMUM)
434 # define YYCOPY_NEEDED 1
436 /* Relocate STACK from its old location to the new one. The
437 local variables YYSIZE and YYSTACKSIZE give the old and new number of
438 elements in the stack, and YYPTR gives the new location of the
439 stack. Advance YYPTR to a properly aligned location for the next
441 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
444 YYPTRDIFF_T yynewbytes; \
445 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
446 Stack = &yyptr->Stack_alloc; \
447 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
448 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
454 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
455 /* Copy COUNT objects from SRC to DST. The source and destination do
458 # if defined __GNUC__ && 1 < __GNUC__
459 # define YYCOPY(Dst, Src, Count) \
460 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
462 # define YYCOPY(Dst, Src, Count) \
466 for (yyi = 0; yyi < (Count); yyi++) \
467 (Dst)[yyi] = (Src)[yyi]; \
472 #endif /* !YYCOPY_NEEDED */
474 /* YYFINAL -- State number of the termination state. */
476 /* YYLAST -- Last index in YYTABLE. */
479 /* YYNTOKENS -- Number of terminals. */
481 /* YYNNTS -- Number of nonterminals. */
483 /* YYNRULES -- Number of rules. */
485 /* YYNSTATES -- Number of states. */
488 /* YYMAXUTOK -- Last valid token kind. */
489 #define YYMAXUTOK 277
492 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
493 as returned by yylex, with out-of-bounds checking. */
494 #define YYTRANSLATE(YYX) \
495 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
496 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
499 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
500 as returned by yylex. */
501 static const yytype_int8 yytranslate[] =
503 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
507 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
510 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
511 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
512 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
513 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
514 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
515 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
529 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
530 15, 16, 17, 18, 19, 20, 21, 22
534 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
535 static const yytype_int8 yyrline[] =
537 0, 60, 60, 63, 64, 64, 67, 68, 71, 72,
542 /** Accessing symbol of state STATE. */
543 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
546 /* The user-facing name of the symbol whose (internal) number is
547 YYSYMBOL. No bounds checking. */
548 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
550 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
551 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
552 static const char *const yytname[] =
554 "\"end of file\"", "error", "\"invalid token\"", "NEVER", "IF", "FI",
555 "IMPLIES", "GOTO", "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE",
556 "COLON", "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE",
557 "LITT_ENT", "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton",
558 "stateseq", "$@1", "option", "exp", YY_NULLPTR
562 yysymbol_name (yysymbol_kind_t yysymbol)
564 return yytname[yysymbol];
568 #define YYPACT_NINF (-16)
570 #define yypact_value_is_default(Yyn) \
571 ((Yyn) == YYPACT_NINF)
573 #define YYTABLE_NINF (-1)
575 #define yytable_value_is_error(Yyn) \
578 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
580 static const yytype_int8 yypact[] =
582 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
583 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
584 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
588 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
589 Performed when YYTABLE does not specify something else to do. Zero
590 means the default is an error. */
591 static const yytype_int8 yydefact[] =
593 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
594 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
595 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
599 /* YYPGOTO[NTERM-NUM]. */
600 static const yytype_int8 yypgoto[] =
602 -16, -16, 4, -16, -7, -9
605 /* YYDEFGOTO[NTERM-NUM]. */
606 static const yytype_int8 yydefgoto[] =
611 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
612 positive, shift that token. If negative, reduce the rule whose
613 number is the opposite. If YYTABLE_NINF, syntax error. */
614 static const yytype_int8 yytable[] =
616 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
617 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
618 10, 11, 18, 31, 0, 26, 24, 30, 29
621 static const yytype_int8 yycheck[] =
623 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
624 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
625 4, 13, 5, 30, -1, 7, 15, 22, 24
628 /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
630 static const yytype_int8 yystos[] =
632 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
633 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
634 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
638 /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */
639 static const yytype_int8 yyr1[] =
641 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
645 /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */
646 static const yytype_int8 yyr2[] =
648 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
653 enum { YYENOMEM = -2 };
655 #define yyerrok (yyerrstatus = 0)
656 #define yyclearin (yychar = YYEMPTY)
658 #define YYACCEPT goto yyacceptlab
659 #define YYABORT goto yyabortlab
660 #define YYERROR goto yyerrorlab
661 #define YYNOMEM goto yyexhaustedlab
664 #define YYRECOVERING() (!!yyerrstatus)
666 #define YYBACKUP(Token, Value) \
668 if (yychar == YYEMPTY) \
672 YYPOPSTACK (yylen); \
678 yyerror (YY_("syntax error: cannot back up")); \
683 /* Backward compatibility with an undocumented macro.
684 Use YYerror or YYUNDEF. */
685 #define YYERRCODE YYUNDEF
688 /* Enable debugging if requested. */
692 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
693 # define YYFPRINTF fprintf
696 # define YYDPRINTF(Args) \
705 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
709 YYFPRINTF (stderr, "%s ", Title); \
710 yy_symbol_print (stderr, \
712 YYFPRINTF (stderr, "\n"); \
717 /*-----------------------------------.
718 | Print this symbol's value on YYO. |
719 `-----------------------------------*/
722 yy_symbol_value_print (FILE *yyo,
723 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
725 FILE *yyoutput = yyo;
729 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
731 YY_IGNORE_MAYBE_UNINITIALIZED_END
735 /*---------------------------.
736 | Print this symbol on YYO. |
737 `---------------------------*/
740 yy_symbol_print (FILE *yyo,
741 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
743 YYFPRINTF (yyo, "%s %s (",
744 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
746 yy_symbol_value_print (yyo, yykind, yyvaluep);
747 YYFPRINTF (yyo, ")");
750 /*------------------------------------------------------------------.
751 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
753 `------------------------------------------------------------------*/
756 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
758 YYFPRINTF (stderr, "Stack now");
759 for (; yybottom <= yytop; yybottom++)
761 int yybot = *yybottom;
762 YYFPRINTF (stderr, " %d", yybot);
764 YYFPRINTF (stderr, "\n");
767 # define YY_STACK_PRINT(Bottom, Top) \
770 yy_stack_print ((Bottom), (Top)); \
774 /*------------------------------------------------.
775 | Report that the YYRULE is going to be reduced. |
776 `------------------------------------------------*/
779 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
782 int yylno = yyrline[yyrule];
783 int yynrhs = yyr2[yyrule];
785 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
787 /* The symbols being reduced. */
788 for (yyi = 0; yyi < yynrhs; yyi++)
790 YYFPRINTF (stderr, " $%d = ", yyi + 1);
791 yy_symbol_print (stderr,
792 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
793 &yyvsp[(yyi + 1) - (yynrhs)]);
794 YYFPRINTF (stderr, "\n");
798 # define YY_REDUCE_PRINT(Rule) \
801 yy_reduce_print (yyssp, yyvsp, Rule); \
804 /* Nonzero means print parse trace. It is left uninitialized so that
805 multiple parsers can coexist. */
808 # define YYDPRINTF(Args) ((void) 0)
809 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
810 # define YY_STACK_PRINT(Bottom, Top)
811 # define YY_REDUCE_PRINT(Rule)
812 #endif /* !YYDEBUG */
815 /* YYINITDEPTH -- initial size of the parser's stacks. */
817 # define YYINITDEPTH 200
820 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
821 if the built-in stack extension method is used).
823 Do not make this value too large; the results are undefined if
824 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
825 evaluated with infinite-precision integer arithmetic. */
828 # define YYMAXDEPTH 10000
836 /*-----------------------------------------------.
837 | Release the memory associated to this symbol. |
838 `-----------------------------------------------*/
841 yydestruct (const char *yymsg,
842 yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
847 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
849 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
851 YY_IGNORE_MAYBE_UNINITIALIZED_END
855 /* Lookahead token kind. */
858 /* The semantic value of the lookahead symbol. */
860 /* Number of syntax errors so far. */
873 yy_state_fast_t yystate = 0;
874 /* Number of tokens to shift before error messages enabled. */
877 /* Refer to the stacks through separate pointers, to allow yyoverflow
878 to reallocate them elsewhere. */
881 YYPTRDIFF_T yystacksize = YYINITDEPTH;
883 /* The state stack: array, bottom, top. */
884 yy_state_t yyssa[YYINITDEPTH];
885 yy_state_t *yyss = yyssa;
886 yy_state_t *yyssp = yyss;
888 /* The semantic value stack: array, bottom, top. */
889 YYSTYPE yyvsa[YYINITDEPTH];
890 YYSTYPE *yyvs = yyvsa;
891 YYSTYPE *yyvsp = yyvs;
894 /* The return value of yyparse. */
896 /* Lookahead symbol kind. */
897 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
898 /* The variables used to return semantic value and location from the
904 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
906 /* The number of symbols on the RHS of the reduced rule.
907 Keep to zero when no symbol should be popped. */
910 YYDPRINTF ((stderr, "Starting parse\n"));
912 yychar = YYEMPTY; /* Cause a token to be read. */
917 /*------------------------------------------------------------.
918 | yynewstate -- push a new state, which is found in yystate. |
919 `------------------------------------------------------------*/
921 /* In all cases, when you get here, the value and location stacks
922 have just been pushed. So pushing a state here evens the stacks. */
926 /*--------------------------------------------------------------------.
927 | yysetstate -- set current state (the top of the stack) to yystate. |
928 `--------------------------------------------------------------------*/
930 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
931 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
932 YY_IGNORE_USELESS_CAST_BEGIN
933 *yyssp = YY_CAST (yy_state_t, yystate);
934 YY_IGNORE_USELESS_CAST_END
935 YY_STACK_PRINT (yyss, yyssp);
937 if (yyss + yystacksize - 1 <= yyssp)
938 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
942 /* Get the current used size of the three stacks, in elements. */
943 YYPTRDIFF_T yysize = yyssp - yyss + 1;
945 # if defined yyoverflow
947 /* Give user a chance to reallocate the stack. Use copies of
948 these so that the &'s don't force the real ones into
950 yy_state_t *yyss1 = yyss;
951 YYSTYPE *yyvs1 = yyvs;
953 /* Each stack pointer address is followed by the size of the
954 data in use in that stack, in bytes. This used to be a
955 conditional around just the two extra args, but that might
956 be undefined if yyoverflow is a macro. */
957 yyoverflow (YY_("memory exhausted"),
958 &yyss1, yysize * YYSIZEOF (*yyssp),
959 &yyvs1, yysize * YYSIZEOF (*yyvsp),
964 # else /* defined YYSTACK_RELOCATE */
965 /* Extend the stack our own way. */
966 if (YYMAXDEPTH <= yystacksize)
969 if (YYMAXDEPTH < yystacksize)
970 yystacksize = YYMAXDEPTH;
973 yy_state_t *yyss1 = yyss;
974 union yyalloc *yyptr =
975 YY_CAST (union yyalloc *,
976 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
979 YYSTACK_RELOCATE (yyss_alloc, yyss);
980 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
981 # undef YYSTACK_RELOCATE
983 YYSTACK_FREE (yyss1);
987 yyssp = yyss + yysize - 1;
988 yyvsp = yyvs + yysize - 1;
990 YY_IGNORE_USELESS_CAST_BEGIN
991 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
992 YY_CAST (long, yystacksize)));
993 YY_IGNORE_USELESS_CAST_END
995 if (yyss + yystacksize - 1 <= yyssp)
998 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1001 if (yystate == YYFINAL)
1011 /* Do appropriate processing given the current state. Read a
1012 lookahead token if we need one and don't already have one. */
1014 /* First try to decide what to do without reference to lookahead token. */
1015 yyn = yypact[yystate];
1016 if (yypact_value_is_default (yyn))
1019 /* Not known => get a lookahead token if don't already have one. */
1021 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1022 if (yychar == YYEMPTY)
1024 YYDPRINTF ((stderr, "Reading a token\n"));
1028 if (yychar <= YYEOF)
1031 yytoken = YYSYMBOL_YYEOF;
1032 YYDPRINTF ((stderr, "Now at end of input.\n"));
1034 else if (yychar == YYerror)
1036 /* The scanner already issued an error message, process directly
1037 to error recovery. But do not keep the error token as
1038 lookahead, it is too special and may lead us to an endless
1039 loop in error recovery. */
1041 yytoken = YYSYMBOL_YYerror;
1046 yytoken = YYTRANSLATE (yychar);
1047 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1050 /* If the proper action on seeing token YYTOKEN is to reduce or to
1051 detect an error, take that action. */
1053 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1058 if (yytable_value_is_error (yyn))
1064 /* Count tokens shifted since error; after three, turn off error
1069 /* Shift the lookahead token. */
1070 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1072 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1074 YY_IGNORE_MAYBE_UNINITIALIZED_END
1076 /* Discard the shifted token. */
1081 /*-----------------------------------------------------------.
1082 | yydefault -- do the default action for the current state. |
1083 `-----------------------------------------------------------*/
1085 yyn = yydefact[yystate];
1091 /*-----------------------------.
1092 | yyreduce -- do a reduction. |
1093 `-----------------------------*/
1095 /* yyn is the number of a rule to reduce with. */
1098 /* If YYLEN is nonzero, implement the default value of the action:
1101 Otherwise, the following line sets YYVAL to garbage.
1102 This behavior is undocumented and Bison
1103 users should not rely upon it. Assigning to YYVAL
1104 unconditionally makes the parser a bit smaller, and it avoids a
1105 GCC warning that YYVAL may be used uninitialized. */
1106 yyval = yyvsp[1-yylen];
1109 YY_REDUCE_PRINT (yyn);
1112 case 4: /* $@1: %empty */
1113 #line 64 "parserPromela.yacc"
1114 { new_state((yyvsp[-1].string), 1);}
1115 #line 1116 "parserPromela.tab.cacc"
1118 case 7: /* option: CASE exp IMPLIES GOTO ID option */
1119 #line 68 "parserPromela.yacc"
1120 { new_transition((yyvsp[-1].string), (yyvsp[-4].label));}
1121 #line 1122 "parserPromela.tab.cacc"
1124 case 8: /* exp: LEFT_PAR exp RIGHT_PAR */
1125 #line 71 "parserPromela.yacc"
1126 { (yyval.label) = (yyvsp[-1].label); }
1127 #line 1128 "parserPromela.tab.cacc"
1130 case 9: /* exp: exp OR exp */
1131 #line 72 "parserPromela.yacc"
1132 { (yyval.label) = xbt_automaton_exp_label_new_or((yyvsp[-2].label), (yyvsp[0].label)); }
1133 #line 1134 "parserPromela.tab.cacc"
1136 case 10: /* exp: exp AND exp */
1137 #line 73 "parserPromela.yacc"
1138 { (yyval.label) = xbt_automaton_exp_label_new_and((yyvsp[-2].label), (yyvsp[0].label)); }
1139 #line 1140 "parserPromela.tab.cacc"
1142 case 11: /* exp: NOT exp */
1143 #line 74 "parserPromela.yacc"
1144 { (yyval.label) = xbt_automaton_exp_label_new_not((yyvsp[0].label)); }
1145 #line 1146 "parserPromela.tab.cacc"
1148 case 12: /* exp: CASE_TRUE */
1149 #line 75 "parserPromela.yacc"
1150 { (yyval.label) = xbt_automaton_exp_label_new_one(); }
1151 #line 1152 "parserPromela.tab.cacc"
1154 case 13: /* exp: ID */
1155 #line 76 "parserPromela.yacc"
1156 { (yyval.label) = xbt_automaton_exp_label_new_predicat((yyvsp[0].string)); }
1157 #line 1158 "parserPromela.tab.cacc"
1161 #line 1162 "parserPromela.tab.cacc"
1165 /* User semantic actions sometimes alter yychar, and that requires
1166 that yytoken be updated with the new translation. We take the
1167 approach of translating immediately before every use of yytoken.
1168 One alternative is translating here after every semantic action,
1169 but that translation would be missed if the semantic action invokes
1170 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1171 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1172 incorrect destructor might then be invoked immediately. In the
1173 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1174 to an incorrect destructor call or verbose syntax error message
1175 before the lookahead is translated. */
1176 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1183 /* Now 'shift' the result of the reduction. Determine what state
1184 that goes to, based on the state we popped back to and the rule
1185 number reduced by. */
1187 const int yylhs = yyr1[yyn] - YYNTOKENS;
1188 const int yyi = yypgoto[yylhs] + *yyssp;
1189 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1191 : yydefgoto[yylhs]);
1197 /*--------------------------------------.
1198 | yyerrlab -- here on detecting error. |
1199 `--------------------------------------*/
1201 /* Make sure we have latest lookahead translation. See comments at
1202 user semantic actions for why this is necessary. */
1203 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1204 /* If not already recovering from an error, report this error. */
1208 yyerror (YY_("syntax error"));
1211 if (yyerrstatus == 3)
1213 /* If just tried and failed to reuse lookahead token after an
1214 error, discard it. */
1216 if (yychar <= YYEOF)
1218 /* Return failure if at end of input. */
1219 if (yychar == YYEOF)
1224 yydestruct ("Error: discarding",
1230 /* Else will try to reuse lookahead token after shifting the error
1235 /*---------------------------------------------------.
1236 | yyerrorlab -- error raised explicitly by YYERROR. |
1237 `---------------------------------------------------*/
1239 /* Pacify compilers when the user code never invokes YYERROR and the
1240 label yyerrorlab therefore never appears in user code. */
1245 /* Do not reclaim the symbols of the rule whose action triggered
1249 YY_STACK_PRINT (yyss, yyssp);
1254 /*-------------------------------------------------------------.
1255 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1256 `-------------------------------------------------------------*/
1258 yyerrstatus = 3; /* Each real token shifted decrements this. */
1260 /* Pop stack until we find a state that shifts the error token. */
1263 yyn = yypact[yystate];
1264 if (!yypact_value_is_default (yyn))
1266 yyn += YYSYMBOL_YYerror;
1267 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1275 /* Pop the current state because it cannot handle the error token. */
1280 yydestruct ("Error: popping",
1281 YY_ACCESSING_SYMBOL (yystate), yyvsp);
1284 YY_STACK_PRINT (yyss, yyssp);
1287 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1289 YY_IGNORE_MAYBE_UNINITIALIZED_END
1292 /* Shift the error token. */
1293 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1299 /*-------------------------------------.
1300 | yyacceptlab -- YYACCEPT comes here. |
1301 `-------------------------------------*/
1307 /*-----------------------------------.
1308 | yyabortlab -- YYABORT comes here. |
1309 `-----------------------------------*/
1315 /*-----------------------------------------------------------.
1316 | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. |
1317 `-----------------------------------------------------------*/
1319 yyerror (YY_("memory exhausted"));
1324 /*----------------------------------------------------------.
1325 | yyreturnlab -- parsing is finished, clean up and return. |
1326 `----------------------------------------------------------*/
1328 if (yychar != YYEMPTY)
1330 /* Make sure we have latest lookahead translation. See comments at
1331 user semantic actions for why this is necessary. */
1332 yytoken = YYTRANSLATE (yychar);
1333 yydestruct ("Cleanup: discarding lookahead",
1336 /* Do not reclaim the symbols of the rule whose action triggered
1337 this YYABORT or YYACCEPT. */
1339 YY_STACK_PRINT (yyss, yyssp);
1340 while (yyssp != yyss)
1342 yydestruct ("Cleanup: popping",
1343 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1348 YYSTACK_FREE (yyss);
1354 #line 79 "parserPromela.yacc"
1359 void yyerror(const char *s){
1360 fprintf (stderr, "%s\n", s);