[PSAPI_WINETEST] Sync with Wine Staging 2.16. CORE-13762
[reactos.git] / dll / win32 / jscript / cc_parser.tab.c
1 /* A Bison parser, made by GNU Bison 3.0.2. */
2
3 /* Bison implementation for Yacc-like parsers in C
4
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
6
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.
11
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.
16
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/>. */
19
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.
29
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
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. */
42
43 /* Identify Bison output. */
44 #define YYBISON 1
45
46 /* Bison version. */
47 #define YYBISON_VERSION "3.0.2"
48
49 /* Skeleton name. */
50 #define YYSKELETON_NAME "yacc.c"
51
52 /* Pure parsers. */
53 #define YYPURE 1
54
55 /* Push parsers. */
56 #define YYPUSH 0
57
58 /* Pull parsers. */
59 #define YYPULL 1
60
61
62 /* Substitute the variable and function names. */
63 #define yyparse cc_parser_parse
64 #define yylex cc_parser_lex
65 #define yyerror cc_parser_error
66 #define yydebug cc_parser_debug
67 #define yynerrs cc_parser_nerrs
68
69
70 /* Copy the first part of user declarations. */
71 #line 19 "cc_parser.y" /* yacc.c:339 */
72
73 #include "jscript.h"
74
75 #line 84 "cc_parser.tab.c" /* yacc.c:339 */
76
77 # ifndef YY_NULLPTR
78 # if defined __cplusplus && 201103L <= __cplusplus
79 # define YY_NULLPTR nullptr
80 # else
81 # define YY_NULLPTR 0
82 # endif
83 # endif
84
85 /* Enabling verbose error messages. */
86 #ifdef YYERROR_VERBOSE
87 # undef YYERROR_VERBOSE
88 # define YYERROR_VERBOSE 1
89 #else
90 # define YYERROR_VERBOSE 0
91 #endif
92
93
94 /* Debug traces. */
95 #ifndef YYDEBUG
96 # define YYDEBUG 0
97 #endif
98 #if YYDEBUG
99 extern int cc_parser_debug;
100 #endif
101
102 /* Token type. */
103 #ifndef YYTOKENTYPE
104 # define YYTOKENTYPE
105 enum yytokentype
106 {
107 tEQ = 258,
108 tEQEQ = 259,
109 tNEQ = 260,
110 tNEQEQ = 261,
111 tLSHIFT = 262,
112 tRSHIFT = 263,
113 tRRSHIFT = 264,
114 tOR = 265,
115 tAND = 266,
116 tLEQ = 267,
117 tGEQ = 268,
118 tCCValue = 269
119 };
120 #endif
121
122 /* Value type. */
123 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
124 typedef union YYSTYPE YYSTYPE;
125 union YYSTYPE
126 {
127 #line 36 "cc_parser.y" /* yacc.c:355 */
128
129 ccval_t ccval;
130
131 #line 140 "cc_parser.tab.c" /* yacc.c:355 */
132 };
133 # define YYSTYPE_IS_TRIVIAL 1
134 # define YYSTYPE_IS_DECLARED 1
135 #endif
136
137
138
139 int cc_parser_parse (parser_ctx_t *ctx);
140
141
142
143 /* Copy the second part of user declarations. */
144 #line 47 "cc_parser.y" /* yacc.c:358 */
145
146
147 static int cc_parser_error(parser_ctx_t *ctx, const char *str)
148 {
149 if(SUCCEEDED(ctx->hres)) {
150 WARN("%s\n", str);
151 ctx->hres = JS_E_SYNTAX;
152 }
153
154 return 0;
155 }
156
157 static int cc_parser_lex(void *lval, parser_ctx_t *ctx)
158 {
159 int r;
160
161 r = try_parse_ccval(ctx, lval);
162 if(r)
163 return r > 0 ? tCCValue : -1;
164
165 switch(*ctx->ptr) {
166 case '(':
167 case ')':
168 case '+':
169 case '-':
170 case '*':
171 case '/':
172 case '~':
173 case '%':
174 case '^':
175 return *ctx->ptr++;
176 case '=':
177 if(*++ctx->ptr == '=') {
178 if(*++ctx->ptr == '=') {
179 ctx->ptr++;
180 return tEQEQ;
181 }
182 return tEQ;
183 }
184 break;
185 case '!':
186 if(*++ctx->ptr == '=') {
187 if(*++ctx->ptr == '=') {
188 ctx->ptr++;
189 return tNEQEQ;
190 }
191 return tNEQ;
192 }
193 return '!';
194 case '<':
195 switch(*++ctx->ptr) {
196 case '<':
197 ctx->ptr++;
198 return tLSHIFT;
199 case '=':
200 ctx->ptr++;
201 return tLEQ;
202 default:
203 return '<';
204 }
205 case '>':
206 switch(*++ctx->ptr) {
207 case '>':
208 if(*++ctx->ptr == '>') {
209 ctx->ptr++;
210 return tRRSHIFT;
211 }
212 return tRSHIFT;
213 case '=':
214 ctx->ptr++;
215 return tGEQ;
216 default:
217 return '>';
218 }
219 case '|':
220 if(*++ctx->ptr == '|') {
221 ctx->ptr++;
222 return tOR;
223 }
224 return '|';
225 case '&':
226 if(*++ctx->ptr == '&') {
227 ctx->ptr++;
228 return tAND;
229 }
230 return '&';
231 }
232
233 WARN("Failed to interpret %s\n", debugstr_w(ctx->ptr));
234 return -1;
235 }
236
237
238 #line 247 "cc_parser.tab.c" /* yacc.c:358 */
239
240 #ifdef short
241 # undef short
242 #endif
243
244 #ifdef YYTYPE_UINT8
245 typedef YYTYPE_UINT8 yytype_uint8;
246 #else
247 typedef unsigned char yytype_uint8;
248 #endif
249
250 #ifdef YYTYPE_INT8
251 typedef YYTYPE_INT8 yytype_int8;
252 #else
253 typedef signed char yytype_int8;
254 #endif
255
256 #ifdef YYTYPE_UINT16
257 typedef YYTYPE_UINT16 yytype_uint16;
258 #else
259 typedef unsigned short int yytype_uint16;
260 #endif
261
262 #ifdef YYTYPE_INT16
263 typedef YYTYPE_INT16 yytype_int16;
264 #else
265 typedef short int yytype_int16;
266 #endif
267
268 #ifndef YYSIZE_T
269 # ifdef __SIZE_TYPE__
270 # define YYSIZE_T __SIZE_TYPE__
271 # elif defined size_t
272 # define YYSIZE_T size_t
273 # elif ! defined YYSIZE_T
274 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
275 # define YYSIZE_T size_t
276 # else
277 # define YYSIZE_T unsigned int
278 # endif
279 #endif
280
281 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
282
283 #ifndef YY_
284 # if defined YYENABLE_NLS && YYENABLE_NLS
285 # if ENABLE_NLS
286 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
287 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
288 # endif
289 # endif
290 # ifndef YY_
291 # define YY_(Msgid) Msgid
292 # endif
293 #endif
294
295 #ifndef YY_ATTRIBUTE
296 # if (defined __GNUC__ \
297 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
298 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
299 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
300 # else
301 # define YY_ATTRIBUTE(Spec) /* empty */
302 # endif
303 #endif
304
305 #ifndef YY_ATTRIBUTE_PURE
306 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
307 #endif
308
309 #ifndef YY_ATTRIBUTE_UNUSED
310 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
311 #endif
312
313 #if !defined _Noreturn \
314 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
315 # if defined _MSC_VER && 1200 <= _MSC_VER
316 # define _Noreturn __declspec (noreturn)
317 # else
318 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
319 # endif
320 #endif
321
322 /* Suppress unused-variable warnings by "using" E. */
323 #if ! defined lint || defined __GNUC__
324 # define YYUSE(E) ((void) (E))
325 #else
326 # define YYUSE(E) /* empty */
327 #endif
328
329 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
330 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
331 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
332 _Pragma ("GCC diagnostic push") \
333 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
334 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
335 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
336 _Pragma ("GCC diagnostic pop")
337 #else
338 # define YY_INITIAL_VALUE(Value) Value
339 #endif
340 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
341 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
342 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
343 #endif
344 #ifndef YY_INITIAL_VALUE
345 # define YY_INITIAL_VALUE(Value) /* Nothing. */
346 #endif
347
348
349 #if ! defined yyoverflow || YYERROR_VERBOSE
350
351 /* The parser invokes alloca or malloc; define the necessary symbols. */
352
353 # ifdef YYSTACK_USE_ALLOCA
354 # if YYSTACK_USE_ALLOCA
355 # ifdef __GNUC__
356 # define YYSTACK_ALLOC __builtin_alloca
357 # elif defined __BUILTIN_VA_ARG_INCR
358 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
359 # elif defined _AIX
360 # define YYSTACK_ALLOC __alloca
361 # elif defined _MSC_VER
362 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
363 # define alloca _alloca
364 # else
365 # define YYSTACK_ALLOC alloca
366 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
367 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
368 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
369 # ifndef EXIT_SUCCESS
370 # define EXIT_SUCCESS 0
371 # endif
372 # endif
373 # endif
374 # endif
375 # endif
376
377 # ifdef YYSTACK_ALLOC
378 /* Pacify GCC's 'empty if-body' warning. */
379 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
380 # ifndef YYSTACK_ALLOC_MAXIMUM
381 /* The OS might guarantee only one guard page at the bottom of the stack,
382 and a page size can be as small as 4096 bytes. So we cannot safely
383 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
384 to allow for a few compiler-allocated temporary stack slots. */
385 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
386 # endif
387 # else
388 # define YYSTACK_ALLOC YYMALLOC
389 # define YYSTACK_FREE YYFREE
390 # ifndef YYSTACK_ALLOC_MAXIMUM
391 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
392 # endif
393 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
394 && ! ((defined YYMALLOC || defined malloc) \
395 && (defined YYFREE || defined free)))
396 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
397 # ifndef EXIT_SUCCESS
398 # define EXIT_SUCCESS 0
399 # endif
400 # endif
401 # ifndef YYMALLOC
402 # define YYMALLOC malloc
403 # if ! defined malloc && ! defined EXIT_SUCCESS
404 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
405 # endif
406 # endif
407 # ifndef YYFREE
408 # define YYFREE free
409 # if ! defined free && ! defined EXIT_SUCCESS
410 void free (void *); /* INFRINGES ON USER NAME SPACE */
411 # endif
412 # endif
413 # endif
414 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
415
416
417 #if (! defined yyoverflow \
418 && (! defined __cplusplus \
419 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
420
421 /* A type that is properly aligned for any stack member. */
422 union yyalloc
423 {
424 yytype_int16 yyss_alloc;
425 YYSTYPE yyvs_alloc;
426 };
427
428 /* The size of the maximum gap between one aligned stack and the next. */
429 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
430
431 /* The size of an array large to enough to hold all stacks, each with
432 N elements. */
433 # define YYSTACK_BYTES(N) \
434 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
435 + YYSTACK_GAP_MAXIMUM)
436
437 # define YYCOPY_NEEDED 1
438
439 /* Relocate STACK from its old location to the new one. The
440 local variables YYSIZE and YYSTACKSIZE give the old and new number of
441 elements in the stack, and YYPTR gives the new location of the
442 stack. Advance YYPTR to a properly aligned location for the next
443 stack. */
444 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
445 do \
446 { \
447 YYSIZE_T yynewbytes; \
448 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
449 Stack = &yyptr->Stack_alloc; \
450 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
451 yyptr += yynewbytes / sizeof (*yyptr); \
452 } \
453 while (0)
454
455 #endif
456
457 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
458 /* Copy COUNT objects from SRC to DST. The source and destination do
459 not overlap. */
460 # ifndef YYCOPY
461 # if defined __GNUC__ && 1 < __GNUC__
462 # define YYCOPY(Dst, Src, Count) \
463 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
464 # else
465 # define YYCOPY(Dst, Src, Count) \
466 do \
467 { \
468 YYSIZE_T yyi; \
469 for (yyi = 0; yyi < (Count); yyi++) \
470 (Dst)[yyi] = (Src)[yyi]; \
471 } \
472 while (0)
473 # endif
474 # endif
475 #endif /* !YYCOPY_NEEDED */
476
477 /* YYFINAL -- State number of the termination state. */
478 #define YYFINAL 24
479 /* YYLAST -- Last index in YYTABLE. */
480 #define YYLAST 57
481
482 /* YYNTOKENS -- Number of terminals. */
483 #define YYNTOKENS 29
484 /* YYNNTS -- Number of nonterminals. */
485 #define YYNNTS 13
486 /* YYNRULES -- Number of rules. */
487 #define YYNRULES 39
488 /* YYNSTATES -- Number of states. */
489 #define YYNSTATES 69
490
491 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
492 by yylex, with out-of-bounds checking. */
493 #define YYUNDEFTOK 2
494 #define YYMAXUTOK 269
495
496 #define YYTRANSLATE(YYX) \
497 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
498
499 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
500 as returned by yylex, without out-of-bounds checking. */
501 static const yytype_uint8 yytranslate[] =
502 {
503 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
504 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
505 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
506 2, 2, 2, 17, 2, 2, 2, 28, 23, 2,
507 15, 16, 26, 19, 2, 20, 2, 27, 2, 2,
508 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
509 24, 2, 25, 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, 22, 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, 21, 2, 18, 2, 2, 2,
516 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
517 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
518 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
519 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
520 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
521 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
522 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
523 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
524 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
525 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
526 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
527 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
528 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
529 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
530 };
531
532 #if YYDEBUG
533 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
534 static const yytype_uint8 yyrline[] =
535 {
536 0, 146, 146, 149, 150, 151, 152, 153, 154, 157,
537 158, 162, 163, 167, 168, 172, 173, 177, 178, 182,
538 183, 185, 187, 189, 193, 194, 196, 198, 200, 204,
539 205, 207, 209, 213, 214, 216, 220, 221, 223, 225
540 };
541 #endif
542
543 #if YYDEBUG || YYERROR_VERBOSE || 0
544 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
545 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
546 static const char *const yytname[] =
547 {
548 "$end", "error", "$undefined", "tEQ", "tEQEQ", "tNEQ", "tNEQEQ",
549 "tLSHIFT", "tRSHIFT", "tRRSHIFT", "tOR", "tAND", "tLEQ", "tGEQ",
550 "tCCValue", "'('", "')'", "'!'", "'~'", "'+'", "'-'", "'|'", "'^'",
551 "'&'", "'<'", "'>'", "'*'", "'/'", "'%'", "$accept", "CCExpr",
552 "CCUnaryExpression", "CCLogicalORExpression", "CCLogicalANDExpression",
553 "CCBitwiseORExpression", "CCBitwiseXORExpression",
554 "CCBitwiseANDExpression", "CCEqualityExpression",
555 "CCRelationalExpression", "CCShiftExpression", "CCAdditiveExpression",
556 "CCMultiplicativeExpression", YY_NULLPTR
557 };
558 #endif
559
560 # ifdef YYPRINT
561 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
562 (internal) symbol number NUM (which must be that of a token). */
563 static const yytype_uint16 yytoknum[] =
564 {
565 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
566 265, 266, 267, 268, 269, 40, 41, 33, 126, 43,
567 45, 124, 94, 38, 60, 62, 42, 47, 37
568 };
569 # endif
570
571 #define YYPACT_NINF -17
572
573 #define yypact_value_is_default(Yystate) \
574 (!!((Yystate) == (-17)))
575
576 #define YYTABLE_NINF -1
577
578 #define yytable_value_is_error(Yytable_value) \
579 0
580
581 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
582 STATE-NUM. */
583 static const yytype_int8 yypact[] =
584 {
585 3, -17, 3, 3, 3, 3, 3, 16, -17, -17,
586 -1, -17, -13, 32, -4, 21, -11, 30, 31, -16,
587 -17, -17, -17, -17, -17, 3, -17, 3, 3, 3,
588 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
589 3, 3, 3, 3, 3, 3, 3, -17, 32, 9,
590 9, -13, 21, -11, -11, -11, -11, 30, 30, 30,
591 30, 31, 31, 31, -16, -16, -17, -17, -17
592 };
593
594 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
595 Performed when YYTABLE does not specify something else to do. Zero
596 means the default is an error. */
597 static const yytype_uint8 yydefact[] =
598 {
599 0, 3, 0, 0, 0, 0, 0, 0, 2, 36,
600 0, 9, 11, 13, 15, 17, 19, 24, 29, 33,
601 5, 6, 7, 8, 1, 0, 4, 0, 0, 0,
602 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
603 0, 0, 0, 0, 0, 0, 0, 10, 14, 15,
604 16, 12, 18, 20, 22, 21, 23, 26, 28, 25,
605 27, 30, 31, 32, 34, 35, 37, 38, 39
606 };
607
608 /* YYPGOTO[NTERM-NUM]. */
609 static const yytype_int8 yypgoto[] =
610 {
611 -17, -17, 0, -17, 18, 26, 29, 13, 27, -3,
612 -2, 8, 10
613 };
614
615 /* YYDEFGOTO[NTERM-NUM]. */
616 static const yytype_int8 yydefgoto[] =
617 {
618 -1, 7, 9, 10, 11, 12, 13, 14, 15, 16,
619 17, 18, 19
620 };
621
622 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
623 positive, shift that token. If negative, reduce the rule whose
624 number is the opposite. If YYTABLE_NINF, syntax error. */
625 static const yytype_uint8 yytable[] =
626 {
627 8, 35, 36, 20, 21, 22, 23, 29, 27, 25,
628 44, 45, 46, 37, 38, 26, 24, 1, 2, 30,
629 3, 4, 5, 6, 31, 32, 33, 34, 53, 54,
630 55, 56, 30, 57, 58, 59, 60, 39, 40, 41,
631 49, 50, 49, 47, 66, 67, 68, 61, 62, 63,
632 42, 43, 64, 65, 28, 51, 48, 52
633 };
634
635 static const yytype_uint8 yycheck[] =
636 {
637 0, 12, 13, 3, 4, 5, 6, 11, 21, 10,
638 26, 27, 28, 24, 25, 16, 0, 14, 15, 23,
639 17, 18, 19, 20, 3, 4, 5, 6, 31, 32,
640 33, 34, 23, 35, 36, 37, 38, 7, 8, 9,
641 27, 28, 29, 25, 44, 45, 46, 39, 40, 41,
642 19, 20, 42, 43, 22, 29, 27, 30
643 };
644
645 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
646 symbol of state STATE-NUM. */
647 static const yytype_uint8 yystos[] =
648 {
649 0, 14, 15, 17, 18, 19, 20, 30, 31, 31,
650 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
651 31, 31, 31, 31, 0, 10, 16, 21, 22, 11,
652 23, 3, 4, 5, 6, 12, 13, 24, 25, 7,
653 8, 9, 19, 20, 26, 27, 28, 33, 35, 36,
654 36, 34, 37, 38, 38, 38, 38, 39, 39, 39,
655 39, 40, 40, 40, 41, 41, 31, 31, 31
656 };
657
658 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
659 static const yytype_uint8 yyr1[] =
660 {
661 0, 29, 30, 31, 31, 31, 31, 31, 31, 32,
662 32, 33, 33, 34, 34, 35, 35, 36, 36, 37,
663 37, 37, 37, 37, 38, 38, 38, 38, 38, 39,
664 39, 39, 39, 40, 40, 40, 41, 41, 41, 41
665 };
666
667 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
668 static const yytype_uint8 yyr2[] =
669 {
670 0, 2, 1, 1, 3, 2, 2, 2, 2, 1,
671 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
672 3, 3, 3, 3, 1, 3, 3, 3, 3, 1,
673 3, 3, 3, 1, 3, 3, 1, 3, 3, 3
674 };
675
676
677 #define yyerrok (yyerrstatus = 0)
678 #define yyclearin (yychar = YYEMPTY)
679 #define YYEMPTY (-2)
680 #define YYEOF 0
681
682 #define YYACCEPT goto yyacceptlab
683 #define YYABORT goto yyabortlab
684 #define YYERROR goto yyerrorlab
685
686
687 #define YYRECOVERING() (!!yyerrstatus)
688
689 #define YYBACKUP(Token, Value) \
690 do \
691 if (yychar == YYEMPTY) \
692 { \
693 yychar = (Token); \
694 yylval = (Value); \
695 YYPOPSTACK (yylen); \
696 yystate = *yyssp; \
697 goto yybackup; \
698 } \
699 else \
700 { \
701 yyerror (ctx, YY_("syntax error: cannot back up")); \
702 YYERROR; \
703 } \
704 while (0)
705
706 /* Error token number */
707 #define YYTERROR 1
708 #define YYERRCODE 256
709
710
711
712 /* Enable debugging if requested. */
713 #if YYDEBUG
714
715 # ifndef YYFPRINTF
716 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
717 # define YYFPRINTF fprintf
718 # endif
719
720 # define YYDPRINTF(Args) \
721 do { \
722 if (yydebug) \
723 YYFPRINTF Args; \
724 } while (0)
725
726 /* This macro is provided for backward compatibility. */
727 #ifndef YY_LOCATION_PRINT
728 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
729 #endif
730
731
732 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
733 do { \
734 if (yydebug) \
735 { \
736 YYFPRINTF (stderr, "%s ", Title); \
737 yy_symbol_print (stderr, \
738 Type, Value, ctx); \
739 YYFPRINTF (stderr, "\n"); \
740 } \
741 } while (0)
742
743
744 /*----------------------------------------.
745 | Print this symbol's value on YYOUTPUT. |
746 `----------------------------------------*/
747
748 static void
749 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx)
750 {
751 FILE *yyo = yyoutput;
752 YYUSE (yyo);
753 YYUSE (ctx);
754 if (!yyvaluep)
755 return;
756 # ifdef YYPRINT
757 if (yytype < YYNTOKENS)
758 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
759 # endif
760 YYUSE (yytype);
761 }
762
763
764 /*--------------------------------.
765 | Print this symbol on YYOUTPUT. |
766 `--------------------------------*/
767
768 static void
769 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx)
770 {
771 YYFPRINTF (yyoutput, "%s %s (",
772 yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
773
774 yy_symbol_value_print (yyoutput, yytype, yyvaluep, ctx);
775 YYFPRINTF (yyoutput, ")");
776 }
777
778 /*------------------------------------------------------------------.
779 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
780 | TOP (included). |
781 `------------------------------------------------------------------*/
782
783 static void
784 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
785 {
786 YYFPRINTF (stderr, "Stack now");
787 for (; yybottom <= yytop; yybottom++)
788 {
789 int yybot = *yybottom;
790 YYFPRINTF (stderr, " %d", yybot);
791 }
792 YYFPRINTF (stderr, "\n");
793 }
794
795 # define YY_STACK_PRINT(Bottom, Top) \
796 do { \
797 if (yydebug) \
798 yy_stack_print ((Bottom), (Top)); \
799 } while (0)
800
801
802 /*------------------------------------------------.
803 | Report that the YYRULE is going to be reduced. |
804 `------------------------------------------------*/
805
806 static void
807 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx)
808 {
809 unsigned long int yylno = yyrline[yyrule];
810 int yynrhs = yyr2[yyrule];
811 int yyi;
812 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
813 yyrule - 1, yylno);
814 /* The symbols being reduced. */
815 for (yyi = 0; yyi < yynrhs; yyi++)
816 {
817 YYFPRINTF (stderr, " $%d = ", yyi + 1);
818 yy_symbol_print (stderr,
819 yystos[yyssp[yyi + 1 - yynrhs]],
820 &(yyvsp[(yyi + 1) - (yynrhs)])
821 , ctx);
822 YYFPRINTF (stderr, "\n");
823 }
824 }
825
826 # define YY_REDUCE_PRINT(Rule) \
827 do { \
828 if (yydebug) \
829 yy_reduce_print (yyssp, yyvsp, Rule, ctx); \
830 } while (0)
831
832 /* Nonzero means print parse trace. It is left uninitialized so that
833 multiple parsers can coexist. */
834 int yydebug;
835 #else /* !YYDEBUG */
836 # define YYDPRINTF(Args)
837 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
838 # define YY_STACK_PRINT(Bottom, Top)
839 # define YY_REDUCE_PRINT(Rule)
840 #endif /* !YYDEBUG */
841
842
843 /* YYINITDEPTH -- initial size of the parser's stacks. */
844 #ifndef YYINITDEPTH
845 # define YYINITDEPTH 200
846 #endif
847
848 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
849 if the built-in stack extension method is used).
850
851 Do not make this value too large; the results are undefined if
852 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
853 evaluated with infinite-precision integer arithmetic. */
854
855 #ifndef YYMAXDEPTH
856 # define YYMAXDEPTH 10000
857 #endif
858
859
860 #if YYERROR_VERBOSE
861
862 # ifndef yystrlen
863 # if defined __GLIBC__ && defined _STRING_H
864 # define yystrlen strlen
865 # else
866 /* Return the length of YYSTR. */
867 static YYSIZE_T
868 yystrlen (const char *yystr)
869 {
870 YYSIZE_T yylen;
871 for (yylen = 0; yystr[yylen]; yylen++)
872 continue;
873 return yylen;
874 }
875 # endif
876 # endif
877
878 # ifndef yystpcpy
879 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
880 # define yystpcpy stpcpy
881 # else
882 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
883 YYDEST. */
884 static char *
885 yystpcpy (char *yydest, const char *yysrc)
886 {
887 char *yyd = yydest;
888 const char *yys = yysrc;
889
890 while ((*yyd++ = *yys++) != '\0')
891 continue;
892
893 return yyd - 1;
894 }
895 # endif
896 # endif
897
898 # ifndef yytnamerr
899 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
900 quotes and backslashes, so that it's suitable for yyerror. The
901 heuristic is that double-quoting is unnecessary unless the string
902 contains an apostrophe, a comma, or backslash (other than
903 backslash-backslash). YYSTR is taken from yytname. If YYRES is
904 null, do not copy; instead, return the length of what the result
905 would have been. */
906 static YYSIZE_T
907 yytnamerr (char *yyres, const char *yystr)
908 {
909 if (*yystr == '"')
910 {
911 YYSIZE_T yyn = 0;
912 char const *yyp = yystr;
913
914 for (;;)
915 switch (*++yyp)
916 {
917 case '\'':
918 case ',':
919 goto do_not_strip_quotes;
920
921 case '\\':
922 if (*++yyp != '\\')
923 goto do_not_strip_quotes;
924 /* Fall through. */
925 default:
926 if (yyres)
927 yyres[yyn] = *yyp;
928 yyn++;
929 break;
930
931 case '"':
932 if (yyres)
933 yyres[yyn] = '\0';
934 return yyn;
935 }
936 do_not_strip_quotes: ;
937 }
938
939 if (! yyres)
940 return yystrlen (yystr);
941
942 return yystpcpy (yyres, yystr) - yyres;
943 }
944 # endif
945
946 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
947 about the unexpected token YYTOKEN for the state stack whose top is
948 YYSSP.
949
950 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
951 not large enough to hold the message. In that case, also set
952 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
953 required number of bytes is too large to store. */
954 static int
955 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
956 yytype_int16 *yyssp, int yytoken)
957 {
958 YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
959 YYSIZE_T yysize = yysize0;
960 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
961 /* Internationalized format string. */
962 const char *yyformat = YY_NULLPTR;
963 /* Arguments of yyformat. */
964 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
965 /* Number of reported tokens (one for the "unexpected", one per
966 "expected"). */
967 int yycount = 0;
968
969 /* There are many possibilities here to consider:
970 - If this state is a consistent state with a default action, then
971 the only way this function was invoked is if the default action
972 is an error action. In that case, don't check for expected
973 tokens because there are none.
974 - The only way there can be no lookahead present (in yychar) is if
975 this state is a consistent state with a default action. Thus,
976 detecting the absence of a lookahead is sufficient to determine
977 that there is no unexpected or expected token to report. In that
978 case, just report a simple "syntax error".
979 - Don't assume there isn't a lookahead just because this state is a
980 consistent state with a default action. There might have been a
981 previous inconsistent state, consistent state with a non-default
982 action, or user semantic action that manipulated yychar.
983 - Of course, the expected token list depends on states to have
984 correct lookahead information, and it depends on the parser not
985 to perform extra reductions after fetching a lookahead from the
986 scanner and before detecting a syntax error. Thus, state merging
987 (from LALR or IELR) and default reductions corrupt the expected
988 token list. However, the list is correct for canonical LR with
989 one exception: it will still contain any token that will not be
990 accepted due to an error action in a later state.
991 */
992 if (yytoken != YYEMPTY)
993 {
994 int yyn = yypact[*yyssp];
995 yyarg[yycount++] = yytname[yytoken];
996 if (!yypact_value_is_default (yyn))
997 {
998 /* Start YYX at -YYN if negative to avoid negative indexes in
999 YYCHECK. In other words, skip the first -YYN actions for
1000 this state because they are default actions. */
1001 int yyxbegin = yyn < 0 ? -yyn : 0;
1002 /* Stay within bounds of both yycheck and yytname. */
1003 int yychecklim = YYLAST - yyn + 1;
1004 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1005 int yyx;
1006
1007 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1008 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1009 && !yytable_value_is_error (yytable[yyx + yyn]))
1010 {
1011 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1012 {
1013 yycount = 1;
1014 yysize = yysize0;
1015 break;
1016 }
1017 yyarg[yycount++] = yytname[yyx];
1018 {
1019 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
1020 if (! (yysize <= yysize1
1021 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1022 return 2;
1023 yysize = yysize1;
1024 }
1025 }
1026 }
1027 }
1028
1029 switch (yycount)
1030 {
1031 # define YYCASE_(N, S) \
1032 case N: \
1033 yyformat = S; \
1034 break
1035 YYCASE_(0, YY_("syntax error"));
1036 YYCASE_(1, YY_("syntax error, unexpected %s"));
1037 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1038 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1039 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1040 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1041 # undef YYCASE_
1042 }
1043
1044 {
1045 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1046 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1047 return 2;
1048 yysize = yysize1;
1049 }
1050
1051 if (*yymsg_alloc < yysize)
1052 {
1053 *yymsg_alloc = 2 * yysize;
1054 if (! (yysize <= *yymsg_alloc
1055 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1056 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1057 return 1;
1058 }
1059
1060 /* Avoid sprintf, as that infringes on the user's name space.
1061 Don't have undefined behavior even if the translation
1062 produced a string with the wrong number of "%s"s. */
1063 {
1064 char *yyp = *yymsg;
1065 int yyi = 0;
1066 while ((*yyp = *yyformat) != '\0')
1067 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1068 {
1069 yyp += yytnamerr (yyp, yyarg[yyi++]);
1070 yyformat += 2;
1071 }
1072 else
1073 {
1074 yyp++;
1075 yyformat++;
1076 }
1077 }
1078 return 0;
1079 }
1080 #endif /* YYERROR_VERBOSE */
1081
1082 /*-----------------------------------------------.
1083 | Release the memory associated to this symbol. |
1084 `-----------------------------------------------*/
1085
1086 static void
1087 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_ctx_t *ctx)
1088 {
1089 YYUSE (yyvaluep);
1090 YYUSE (ctx);
1091 if (!yymsg)
1092 yymsg = "Deleting";
1093 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1094
1095 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1096 YYUSE (yytype);
1097 YY_IGNORE_MAYBE_UNINITIALIZED_END
1098 }
1099
1100
1101
1102
1103 /*----------.
1104 | yyparse. |
1105 `----------*/
1106
1107 int
1108 yyparse (parser_ctx_t *ctx)
1109 {
1110 /* The lookahead symbol. */
1111 int yychar;
1112
1113
1114 /* The semantic value of the lookahead symbol. */
1115 /* Default value used for initialization, for pacifying older GCCs
1116 or non-GCC compilers. */
1117 YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
1118 YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
1119
1120 /* Number of syntax errors so far. */
1121 int yynerrs;
1122
1123 int yystate;
1124 /* Number of tokens to shift before error messages enabled. */
1125 int yyerrstatus;
1126
1127 /* The stacks and their tools:
1128 'yyss': related to states.
1129 'yyvs': related to semantic values.
1130
1131 Refer to the stacks through separate pointers, to allow yyoverflow
1132 to reallocate them elsewhere. */
1133
1134 /* The state stack. */
1135 yytype_int16 yyssa[YYINITDEPTH];
1136 yytype_int16 *yyss;
1137 yytype_int16 *yyssp;
1138
1139 /* The semantic value stack. */
1140 YYSTYPE yyvsa[YYINITDEPTH];
1141 YYSTYPE *yyvs;
1142 YYSTYPE *yyvsp;
1143
1144 YYSIZE_T yystacksize;
1145
1146 int yyn;
1147 int yyresult;
1148 /* Lookahead token as an internal (translated) token number. */
1149 int yytoken = 0;
1150 /* The variables used to return semantic value and location from the
1151 action routines. */
1152 YYSTYPE yyval;
1153
1154 #if YYERROR_VERBOSE
1155 /* Buffer for error messages, and its allocated size. */
1156 char yymsgbuf[128];
1157 char *yymsg = yymsgbuf;
1158 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1159 #endif
1160
1161 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1162
1163 /* The number of symbols on the RHS of the reduced rule.
1164 Keep to zero when no symbol should be popped. */
1165 int yylen = 0;
1166
1167 yyssp = yyss = yyssa;
1168 yyvsp = yyvs = yyvsa;
1169 yystacksize = YYINITDEPTH;
1170
1171 YYDPRINTF ((stderr, "Starting parse\n"));
1172
1173 yystate = 0;
1174 yyerrstatus = 0;
1175 yynerrs = 0;
1176 yychar = YYEMPTY; /* Cause a token to be read. */
1177 goto yysetstate;
1178
1179 /*------------------------------------------------------------.
1180 | yynewstate -- Push a new state, which is found in yystate. |
1181 `------------------------------------------------------------*/
1182 yynewstate:
1183 /* In all cases, when you get here, the value and location stacks
1184 have just been pushed. So pushing a state here evens the stacks. */
1185 yyssp++;
1186
1187 yysetstate:
1188 *yyssp = yystate;
1189
1190 if (yyss + yystacksize - 1 <= yyssp)
1191 {
1192 /* Get the current used size of the three stacks, in elements. */
1193 YYSIZE_T yysize = yyssp - yyss + 1;
1194
1195 #ifdef yyoverflow
1196 {
1197 /* Give user a chance to reallocate the stack. Use copies of
1198 these so that the &'s don't force the real ones into
1199 memory. */
1200 YYSTYPE *yyvs1 = yyvs;
1201 yytype_int16 *yyss1 = yyss;
1202
1203 /* Each stack pointer address is followed by the size of the
1204 data in use in that stack, in bytes. This used to be a
1205 conditional around just the two extra args, but that might
1206 be undefined if yyoverflow is a macro. */
1207 yyoverflow (YY_("memory exhausted"),
1208 &yyss1, yysize * sizeof (*yyssp),
1209 &yyvs1, yysize * sizeof (*yyvsp),
1210 &yystacksize);
1211
1212 yyss = yyss1;
1213 yyvs = yyvs1;
1214 }
1215 #else /* no yyoverflow */
1216 # ifndef YYSTACK_RELOCATE
1217 goto yyexhaustedlab;
1218 # else
1219 /* Extend the stack our own way. */
1220 if (YYMAXDEPTH <= yystacksize)
1221 goto yyexhaustedlab;
1222 yystacksize *= 2;
1223 if (YYMAXDEPTH < yystacksize)
1224 yystacksize = YYMAXDEPTH;
1225
1226 {
1227 yytype_int16 *yyss1 = yyss;
1228 union yyalloc *yyptr =
1229 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
1230 if (! yyptr)
1231 goto yyexhaustedlab;
1232 YYSTACK_RELOCATE (yyss_alloc, yyss);
1233 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1234 # undef YYSTACK_RELOCATE
1235 if (yyss1 != yyssa)
1236 YYSTACK_FREE (yyss1);
1237 }
1238 # endif
1239 #endif /* no yyoverflow */
1240
1241 yyssp = yyss + yysize - 1;
1242 yyvsp = yyvs + yysize - 1;
1243
1244 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
1245 (unsigned long int) yystacksize));
1246
1247 if (yyss + yystacksize - 1 <= yyssp)
1248 YYABORT;
1249 }
1250
1251 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1252
1253 if (yystate == YYFINAL)
1254 YYACCEPT;
1255
1256 goto yybackup;
1257
1258 /*-----------.
1259 | yybackup. |
1260 `-----------*/
1261 yybackup:
1262
1263 /* Do appropriate processing given the current state. Read a
1264 lookahead token if we need one and don't already have one. */
1265
1266 /* First try to decide what to do without reference to lookahead token. */
1267 yyn = yypact[yystate];
1268 if (yypact_value_is_default (yyn))
1269 goto yydefault;
1270
1271 /* Not known => get a lookahead token if don't already have one. */
1272
1273 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1274 if (yychar == YYEMPTY)
1275 {
1276 YYDPRINTF ((stderr, "Reading a token: "));
1277 yychar = yylex (&yylval, ctx);
1278 }
1279
1280 if (yychar <= YYEOF)
1281 {
1282 yychar = yytoken = YYEOF;
1283 YYDPRINTF ((stderr, "Now at end of input.\n"));
1284 }
1285 else
1286 {
1287 yytoken = YYTRANSLATE (yychar);
1288 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1289 }
1290
1291 /* If the proper action on seeing token YYTOKEN is to reduce or to
1292 detect an error, take that action. */
1293 yyn += yytoken;
1294 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1295 goto yydefault;
1296 yyn = yytable[yyn];
1297 if (yyn <= 0)
1298 {
1299 if (yytable_value_is_error (yyn))
1300 goto yyerrlab;
1301 yyn = -yyn;
1302 goto yyreduce;
1303 }
1304
1305 /* Count tokens shifted since error; after three, turn off error
1306 status. */
1307 if (yyerrstatus)
1308 yyerrstatus--;
1309
1310 /* Shift the lookahead token. */
1311 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1312
1313 /* Discard the shifted token. */
1314 yychar = YYEMPTY;
1315
1316 yystate = yyn;
1317 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1318 *++yyvsp = yylval;
1319 YY_IGNORE_MAYBE_UNINITIALIZED_END
1320
1321 goto yynewstate;
1322
1323
1324 /*-----------------------------------------------------------.
1325 | yydefault -- do the default action for the current state. |
1326 `-----------------------------------------------------------*/
1327 yydefault:
1328 yyn = yydefact[yystate];
1329 if (yyn == 0)
1330 goto yyerrlab;
1331 goto yyreduce;
1332
1333
1334 /*-----------------------------.
1335 | yyreduce -- Do a reduction. |
1336 `-----------------------------*/
1337 yyreduce:
1338 /* yyn is the number of a rule to reduce with. */
1339 yylen = yyr2[yyn];
1340
1341 /* If YYLEN is nonzero, implement the default value of the action:
1342 '$$ = $1'.
1343
1344 Otherwise, the following line sets YYVAL to garbage.
1345 This behavior is undocumented and Bison
1346 users should not rely upon it. Assigning to YYVAL
1347 unconditionally makes the parser a bit smaller, and it avoids a
1348 GCC warning that YYVAL may be used uninitialized. */
1349 yyval = yyvsp[1-yylen];
1350
1351
1352 YY_REDUCE_PRINT (yyn);
1353 switch (yyn)
1354 {
1355 case 2:
1356 #line 146 "cc_parser.y" /* yacc.c:1646 */
1357 { ctx->ccval = (yyvsp[0].ccval); YYACCEPT; }
1358 #line 1367 "cc_parser.tab.c" /* yacc.c:1646 */
1359 break;
1360
1361 case 3:
1362 #line 149 "cc_parser.y" /* yacc.c:1646 */
1363 { (yyval.ccval) = (yyvsp[0].ccval); }
1364 #line 1373 "cc_parser.tab.c" /* yacc.c:1646 */
1365 break;
1366
1367 case 4:
1368 #line 150 "cc_parser.y" /* yacc.c:1646 */
1369 { (yyval.ccval) = (yyvsp[-1].ccval); }
1370 #line 1379 "cc_parser.tab.c" /* yacc.c:1646 */
1371 break;
1372
1373 case 5:
1374 #line 151 "cc_parser.y" /* yacc.c:1646 */
1375 { (yyval.ccval) = ccval_bool(!get_ccbool((yyvsp[0].ccval))); }
1376 #line 1385 "cc_parser.tab.c" /* yacc.c:1646 */
1377 break;
1378
1379 case 6:
1380 #line 152 "cc_parser.y" /* yacc.c:1646 */
1381 { FIXME("'~' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1382 #line 1391 "cc_parser.tab.c" /* yacc.c:1646 */
1383 break;
1384
1385 case 7:
1386 #line 153 "cc_parser.y" /* yacc.c:1646 */
1387 { FIXME("'+' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1388 #line 1397 "cc_parser.tab.c" /* yacc.c:1646 */
1389 break;
1390
1391 case 8:
1392 #line 154 "cc_parser.y" /* yacc.c:1646 */
1393 { FIXME("'-' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1394 #line 1403 "cc_parser.tab.c" /* yacc.c:1646 */
1395 break;
1396
1397 case 9:
1398 #line 157 "cc_parser.y" /* yacc.c:1646 */
1399 { (yyval.ccval) = (yyvsp[0].ccval); }
1400 #line 1409 "cc_parser.tab.c" /* yacc.c:1646 */
1401 break;
1402
1403 case 10:
1404 #line 159 "cc_parser.y" /* yacc.c:1646 */
1405 { FIXME("'||' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1406 #line 1415 "cc_parser.tab.c" /* yacc.c:1646 */
1407 break;
1408
1409 case 11:
1410 #line 162 "cc_parser.y" /* yacc.c:1646 */
1411 { (yyval.ccval) = (yyvsp[0].ccval); }
1412 #line 1421 "cc_parser.tab.c" /* yacc.c:1646 */
1413 break;
1414
1415 case 12:
1416 #line 164 "cc_parser.y" /* yacc.c:1646 */
1417 { FIXME("'&&' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1418 #line 1427 "cc_parser.tab.c" /* yacc.c:1646 */
1419 break;
1420
1421 case 13:
1422 #line 167 "cc_parser.y" /* yacc.c:1646 */
1423 { (yyval.ccval) = (yyvsp[0].ccval); }
1424 #line 1433 "cc_parser.tab.c" /* yacc.c:1646 */
1425 break;
1426
1427 case 14:
1428 #line 169 "cc_parser.y" /* yacc.c:1646 */
1429 { FIXME("'|' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1430 #line 1439 "cc_parser.tab.c" /* yacc.c:1646 */
1431 break;
1432
1433 case 15:
1434 #line 172 "cc_parser.y" /* yacc.c:1646 */
1435 { (yyval.ccval) = (yyvsp[0].ccval); }
1436 #line 1445 "cc_parser.tab.c" /* yacc.c:1646 */
1437 break;
1438
1439 case 16:
1440 #line 174 "cc_parser.y" /* yacc.c:1646 */
1441 { FIXME("'^' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1442 #line 1451 "cc_parser.tab.c" /* yacc.c:1646 */
1443 break;
1444
1445 case 17:
1446 #line 177 "cc_parser.y" /* yacc.c:1646 */
1447 { (yyval.ccval) = (yyvsp[0].ccval); }
1448 #line 1457 "cc_parser.tab.c" /* yacc.c:1646 */
1449 break;
1450
1451 case 18:
1452 #line 179 "cc_parser.y" /* yacc.c:1646 */
1453 { FIXME("'&' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1454 #line 1463 "cc_parser.tab.c" /* yacc.c:1646 */
1455 break;
1456
1457 case 19:
1458 #line 182 "cc_parser.y" /* yacc.c:1646 */
1459 { (yyval.ccval) = (yyvsp[0].ccval); }
1460 #line 1469 "cc_parser.tab.c" /* yacc.c:1646 */
1461 break;
1462
1463 case 20:
1464 #line 184 "cc_parser.y" /* yacc.c:1646 */
1465 { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) == get_ccnum((yyvsp[0].ccval))); }
1466 #line 1475 "cc_parser.tab.c" /* yacc.c:1646 */
1467 break;
1468
1469 case 21:
1470 #line 186 "cc_parser.y" /* yacc.c:1646 */
1471 { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) != get_ccnum((yyvsp[0].ccval))); }
1472 #line 1481 "cc_parser.tab.c" /* yacc.c:1646 */
1473 break;
1474
1475 case 22:
1476 #line 188 "cc_parser.y" /* yacc.c:1646 */
1477 { FIXME("'===' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1478 #line 1487 "cc_parser.tab.c" /* yacc.c:1646 */
1479 break;
1480
1481 case 23:
1482 #line 190 "cc_parser.y" /* yacc.c:1646 */
1483 { FIXME("'!==' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1484 #line 1493 "cc_parser.tab.c" /* yacc.c:1646 */
1485 break;
1486
1487 case 24:
1488 #line 193 "cc_parser.y" /* yacc.c:1646 */
1489 { (yyval.ccval) = (yyvsp[0].ccval); }
1490 #line 1499 "cc_parser.tab.c" /* yacc.c:1646 */
1491 break;
1492
1493 case 25:
1494 #line 195 "cc_parser.y" /* yacc.c:1646 */
1495 { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) < get_ccnum((yyvsp[0].ccval))); }
1496 #line 1505 "cc_parser.tab.c" /* yacc.c:1646 */
1497 break;
1498
1499 case 26:
1500 #line 197 "cc_parser.y" /* yacc.c:1646 */
1501 { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) <= get_ccnum((yyvsp[0].ccval))); }
1502 #line 1511 "cc_parser.tab.c" /* yacc.c:1646 */
1503 break;
1504
1505 case 27:
1506 #line 199 "cc_parser.y" /* yacc.c:1646 */
1507 { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) > get_ccnum((yyvsp[0].ccval))); }
1508 #line 1517 "cc_parser.tab.c" /* yacc.c:1646 */
1509 break;
1510
1511 case 28:
1512 #line 201 "cc_parser.y" /* yacc.c:1646 */
1513 { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) >= get_ccnum((yyvsp[0].ccval))); }
1514 #line 1523 "cc_parser.tab.c" /* yacc.c:1646 */
1515 break;
1516
1517 case 29:
1518 #line 204 "cc_parser.y" /* yacc.c:1646 */
1519 { (yyval.ccval) = (yyvsp[0].ccval); }
1520 #line 1529 "cc_parser.tab.c" /* yacc.c:1646 */
1521 break;
1522
1523 case 30:
1524 #line 206 "cc_parser.y" /* yacc.c:1646 */
1525 { FIXME("'<<' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1526 #line 1535 "cc_parser.tab.c" /* yacc.c:1646 */
1527 break;
1528
1529 case 31:
1530 #line 208 "cc_parser.y" /* yacc.c:1646 */
1531 { FIXME("'>>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1532 #line 1541 "cc_parser.tab.c" /* yacc.c:1646 */
1533 break;
1534
1535 case 32:
1536 #line 210 "cc_parser.y" /* yacc.c:1646 */
1537 { FIXME("'>>>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1538 #line 1547 "cc_parser.tab.c" /* yacc.c:1646 */
1539 break;
1540
1541 case 33:
1542 #line 213 "cc_parser.y" /* yacc.c:1646 */
1543 { (yyval.ccval) = (yyvsp[0].ccval); }
1544 #line 1553 "cc_parser.tab.c" /* yacc.c:1646 */
1545 break;
1546
1547 case 34:
1548 #line 215 "cc_parser.y" /* yacc.c:1646 */
1549 { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) + get_ccnum((yyvsp[0].ccval))); }
1550 #line 1559 "cc_parser.tab.c" /* yacc.c:1646 */
1551 break;
1552
1553 case 35:
1554 #line 217 "cc_parser.y" /* yacc.c:1646 */
1555 { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) - get_ccnum((yyvsp[0].ccval))); }
1556 #line 1565 "cc_parser.tab.c" /* yacc.c:1646 */
1557 break;
1558
1559 case 36:
1560 #line 220 "cc_parser.y" /* yacc.c:1646 */
1561 { (yyval.ccval) = (yyvsp[0].ccval); }
1562 #line 1571 "cc_parser.tab.c" /* yacc.c:1646 */
1563 break;
1564
1565 case 37:
1566 #line 222 "cc_parser.y" /* yacc.c:1646 */
1567 { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) * get_ccnum((yyvsp[0].ccval))); }
1568 #line 1577 "cc_parser.tab.c" /* yacc.c:1646 */
1569 break;
1570
1571 case 38:
1572 #line 224 "cc_parser.y" /* yacc.c:1646 */
1573 { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) / get_ccnum((yyvsp[0].ccval))); }
1574 #line 1583 "cc_parser.tab.c" /* yacc.c:1646 */
1575 break;
1576
1577 case 39:
1578 #line 226 "cc_parser.y" /* yacc.c:1646 */
1579 { FIXME("'%%' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; }
1580 #line 1589 "cc_parser.tab.c" /* yacc.c:1646 */
1581 break;
1582
1583
1584 #line 1593 "cc_parser.tab.c" /* yacc.c:1646 */
1585 default: break;
1586 }
1587 /* User semantic actions sometimes alter yychar, and that requires
1588 that yytoken be updated with the new translation. We take the
1589 approach of translating immediately before every use of yytoken.
1590 One alternative is translating here after every semantic action,
1591 but that translation would be missed if the semantic action invokes
1592 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1593 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1594 incorrect destructor might then be invoked immediately. In the
1595 case of YYERROR or YYBACKUP, subsequent parser actions might lead
1596 to an incorrect destructor call or verbose syntax error message
1597 before the lookahead is translated. */
1598 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
1599
1600 YYPOPSTACK (yylen);
1601 yylen = 0;
1602 YY_STACK_PRINT (yyss, yyssp);
1603
1604 *++yyvsp = yyval;
1605
1606 /* Now 'shift' the result of the reduction. Determine what state
1607 that goes to, based on the state we popped back to and the rule
1608 number reduced by. */
1609
1610 yyn = yyr1[yyn];
1611
1612 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
1613 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1614 yystate = yytable[yystate];
1615 else
1616 yystate = yydefgoto[yyn - YYNTOKENS];
1617
1618 goto yynewstate;
1619
1620
1621 /*--------------------------------------.
1622 | yyerrlab -- here on detecting error. |
1623 `--------------------------------------*/
1624 yyerrlab:
1625 /* Make sure we have latest lookahead translation. See comments at
1626 user semantic actions for why this is necessary. */
1627 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
1628
1629 /* If not already recovering from an error, report this error. */
1630 if (!yyerrstatus)
1631 {
1632 ++yynerrs;
1633 #if ! YYERROR_VERBOSE
1634 yyerror (ctx, YY_("syntax error"));
1635 #else
1636 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1637 yyssp, yytoken)
1638 {
1639 char const *yymsgp = YY_("syntax error");
1640 int yysyntax_error_status;
1641 yysyntax_error_status = YYSYNTAX_ERROR;
1642 if (yysyntax_error_status == 0)
1643 yymsgp = yymsg;
1644 else if (yysyntax_error_status == 1)
1645 {
1646 if (yymsg != yymsgbuf)
1647 YYSTACK_FREE (yymsg);
1648 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
1649 if (!yymsg)
1650 {
1651 yymsg = yymsgbuf;
1652 yymsg_alloc = sizeof yymsgbuf;
1653 yysyntax_error_status = 2;
1654 }
1655 else
1656 {
1657 yysyntax_error_status = YYSYNTAX_ERROR;
1658 yymsgp = yymsg;
1659 }
1660 }
1661 yyerror (ctx, yymsgp);
1662 if (yysyntax_error_status == 2)
1663 goto yyexhaustedlab;
1664 }
1665 # undef YYSYNTAX_ERROR
1666 #endif
1667 }
1668
1669
1670
1671 if (yyerrstatus == 3)
1672 {
1673 /* If just tried and failed to reuse lookahead token after an
1674 error, discard it. */
1675
1676 if (yychar <= YYEOF)
1677 {
1678 /* Return failure if at end of input. */
1679 if (yychar == YYEOF)
1680 YYABORT;
1681 }
1682 else
1683 {
1684 yydestruct ("Error: discarding",
1685 yytoken, &yylval, ctx);
1686 yychar = YYEMPTY;
1687 }
1688 }
1689
1690 /* Else will try to reuse lookahead token after shifting the error
1691 token. */
1692 goto yyerrlab1;
1693
1694
1695 /*---------------------------------------------------.
1696 | yyerrorlab -- error raised explicitly by YYERROR. |
1697 `---------------------------------------------------*/
1698 yyerrorlab:
1699
1700 /* Pacify compilers like GCC when the user code never invokes
1701 YYERROR and the label yyerrorlab therefore never appears in user
1702 code. */
1703 if (/*CONSTCOND*/ 0)
1704 goto yyerrorlab;
1705
1706 /* Do not reclaim the symbols of the rule whose action triggered
1707 this YYERROR. */
1708 YYPOPSTACK (yylen);
1709 yylen = 0;
1710 YY_STACK_PRINT (yyss, yyssp);
1711 yystate = *yyssp;
1712 goto yyerrlab1;
1713
1714
1715 /*-------------------------------------------------------------.
1716 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1717 `-------------------------------------------------------------*/
1718 yyerrlab1:
1719 yyerrstatus = 3; /* Each real token shifted decrements this. */
1720
1721 for (;;)
1722 {
1723 yyn = yypact[yystate];
1724 if (!yypact_value_is_default (yyn))
1725 {
1726 yyn += YYTERROR;
1727 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
1728 {
1729 yyn = yytable[yyn];
1730 if (0 < yyn)
1731 break;
1732 }
1733 }
1734
1735 /* Pop the current state because it cannot handle the error token. */
1736 if (yyssp == yyss)
1737 YYABORT;
1738
1739
1740 yydestruct ("Error: popping",
1741 yystos[yystate], yyvsp, ctx);
1742 YYPOPSTACK (1);
1743 yystate = *yyssp;
1744 YY_STACK_PRINT (yyss, yyssp);
1745 }
1746
1747 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1748 *++yyvsp = yylval;
1749 YY_IGNORE_MAYBE_UNINITIALIZED_END
1750
1751
1752 /* Shift the error token. */
1753 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
1754
1755 yystate = yyn;
1756 goto yynewstate;
1757
1758
1759 /*-------------------------------------.
1760 | yyacceptlab -- YYACCEPT comes here. |
1761 `-------------------------------------*/
1762 yyacceptlab:
1763 yyresult = 0;
1764 goto yyreturn;
1765
1766 /*-----------------------------------.
1767 | yyabortlab -- YYABORT comes here. |
1768 `-----------------------------------*/
1769 yyabortlab:
1770 yyresult = 1;
1771 goto yyreturn;
1772
1773 #if !defined yyoverflow || YYERROR_VERBOSE
1774 /*-------------------------------------------------.
1775 | yyexhaustedlab -- memory exhaustion comes here. |
1776 `-------------------------------------------------*/
1777 yyexhaustedlab:
1778 yyerror (ctx, YY_("memory exhausted"));
1779 yyresult = 2;
1780 /* Fall through. */
1781 #endif
1782
1783 yyreturn:
1784 if (yychar != YYEMPTY)
1785 {
1786 /* Make sure we have latest lookahead translation. See comments at
1787 user semantic actions for why this is necessary. */
1788 yytoken = YYTRANSLATE (yychar);
1789 yydestruct ("Cleanup: discarding lookahead",
1790 yytoken, &yylval, ctx);
1791 }
1792 /* Do not reclaim the symbols of the rule whose action triggered
1793 this YYABORT or YYACCEPT. */
1794 YYPOPSTACK (yylen);
1795 YY_STACK_PRINT (yyss, yyssp);
1796 while (yyssp != yyss)
1797 {
1798 yydestruct ("Cleanup: popping",
1799 yystos[*yyssp], yyvsp, ctx);
1800 YYPOPSTACK (1);
1801 }
1802 #ifndef yyoverflow
1803 if (yyss != yyssa)
1804 YYSTACK_FREE (yyss);
1805 #endif
1806 #if YYERROR_VERBOSE
1807 if (yymsg != yymsgbuf)
1808 YYSTACK_FREE (yymsg);
1809 #endif
1810 return yyresult;
1811 }
1812 #line 228 "cc_parser.y" /* yacc.c:1906 */
1813
1814
1815 BOOL parse_cc_expr(parser_ctx_t *ctx)
1816 {
1817 ctx->hres = S_OK;
1818 cc_parser_parse(ctx);
1819 return SUCCEEDED(ctx->hres);
1820 }