1 /* A Bison parser, made by GNU Bison 3.0.2. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "3.0.2"
50 #define YYSKELETON_NAME "yacc.c"
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
70 /* Copy the first part of user declarations. */
71 #line 19 "cc_parser.y" /* yacc.c:339 */
75 #line 84 "cc_parser.tab.c" /* yacc.c:339 */
78 # if defined __cplusplus && 201103L <= __cplusplus
79 # define YY_NULLPTR nullptr
85 /* Enabling verbose error messages. */
86 #ifdef YYERROR_VERBOSE
87 # undef YYERROR_VERBOSE
88 # define YYERROR_VERBOSE 1
90 # define YYERROR_VERBOSE 0
99 extern int cc_parser_debug
;
123 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
124 typedef union YYSTYPE YYSTYPE
;
127 #line 36 "cc_parser.y" /* yacc.c:355 */
131 #line 140 "cc_parser.tab.c" /* yacc.c:355 */
133 # define YYSTYPE_IS_TRIVIAL 1
134 # define YYSTYPE_IS_DECLARED 1
139 int cc_parser_parse (parser_ctx_t
*ctx
);
143 /* Copy the second part of user declarations. */
144 #line 47 "cc_parser.y" /* yacc.c:358 */
147 static int cc_parser_error(parser_ctx_t
*ctx
, const char *str
)
149 if(SUCCEEDED(ctx
->hres
)) {
151 ctx
->hres
= JS_E_SYNTAX
;
157 static int cc_parser_lex(void *lval
, parser_ctx_t
*ctx
)
161 r
= try_parse_ccval(ctx
, lval
);
163 return r
> 0 ? tCCValue
: -1;
177 if(*++ctx
->ptr
== '=') {
178 if(*++ctx
->ptr
== '=') {
186 if(*++ctx
->ptr
== '=') {
187 if(*++ctx
->ptr
== '=') {
195 switch(*++ctx
->ptr
) {
206 switch(*++ctx
->ptr
) {
208 if(*++ctx
->ptr
== '>') {
220 if(*++ctx
->ptr
== '|') {
226 if(*++ctx
->ptr
== '&') {
233 WARN("Failed to interpret %s\n", debugstr_w(ctx
->ptr
));
238 #line 247 "cc_parser.tab.c" /* yacc.c:358 */
245 typedef YYTYPE_UINT8 yytype_uint8
;
247 typedef unsigned char yytype_uint8
;
251 typedef YYTYPE_INT8 yytype_int8
;
253 typedef signed char yytype_int8
;
257 typedef YYTYPE_UINT16 yytype_uint16
;
259 typedef unsigned short int yytype_uint16
;
263 typedef YYTYPE_INT16 yytype_int16
;
265 typedef short int yytype_int16
;
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
277 # define YYSIZE_T unsigned int
281 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
284 # if defined YYENABLE_NLS && YYENABLE_NLS
286 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
287 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
291 # define YY_(Msgid) Msgid
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)
301 # define YY_ATTRIBUTE(Spec) /* empty */
305 #ifndef YY_ATTRIBUTE_PURE
306 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
309 #ifndef YY_ATTRIBUTE_UNUSED
310 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
313 #if !defined _Noreturn \
314 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
315 # if defined _MSC_VER && 1200 <= _MSC_VER
316 # define _Noreturn __declspec (noreturn)
318 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
322 /* Suppress unused-variable warnings by "using" E. */
323 #if ! defined lint || defined __GNUC__
324 # define YYUSE(E) ((void) (E))
326 # define YYUSE(E) /* empty */
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")
338 # define YY_INITIAL_VALUE(Value) Value
340 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
341 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
342 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
344 #ifndef YY_INITIAL_VALUE
345 # define YY_INITIAL_VALUE(Value) /* Nothing. */
349 #if ! defined yyoverflow || YYERROR_VERBOSE
351 /* The parser invokes alloca or malloc; define the necessary symbols. */
353 # ifdef YYSTACK_USE_ALLOCA
354 # if YYSTACK_USE_ALLOCA
356 # define YYSTACK_ALLOC __builtin_alloca
357 # elif defined __BUILTIN_VA_ARG_INCR
358 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
360 # define YYSTACK_ALLOC __alloca
361 # elif defined _MSC_VER
362 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
363 # define alloca _alloca
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
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 */
388 # define YYSTACK_ALLOC YYMALLOC
389 # define YYSTACK_FREE YYFREE
390 # ifndef YYSTACK_ALLOC_MAXIMUM
391 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
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
402 # define YYMALLOC malloc
403 # if ! defined malloc && ! defined EXIT_SUCCESS
404 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
409 # if ! defined free && ! defined EXIT_SUCCESS
410 void free (void *); /* INFRINGES ON USER NAME SPACE */
414 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
417 #if (! defined yyoverflow \
418 && (! defined __cplusplus \
419 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
421 /* A type that is properly aligned for any stack member. */
424 yytype_int16 yyss_alloc
;
428 /* The size of the maximum gap between one aligned stack and the next. */
429 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
431 /* The size of an array large to enough to hold all stacks, each with
433 # define YYSTACK_BYTES(N) \
434 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
435 + YYSTACK_GAP_MAXIMUM)
437 # define YYCOPY_NEEDED 1
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
444 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
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); \
457 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
458 /* Copy COUNT objects from SRC to DST. The source and destination do
461 # if defined __GNUC__ && 1 < __GNUC__
462 # define YYCOPY(Dst, Src, Count) \
463 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
465 # define YYCOPY(Dst, Src, Count) \
469 for (yyi = 0; yyi < (Count); yyi++) \
470 (Dst)[yyi] = (Src)[yyi]; \
475 #endif /* !YYCOPY_NEEDED */
477 /* YYFINAL -- State number of the termination state. */
479 /* YYLAST -- Last index in YYTABLE. */
482 /* YYNTOKENS -- Number of terminals. */
484 /* YYNNTS -- Number of nonterminals. */
486 /* YYNRULES -- Number of rules. */
488 /* YYNSTATES -- Number of states. */
491 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
492 by yylex, with out-of-bounds checking. */
494 #define YYMAXUTOK 269
496 #define YYTRANSLATE(YYX) \
497 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
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
[] =
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
533 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
534 static const yytype_uint8 yyrline
[] =
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
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
[] =
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
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
[] =
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
571 #define YYPACT_NINF -17
573 #define yypact_value_is_default(Yystate) \
574 (!!((Yystate) == (-17)))
576 #define YYTABLE_NINF -1
578 #define yytable_value_is_error(Yytable_value) \
581 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
583 static const yytype_int8 yypact
[] =
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
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
[] =
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
608 /* YYPGOTO[NTERM-NUM]. */
609 static const yytype_int8 yypgoto
[] =
611 -17, -17, 0, -17, 18, 26, 29, 13, 27, -3,
615 /* YYDEFGOTO[NTERM-NUM]. */
616 static const yytype_int8 yydefgoto
[] =
618 -1, 7, 9, 10, 11, 12, 13, 14, 15, 16,
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
[] =
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
635 static const yytype_uint8 yycheck
[] =
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
645 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
646 symbol of state STATE-NUM. */
647 static const yytype_uint8 yystos
[] =
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
658 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
659 static const yytype_uint8 yyr1
[] =
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
667 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
668 static const yytype_uint8 yyr2
[] =
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
677 #define yyerrok (yyerrstatus = 0)
678 #define yyclearin (yychar = YYEMPTY)
682 #define YYACCEPT goto yyacceptlab
683 #define YYABORT goto yyabortlab
684 #define YYERROR goto yyerrorlab
687 #define YYRECOVERING() (!!yyerrstatus)
689 #define YYBACKUP(Token, Value) \
691 if (yychar == YYEMPTY) \
695 YYPOPSTACK (yylen); \
701 yyerror (ctx, YY_("syntax error: cannot back up")); \
706 /* Error token number */
708 #define YYERRCODE 256
712 /* Enable debugging if requested. */
716 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
717 # define YYFPRINTF fprintf
720 # define YYDPRINTF(Args) \
726 /* This macro is provided for backward compatibility. */
727 #ifndef YY_LOCATION_PRINT
728 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
732 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
736 YYFPRINTF (stderr, "%s ", Title); \
737 yy_symbol_print (stderr, \
739 YYFPRINTF (stderr, "\n"); \
744 /*----------------------------------------.
745 | Print this symbol's value on YYOUTPUT. |
746 `----------------------------------------*/
749 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, parser_ctx_t
*ctx
)
751 FILE *yyo
= yyoutput
;
757 if (yytype
< YYNTOKENS
)
758 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
764 /*--------------------------------.
765 | Print this symbol on YYOUTPUT. |
766 `--------------------------------*/
769 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
, parser_ctx_t
*ctx
)
771 YYFPRINTF (yyoutput
, "%s %s (",
772 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
774 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
, ctx
);
775 YYFPRINTF (yyoutput
, ")");
778 /*------------------------------------------------------------------.
779 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
781 `------------------------------------------------------------------*/
784 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
786 YYFPRINTF (stderr
, "Stack now");
787 for (; yybottom
<= yytop
; yybottom
++)
789 int yybot
= *yybottom
;
790 YYFPRINTF (stderr
, " %d", yybot
);
792 YYFPRINTF (stderr
, "\n");
795 # define YY_STACK_PRINT(Bottom, Top) \
798 yy_stack_print ((Bottom), (Top)); \
802 /*------------------------------------------------.
803 | Report that the YYRULE is going to be reduced. |
804 `------------------------------------------------*/
807 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, int yyrule
, parser_ctx_t
*ctx
)
809 unsigned long int yylno
= yyrline
[yyrule
];
810 int yynrhs
= yyr2
[yyrule
];
812 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
814 /* The symbols being reduced. */
815 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
817 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
818 yy_symbol_print (stderr
,
819 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
820 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
822 YYFPRINTF (stderr
, "\n");
826 # define YY_REDUCE_PRINT(Rule) \
829 yy_reduce_print (yyssp, yyvsp, Rule, ctx); \
832 /* Nonzero means print parse trace. It is left uninitialized so that
833 multiple parsers can coexist. */
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 */
843 /* YYINITDEPTH -- initial size of the parser's stacks. */
845 # define YYINITDEPTH 200
848 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
849 if the built-in stack extension method is used).
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. */
856 # define YYMAXDEPTH 10000
863 # if defined __GLIBC__ && defined _STRING_H
864 # define yystrlen strlen
866 /* Return the length of YYSTR. */
868 yystrlen (const char *yystr
)
871 for (yylen
= 0; yystr
[yylen
]; yylen
++)
879 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
880 # define yystpcpy stpcpy
882 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
885 yystpcpy (char *yydest
, const char *yysrc
)
888 const char *yys
= yysrc
;
890 while ((*yyd
++ = *yys
++) != '\0')
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
907 yytnamerr (char *yyres
, const char *yystr
)
912 char const *yyp
= yystr
;
919 goto do_not_strip_quotes
;
923 goto do_not_strip_quotes
;
936 do_not_strip_quotes
: ;
940 return yystrlen (yystr
);
942 return yystpcpy (yyres
, yystr
) - yyres
;
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
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. */
955 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
956 yytype_int16
*yyssp
, int yytoken
)
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
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.
992 if (yytoken
!= YYEMPTY
)
994 int yyn
= yypact
[*yyssp
];
995 yyarg
[yycount
++] = yytname
[yytoken
];
996 if (!yypact_value_is_default (yyn
))
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
;
1007 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1008 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1009 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1011 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1017 yyarg
[yycount
++] = yytname
[yyx
];
1019 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULLPTR
, yytname
[yyx
]);
1020 if (! (yysize
<= yysize1
1021 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1031 # define YYCASE_(N, S) \
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"));
1045 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1046 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1051 if (*yymsg_alloc
< yysize
)
1053 *yymsg_alloc
= 2 * yysize
;
1054 if (! (yysize
<= *yymsg_alloc
1055 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1056 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
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. */
1066 while ((*yyp
= *yyformat
) != '\0')
1067 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1069 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1080 #endif /* YYERROR_VERBOSE */
1082 /*-----------------------------------------------.
1083 | Release the memory associated to this symbol. |
1084 `-----------------------------------------------*/
1087 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
, parser_ctx_t
*ctx
)
1093 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1095 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1097 YY_IGNORE_MAYBE_UNINITIALIZED_END
1108 yyparse (parser_ctx_t
*ctx
)
1110 /* The lookahead symbol. */
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
);
1120 /* Number of syntax errors so far. */
1124 /* Number of tokens to shift before error messages enabled. */
1127 /* The stacks and their tools:
1128 'yyss': related to states.
1129 'yyvs': related to semantic values.
1131 Refer to the stacks through separate pointers, to allow yyoverflow
1132 to reallocate them elsewhere. */
1134 /* The state stack. */
1135 yytype_int16 yyssa
[YYINITDEPTH
];
1137 yytype_int16
*yyssp
;
1139 /* The semantic value stack. */
1140 YYSTYPE yyvsa
[YYINITDEPTH
];
1144 YYSIZE_T yystacksize
;
1148 /* Lookahead token as an internal (translated) token number. */
1150 /* The variables used to return semantic value and location from the
1155 /* Buffer for error messages, and its allocated size. */
1157 char *yymsg
= yymsgbuf
;
1158 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1161 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1163 /* The number of symbols on the RHS of the reduced rule.
1164 Keep to zero when no symbol should be popped. */
1167 yyssp
= yyss
= yyssa
;
1168 yyvsp
= yyvs
= yyvsa
;
1169 yystacksize
= YYINITDEPTH
;
1171 YYDPRINTF ((stderr
, "Starting parse\n"));
1176 yychar
= YYEMPTY
; /* Cause a token to be read. */
1179 /*------------------------------------------------------------.
1180 | yynewstate -- Push a new state, which is found in yystate. |
1181 `------------------------------------------------------------*/
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. */
1190 if (yyss
+ yystacksize
- 1 <= yyssp
)
1192 /* Get the current used size of the three stacks, in elements. */
1193 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
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
1200 YYSTYPE
*yyvs1
= yyvs
;
1201 yytype_int16
*yyss1
= yyss
;
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
),
1215 #else /* no yyoverflow */
1216 # ifndef YYSTACK_RELOCATE
1217 goto yyexhaustedlab
;
1219 /* Extend the stack our own way. */
1220 if (YYMAXDEPTH
<= yystacksize
)
1221 goto yyexhaustedlab
;
1223 if (YYMAXDEPTH
< yystacksize
)
1224 yystacksize
= YYMAXDEPTH
;
1227 yytype_int16
*yyss1
= yyss
;
1228 union yyalloc
*yyptr
=
1229 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1231 goto yyexhaustedlab
;
1232 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1233 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1234 # undef YYSTACK_RELOCATE
1236 YYSTACK_FREE (yyss1
);
1239 #endif /* no yyoverflow */
1241 yyssp
= yyss
+ yysize
- 1;
1242 yyvsp
= yyvs
+ yysize
- 1;
1244 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1245 (unsigned long int) yystacksize
));
1247 if (yyss
+ yystacksize
- 1 <= yyssp
)
1251 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1253 if (yystate
== YYFINAL
)
1263 /* Do appropriate processing given the current state. Read a
1264 lookahead token if we need one and don't already have one. */
1266 /* First try to decide what to do without reference to lookahead token. */
1267 yyn
= yypact
[yystate
];
1268 if (yypact_value_is_default (yyn
))
1271 /* Not known => get a lookahead token if don't already have one. */
1273 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1274 if (yychar
== YYEMPTY
)
1276 YYDPRINTF ((stderr
, "Reading a token: "));
1277 yychar
= yylex (&yylval
, ctx
);
1280 if (yychar
<= YYEOF
)
1282 yychar
= yytoken
= YYEOF
;
1283 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1287 yytoken
= YYTRANSLATE (yychar
);
1288 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1291 /* If the proper action on seeing token YYTOKEN is to reduce or to
1292 detect an error, take that action. */
1294 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1299 if (yytable_value_is_error (yyn
))
1305 /* Count tokens shifted since error; after three, turn off error
1310 /* Shift the lookahead token. */
1311 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1313 /* Discard the shifted token. */
1317 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1319 YY_IGNORE_MAYBE_UNINITIALIZED_END
1324 /*-----------------------------------------------------------.
1325 | yydefault -- do the default action for the current state. |
1326 `-----------------------------------------------------------*/
1328 yyn
= yydefact
[yystate
];
1334 /*-----------------------------.
1335 | yyreduce -- Do a reduction. |
1336 `-----------------------------*/
1338 /* yyn is the number of a rule to reduce with. */
1341 /* If YYLEN is nonzero, implement the default value of the action:
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
];
1352 YY_REDUCE_PRINT (yyn
);
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
1584 #line 1593 "cc_parser.tab.c" /* yacc.c:1646 */
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
);
1602 YY_STACK_PRINT (yyss
, yyssp
);
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. */
1612 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
1613 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
1614 yystate
= yytable
[yystate
];
1616 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
1621 /*--------------------------------------.
1622 | yyerrlab -- here on detecting error. |
1623 `--------------------------------------*/
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
);
1629 /* If not already recovering from an error, report this error. */
1633 #if ! YYERROR_VERBOSE
1634 yyerror (ctx
, YY_("syntax error"));
1636 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
1639 char const *yymsgp
= YY_("syntax error");
1640 int yysyntax_error_status
;
1641 yysyntax_error_status
= YYSYNTAX_ERROR
;
1642 if (yysyntax_error_status
== 0)
1644 else if (yysyntax_error_status
== 1)
1646 if (yymsg
!= yymsgbuf
)
1647 YYSTACK_FREE (yymsg
);
1648 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
1652 yymsg_alloc
= sizeof yymsgbuf
;
1653 yysyntax_error_status
= 2;
1657 yysyntax_error_status
= YYSYNTAX_ERROR
;
1661 yyerror (ctx
, yymsgp
);
1662 if (yysyntax_error_status
== 2)
1663 goto yyexhaustedlab
;
1665 # undef YYSYNTAX_ERROR
1671 if (yyerrstatus
== 3)
1673 /* If just tried and failed to reuse lookahead token after an
1674 error, discard it. */
1676 if (yychar
<= YYEOF
)
1678 /* Return failure if at end of input. */
1679 if (yychar
== YYEOF
)
1684 yydestruct ("Error: discarding",
1685 yytoken
, &yylval
, ctx
);
1690 /* Else will try to reuse lookahead token after shifting the error
1695 /*---------------------------------------------------.
1696 | yyerrorlab -- error raised explicitly by YYERROR. |
1697 `---------------------------------------------------*/
1700 /* Pacify compilers like GCC when the user code never invokes
1701 YYERROR and the label yyerrorlab therefore never appears in user
1703 if (/*CONSTCOND*/ 0)
1706 /* Do not reclaim the symbols of the rule whose action triggered
1710 YY_STACK_PRINT (yyss
, yyssp
);
1715 /*-------------------------------------------------------------.
1716 | yyerrlab1 -- common code for both syntax error and YYERROR. |
1717 `-------------------------------------------------------------*/
1719 yyerrstatus
= 3; /* Each real token shifted decrements this. */
1723 yyn
= yypact
[yystate
];
1724 if (!yypact_value_is_default (yyn
))
1727 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
1735 /* Pop the current state because it cannot handle the error token. */
1740 yydestruct ("Error: popping",
1741 yystos
[yystate
], yyvsp
, ctx
);
1744 YY_STACK_PRINT (yyss
, yyssp
);
1747 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1749 YY_IGNORE_MAYBE_UNINITIALIZED_END
1752 /* Shift the error token. */
1753 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
1759 /*-------------------------------------.
1760 | yyacceptlab -- YYACCEPT comes here. |
1761 `-------------------------------------*/
1766 /*-----------------------------------.
1767 | yyabortlab -- YYABORT comes here. |
1768 `-----------------------------------*/
1773 #if !defined yyoverflow || YYERROR_VERBOSE
1774 /*-------------------------------------------------.
1775 | yyexhaustedlab -- memory exhaustion comes here. |
1776 `-------------------------------------------------*/
1778 yyerror (ctx
, YY_("memory exhausted"));
1784 if (yychar
!= YYEMPTY
)
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
);
1792 /* Do not reclaim the symbols of the rule whose action triggered
1793 this YYABORT or YYACCEPT. */
1795 YY_STACK_PRINT (yyss
, yyssp
);
1796 while (yyssp
!= yyss
)
1798 yydestruct ("Cleanup: popping",
1799 yystos
[*yyssp
], yyvsp
, ctx
);
1804 YYSTACK_FREE (yyss
);
1807 if (yymsg
!= yymsgbuf
)
1808 YYSTACK_FREE (yymsg
);
1812 #line 228 "cc_parser.y" /* yacc.c:1906 */
1815 BOOL
parse_cc_expr(parser_ctx_t
*ctx
)
1818 cc_parser_parse(ctx
);
1819 return SUCCEEDED(ctx
->hres
);