1 /* A Bison parser, made by GNU Bison 3.0.4. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.4"
50 #define YYSKELETON_NAME "yacc.c"
62 /* Substitute the variable and function names. */
63 #define yyparse sexparse
65 #define yyerror sexerror
66 #define yydebug sexdebug
67 #define yynerrs sexnerrs
70 /* Copy the first part of user declarations. */
71 #line 31 "../../src/rec-sex-tab.y" /* yacc.c:339 */
80 #include <rec-sex-ast.h>
81 #include <rec-sex-parser.h>
82 #include "rec-sex-tab.h"
83 /* #include "rec-sex-lex.h" */
85 void sexerror (rec_sex_parser_t context
, const char *err
)
90 #define scanner (rec_sex_parser_scanner (sex_parser))
92 #define CREATE_NODE_OP1(TYPE,RES,OP) \
95 /* Create the node. */ \
96 (RES) = rec_sex_ast_node_new (); \
97 rec_sex_ast_node_set_type ((RES), (TYPE)); \
100 rec_sex_ast_node_link ((RES), (OP)); \
104 #define CREATE_NODE_OP2(TYPE, RES, OP1, OP2) \
107 /* Create the node. */ \
108 (RES) = rec_sex_ast_node_new (); \
109 rec_sex_ast_node_set_type ((RES), (TYPE)); \
111 /* Set children. */ \
112 rec_sex_ast_node_link ((RES), (OP1)); \
113 rec_sex_ast_node_link ((RES), (OP2)); \
117 #define CREATE_NODE_OP3(TYPE, RES, OP1, OP2, OP3) \
120 /* Create the node. */ \
121 (RES) = rec_sex_ast_node_new (); \
122 rec_sex_ast_node_set_type ((RES), (TYPE)); \
124 /* Set children. */ \
125 rec_sex_ast_node_link ((RES), (OP1)); \
126 rec_sex_ast_node_link ((RES), (OP2)); \
127 rec_sex_ast_node_link ((RES), (OP3)); \
132 #line 133 "rec-sex-tab.c" /* yacc.c:339 */
135 # if defined __cplusplus && 201103L <= __cplusplus
136 # define YY_NULLPTR nullptr
138 # define YY_NULLPTR 0
142 /* Enabling verbose error messages. */
143 #ifdef YYERROR_VERBOSE
144 # undef YYERROR_VERBOSE
145 # define YYERROR_VERBOSE 1
147 # define YYERROR_VERBOSE 0
150 /* In a future release of Bison, this section will be replaced
151 by #include "y.tab.h". */
152 #ifndef YY_SEX_REC_SEX_TAB_H_INCLUDED
153 # define YY_SEX_REC_SEX_TAB_H_INCLUDED
167 REC_SEX_TOK_INT
= 258,
168 REC_SEX_TOK_REAL
= 259,
169 REC_SEX_TOK_STR
= 260,
170 REC_SEX_TOK_NAM
= 261,
171 REC_SEX_TOK_COLON
= 262,
172 REC_SEX_TOK_QM
= 263,
173 REC_SEX_TOK_IMPLIES
= 264,
174 REC_SEX_TOK_AND
= 265,
175 REC_SEX_TOK_OR
= 266,
176 REC_SEX_TOK_EQL
= 267,
177 REC_SEX_TOK_NEQ
= 268,
178 REC_SEX_TOK_LT
= 269,
179 REC_SEX_TOK_GT
= 270,
180 REC_SEX_TOK_LTE
= 271,
181 REC_SEX_TOK_GTE
= 272,
182 REC_SEX_TOK_SAMETIME
= 273,
183 REC_SEX_TOK_AFTER
= 274,
184 REC_SEX_TOK_BEFORE
= 275,
185 REC_SEX_TOK_SUB
= 276,
186 REC_SEX_TOK_ADD
= 277,
187 REC_SEX_TOK_MUL
= 278,
188 REC_SEX_TOK_DIV
= 279,
189 REC_SEX_TOK_MOD
= 280,
190 REC_SEX_TOK_MAT
= 281,
191 REC_SEX_TOK_AMP
= 282,
192 REC_SEX_TOK_NEG
= 283,
193 REC_SEX_TOK_MIN
= 284,
194 REC_SEX_TOK_NOT
= 285,
195 REC_SEX_TOK_BP
= 286,
196 REC_SEX_TOK_EP
= 287,
197 REC_SEX_TOK_ERR
= 288,
198 REC_SEX_TOK_SHARP
= 289
203 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
207 #line 92 "../../src/rec-sex-tab.y" /* yacc.c:355 */
209 rec_sex_ast_node_t node
;
212 #line 213 "rec-sex-tab.c" /* yacc.c:355 */
215 typedef union YYSTYPE YYSTYPE
;
216 # define YYSTYPE_IS_TRIVIAL 1
217 # define YYSTYPE_IS_DECLARED 1
222 int sexparse (rec_sex_parser_t sex_parser
);
224 #endif /* !YY_SEX_REC_SEX_TAB_H_INCLUDED */
226 /* Copy the second part of user declarations. */
228 #line 229 "rec-sex-tab.c" /* yacc.c:358 */
235 typedef YYTYPE_UINT8 yytype_uint8
;
237 typedef unsigned char yytype_uint8
;
241 typedef YYTYPE_INT8 yytype_int8
;
243 typedef signed char yytype_int8
;
247 typedef YYTYPE_UINT16 yytype_uint16
;
249 typedef unsigned short int yytype_uint16
;
253 typedef YYTYPE_INT16 yytype_int16
;
255 typedef short int yytype_int16
;
259 # ifdef __SIZE_TYPE__
260 # define YYSIZE_T __SIZE_TYPE__
261 # elif defined size_t
262 # define YYSIZE_T size_t
263 # elif ! defined YYSIZE_T
264 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
265 # define YYSIZE_T size_t
267 # define YYSIZE_T unsigned int
271 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
274 # if defined YYENABLE_NLS && YYENABLE_NLS
276 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
277 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
281 # define YY_(Msgid) Msgid
286 # if (defined __GNUC__ \
287 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
288 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
289 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
291 # define YY_ATTRIBUTE(Spec) /* empty */
295 #ifndef YY_ATTRIBUTE_PURE
296 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
299 #ifndef YY_ATTRIBUTE_UNUSED
300 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
303 #if !defined _Noreturn \
304 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
305 # if defined _MSC_VER && 1200 <= _MSC_VER
306 # define _Noreturn __declspec (noreturn)
308 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
312 /* Suppress unused-variable warnings by "using" E. */
313 #if ! defined lint || defined __GNUC__
314 # define YYUSE(E) ((void) (E))
316 # define YYUSE(E) /* empty */
319 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
320 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
321 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
322 _Pragma ("GCC diagnostic push") \
323 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
324 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
325 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
326 _Pragma ("GCC diagnostic pop")
328 # define YY_INITIAL_VALUE(Value) Value
330 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
331 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
332 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
334 #ifndef YY_INITIAL_VALUE
335 # define YY_INITIAL_VALUE(Value) /* Nothing. */
339 #if ! defined yyoverflow || YYERROR_VERBOSE
341 /* The parser invokes alloca or malloc; define the necessary symbols. */
343 # ifdef YYSTACK_USE_ALLOCA
344 # if YYSTACK_USE_ALLOCA
346 # define YYSTACK_ALLOC __builtin_alloca
347 # elif defined __BUILTIN_VA_ARG_INCR
348 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
350 # define YYSTACK_ALLOC __alloca
351 # elif defined _MSC_VER
352 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
353 # define alloca _alloca
355 # define YYSTACK_ALLOC alloca
356 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
357 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
358 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
359 # ifndef EXIT_SUCCESS
360 # define EXIT_SUCCESS 0
367 # ifdef YYSTACK_ALLOC
368 /* Pacify GCC's 'empty if-body' warning. */
369 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
370 # ifndef YYSTACK_ALLOC_MAXIMUM
371 /* The OS might guarantee only one guard page at the bottom of the stack,
372 and a page size can be as small as 4096 bytes. So we cannot safely
373 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
374 to allow for a few compiler-allocated temporary stack slots. */
375 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
378 # define YYSTACK_ALLOC YYMALLOC
379 # define YYSTACK_FREE YYFREE
380 # ifndef YYSTACK_ALLOC_MAXIMUM
381 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
383 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
384 && ! ((defined YYMALLOC || defined malloc) \
385 && (defined YYFREE || defined free)))
386 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
387 # ifndef EXIT_SUCCESS
388 # define EXIT_SUCCESS 0
392 # define YYMALLOC malloc
393 # if ! defined malloc && ! defined EXIT_SUCCESS
394 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
399 # if ! defined free && ! defined EXIT_SUCCESS
400 void free (void *); /* INFRINGES ON USER NAME SPACE */
404 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
407 #if (! defined yyoverflow \
408 && (! defined __cplusplus \
409 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
411 /* A type that is properly aligned for any stack member. */
414 yytype_int16 yyss_alloc
;
418 /* The size of the maximum gap between one aligned stack and the next. */
419 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
421 /* The size of an array large to enough to hold all stacks, each with
423 # define YYSTACK_BYTES(N) \
424 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
425 + YYSTACK_GAP_MAXIMUM)
427 # define YYCOPY_NEEDED 1
429 /* Relocate STACK from its old location to the new one. The
430 local variables YYSIZE and YYSTACKSIZE give the old and new number of
431 elements in the stack, and YYPTR gives the new location of the
432 stack. Advance YYPTR to a properly aligned location for the next
434 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
437 YYSIZE_T yynewbytes; \
438 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
439 Stack = &yyptr->Stack_alloc; \
440 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
441 yyptr += yynewbytes / sizeof (*yyptr); \
447 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
448 /* Copy COUNT objects from SRC to DST. The source and destination do
451 # if defined __GNUC__ && 1 < __GNUC__
452 # define YYCOPY(Dst, Src, Count) \
453 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
455 # define YYCOPY(Dst, Src, Count) \
459 for (yyi = 0; yyi < (Count); yyi++) \
460 (Dst)[yyi] = (Src)[yyi]; \
465 #endif /* !YYCOPY_NEEDED */
467 /* YYFINAL -- State number of the termination state. */
469 /* YYLAST -- Last index in YYTABLE. */
472 /* YYNTOKENS -- Number of terminals. */
474 /* YYNNTS -- Number of nonterminals. */
476 /* YYNRULES -- Number of rules. */
478 /* YYNSTATES -- Number of states. */
481 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
482 by yylex, with out-of-bounds checking. */
484 #define YYMAXUTOK 289
486 #define YYTRANSLATE(YYX) \
487 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
489 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
490 as returned by yylex, without out-of-bounds checking. */
491 static const yytype_uint8 yytranslate
[] =
493 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
494 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
495 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
496 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
497 2, 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, 1, 2, 3, 4,
519 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
520 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
521 25, 26, 27, 28, 29, 30, 31, 32, 33, 34
525 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
526 static const yytype_uint8 yyrline
[] =
528 0, 124, 124, 134, 135, 136, 137, 138, 140, 141,
529 142, 154, 155, 156, 157, 158, 159, 160, 161, 162,
530 163, 164, 165, 166, 167, 168, 169, 170, 171, 172
534 #if YYDEBUG || YYERROR_VERBOSE || 0
535 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
536 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
537 static const char *const yytname
[] =
539 "$end", "error", "$undefined", "REC_SEX_TOK_INT", "REC_SEX_TOK_REAL",
540 "REC_SEX_TOK_STR", "REC_SEX_TOK_NAM", "REC_SEX_TOK_COLON",
541 "REC_SEX_TOK_QM", "REC_SEX_TOK_IMPLIES", "REC_SEX_TOK_AND",
542 "REC_SEX_TOK_OR", "REC_SEX_TOK_EQL", "REC_SEX_TOK_NEQ", "REC_SEX_TOK_LT",
543 "REC_SEX_TOK_GT", "REC_SEX_TOK_LTE", "REC_SEX_TOK_GTE",
544 "REC_SEX_TOK_SAMETIME", "REC_SEX_TOK_AFTER", "REC_SEX_TOK_BEFORE",
545 "REC_SEX_TOK_SUB", "REC_SEX_TOK_ADD", "REC_SEX_TOK_MUL",
546 "REC_SEX_TOK_DIV", "REC_SEX_TOK_MOD", "REC_SEX_TOK_MAT",
547 "REC_SEX_TOK_AMP", "REC_SEX_TOK_NEG", "REC_SEX_TOK_MIN",
548 "REC_SEX_TOK_NOT", "REC_SEX_TOK_BP", "REC_SEX_TOK_EP", "REC_SEX_TOK_ERR",
549 "REC_SEX_TOK_SHARP", "$accept", "input", "exp", YY_NULLPTR
554 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
555 (internal) symbol number NUM (which must be that of a token). */
556 static const yytype_uint16 yytoknum
[] =
558 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
559 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
560 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
561 285, 286, 287, 288, 289
565 #define YYPACT_NINF -20
567 #define yypact_value_is_default(Yystate) \
568 (!!((Yystate) == (-20)))
570 #define YYTABLE_NINF -1
572 #define yytable_value_is_error(Yytable_value) \
575 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
577 static const yytype_int16 yypact
[] =
579 -1, -20, -20, -20, -20, -1, -1, 0, 7, 89,
580 -20, 43, -20, -20, -1, -1, -1, -1, -1, -1,
581 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
582 -1, -1, -1, -1, -20, 69, 108, 22, 22, 118,
583 118, 118, 118, 118, 118, 125, 125, 125, 130, 130,
584 -19, -19, -19, -19, -20, -1, 89
587 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
588 Performed when YYTABLE does not specify something else to do. Zero
589 means the default is an error. */
590 static const yytype_uint8 yydefact
[] =
592 0, 3, 4, 5, 6, 0, 0, 0, 0, 2,
593 24, 0, 28, 1, 0, 0, 0, 0, 0, 0,
594 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
595 0, 0, 0, 0, 29, 0, 23, 25, 26, 8,
596 9, 17, 16, 19, 18, 22, 20, 21, 12, 11,
597 13, 14, 15, 10, 27, 0, 7
600 /* YYPGOTO[NTERM-NUM]. */
601 static const yytype_int8 yypgoto
[] =
606 /* YYDEFGOTO[NTERM-NUM]. */
607 static const yytype_int8 yydefgoto
[] =
612 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
613 positive, shift that token. If negative, reduce the rule whose
614 number is the opposite. If YYTABLE_NINF, syntax error. */
615 static const yytype_uint8 yytable
[] =
617 10, 11, 1, 2, 3, 4, 12, 13, 33, 35,
618 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
619 46, 47, 48, 49, 50, 51, 52, 53, 54, 5,
620 6, 0, 0, 7, 18, 19, 20, 21, 22, 23,
621 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
622 56, 14, 15, 16, 17, 18, 19, 20, 21, 22,
623 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
624 33, 0, 0, 0, 0, 34, 55, 14, 15, 16,
625 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
626 27, 28, 29, 30, 31, 32, 33, 14, 15, 16,
627 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
628 27, 28, 29, 30, 31, 32, 33, 15, 16, 17,
629 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
630 28, 29, 30, 31, 32, 33, 24, 25, 26, 27,
631 28, 29, 30, 31, 32, 33, 27, 28, 29, 30,
632 31, 32, 33, 29, 30, 31, 32, 33
635 static const yytype_int8 yycheck
[] =
637 5, 6, 3, 4, 5, 6, 6, 0, 27, 14,
638 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
639 25, 26, 27, 28, 29, 30, 31, 32, 33, 30,
640 31, -1, -1, 34, 12, 13, 14, 15, 16, 17,
641 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
642 55, 8, 9, 10, 11, 12, 13, 14, 15, 16,
643 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
644 27, -1, -1, -1, -1, 32, 7, 8, 9, 10,
645 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
646 21, 22, 23, 24, 25, 26, 27, 8, 9, 10,
647 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
648 21, 22, 23, 24, 25, 26, 27, 9, 10, 11,
649 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
650 22, 23, 24, 25, 26, 27, 18, 19, 20, 21,
651 22, 23, 24, 25, 26, 27, 21, 22, 23, 24,
652 25, 26, 27, 23, 24, 25, 26, 27
655 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
656 symbol of state STATE-NUM. */
657 static const yytype_uint8 yystos
[] =
659 0, 3, 4, 5, 6, 30, 31, 34, 36, 37,
660 37, 37, 6, 0, 8, 9, 10, 11, 12, 13,
661 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
662 24, 25, 26, 27, 32, 37, 37, 37, 37, 37,
663 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
664 37, 37, 37, 37, 37, 7, 37
667 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
668 static const yytype_uint8 yyr1
[] =
670 0, 35, 36, 37, 37, 37, 37, 37, 37, 37,
671 37, 37, 37, 37, 37, 37, 37, 37, 37, 37,
672 37, 37, 37, 37, 37, 37, 37, 37, 37, 37
675 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
676 static const yytype_uint8 yyr2
[] =
678 0, 2, 1, 1, 1, 1, 1, 5, 3, 3,
679 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
680 3, 3, 3, 3, 2, 3, 3, 3, 2, 3
684 #define yyerrok (yyerrstatus = 0)
685 #define yyclearin (yychar = YYEMPTY)
689 #define YYACCEPT goto yyacceptlab
690 #define YYABORT goto yyabortlab
691 #define YYERROR goto yyerrorlab
694 #define YYRECOVERING() (!!yyerrstatus)
696 #define YYBACKUP(Token, Value) \
698 if (yychar == YYEMPTY) \
702 YYPOPSTACK (yylen); \
708 yyerror (sex_parser, YY_("syntax error: cannot back up")); \
713 /* Error token number */
715 #define YYERRCODE 256
719 /* Enable debugging if requested. */
723 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
724 # define YYFPRINTF fprintf
727 # define YYDPRINTF(Args) \
733 /* This macro is provided for backward compatibility. */
734 #ifndef YY_LOCATION_PRINT
735 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
739 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
743 YYFPRINTF (stderr, "%s ", Title); \
744 yy_symbol_print (stderr, \
745 Type, Value, sex_parser); \
746 YYFPRINTF (stderr, "\n"); \
751 /*----------------------------------------.
752 | Print this symbol's value on YYOUTPUT. |
753 `----------------------------------------*/
756 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, rec_sex_parser_t sex_parser
)
758 FILE *yyo
= yyoutput
;
764 if (yytype
< YYNTOKENS
)
765 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
771 /*--------------------------------.
772 | Print this symbol on YYOUTPUT. |
773 `--------------------------------*/
776 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, rec_sex_parser_t sex_parser
)
778 YYFPRINTF (yyoutput
, "%s %s (",
779 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
781 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, sex_parser
);
782 YYFPRINTF (yyoutput
, ")");
785 /*------------------------------------------------------------------.
786 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
788 `------------------------------------------------------------------*/
791 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
793 YYFPRINTF (stderr
, "Stack now");
794 for (; yybottom
<= yytop
; yybottom
++)
796 int yybot
= *yybottom
;
797 YYFPRINTF (stderr
, " %d", yybot
);
799 YYFPRINTF (stderr
, "\n");
802 # define YY_STACK_PRINT(Bottom, Top) \
805 yy_stack_print ((Bottom), (Top)); \
809 /*------------------------------------------------.
810 | Report that the YYRULE is going to be reduced. |
811 `------------------------------------------------*/
814 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, int yyrule
, rec_sex_parser_t sex_parser
)
816 unsigned long int yylno
= yyrline
[yyrule
];
817 int yynrhs
= yyr2
[yyrule
];
819 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
821 /* The symbols being reduced. */
822 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
824 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
825 yy_symbol_print (stderr
,
826 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
827 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
829 YYFPRINTF (stderr
, "\n");
833 # define YY_REDUCE_PRINT(Rule) \
836 yy_reduce_print (yyssp, yyvsp, Rule, sex_parser); \
839 /* Nonzero means print parse trace. It is left uninitialized so that
840 multiple parsers can coexist. */
843 # define YYDPRINTF(Args)
844 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
845 # define YY_STACK_PRINT(Bottom, Top)
846 # define YY_REDUCE_PRINT(Rule)
847 #endif /* !YYDEBUG */
850 /* YYINITDEPTH -- initial size of the parser's stacks. */
852 # define YYINITDEPTH 200
855 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
856 if the built-in stack extension method is used).
858 Do not make this value too large; the results are undefined if
859 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
860 evaluated with infinite-precision integer arithmetic. */
863 # define YYMAXDEPTH 10000
870 # if defined __GLIBC__ && defined _STRING_H
871 # define yystrlen strlen
873 /* Return the length of YYSTR. */
875 yystrlen (const char *yystr
)
878 for (yylen
= 0; yystr
[yylen
]; yylen
++)
886 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
887 # define yystpcpy stpcpy
889 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
892 yystpcpy (char *yydest
, const char *yysrc
)
895 const char *yys
= yysrc
;
897 while ((*yyd
++ = *yys
++) != '\0')
906 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
907 quotes and backslashes, so that it's suitable for yyerror. The
908 heuristic is that double-quoting is unnecessary unless the string
909 contains an apostrophe, a comma, or backslash (other than
910 backslash-backslash). YYSTR is taken from yytname. If YYRES is
911 null, do not copy; instead, return the length of what the result
914 yytnamerr (char *yyres
, const char *yystr
)
919 char const *yyp
= yystr
;
926 goto do_not_strip_quotes
;
930 goto do_not_strip_quotes
;
943 do_not_strip_quotes
: ;
947 return yystrlen (yystr
);
949 return yystpcpy (yyres
, yystr
) - yyres
;
953 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
954 about the unexpected token YYTOKEN for the state stack whose top is
957 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
958 not large enough to hold the message. In that case, also set
959 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
960 required number of bytes is too large to store. */
962 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
963 yytype_int16
*yyssp
, int yytoken
)
965 YYSIZE_T yysize0
= yytnamerr (YY_NULLPTR
, yytname
[yytoken
]);
966 YYSIZE_T yysize
= yysize0
;
967 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
968 /* Internationalized format string. */
969 const char *yyformat
= YY_NULLPTR
;
970 /* Arguments of yyformat. */
971 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
972 /* Number of reported tokens (one for the "unexpected", one per
976 /* There are many possibilities here to consider:
977 - If this state is a consistent state with a default action, then
978 the only way this function was invoked is if the default action
979 is an error action. In that case, don't check for expected
980 tokens because there are none.
981 - The only way there can be no lookahead present (in yychar) is if
982 this state is a consistent state with a default action. Thus,
983 detecting the absence of a lookahead is sufficient to determine
984 that there is no unexpected or expected token to report. In that
985 case, just report a simple "syntax error".
986 - Don't assume there isn't a lookahead just because this state is a
987 consistent state with a default action. There might have been a
988 previous inconsistent state, consistent state with a non-default
989 action, or user semantic action that manipulated yychar.
990 - Of course, the expected token list depends on states to have
991 correct lookahead information, and it depends on the parser not
992 to perform extra reductions after fetching a lookahead from the
993 scanner and before detecting a syntax error. Thus, state merging
994 (from LALR or IELR) and default reductions corrupt the expected
995 token list. However, the list is correct for canonical LR with
996 one exception: it will still contain any token that will not be
997 accepted due to an error action in a later state.
999 if (yytoken
!= YYEMPTY
)
1001 int yyn
= yypact
[*yyssp
];
1002 yyarg
[yycount
++] = yytname
[yytoken
];
1003 if (!yypact_value_is_default (yyn
))
1005 /* Start YYX at -YYN if negative to avoid negative indexes in
1006 YYCHECK. In other words, skip the first -YYN actions for
1007 this state because they are default actions. */
1008 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1009 /* Stay within bounds of both yycheck and yytname. */
1010 int yychecklim
= YYLAST
- yyn
+ 1;
1011 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1014 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1015 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1016 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1018 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1024 yyarg
[yycount
++] = yytname
[yyx
];
1026 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULLPTR
, yytname
[yyx
]);
1027 if (! (yysize
<= yysize1
1028 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1038 # define YYCASE_(N, S) \
1042 YYCASE_(0, YY_("syntax error"));
1043 YYCASE_(1, YY_("syntax error, unexpected %s"));
1044 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1045 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1046 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1047 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1052 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1053 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1058 if (*yymsg_alloc
< yysize
)
1060 *yymsg_alloc
= 2 * yysize
;
1061 if (! (yysize
<= *yymsg_alloc
1062 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1063 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1067 /* Avoid sprintf, as that infringes on the user's name space.
1068 Don't have undefined behavior even if the translation
1069 produced a string with the wrong number of "%s"s. */
1073 while ((*yyp
= *yyformat
) != '\0')
1074 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1076 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1087 #endif /* YYERROR_VERBOSE */
1089 /*-----------------------------------------------.
1090 | Release the memory associated to this symbol. |
1091 `-----------------------------------------------*/
1094 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, rec_sex_parser_t sex_parser
)
1100 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1102 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1104 YY_IGNORE_MAYBE_UNINITIALIZED_END
1115 yyparse (rec_sex_parser_t sex_parser
)
1117 /* The lookahead symbol. */
1121 /* The semantic value of the lookahead symbol. */
1122 /* Default value used for initialization, for pacifying older GCCs
1123 or non-GCC compilers. */
1124 YY_INITIAL_VALUE (static YYSTYPE yyval_default
;)
1125 YYSTYPE yylval
YY_INITIAL_VALUE (= yyval_default
);
1127 /* Number of syntax errors so far. */
1131 /* Number of tokens to shift before error messages enabled. */
1134 /* The stacks and their tools:
1135 'yyss': related to states.
1136 'yyvs': related to semantic values.
1138 Refer to the stacks through separate pointers, to allow yyoverflow
1139 to reallocate them elsewhere. */
1141 /* The state stack. */
1142 yytype_int16 yyssa
[YYINITDEPTH
];
1144 yytype_int16
*yyssp
;
1146 /* The semantic value stack. */
1147 YYSTYPE yyvsa
[YYINITDEPTH
];
1151 YYSIZE_T yystacksize
;
1155 /* Lookahead token as an internal (translated) token number. */
1157 /* The variables used to return semantic value and location from the
1162 /* Buffer for error messages, and its allocated size. */
1164 char *yymsg
= yymsgbuf
;
1165 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1168 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1170 /* The number of symbols on the RHS of the reduced rule.
1171 Keep to zero when no symbol should be popped. */
1174 yyssp
= yyss
= yyssa
;
1175 yyvsp
= yyvs
= yyvsa
;
1176 yystacksize
= YYINITDEPTH
;
1178 YYDPRINTF ((stderr
, "Starting parse\n"));
1183 yychar
= YYEMPTY
; /* Cause a token to be read. */
1186 /*------------------------------------------------------------.
1187 | yynewstate -- Push a new state, which is found in yystate. |
1188 `------------------------------------------------------------*/
1190 /* In all cases, when you get here, the value and location stacks
1191 have just been pushed. So pushing a state here evens the stacks. */
1197 if (yyss
+ yystacksize
- 1 <= yyssp
)
1199 /* Get the current used size of the three stacks, in elements. */
1200 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1204 /* Give user a chance to reallocate the stack. Use copies of
1205 these so that the &'s don't force the real ones into
1207 YYSTYPE
*yyvs1
= yyvs
;
1208 yytype_int16
*yyss1
= yyss
;
1210 /* Each stack pointer address is followed by the size of the
1211 data in use in that stack, in bytes. This used to be a
1212 conditional around just the two extra args, but that might
1213 be undefined if yyoverflow is a macro. */
1214 yyoverflow (YY_("memory exhausted"),
1215 &yyss1
, yysize
* sizeof (*yyssp
),
1216 &yyvs1
, yysize
* sizeof (*yyvsp
),
1222 #else /* no yyoverflow */
1223 # ifndef YYSTACK_RELOCATE
1224 goto yyexhaustedlab
;
1226 /* Extend the stack our own way. */
1227 if (YYMAXDEPTH
<= yystacksize
)
1228 goto yyexhaustedlab
;
1230 if (YYMAXDEPTH
< yystacksize
)
1231 yystacksize
= YYMAXDEPTH
;
1234 yytype_int16
*yyss1
= yyss
;
1235 union yyalloc
*yyptr
=
1236 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1238 goto yyexhaustedlab
;
1239 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1240 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1241 # undef YYSTACK_RELOCATE
1243 YYSTACK_FREE (yyss1
);
1246 #endif /* no yyoverflow */
1248 yyssp
= yyss
+ yysize
- 1;
1249 yyvsp
= yyvs
+ yysize
- 1;
1251 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1252 (unsigned long int) yystacksize
));
1254 if (yyss
+ yystacksize
- 1 <= yyssp
)
1258 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1260 if (yystate
== YYFINAL
)
1270 /* Do appropriate processing given the current state. Read a
1271 lookahead token if we need one and don't already have one. */
1273 /* First try to decide what to do without reference to lookahead token. */
1274 yyn
= yypact
[yystate
];
1275 if (yypact_value_is_default (yyn
))
1278 /* Not known => get a lookahead token if don't already have one. */
1280 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1281 if (yychar
== YYEMPTY
)
1283 YYDPRINTF ((stderr
, "Reading a token: "));
1284 yychar
= yylex (&yylval
, scanner
);
1287 if (yychar
<= YYEOF
)
1289 yychar
= yytoken
= YYEOF
;
1290 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1294 yytoken
= YYTRANSLATE (yychar
);
1295 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1298 /* If the proper action on seeing token YYTOKEN is to reduce or to
1299 detect an error, take that action. */
1301 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1306 if (yytable_value_is_error (yyn
))
1312 /* Count tokens shifted since error; after three, turn off error
1317 /* Shift the lookahead token. */
1318 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1320 /* Discard the shifted token. */
1324 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1326 YY_IGNORE_MAYBE_UNINITIALIZED_END
1331 /*-----------------------------------------------------------.
1332 | yydefault -- do the default action for the current state. |
1333 `-----------------------------------------------------------*/
1335 yyn
= yydefact
[yystate
];
1341 /*-----------------------------.
1342 | yyreduce -- Do a reduction. |
1343 `-----------------------------*/
1345 /* yyn is the number of a rule to reduce with. */
1348 /* If YYLEN is nonzero, implement the default value of the action:
1351 Otherwise, the following line sets YYVAL to garbage.
1352 This behavior is undocumented and Bison
1353 users should not rely upon it. Assigning to YYVAL
1354 unconditionally makes the parser a bit smaller, and it avoids a
1355 GCC warning that YYVAL may be used uninitialized. */
1356 yyval
= yyvsp
[1-yylen
];
1359 YY_REDUCE_PRINT (yyn
);
1363 #line 125 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1367 ast
= rec_sex_ast_new ();
1368 rec_sex_ast_set_top (ast
, (yyvsp
[0].node
));
1369 rec_sex_parser_set_ast (sex_parser
, ast
);
1371 #line 1372 "rec-sex-tab.c" /* yacc.c:1646 */
1375 #line 134 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1376 { (yyval
.node
) = (yyvsp
[0].node
); }
1377 #line 1378 "rec-sex-tab.c" /* yacc.c:1646 */
1381 #line 135 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1382 { (yyval
.node
) = (yyvsp
[0].node
); }
1383 #line 1384 "rec-sex-tab.c" /* yacc.c:1646 */
1387 #line 136 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1388 { (yyval
.node
) = (yyvsp
[0].node
); }
1389 #line 1390 "rec-sex-tab.c" /* yacc.c:1646 */
1393 #line 137 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1394 { (yyval
.node
) = (yyvsp
[0].node
); }
1395 #line 1396 "rec-sex-tab.c" /* yacc.c:1646 */
1399 #line 139 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1400 { CREATE_NODE_OP3 (REC_SEX_OP_COND
, (yyval
.node
), (yyvsp
[-4].node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1401 #line 1402 "rec-sex-tab.c" /* yacc.c:1646 */
1405 #line 140 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1406 { CREATE_NODE_OP2 (REC_SEX_OP_EQL
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1407 #line 1408 "rec-sex-tab.c" /* yacc.c:1646 */
1411 #line 141 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1412 { CREATE_NODE_OP2 (REC_SEX_OP_NEQ
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1413 #line 1414 "rec-sex-tab.c" /* yacc.c:1646 */
1417 #line 143 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1419 if ((rec_sex_ast_node_type ((yyvsp
[-2].node
)) == REC_SEX_INT
)
1420 || (rec_sex_ast_node_type ((yyvsp
[0].node
)) == REC_SEX_INT
))
1422 rec_sex_ast_node_destroy ((yyvsp
[-2].node
));
1423 rec_sex_ast_node_destroy ((yyvsp
[0].node
));
1427 CREATE_NODE_OP2 (REC_SEX_OP_MAT
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
));
1429 #line 1430 "rec-sex-tab.c" /* yacc.c:1646 */
1433 #line 154 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1434 { CREATE_NODE_OP2 (REC_SEX_OP_ADD
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1435 #line 1436 "rec-sex-tab.c" /* yacc.c:1646 */
1439 #line 155 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1440 { CREATE_NODE_OP2 (REC_SEX_OP_SUB
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1441 #line 1442 "rec-sex-tab.c" /* yacc.c:1646 */
1445 #line 156 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1446 { CREATE_NODE_OP2 (REC_SEX_OP_MUL
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1447 #line 1448 "rec-sex-tab.c" /* yacc.c:1646 */
1451 #line 157 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1452 { CREATE_NODE_OP2 (REC_SEX_OP_DIV
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1453 #line 1454 "rec-sex-tab.c" /* yacc.c:1646 */
1457 #line 158 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1458 { CREATE_NODE_OP2 (REC_SEX_OP_MOD
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1459 #line 1460 "rec-sex-tab.c" /* yacc.c:1646 */
1463 #line 159 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1464 { CREATE_NODE_OP2 (REC_SEX_OP_GT
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1465 #line 1466 "rec-sex-tab.c" /* yacc.c:1646 */
1469 #line 160 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1470 { CREATE_NODE_OP2 (REC_SEX_OP_LT
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1471 #line 1472 "rec-sex-tab.c" /* yacc.c:1646 */
1475 #line 161 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1476 { CREATE_NODE_OP2 (REC_SEX_OP_GTE
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1477 #line 1478 "rec-sex-tab.c" /* yacc.c:1646 */
1481 #line 162 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1482 { CREATE_NODE_OP2 (REC_SEX_OP_LTE
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1483 #line 1484 "rec-sex-tab.c" /* yacc.c:1646 */
1487 #line 163 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1488 { CREATE_NODE_OP2 (REC_SEX_OP_AFTER
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1489 #line 1490 "rec-sex-tab.c" /* yacc.c:1646 */
1493 #line 164 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1494 { CREATE_NODE_OP2 (REC_SEX_OP_BEFORE
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1495 #line 1496 "rec-sex-tab.c" /* yacc.c:1646 */
1499 #line 165 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1500 { CREATE_NODE_OP2 (REC_SEX_OP_SAMETIME
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1501 #line 1502 "rec-sex-tab.c" /* yacc.c:1646 */
1505 #line 166 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1506 { CREATE_NODE_OP2 (REC_SEX_OP_IMPLIES
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1507 #line 1508 "rec-sex-tab.c" /* yacc.c:1646 */
1511 #line 167 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1512 { CREATE_NODE_OP1 (REC_SEX_OP_NOT
, (yyval
.node
), (yyvsp
[0].node
)); }
1513 #line 1514 "rec-sex-tab.c" /* yacc.c:1646 */
1517 #line 168 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1518 { CREATE_NODE_OP2 (REC_SEX_OP_AND
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1519 #line 1520 "rec-sex-tab.c" /* yacc.c:1646 */
1523 #line 169 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1524 { CREATE_NODE_OP2 (REC_SEX_OP_OR
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1525 #line 1526 "rec-sex-tab.c" /* yacc.c:1646 */
1529 #line 170 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1530 { CREATE_NODE_OP2 (REC_SEX_OP_CONCAT
, (yyval
.node
), (yyvsp
[-2].node
), (yyvsp
[0].node
)); }
1531 #line 1532 "rec-sex-tab.c" /* yacc.c:1646 */
1535 #line 171 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1536 { CREATE_NODE_OP1 (REC_SEX_OP_SHA
, (yyval
.node
), (yyvsp
[0].node
)); }
1537 #line 1538 "rec-sex-tab.c" /* yacc.c:1646 */
1541 #line 172 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1542 { (yyval
.node
) = (yyvsp
[-1].node
); }
1543 #line 1544 "rec-sex-tab.c" /* yacc.c:1646 */
1547 #line 1548 "rec-sex-tab.c" /* yacc.c:1646 */
1550 /* User semantic actions sometimes alter yychar, and that requires
1551 that yytoken be updated with the new translation. We take the
1552 approach of translating immediately before every use of yytoken.
1553 One alternative is translating here after every semantic action,
1554 but that translation would be missed if the semantic action invokes
1555 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1556 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1557 incorrect destructor might then be invoked immediately. In the
1558 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1559 to an incorrect destructor call or verbose syntax error message
1560 before the lookahead is translated. */
1561 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
1565 YY_STACK_PRINT (yyss
, yyssp
);
1569 /* Now 'shift' the result of the reduction. Determine what state
1570 that goes to, based on the state we popped back to and the rule
1571 number reduced by. */
1575 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1576 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1577 yystate
= yytable
[yystate
];
1579 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1584 /*--------------------------------------.
1585 | yyerrlab -- here on detecting error. |
1586 `--------------------------------------*/
1588 /* Make sure we have latest lookahead translation. See comments at
1589 user semantic actions for why this is necessary. */
1590 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
1592 /* If not already recovering from an error, report this error. */
1596 #if ! YYERROR_VERBOSE
1597 yyerror (sex_parser
, YY_("syntax error"));
1599 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1602 char const *yymsgp
= YY_("syntax error");
1603 int yysyntax_error_status
;
1604 yysyntax_error_status
= YYSYNTAX_ERROR
;
1605 if (yysyntax_error_status
== 0)
1607 else if (yysyntax_error_status
== 1)
1609 if (yymsg
!= yymsgbuf
)
1610 YYSTACK_FREE (yymsg
);
1611 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
1615 yymsg_alloc
= sizeof yymsgbuf
;
1616 yysyntax_error_status
= 2;
1620 yysyntax_error_status
= YYSYNTAX_ERROR
;
1624 yyerror (sex_parser
, yymsgp
);
1625 if (yysyntax_error_status
== 2)
1626 goto yyexhaustedlab
;
1628 # undef YYSYNTAX_ERROR
1634 if (yyerrstatus
== 3)
1636 /* If just tried and failed to reuse lookahead token after an
1637 error, discard it. */
1639 if (yychar
<= YYEOF
)
1641 /* Return failure if at end of input. */
1642 if (yychar
== YYEOF
)
1647 yydestruct ("Error: discarding",
1648 yytoken
, &yylval
, sex_parser
);
1653 /* Else will try to reuse lookahead token after shifting the error
1658 /*---------------------------------------------------.
1659 | yyerrorlab -- error raised explicitly by YYERROR. |
1660 `---------------------------------------------------*/
1663 /* Pacify compilers like GCC when the user code never invokes
1664 YYERROR and the label yyerrorlab therefore never appears in user
1666 if (/*CONSTCOND*/ 0)
1669 /* Do not reclaim the symbols of the rule whose action triggered
1673 YY_STACK_PRINT (yyss
, yyssp
);
1678 /*-------------------------------------------------------------.
1679 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1680 `-------------------------------------------------------------*/
1682 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1686 yyn
= yypact
[yystate
];
1687 if (!yypact_value_is_default (yyn
))
1690 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1698 /* Pop the current state because it cannot handle the error token. */
1703 yydestruct ("Error: popping",
1704 yystos
[yystate
], yyvsp
, sex_parser
);
1707 YY_STACK_PRINT (yyss
, yyssp
);
1710 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1712 YY_IGNORE_MAYBE_UNINITIALIZED_END
1715 /* Shift the error token. */
1716 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
1722 /*-------------------------------------.
1723 | yyacceptlab -- YYACCEPT comes here. |
1724 `-------------------------------------*/
1729 /*-----------------------------------.
1730 | yyabortlab -- YYABORT comes here. |
1731 `-----------------------------------*/
1736 #if !defined yyoverflow || YYERROR_VERBOSE
1737 /*-------------------------------------------------.
1738 | yyexhaustedlab -- memory exhaustion comes here. |
1739 `-------------------------------------------------*/
1741 yyerror (sex_parser
, YY_("memory exhausted"));
1747 if (yychar
!= YYEMPTY
)
1749 /* Make sure we have latest lookahead translation. See comments at
1750 user semantic actions for why this is necessary. */
1751 yytoken
= YYTRANSLATE (yychar
);
1752 yydestruct ("Cleanup: discarding lookahead",
1753 yytoken
, &yylval
, sex_parser
);
1755 /* Do not reclaim the symbols of the rule whose action triggered
1756 this YYABORT or YYACCEPT. */
1758 YY_STACK_PRINT (yyss
, yyssp
);
1759 while (yyssp
!= yyss
)
1761 yydestruct ("Cleanup: popping",
1762 yystos
[*yyssp
], yyvsp
, sex_parser
);
1767 YYSTACK_FREE (yyss
);
1770 if (yymsg
!= yymsgbuf
)
1771 YYSTACK_FREE (yymsg
);
1775 #line 174 "../../src/rec-sex-tab.y" /* yacc.c:1906 */
1778 /* End of rec-sex.y */