1 /* A Bison parser, made by GNU Bison 3.7.6. */
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.7.6"
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 #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
308 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
309 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
310 _Pragma ("GCC diagnostic push") \
311 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
312 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
313 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
314 _Pragma ("GCC diagnostic pop")
316 # define YY_INITIAL_VALUE(Value) Value
318 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
319 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
320 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
322 #ifndef YY_INITIAL_VALUE
323 # define YY_INITIAL_VALUE(Value) /* Nothing. */
326 #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
327 # define YY_IGNORE_USELESS_CAST_BEGIN \
328 _Pragma ("GCC diagnostic push") \
329 _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
330 # define YY_IGNORE_USELESS_CAST_END \
331 _Pragma ("GCC diagnostic pop")
333 #ifndef YY_IGNORE_USELESS_CAST_BEGIN
334 # define YY_IGNORE_USELESS_CAST_BEGIN
335 # define YY_IGNORE_USELESS_CAST_END
339 #define YY_ASSERT(E) ((void) (0 && (E)))
341 #if !defined yyoverflow
343 /* The parser invokes alloca or malloc; define the necessary symbols. */
345 # ifdef YYSTACK_USE_ALLOCA
346 # if YYSTACK_USE_ALLOCA
348 # define YYSTACK_ALLOC __builtin_alloca
349 # elif defined __BUILTIN_VA_ARG_INCR
350 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
352 # define YYSTACK_ALLOC __alloca
353 # elif defined _MSC_VER
354 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
355 # define alloca _alloca
357 # define YYSTACK_ALLOC alloca
358 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
359 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
360 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
361 # ifndef EXIT_SUCCESS
362 # define EXIT_SUCCESS 0
369 # ifdef YYSTACK_ALLOC
370 /* Pacify GCC's 'empty if-body' warning. */
371 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
372 # ifndef YYSTACK_ALLOC_MAXIMUM
373 /* The OS might guarantee only one guard page at the bottom of the stack,
374 and a page size can be as small as 4096 bytes. So we cannot safely
375 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
376 to allow for a few compiler-allocated temporary stack slots. */
377 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
380 # define YYSTACK_ALLOC YYMALLOC
381 # define YYSTACK_FREE YYFREE
382 # ifndef YYSTACK_ALLOC_MAXIMUM
383 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
385 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
386 && ! ((defined YYMALLOC || defined malloc) \
387 && (defined YYFREE || defined free)))
388 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
389 # ifndef EXIT_SUCCESS
390 # define EXIT_SUCCESS 0
394 # define YYMALLOC malloc
395 # if ! defined malloc && ! defined EXIT_SUCCESS
396 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
401 # if ! defined free && ! defined EXIT_SUCCESS
402 void free (void *); /* INFRINGES ON USER NAME SPACE */
406 #endif /* !defined yyoverflow */
408 #if (! defined yyoverflow \
409 && (! defined __cplusplus \
410 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
412 /* A type that is properly aligned for any stack member. */
415 yy_state_t yyss_alloc;
419 /* The size of the maximum gap between one aligned stack and the next. */
420 # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
422 /* The size of an array large to enough to hold all stacks, each with
424 # define YYSTACK_BYTES(N) \
425 ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
426 + YYSTACK_GAP_MAXIMUM)
428 # define YYCOPY_NEEDED 1
430 /* Relocate STACK from its old location to the new one. The
431 local variables YYSIZE and YYSTACKSIZE give the old and new number of
432 elements in the stack, and YYPTR gives the new location of the
433 stack. Advance YYPTR to a properly aligned location for the next
435 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
438 YYPTRDIFF_T yynewbytes; \
439 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
440 Stack = &yyptr->Stack_alloc; \
441 yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
442 yyptr += yynewbytes / YYSIZEOF (*yyptr); \
448 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
449 /* Copy COUNT objects from SRC to DST. The source and destination do
452 # if defined __GNUC__ && 1 < __GNUC__
453 # define YYCOPY(Dst, Src, Count) \
454 __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
456 # define YYCOPY(Dst, Src, Count) \
460 for (yyi = 0; yyi < (Count); yyi++) \
461 (Dst)[yyi] = (Src)[yyi]; \
466 #endif /* !YYCOPY_NEEDED */
468 /* YYFINAL -- State number of the termination state. */
470 /* YYLAST -- Last index in YYTABLE. */
473 /* YYNTOKENS -- Number of terminals. */
475 /* YYNNTS -- Number of nonterminals. */
477 /* YYNRULES -- Number of rules. */
479 /* YYNSTATES -- Number of states. */
482 /* YYMAXUTOK -- Last valid token kind. */
483 #define YYMAXUTOK 277
486 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
487 as returned by yylex, with out-of-bounds checking. */
488 #define YYTRANSLATE(YYX) \
489 (0 <= (YYX) && (YYX) <= YYMAXUTOK \
490 ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
493 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
494 as returned by yylex. */
495 static const yytype_int8 yytranslate[] =
497 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
498 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
499 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
500 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
501 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
502 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
503 2, 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, 1, 2, 3, 4,
523 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
524 15, 16, 17, 18, 19, 20, 21, 22
528 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
529 static const yytype_int8 yyrline[] =
531 0, 60, 60, 63, 64, 64, 67, 68, 71, 72,
536 /** Accessing symbol of state STATE. */
537 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
540 /* The user-facing name of the symbol whose (internal) number is
541 YYSYMBOL. No bounds checking. */
542 static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
544 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
545 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
546 static const char *const yytname[] =
548 "\"end of file\"", "error", "\"invalid token\"", "NEVER", "IF", "FI",
549 "IMPLIES", "GOTO", "AND", "OR", "NOT", "LEFT_PAR", "RIGHT_PAR", "CASE",
550 "COLON", "SEMI_COLON", "CASE_TRUE", "LEFT_BRACE", "RIGHT_BRACE",
551 "LITT_ENT", "LITT_CHAINE", "LITT_REEL", "ID", "$accept", "automaton",
552 "stateseq", "$@1", "option", "exp", YY_NULLPTR
556 yysymbol_name (yysymbol_kind_t yysymbol)
558 return yytname[yysymbol];
563 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
564 (internal) symbol number NUM (which must be that of a token). */
565 static const yytype_int16 yytoknum[] =
567 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
568 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
573 #define YYPACT_NINF (-16)
575 #define yypact_value_is_default(Yyn) \
576 ((Yyn) == YYPACT_NINF)
578 #define YYTABLE_NINF (-1)
580 #define yytable_value_is_error(Yyn) \
583 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
585 static const yytype_int8 yypact[] =
587 0, -15, 10, -13, -16, 2, 1, -16, -16, 16,
588 8, -10, 17, -10, -10, -16, -16, 9, 11, -16,
589 -1, 18, -10, -10, -13, -16, 5, -16, -16, -16,
593 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
594 Performed when YYTABLE does not specify something else to do. Zero
595 means the default is an error. */
596 static const yytype_int8 yydefact[] =
598 0, 0, 0, 3, 1, 0, 0, 4, 2, 0,
599 6, 0, 0, 0, 0, 12, 13, 0, 0, 11,
600 0, 0, 0, 0, 3, 8, 0, 10, 9, 5,
604 /* YYPGOTO[NTERM-NUM]. */
605 static const yytype_int8 yypgoto[] =
607 -16, -16, 4, -16, -7, -9
610 /* YYDEFGOTO[NTERM-NUM]. */
611 static const yytype_int8 yydefgoto[] =
616 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
617 positive, shift that token. If negative, reduce the rule whose
618 number is the opposite. If YYTABLE_NINF, syntax error. */
619 static const yytype_int8 yytable[] =
621 13, 14, 3, 1, 19, 20, 15, 22, 23, 5,
622 4, 25, 16, 27, 28, 21, 7, 22, 23, 8,
623 10, 11, 18, 31, 0, 26, 24, 30, 29
626 static const yytype_int8 yycheck[] =
628 10, 11, 17, 3, 13, 14, 16, 8, 9, 22,
629 0, 12, 22, 22, 23, 6, 14, 8, 9, 18,
630 4, 13, 5, 30, -1, 7, 15, 22, 24
633 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
634 symbol of state STATE-NUM. */
635 static const yytype_int8 yystos[] =
637 0, 3, 24, 17, 0, 22, 25, 14, 18, 26,
638 4, 13, 27, 10, 11, 16, 22, 28, 5, 28,
639 28, 6, 8, 9, 15, 12, 7, 28, 28, 25,
643 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
644 static const yytype_int8 yyr1[] =
646 0, 23, 24, 25, 26, 25, 27, 27, 28, 28,
650 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
651 static const yytype_int8 yyr2[] =
653 0, 2, 4, 0, 0, 8, 0, 6, 3, 3,
658 enum { YYENOMEM = -2 };
660 #define yyerrok (yyerrstatus = 0)
661 #define yyclearin (yychar = YYEMPTY)
663 #define YYACCEPT goto yyacceptlab
664 #define YYABORT goto yyabortlab
665 #define YYERROR goto yyerrorlab
668 #define YYRECOVERING() (!!yyerrstatus)
670 #define YYBACKUP(Token, Value) \
672 if (yychar == YYEMPTY) \
676 YYPOPSTACK (yylen); \
682 yyerror (YY_("syntax error: cannot back up")); \
687 /* Backward compatibility with an undocumented macro.
688 Use YYerror or YYUNDEF. */
689 #define YYERRCODE YYUNDEF
692 /* Enable debugging if requested. */
696 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
697 # define YYFPRINTF fprintf
700 # define YYDPRINTF(Args) \
706 /* This macro is provided for backward compatibility. */
707 # ifndef YY_LOCATION_PRINT
708 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
712 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
716 YYFPRINTF (stderr, "%s ", Title); \
717 yy_symbol_print (stderr, \
719 YYFPRINTF (stderr, "\n"); \
724 /*-----------------------------------.
725 | Print this symbol's value on YYO. |
726 `-----------------------------------*/
729 yy_symbol_value_print (FILE *yyo,
730 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
732 FILE *yyoutput = yyo;
737 if (yykind < YYNTOKENS)
738 YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
740 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
742 YY_IGNORE_MAYBE_UNINITIALIZED_END
746 /*---------------------------.
747 | Print this symbol on YYO. |
748 `---------------------------*/
751 yy_symbol_print (FILE *yyo,
752 yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
754 YYFPRINTF (yyo, "%s %s (",
755 yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
757 yy_symbol_value_print (yyo, yykind, yyvaluep);
758 YYFPRINTF (yyo, ")");
761 /*------------------------------------------------------------------.
762 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
764 `------------------------------------------------------------------*/
767 yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
769 YYFPRINTF (stderr, "Stack now");
770 for (; yybottom <= yytop; yybottom++)
772 int yybot = *yybottom;
773 YYFPRINTF (stderr, " %d", yybot);
775 YYFPRINTF (stderr, "\n");
778 # define YY_STACK_PRINT(Bottom, Top) \
781 yy_stack_print ((Bottom), (Top)); \
785 /*------------------------------------------------.
786 | Report that the YYRULE is going to be reduced. |
787 `------------------------------------------------*/
790 yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
793 int yylno = yyrline[yyrule];
794 int yynrhs = yyr2[yyrule];
796 YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
798 /* The symbols being reduced. */
799 for (yyi = 0; yyi < yynrhs; yyi++)
801 YYFPRINTF (stderr, " $%d = ", yyi + 1);
802 yy_symbol_print (stderr,
803 YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
804 &yyvsp[(yyi + 1) - (yynrhs)]);
805 YYFPRINTF (stderr, "\n");
809 # define YY_REDUCE_PRINT(Rule) \
812 yy_reduce_print (yyssp, yyvsp, Rule); \
815 /* Nonzero means print parse trace. It is left uninitialized so that
816 multiple parsers can coexist. */
819 # define YYDPRINTF(Args) ((void) 0)
820 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
821 # define YY_STACK_PRINT(Bottom, Top)
822 # define YY_REDUCE_PRINT(Rule)
823 #endif /* !YYDEBUG */
826 /* YYINITDEPTH -- initial size of the parser's stacks. */
828 # define YYINITDEPTH 200
831 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
832 if the built-in stack extension method is used).
834 Do not make this value too large; the results are undefined if
835 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
836 evaluated with infinite-precision integer arithmetic. */
839 # define YYMAXDEPTH 10000
847 /*-----------------------------------------------.
848 | Release the memory associated to this symbol. |
849 `-----------------------------------------------*/
852 yydestruct (const char *yymsg,
853 yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
858 YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
860 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
862 YY_IGNORE_MAYBE_UNINITIALIZED_END
866 /* Lookahead token kind. */
869 /* The semantic value of the lookahead symbol. */
871 /* Number of syntax errors so far. */
884 yy_state_fast_t yystate = 0;
885 /* Number of tokens to shift before error messages enabled. */
888 /* Refer to the stacks through separate pointers, to allow yyoverflow
889 to reallocate them elsewhere. */
892 YYPTRDIFF_T yystacksize = YYINITDEPTH;
894 /* The state stack: array, bottom, top. */
895 yy_state_t yyssa[YYINITDEPTH];
896 yy_state_t *yyss = yyssa;
897 yy_state_t *yyssp = yyss;
899 /* The semantic value stack: array, bottom, top. */
900 YYSTYPE yyvsa[YYINITDEPTH];
901 YYSTYPE *yyvs = yyvsa;
902 YYSTYPE *yyvsp = yyvs;
905 /* The return value of yyparse. */
907 /* Lookahead symbol kind. */
908 yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
909 /* The variables used to return semantic value and location from the
915 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
917 /* The number of symbols on the RHS of the reduced rule.
918 Keep to zero when no symbol should be popped. */
921 YYDPRINTF ((stderr, "Starting parse\n"));
923 yychar = YYEMPTY; /* Cause a token to be read. */
927 /*------------------------------------------------------------.
928 | yynewstate -- push a new state, which is found in yystate. |
929 `------------------------------------------------------------*/
931 /* In all cases, when you get here, the value and location stacks
932 have just been pushed. So pushing a state here evens the stacks. */
936 /*--------------------------------------------------------------------.
937 | yysetstate -- set current state (the top of the stack) to yystate. |
938 `--------------------------------------------------------------------*/
940 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
941 YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
942 YY_IGNORE_USELESS_CAST_BEGIN
943 *yyssp = YY_CAST (yy_state_t, yystate);
944 YY_IGNORE_USELESS_CAST_END
945 YY_STACK_PRINT (yyss, yyssp);
947 if (yyss + yystacksize - 1 <= yyssp)
948 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
952 /* Get the current used size of the three stacks, in elements. */
953 YYPTRDIFF_T yysize = yyssp - yyss + 1;
955 # if defined yyoverflow
957 /* Give user a chance to reallocate the stack. Use copies of
958 these so that the &'s don't force the real ones into
960 yy_state_t *yyss1 = yyss;
961 YYSTYPE *yyvs1 = yyvs;
963 /* Each stack pointer address is followed by the size of the
964 data in use in that stack, in bytes. This used to be a
965 conditional around just the two extra args, but that might
966 be undefined if yyoverflow is a macro. */
967 yyoverflow (YY_("memory exhausted"),
968 &yyss1, yysize * YYSIZEOF (*yyssp),
969 &yyvs1, yysize * YYSIZEOF (*yyvsp),
974 # else /* defined YYSTACK_RELOCATE */
975 /* Extend the stack our own way. */
976 if (YYMAXDEPTH <= yystacksize)
979 if (YYMAXDEPTH < yystacksize)
980 yystacksize = YYMAXDEPTH;
983 yy_state_t *yyss1 = yyss;
984 union yyalloc *yyptr =
985 YY_CAST (union yyalloc *,
986 YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
989 YYSTACK_RELOCATE (yyss_alloc, yyss);
990 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
991 # undef YYSTACK_RELOCATE
993 YYSTACK_FREE (yyss1);
997 yyssp = yyss + yysize - 1;
998 yyvsp = yyvs + yysize - 1;
1000 YY_IGNORE_USELESS_CAST_BEGIN
1001 YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1002 YY_CAST (long, yystacksize)));
1003 YY_IGNORE_USELESS_CAST_END
1005 if (yyss + yystacksize - 1 <= yyssp)
1008 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1010 if (yystate == YYFINAL)
1020 /* Do appropriate processing given the current state. Read a
1021 lookahead token if we need one and don't already have one. */
1023 /* First try to decide what to do without reference to lookahead token. */
1024 yyn = yypact[yystate];
1025 if (yypact_value_is_default (yyn))
1028 /* Not known => get a lookahead token if don't already have one. */
1030 /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1031 if (yychar == YYEMPTY)
1033 YYDPRINTF ((stderr, "Reading a token\n"));
1037 if (yychar <= YYEOF)
1040 yytoken = YYSYMBOL_YYEOF;
1041 YYDPRINTF ((stderr, "Now at end of input.\n"));
1043 else if (yychar == YYerror)
1045 /* The scanner already issued an error message, process directly
1046 to error recovery. But do not keep the error token as
1047 lookahead, it is too special and may lead us to an endless
1048 loop in error recovery. */
1050 yytoken = YYSYMBOL_YYerror;
1055 yytoken = YYTRANSLATE (yychar);
1056 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1059 /* If the proper action on seeing token YYTOKEN is to reduce or to
1060 detect an error, take that action. */
1062 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1067 if (yytable_value_is_error (yyn))
1073 /* Count tokens shifted since error; after three, turn off error
1078 /* Shift the lookahead token. */
1079 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1081 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1083 YY_IGNORE_MAYBE_UNINITIALIZED_END
1085 /* Discard the shifted token. */
1090 /*-----------------------------------------------------------.
1091 | yydefault -- do the default action for the current state. |
1092 `-----------------------------------------------------------*/
1094 yyn = yydefact[yystate];
1100 /*-----------------------------.
1101 | yyreduce -- do a reduction. |
1102 `-----------------------------*/
1104 /* yyn is the number of a rule to reduce with. */
1107 /* If YYLEN is nonzero, implement the default value of the action:
1110 Otherwise, the following line sets YYVAL to garbage.
1111 This behavior is undocumented and Bison
1112 users should not rely upon it. Assigning to YYVAL
1113 unconditionally makes the parser a bit smaller, and it avoids a
1114 GCC warning that YYVAL may be used uninitialized. */
1115 yyval = yyvsp[1-yylen];
1118 YY_REDUCE_PRINT (yyn);
1121 case 4: /* $@1: %empty */
1122 #line 64 "parserPromela.yacc"
1123 { new_state((yyvsp[-1].string), 1);}
1124 #line 1125 "parserPromela.tab.cacc"
1127 case 7: /* option: CASE exp IMPLIES GOTO ID option */
1128 #line 68 "parserPromela.yacc"
1129 { new_transition((yyvsp[-1].string), (yyvsp[-4].label));}
1130 #line 1131 "parserPromela.tab.cacc"
1133 case 8: /* exp: LEFT_PAR exp RIGHT_PAR */
1134 #line 71 "parserPromela.yacc"
1135 { (yyval.label) = (yyvsp[-1].label); }
1136 #line 1137 "parserPromela.tab.cacc"
1139 case 9: /* exp: exp OR exp */
1140 #line 72 "parserPromela.yacc"
1141 { (yyval.label) = xbt_automaton_exp_label_new_or((yyvsp[-2].label), (yyvsp[0].label)); }
1142 #line 1143 "parserPromela.tab.cacc"
1145 case 10: /* exp: exp AND exp */
1146 #line 73 "parserPromela.yacc"
1147 { (yyval.label) = xbt_automaton_exp_label_new_and((yyvsp[-2].label), (yyvsp[0].label)); }
1148 #line 1149 "parserPromela.tab.cacc"
1151 case 11: /* exp: NOT exp */
1152 #line 74 "parserPromela.yacc"
1153 { (yyval.label) = xbt_automaton_exp_label_new_not((yyvsp[0].label)); }
1154 #line 1155 "parserPromela.tab.cacc"
1157 case 12: /* exp: CASE_TRUE */
1158 #line 75 "parserPromela.yacc"
1159 { (yyval.label) = xbt_automaton_exp_label_new_one(); }
1160 #line 1161 "parserPromela.tab.cacc"
1163 case 13: /* exp: ID */
1164 #line 76 "parserPromela.yacc"
1165 { (yyval.label) = xbt_automaton_exp_label_new_predicat((yyvsp[0].string)); }
1166 #line 1167 "parserPromela.tab.cacc"
1170 #line 1171 "parserPromela.tab.cacc"
1174 /* User semantic actions sometimes alter yychar, and that requires
1175 that yytoken be updated with the new translation. We take the
1176 approach of translating immediately before every use of yytoken.
1177 One alternative is translating here after every semantic action,
1178 but that translation would be missed if the semantic action invokes
1179 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1180 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1181 incorrect destructor might then be invoked immediately. In the
1182 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1183 to an incorrect destructor call or verbose syntax error message
1184 before the lookahead is translated. */
1185 YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1192 /* Now 'shift' the result of the reduction. Determine what state
1193 that goes to, based on the state we popped back to and the rule
1194 number reduced by. */
1196 const int yylhs = yyr1[yyn] - YYNTOKENS;
1197 const int yyi = yypgoto[yylhs] + *yyssp;
1198 yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1200 : yydefgoto[yylhs]);
1206 /*--------------------------------------.
1207 | yyerrlab -- here on detecting error. |
1208 `--------------------------------------*/
1210 /* Make sure we have latest lookahead translation. See comments at
1211 user semantic actions for why this is necessary. */
1212 yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1213 /* If not already recovering from an error, report this error. */
1217 yyerror (YY_("syntax error"));
1220 if (yyerrstatus == 3)
1222 /* If just tried and failed to reuse lookahead token after an
1223 error, discard it. */
1225 if (yychar <= YYEOF)
1227 /* Return failure if at end of input. */
1228 if (yychar == YYEOF)
1233 yydestruct ("Error: discarding",
1239 /* Else will try to reuse lookahead token after shifting the error
1244 /*---------------------------------------------------.
1245 | yyerrorlab -- error raised explicitly by YYERROR. |
1246 `---------------------------------------------------*/
1248 /* Pacify compilers when the user code never invokes YYERROR and the
1249 label yyerrorlab therefore never appears in user code. */
1253 /* Do not reclaim the symbols of the rule whose action triggered
1257 YY_STACK_PRINT (yyss, yyssp);
1262 /*-------------------------------------------------------------.
1263 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1264 `-------------------------------------------------------------*/
1266 yyerrstatus = 3; /* Each real token shifted decrements this. */
1268 /* Pop stack until we find a state that shifts the error token. */
1271 yyn = yypact[yystate];
1272 if (!yypact_value_is_default (yyn))
1274 yyn += YYSYMBOL_YYerror;
1275 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1283 /* Pop the current state because it cannot handle the error token. */
1288 yydestruct ("Error: popping",
1289 YY_ACCESSING_SYMBOL (yystate), yyvsp);
1292 YY_STACK_PRINT (yyss, yyssp);
1295 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1297 YY_IGNORE_MAYBE_UNINITIALIZED_END
1300 /* Shift the error token. */
1301 YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1307 /*-------------------------------------.
1308 | yyacceptlab -- YYACCEPT comes here. |
1309 `-------------------------------------*/
1315 /*-----------------------------------.
1316 | yyabortlab -- YYABORT comes here. |
1317 `-----------------------------------*/
1323 #if !defined yyoverflow
1324 /*-------------------------------------------------.
1325 | yyexhaustedlab -- memory exhaustion comes here. |
1326 `-------------------------------------------------*/
1328 yyerror (YY_("memory exhausted"));
1334 /*-------------------------------------------------------.
1335 | yyreturn -- parsing is finished, clean up and return. |
1336 `-------------------------------------------------------*/
1338 if (yychar != YYEMPTY)
1340 /* Make sure we have latest lookahead translation. See comments at
1341 user semantic actions for why this is necessary. */
1342 yytoken = YYTRANSLATE (yychar);
1343 yydestruct ("Cleanup: discarding lookahead",
1346 /* Do not reclaim the symbols of the rule whose action triggered
1347 this YYABORT or YYACCEPT. */
1349 YY_STACK_PRINT (yyss, yyssp);
1350 while (yyssp != yyss)
1352 yydestruct ("Cleanup: popping",
1353 YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1358 YYSTACK_FREE (yyss);
1364 #line 79 "parserPromela.yacc"
1369 void yyerror(const char *s){
1370 fprintf (stderr, "%s\n", s);