first version upgrade
[devspec.git] / devspec.en_US / project / recutils / src / rec-sex-tab.c
blob48564d659e15fa630a62311cb8230dda8d1b3074
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. */
44 #define YYBISON 1
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.4"
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
52 /* Pure parsers. */
53 #define YYPURE 1
55 /* Push parsers. */
56 #define YYPUSH 0
58 /* Pull parsers. */
59 #define YYPULL 1
62 /* Substitute the variable and function names. */
63 #define yyparse sexparse
64 #define yylex sexlex
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 */
73 #include <config.h>
75 #include <stdlib.h>
76 #include <stdio.h>
77 #include <string.h>
78 #include <regex.h>
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)
87 /* Do nothing. */
90 #define scanner (rec_sex_parser_scanner (sex_parser))
92 #define CREATE_NODE_OP1(TYPE,RES,OP) \
93 do \
94 { \
95 /* Create the node. */ \
96 (RES) = rec_sex_ast_node_new (); \
97 rec_sex_ast_node_set_type ((RES), (TYPE)); \
99 /* Set children. */ \
100 rec_sex_ast_node_link ((RES), (OP)); \
102 while (0)
104 #define CREATE_NODE_OP2(TYPE, RES, OP1, OP2) \
105 do \
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)); \
115 while (0)
117 #define CREATE_NODE_OP3(TYPE, RES, OP1, OP2, OP3) \
118 do \
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)); \
129 while (0)
132 #line 133 "rec-sex-tab.c" /* yacc.c:339 */
134 # ifndef YY_NULLPTR
135 # if defined __cplusplus && 201103L <= __cplusplus
136 # define YY_NULLPTR nullptr
137 # else
138 # define YY_NULLPTR 0
139 # endif
140 # endif
142 /* Enabling verbose error messages. */
143 #ifdef YYERROR_VERBOSE
144 # undef YYERROR_VERBOSE
145 # define YYERROR_VERBOSE 1
146 #else
147 # define YYERROR_VERBOSE 0
148 #endif
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
154 /* Debug traces. */
155 #ifndef YYDEBUG
156 # define YYDEBUG 0
157 #endif
158 #if YYDEBUG
159 extern int sexdebug;
160 #endif
162 /* Token type. */
163 #ifndef YYTOKENTYPE
164 # define YYTOKENTYPE
165 enum yytokentype
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
200 #endif
202 /* Value type. */
203 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
205 union YYSTYPE
207 #line 92 "../../src/rec-sex-tab.y" /* yacc.c:355 */
209 rec_sex_ast_node_t node;
210 rec_sex_ast_t ast;
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
218 #endif
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 */
230 #ifdef short
231 # undef short
232 #endif
234 #ifdef YYTYPE_UINT8
235 typedef YYTYPE_UINT8 yytype_uint8;
236 #else
237 typedef unsigned char yytype_uint8;
238 #endif
240 #ifdef YYTYPE_INT8
241 typedef YYTYPE_INT8 yytype_int8;
242 #else
243 typedef signed char yytype_int8;
244 #endif
246 #ifdef YYTYPE_UINT16
247 typedef YYTYPE_UINT16 yytype_uint16;
248 #else
249 typedef unsigned short int yytype_uint16;
250 #endif
252 #ifdef YYTYPE_INT16
253 typedef YYTYPE_INT16 yytype_int16;
254 #else
255 typedef short int yytype_int16;
256 #endif
258 #ifndef YYSIZE_T
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
266 # else
267 # define YYSIZE_T unsigned int
268 # endif
269 #endif
271 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
273 #ifndef YY_
274 # if defined YYENABLE_NLS && YYENABLE_NLS
275 # if ENABLE_NLS
276 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
277 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
278 # endif
279 # endif
280 # ifndef YY_
281 # define YY_(Msgid) Msgid
282 # endif
283 #endif
285 #ifndef YY_ATTRIBUTE
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)
290 # else
291 # define YY_ATTRIBUTE(Spec) /* empty */
292 # endif
293 #endif
295 #ifndef YY_ATTRIBUTE_PURE
296 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
297 #endif
299 #ifndef YY_ATTRIBUTE_UNUSED
300 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
301 #endif
303 #if !defined _Noreturn \
304 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
305 # if defined _MSC_VER && 1200 <= _MSC_VER
306 # define _Noreturn __declspec (noreturn)
307 # else
308 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
309 # endif
310 #endif
312 /* Suppress unused-variable warnings by "using" E. */
313 #if ! defined lint || defined __GNUC__
314 # define YYUSE(E) ((void) (E))
315 #else
316 # define YYUSE(E) /* empty */
317 #endif
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")
327 #else
328 # define YY_INITIAL_VALUE(Value) Value
329 #endif
330 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
331 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
332 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
333 #endif
334 #ifndef YY_INITIAL_VALUE
335 # define YY_INITIAL_VALUE(Value) /* Nothing. */
336 #endif
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
345 # ifdef __GNUC__
346 # define YYSTACK_ALLOC __builtin_alloca
347 # elif defined __BUILTIN_VA_ARG_INCR
348 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
349 # elif defined _AIX
350 # define YYSTACK_ALLOC __alloca
351 # elif defined _MSC_VER
352 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
353 # define alloca _alloca
354 # else
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
361 # endif
362 # endif
363 # endif
364 # endif
365 # endif
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 */
376 # endif
377 # else
378 # define YYSTACK_ALLOC YYMALLOC
379 # define YYSTACK_FREE YYFREE
380 # ifndef YYSTACK_ALLOC_MAXIMUM
381 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
382 # endif
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
389 # endif
390 # endif
391 # ifndef YYMALLOC
392 # define YYMALLOC malloc
393 # if ! defined malloc && ! defined EXIT_SUCCESS
394 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
395 # endif
396 # endif
397 # ifndef YYFREE
398 # define YYFREE free
399 # if ! defined free && ! defined EXIT_SUCCESS
400 void free (void *); /* INFRINGES ON USER NAME SPACE */
401 # endif
402 # endif
403 # endif
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. */
412 union yyalloc
414 yytype_int16 yyss_alloc;
415 YYSTYPE yyvs_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
422 N elements. */
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
433 stack. */
434 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
435 do \
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); \
443 while (0)
445 #endif
447 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
448 /* Copy COUNT objects from SRC to DST. The source and destination do
449 not overlap. */
450 # ifndef YYCOPY
451 # if defined __GNUC__ && 1 < __GNUC__
452 # define YYCOPY(Dst, Src, Count) \
453 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
454 # else
455 # define YYCOPY(Dst, Src, Count) \
456 do \
458 YYSIZE_T yyi; \
459 for (yyi = 0; yyi < (Count); yyi++) \
460 (Dst)[yyi] = (Src)[yyi]; \
462 while (0)
463 # endif
464 # endif
465 #endif /* !YYCOPY_NEEDED */
467 /* YYFINAL -- State number of the termination state. */
468 #define YYFINAL 13
469 /* YYLAST -- Last index in YYTABLE. */
470 #define YYLAST 157
472 /* YYNTOKENS -- Number of terminals. */
473 #define YYNTOKENS 35
474 /* YYNNTS -- Number of nonterminals. */
475 #define YYNNTS 3
476 /* YYNRULES -- Number of rules. */
477 #define YYNRULES 29
478 /* YYNSTATES -- Number of states. */
479 #define YYNSTATES 57
481 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
482 by yylex, with out-of-bounds checking. */
483 #define YYUNDEFTOK 2
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
524 #if YYDEBUG
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
532 #endif
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
551 #endif
553 # ifdef YYPRINT
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
563 # endif
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
576 STATE-NUM. */
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[] =
603 -20, -20, -5
606 /* YYDEFGOTO[NTERM-NUM]. */
607 static const yytype_int8 yydefgoto[] =
609 -1, 8, 9
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)
686 #define YYEMPTY (-2)
687 #define YYEOF 0
689 #define YYACCEPT goto yyacceptlab
690 #define YYABORT goto yyabortlab
691 #define YYERROR goto yyerrorlab
694 #define YYRECOVERING() (!!yyerrstatus)
696 #define YYBACKUP(Token, Value) \
697 do \
698 if (yychar == YYEMPTY) \
700 yychar = (Token); \
701 yylval = (Value); \
702 YYPOPSTACK (yylen); \
703 yystate = *yyssp; \
704 goto yybackup; \
706 else \
708 yyerror (sex_parser, YY_("syntax error: cannot back up")); \
709 YYERROR; \
711 while (0)
713 /* Error token number */
714 #define YYTERROR 1
715 #define YYERRCODE 256
719 /* Enable debugging if requested. */
720 #if YYDEBUG
722 # ifndef YYFPRINTF
723 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
724 # define YYFPRINTF fprintf
725 # endif
727 # define YYDPRINTF(Args) \
728 do { \
729 if (yydebug) \
730 YYFPRINTF Args; \
731 } while (0)
733 /* This macro is provided for backward compatibility. */
734 #ifndef YY_LOCATION_PRINT
735 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
736 #endif
739 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
740 do { \
741 if (yydebug) \
743 YYFPRINTF (stderr, "%s ", Title); \
744 yy_symbol_print (stderr, \
745 Type, Value, sex_parser); \
746 YYFPRINTF (stderr, "\n"); \
748 } while (0)
751 /*----------------------------------------.
752 | Print this symbol's value on YYOUTPUT. |
753 `----------------------------------------*/
755 static void
756 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, rec_sex_parser_t sex_parser)
758 FILE *yyo = yyoutput;
759 YYUSE (yyo);
760 YYUSE (sex_parser);
761 if (!yyvaluep)
762 return;
763 # ifdef YYPRINT
764 if (yytype < YYNTOKENS)
765 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
766 # endif
767 YYUSE (yytype);
771 /*--------------------------------.
772 | Print this symbol on YYOUTPUT. |
773 `--------------------------------*/
775 static void
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 |
787 | TOP (included). |
788 `------------------------------------------------------------------*/
790 static void
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) \
803 do { \
804 if (yydebug) \
805 yy_stack_print ((Bottom), (Top)); \
806 } while (0)
809 /*------------------------------------------------.
810 | Report that the YYRULE is going to be reduced. |
811 `------------------------------------------------*/
813 static void
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];
818 int yyi;
819 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
820 yyrule - 1, yylno);
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)])
828 , sex_parser);
829 YYFPRINTF (stderr, "\n");
833 # define YY_REDUCE_PRINT(Rule) \
834 do { \
835 if (yydebug) \
836 yy_reduce_print (yyssp, yyvsp, Rule, sex_parser); \
837 } while (0)
839 /* Nonzero means print parse trace. It is left uninitialized so that
840 multiple parsers can coexist. */
841 int yydebug;
842 #else /* !YYDEBUG */
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. */
851 #ifndef YYINITDEPTH
852 # define YYINITDEPTH 200
853 #endif
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. */
862 #ifndef YYMAXDEPTH
863 # define YYMAXDEPTH 10000
864 #endif
867 #if YYERROR_VERBOSE
869 # ifndef yystrlen
870 # if defined __GLIBC__ && defined _STRING_H
871 # define yystrlen strlen
872 # else
873 /* Return the length of YYSTR. */
874 static YYSIZE_T
875 yystrlen (const char *yystr)
877 YYSIZE_T yylen;
878 for (yylen = 0; yystr[yylen]; yylen++)
879 continue;
880 return yylen;
882 # endif
883 # endif
885 # ifndef yystpcpy
886 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
887 # define yystpcpy stpcpy
888 # else
889 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
890 YYDEST. */
891 static char *
892 yystpcpy (char *yydest, const char *yysrc)
894 char *yyd = yydest;
895 const char *yys = yysrc;
897 while ((*yyd++ = *yys++) != '\0')
898 continue;
900 return yyd - 1;
902 # endif
903 # endif
905 # ifndef yytnamerr
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
912 would have been. */
913 static YYSIZE_T
914 yytnamerr (char *yyres, const char *yystr)
916 if (*yystr == '"')
918 YYSIZE_T yyn = 0;
919 char const *yyp = yystr;
921 for (;;)
922 switch (*++yyp)
924 case '\'':
925 case ',':
926 goto do_not_strip_quotes;
928 case '\\':
929 if (*++yyp != '\\')
930 goto do_not_strip_quotes;
931 /* Fall through. */
932 default:
933 if (yyres)
934 yyres[yyn] = *yyp;
935 yyn++;
936 break;
938 case '"':
939 if (yyres)
940 yyres[yyn] = '\0';
941 return yyn;
943 do_not_strip_quotes: ;
946 if (! yyres)
947 return yystrlen (yystr);
949 return yystpcpy (yyres, yystr) - yyres;
951 # endif
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
955 YYSSP.
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. */
961 static int
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
973 "expected"). */
974 int yycount = 0;
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;
1012 int yyx;
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)
1020 yycount = 1;
1021 yysize = yysize0;
1022 break;
1024 yyarg[yycount++] = yytname[yyx];
1026 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1027 if (! (yysize <= yysize1
1028 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1029 return 2;
1030 yysize = yysize1;
1036 switch (yycount)
1038 # define YYCASE_(N, S) \
1039 case N: \
1040 yyformat = S; \
1041 break
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"));
1048 # undef YYCASE_
1052 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1053 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1054 return 2;
1055 yysize = yysize1;
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;
1064 return 1;
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. */
1071 char *yyp = *yymsg;
1072 int yyi = 0;
1073 while ((*yyp = *yyformat) != '\0')
1074 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1076 yyp += yytnamerr (yyp, yyarg[yyi++]);
1077 yyformat += 2;
1079 else
1081 yyp++;
1082 yyformat++;
1085 return 0;
1087 #endif /* YYERROR_VERBOSE */
1089 /*-----------------------------------------------.
1090 | Release the memory associated to this symbol. |
1091 `-----------------------------------------------*/
1093 static void
1094 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, rec_sex_parser_t sex_parser)
1096 YYUSE (yyvaluep);
1097 YYUSE (sex_parser);
1098 if (!yymsg)
1099 yymsg = "Deleting";
1100 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1102 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1103 YYUSE (yytype);
1104 YY_IGNORE_MAYBE_UNINITIALIZED_END
1110 /*----------.
1111 | yyparse. |
1112 `----------*/
1115 yyparse (rec_sex_parser_t sex_parser)
1117 /* The lookahead symbol. */
1118 int yychar;
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. */
1128 int yynerrs;
1130 int yystate;
1131 /* Number of tokens to shift before error messages enabled. */
1132 int yyerrstatus;
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];
1143 yytype_int16 *yyss;
1144 yytype_int16 *yyssp;
1146 /* The semantic value stack. */
1147 YYSTYPE yyvsa[YYINITDEPTH];
1148 YYSTYPE *yyvs;
1149 YYSTYPE *yyvsp;
1151 YYSIZE_T yystacksize;
1153 int yyn;
1154 int yyresult;
1155 /* Lookahead token as an internal (translated) token number. */
1156 int yytoken = 0;
1157 /* The variables used to return semantic value and location from the
1158 action routines. */
1159 YYSTYPE yyval;
1161 #if YYERROR_VERBOSE
1162 /* Buffer for error messages, and its allocated size. */
1163 char yymsgbuf[128];
1164 char *yymsg = yymsgbuf;
1165 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1166 #endif
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. */
1172 int yylen = 0;
1174 yyssp = yyss = yyssa;
1175 yyvsp = yyvs = yyvsa;
1176 yystacksize = YYINITDEPTH;
1178 YYDPRINTF ((stderr, "Starting parse\n"));
1180 yystate = 0;
1181 yyerrstatus = 0;
1182 yynerrs = 0;
1183 yychar = YYEMPTY; /* Cause a token to be read. */
1184 goto yysetstate;
1186 /*------------------------------------------------------------.
1187 | yynewstate -- Push a new state, which is found in yystate. |
1188 `------------------------------------------------------------*/
1189 yynewstate:
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. */
1192 yyssp++;
1194 yysetstate:
1195 *yyssp = yystate;
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;
1202 #ifdef yyoverflow
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
1206 memory. */
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),
1217 &yystacksize);
1219 yyss = yyss1;
1220 yyvs = yyvs1;
1222 #else /* no yyoverflow */
1223 # ifndef YYSTACK_RELOCATE
1224 goto yyexhaustedlab;
1225 # else
1226 /* Extend the stack our own way. */
1227 if (YYMAXDEPTH <= yystacksize)
1228 goto yyexhaustedlab;
1229 yystacksize *= 2;
1230 if (YYMAXDEPTH < yystacksize)
1231 yystacksize = YYMAXDEPTH;
1234 yytype_int16 *yyss1 = yyss;
1235 union yyalloc *yyptr =
1236 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1237 if (! yyptr)
1238 goto yyexhaustedlab;
1239 YYSTACK_RELOCATE (yyss_alloc, yyss);
1240 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1241 # undef YYSTACK_RELOCATE
1242 if (yyss1 != yyssa)
1243 YYSTACK_FREE (yyss1);
1245 # endif
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)
1255 YYABORT;
1258 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1260 if (yystate == YYFINAL)
1261 YYACCEPT;
1263 goto yybackup;
1265 /*-----------.
1266 | yybackup. |
1267 `-----------*/
1268 yybackup:
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))
1276 goto yydefault;
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"));
1292 else
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. */
1300 yyn += yytoken;
1301 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1302 goto yydefault;
1303 yyn = yytable[yyn];
1304 if (yyn <= 0)
1306 if (yytable_value_is_error (yyn))
1307 goto yyerrlab;
1308 yyn = -yyn;
1309 goto yyreduce;
1312 /* Count tokens shifted since error; after three, turn off error
1313 status. */
1314 if (yyerrstatus)
1315 yyerrstatus--;
1317 /* Shift the lookahead token. */
1318 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1320 /* Discard the shifted token. */
1321 yychar = YYEMPTY;
1323 yystate = yyn;
1324 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1325 *++yyvsp = yylval;
1326 YY_IGNORE_MAYBE_UNINITIALIZED_END
1328 goto yynewstate;
1331 /*-----------------------------------------------------------.
1332 | yydefault -- do the default action for the current state. |
1333 `-----------------------------------------------------------*/
1334 yydefault:
1335 yyn = yydefact[yystate];
1336 if (yyn == 0)
1337 goto yyerrlab;
1338 goto yyreduce;
1341 /*-----------------------------.
1342 | yyreduce -- Do a reduction. |
1343 `-----------------------------*/
1344 yyreduce:
1345 /* yyn is the number of a rule to reduce with. */
1346 yylen = yyr2[yyn];
1348 /* If YYLEN is nonzero, implement the default value of the action:
1349 '$$ = $1'.
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);
1360 switch (yyn)
1362 case 2:
1363 #line 125 "../../src/rec-sex-tab.y" /* yacc.c:1646 */
1365 rec_sex_ast_t ast;
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 */
1372 break;
1374 case 3:
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 */
1378 break;
1380 case 4:
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 */
1384 break;
1386 case 5:
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 */
1390 break;
1392 case 6:
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 */
1396 break;
1398 case 7:
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 */
1402 break;
1404 case 8:
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 */
1408 break;
1410 case 9:
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 */
1414 break;
1416 case 10:
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));
1424 YYABORT;
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 */
1430 break;
1432 case 11:
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 */
1436 break;
1438 case 12:
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 */
1442 break;
1444 case 13:
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 */
1448 break;
1450 case 14:
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 */
1454 break;
1456 case 15:
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 */
1460 break;
1462 case 16:
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 */
1466 break;
1468 case 17:
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 */
1472 break;
1474 case 18:
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 */
1478 break;
1480 case 19:
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 */
1484 break;
1486 case 20:
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 */
1490 break;
1492 case 21:
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 */
1496 break;
1498 case 22:
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 */
1502 break;
1504 case 23:
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 */
1508 break;
1510 case 24:
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 */
1514 break;
1516 case 25:
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 */
1520 break;
1522 case 26:
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 */
1526 break;
1528 case 27:
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 */
1532 break;
1534 case 28:
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 */
1538 break;
1540 case 29:
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 */
1544 break;
1547 #line 1548 "rec-sex-tab.c" /* yacc.c:1646 */
1548 default: break;
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);
1563 YYPOPSTACK (yylen);
1564 yylen = 0;
1565 YY_STACK_PRINT (yyss, yyssp);
1567 *++yyvsp = yyval;
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. */
1573 yyn = yyr1[yyn];
1575 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1576 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1577 yystate = yytable[yystate];
1578 else
1579 yystate = yydefgoto[yyn - YYNTOKENS];
1581 goto yynewstate;
1584 /*--------------------------------------.
1585 | yyerrlab -- here on detecting error. |
1586 `--------------------------------------*/
1587 yyerrlab:
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. */
1593 if (!yyerrstatus)
1595 ++yynerrs;
1596 #if ! YYERROR_VERBOSE
1597 yyerror (sex_parser, YY_("syntax error"));
1598 #else
1599 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1600 yyssp, yytoken)
1602 char const *yymsgp = YY_("syntax error");
1603 int yysyntax_error_status;
1604 yysyntax_error_status = YYSYNTAX_ERROR;
1605 if (yysyntax_error_status == 0)
1606 yymsgp = yymsg;
1607 else if (yysyntax_error_status == 1)
1609 if (yymsg != yymsgbuf)
1610 YYSTACK_FREE (yymsg);
1611 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1612 if (!yymsg)
1614 yymsg = yymsgbuf;
1615 yymsg_alloc = sizeof yymsgbuf;
1616 yysyntax_error_status = 2;
1618 else
1620 yysyntax_error_status = YYSYNTAX_ERROR;
1621 yymsgp = yymsg;
1624 yyerror (sex_parser, yymsgp);
1625 if (yysyntax_error_status == 2)
1626 goto yyexhaustedlab;
1628 # undef YYSYNTAX_ERROR
1629 #endif
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)
1643 YYABORT;
1645 else
1647 yydestruct ("Error: discarding",
1648 yytoken, &yylval, sex_parser);
1649 yychar = YYEMPTY;
1653 /* Else will try to reuse lookahead token after shifting the error
1654 token. */
1655 goto yyerrlab1;
1658 /*---------------------------------------------------.
1659 | yyerrorlab -- error raised explicitly by YYERROR. |
1660 `---------------------------------------------------*/
1661 yyerrorlab:
1663 /* Pacify compilers like GCC when the user code never invokes
1664 YYERROR and the label yyerrorlab therefore never appears in user
1665 code. */
1666 if (/*CONSTCOND*/ 0)
1667 goto yyerrorlab;
1669 /* Do not reclaim the symbols of the rule whose action triggered
1670 this YYERROR. */
1671 YYPOPSTACK (yylen);
1672 yylen = 0;
1673 YY_STACK_PRINT (yyss, yyssp);
1674 yystate = *yyssp;
1675 goto yyerrlab1;
1678 /*-------------------------------------------------------------.
1679 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1680 `-------------------------------------------------------------*/
1681 yyerrlab1:
1682 yyerrstatus = 3; /* Each real token shifted decrements this. */
1684 for (;;)
1686 yyn = yypact[yystate];
1687 if (!yypact_value_is_default (yyn))
1689 yyn += YYTERROR;
1690 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1692 yyn = yytable[yyn];
1693 if (0 < yyn)
1694 break;
1698 /* Pop the current state because it cannot handle the error token. */
1699 if (yyssp == yyss)
1700 YYABORT;
1703 yydestruct ("Error: popping",
1704 yystos[yystate], yyvsp, sex_parser);
1705 YYPOPSTACK (1);
1706 yystate = *yyssp;
1707 YY_STACK_PRINT (yyss, yyssp);
1710 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1711 *++yyvsp = yylval;
1712 YY_IGNORE_MAYBE_UNINITIALIZED_END
1715 /* Shift the error token. */
1716 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1718 yystate = yyn;
1719 goto yynewstate;
1722 /*-------------------------------------.
1723 | yyacceptlab -- YYACCEPT comes here. |
1724 `-------------------------------------*/
1725 yyacceptlab:
1726 yyresult = 0;
1727 goto yyreturn;
1729 /*-----------------------------------.
1730 | yyabortlab -- YYABORT comes here. |
1731 `-----------------------------------*/
1732 yyabortlab:
1733 yyresult = 1;
1734 goto yyreturn;
1736 #if !defined yyoverflow || YYERROR_VERBOSE
1737 /*-------------------------------------------------.
1738 | yyexhaustedlab -- memory exhaustion comes here. |
1739 `-------------------------------------------------*/
1740 yyexhaustedlab:
1741 yyerror (sex_parser, YY_("memory exhausted"));
1742 yyresult = 2;
1743 /* Fall through. */
1744 #endif
1746 yyreturn:
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. */
1757 YYPOPSTACK (yylen);
1758 YY_STACK_PRINT (yyss, yyssp);
1759 while (yyssp != yyss)
1761 yydestruct ("Cleanup: popping",
1762 yystos[*yyssp], yyvsp, sex_parser);
1763 YYPOPSTACK (1);
1765 #ifndef yyoverflow
1766 if (yyss != yyssa)
1767 YYSTACK_FREE (yyss);
1768 #endif
1769 #if YYERROR_VERBOSE
1770 if (yymsg != yymsgbuf)
1771 YYSTACK_FREE (yymsg);
1772 #endif
1773 return yyresult;
1775 #line 174 "../../src/rec-sex-tab.y" /* yacc.c:1906 */
1778 /* End of rec-sex.y */