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 ppy_parse
65 #define yyerror ppy_error
66 #define yydebug ppy_debug
67 #define yynerrs ppy_nerrs
69 #define yylval ppy_lval
70 #define yychar ppy_char
72 /* Copy the first part of user declarations. */
73 #line 30 "ppy.y" /* yacc.c:339 */
76 #include "wine/port.h"
85 #include "wpp_private.h"
88 #define UNARY_OP(r, v, OP) \
91 case cv_sint: r.val.si = OP v.val.si; break; \
92 case cv_uint: r.val.ui = OP v.val.ui; break; \
93 case cv_slong: r.val.sl = OP v.val.sl; break; \
94 case cv_ulong: r.val.ul = OP v.val.ul; break; \
95 case cv_sll: r.val.sll = OP v.val.sll; break; \
96 case cv_ull: r.val.ull = OP v.val.ull; break; \
99 #define cv_signed(v) ((v.type & FLAG_SIGNED) != 0)
101 #define BIN_OP_INT(r, v1, v2, OP) \
103 if(cv_signed(v1) && cv_signed(v2)) \
104 r.val.si = v1.val.si OP v2.val.si; \
105 else if(cv_signed(v1) && !cv_signed(v2)) \
106 r.val.si = v1.val.si OP (signed) v2.val.ui; \
107 else if(!cv_signed(v1) && cv_signed(v2)) \
108 r.val.si = (signed) v1.val.ui OP v2.val.si; \
110 r.val.ui = v1.val.ui OP v2.val.ui;
112 #define BIN_OP_LONG(r, v1, v2, OP) \
114 if(cv_signed(v1) && cv_signed(v2)) \
115 r.val.sl = v1.val.sl OP v2.val.sl; \
116 else if(cv_signed(v1) && !cv_signed(v2)) \
117 r.val.sl = v1.val.sl OP (signed long) v2.val.ul; \
118 else if(!cv_signed(v1) && cv_signed(v2)) \
119 r.val.sl = (signed long) v1.val.ul OP v2.val.sl; \
121 r.val.ul = v1.val.ul OP v2.val.ul;
123 #define BIN_OP_LONGLONG(r, v1, v2, OP) \
125 if(cv_signed(v1) && cv_signed(v2)) \
126 r.val.sll = v1.val.sll OP v2.val.sll; \
127 else if(cv_signed(v1) && !cv_signed(v2)) \
128 r.val.sll = v1.val.sll OP (wrc_sll_t) v2.val.ull; \
129 else if(!cv_signed(v1) && cv_signed(v2)) \
130 r.val.sll = (wrc_sll_t) v1.val.ull OP v2.val.sll; \
132 r.val.ull = v1.val.ull OP v2.val.ull;
134 #define BIN_OP(r, v1, v2, OP) \
135 switch(v1.type & SIZE_MASK) \
137 case SIZE_INT: BIN_OP_INT(r, v1, v2, OP); break; \
138 case SIZE_LONG: BIN_OP_LONG(r, v1, v2, OP); break; \
139 case SIZE_LONGLONG: BIN_OP_LONGLONG(r, v1, v2, OP); break; \
140 default: pp_internal_error(__FILE__, __LINE__, "Invalid type indicator (0x%04x)", v1.type); \
147 static int boolean(cval_t
*v
);
148 static void promote_equal_size(cval_t
*v1
, cval_t
*v2
);
149 static void cast_to_sint(cval_t
*v
);
150 static void cast_to_uint(cval_t
*v
);
151 static void cast_to_slong(cval_t
*v
);
152 static void cast_to_ulong(cval_t
*v
);
153 static void cast_to_sll(cval_t
*v
);
154 static void cast_to_ull(cval_t
*v
);
155 static marg_t
*new_marg(char *str
, def_arg_t type
);
156 static marg_t
*add_new_marg(char *str
, def_arg_t type
);
157 static int marg_index(char *id
);
158 static mtext_t
*new_mtext(char *str
, int idx
, def_exp_t type
);
159 static mtext_t
*combine_mtext(mtext_t
*tail
, mtext_t
*mtp
);
160 static char *merge_text(char *s1
, char *s2
);
165 static marg_t
**macro_args
; /* Macro parameters array while parsing */
166 static int nmacro_args
;
169 #line 170 "ppy.tab.c" /* yacc.c:339 */
172 # if defined __cplusplus && 201103L <= __cplusplus
173 # define YY_NULLPTR nullptr
175 # define YY_NULLPTR 0
179 /* Enabling verbose error messages. */
180 #ifdef YYERROR_VERBOSE
181 # undef YYERROR_VERBOSE
182 # define YYERROR_VERBOSE 1
184 # define YYERROR_VERBOSE 0
193 extern int ppy_debug
;
235 tRCINCLUDEPATH
= 292,
248 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
249 typedef union YYSTYPE YYSTYPE
;
252 #line 126 "ppy.y" /* yacc.c:355 */
266 #line 267 "ppy.tab.c" /* yacc.c:355 */
268 # define YYSTYPE_IS_TRIVIAL 1
269 # define YYSTYPE_IS_DECLARED 1
273 extern YYSTYPE ppy_lval
;
275 int ppy_parse (void);
279 /* Copy the second part of user declarations. */
281 #line 282 "ppy.tab.c" /* yacc.c:358 */
288 typedef YYTYPE_UINT8 yytype_uint8
;
290 typedef unsigned char yytype_uint8
;
294 typedef YYTYPE_INT8 yytype_int8
;
296 typedef signed char yytype_int8
;
300 typedef YYTYPE_UINT16 yytype_uint16
;
302 typedef unsigned short int yytype_uint16
;
306 typedef YYTYPE_INT16 yytype_int16
;
308 typedef short int yytype_int16
;
312 # ifdef __SIZE_TYPE__
313 # define YYSIZE_T __SIZE_TYPE__
314 # elif defined size_t
315 # define YYSIZE_T size_t
316 # elif ! defined YYSIZE_T
317 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
318 # define YYSIZE_T size_t
320 # define YYSIZE_T unsigned int
324 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
327 # if defined YYENABLE_NLS && YYENABLE_NLS
329 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
330 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
334 # define YY_(Msgid) Msgid
339 # if (defined __GNUC__ \
340 && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
341 || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
342 # define YY_ATTRIBUTE(Spec) __attribute__(Spec)
344 # define YY_ATTRIBUTE(Spec) /* empty */
348 #ifndef YY_ATTRIBUTE_PURE
349 # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
352 #ifndef YY_ATTRIBUTE_UNUSED
353 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
356 #if !defined _Noreturn \
357 && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
358 # if defined _MSC_VER && 1200 <= _MSC_VER
359 # define _Noreturn __declspec (noreturn)
361 # define _Noreturn YY_ATTRIBUTE ((__noreturn__))
365 /* Suppress unused-variable warnings by "using" E. */
366 #if ! defined lint || defined __GNUC__
367 # define YYUSE(E) ((void) (E))
369 # define YYUSE(E) /* empty */
372 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
373 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
374 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
375 _Pragma ("GCC diagnostic push") \
376 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
377 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
378 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
379 _Pragma ("GCC diagnostic pop")
381 # define YY_INITIAL_VALUE(Value) Value
383 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
384 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
385 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
387 #ifndef YY_INITIAL_VALUE
388 # define YY_INITIAL_VALUE(Value) /* Nothing. */
392 #if ! defined yyoverflow || YYERROR_VERBOSE
394 /* The parser invokes alloca or malloc; define the necessary symbols. */
396 # ifdef YYSTACK_USE_ALLOCA
397 # if YYSTACK_USE_ALLOCA
399 # define YYSTACK_ALLOC __builtin_alloca
400 # elif defined __BUILTIN_VA_ARG_INCR
401 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
403 # define YYSTACK_ALLOC __alloca
404 # elif defined _MSC_VER
405 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
406 # define alloca _alloca
408 # define YYSTACK_ALLOC alloca
409 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
410 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
411 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
412 # ifndef EXIT_SUCCESS
413 # define EXIT_SUCCESS 0
420 # ifdef YYSTACK_ALLOC
421 /* Pacify GCC's 'empty if-body' warning. */
422 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
423 # ifndef YYSTACK_ALLOC_MAXIMUM
424 /* The OS might guarantee only one guard page at the bottom of the stack,
425 and a page size can be as small as 4096 bytes. So we cannot safely
426 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
427 to allow for a few compiler-allocated temporary stack slots. */
428 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
431 # define YYSTACK_ALLOC YYMALLOC
432 # define YYSTACK_FREE YYFREE
433 # ifndef YYSTACK_ALLOC_MAXIMUM
434 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
436 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
437 && ! ((defined YYMALLOC || defined malloc) \
438 && (defined YYFREE || defined free)))
439 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
440 # ifndef EXIT_SUCCESS
441 # define EXIT_SUCCESS 0
445 # define YYMALLOC malloc
446 # if ! defined malloc && ! defined EXIT_SUCCESS
447 void *malloc (YYSIZE_T
); /* INFRINGES ON USER NAME SPACE */
452 # if ! defined free && ! defined EXIT_SUCCESS
453 void free (void *); /* INFRINGES ON USER NAME SPACE */
457 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
460 #if (! defined yyoverflow \
461 && (! defined __cplusplus \
462 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
464 /* A type that is properly aligned for any stack member. */
467 yytype_int16 yyss_alloc
;
471 /* The size of the maximum gap between one aligned stack and the next. */
472 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
474 /* The size of an array large to enough to hold all stacks, each with
476 # define YYSTACK_BYTES(N) \
477 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
478 + YYSTACK_GAP_MAXIMUM)
480 # define YYCOPY_NEEDED 1
482 /* Relocate STACK from its old location to the new one. The
483 local variables YYSIZE and YYSTACKSIZE give the old and new number of
484 elements in the stack, and YYPTR gives the new location of the
485 stack. Advance YYPTR to a properly aligned location for the next
487 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
490 YYSIZE_T yynewbytes; \
491 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
492 Stack = &yyptr->Stack_alloc; \
493 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
494 yyptr += yynewbytes / sizeof (*yyptr); \
500 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
501 /* Copy COUNT objects from SRC to DST. The source and destination do
504 # if defined __GNUC__ && 1 < __GNUC__
505 # define YYCOPY(Dst, Src, Count) \
506 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
508 # define YYCOPY(Dst, Src, Count) \
512 for (yyi = 0; yyi < (Count); yyi++) \
513 (Dst)[yyi] = (Src)[yyi]; \
518 #endif /* !YYCOPY_NEEDED */
520 /* YYFINAL -- State number of the termination state. */
522 /* YYLAST -- Last index in YYTABLE. */
525 /* YYNTOKENS -- Number of terminals. */
527 /* YYNNTS -- Number of nonterminals. */
529 /* YYNRULES -- Number of rules. */
531 /* YYNSTATES -- Number of states. */
532 #define YYNSTATES 153
534 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
535 by yylex, with out-of-bounds checking. */
537 #define YYMAXUTOK 300
539 #define YYTRANSLATE(YYX) \
540 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
542 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
543 as returned by yylex, without out-of-bounds checking. */
544 static const yytype_uint8 yytranslate
[] =
546 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
547 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
548 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
549 2, 2, 2, 58, 2, 2, 2, 2, 44, 2,
550 60, 61, 55, 53, 59, 54, 2, 56, 2, 2,
551 2, 2, 2, 2, 2, 2, 2, 2, 39, 2,
552 47, 2, 49, 38, 2, 2, 2, 2, 2, 2,
553 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
554 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
555 2, 2, 2, 2, 43, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 42, 2, 57, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
572 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
573 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
574 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
575 35, 36, 37, 40, 41, 45, 46, 48, 50, 51,
580 /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
581 static const yytype_uint16 yyrline
[] =
583 0, 181, 181, 182, 186, 187, 188, 189, 190, 210,
584 234, 260, 277, 278, 279, 282, 283, 284, 286, 288,
585 290, 292, 293, 294, 295, 296, 297, 310, 316, 317,
586 320, 321, 322, 323, 324, 325, 328, 331, 332, 335,
587 336, 339, 340, 344, 345, 351, 352, 355, 356, 357,
588 358, 359, 366, 375, 376, 377, 378, 379, 380, 381,
589 382, 383, 384, 385, 386, 387, 388, 389, 390, 391,
590 392, 393, 394, 395, 396, 397, 398, 399, 400, 401,
591 402, 403, 404, 405, 406
595 #if YYDEBUG || YYERROR_VERBOSE || 0
596 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
597 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
598 static const char *const yytname
[] =
600 "$end", "error", "$undefined", "tRCINCLUDE", "tIF", "tIFDEF", "tIFNDEF",
601 "tELSE", "tELIF", "tENDIF", "tDEFINED", "tNL", "tINCLUDE", "tLINE",
602 "tGCCLINE", "tERROR", "tWARNING", "tPRAGMA", "tPPIDENT", "tUNDEF",
603 "tMACROEND", "tCONCAT", "tELIPSIS", "tSTRINGIZE", "tIDENT", "tLITERAL",
604 "tMACRO", "tDEFINE", "tDQSTRING", "tSQSTRING", "tIQSTRING", "tUINT",
605 "tSINT", "tULONG", "tSLONG", "tULONGLONG", "tSLONGLONG",
606 "tRCINCLUDEPATH", "'?'", "':'", "tLOGOR", "tLOGAND", "'|'", "'^'", "'&'",
607 "tEQ", "tNE", "'<'", "tLTE", "'>'", "tGTE", "tLSHIFT", "tRSHIFT", "'+'",
608 "'-'", "'*'", "'/'", "'~'", "'!'", "','", "'('", "')'", "$accept",
609 "pp_file", "preprocessor", "opt_text", "text", "res_arg", "allmargs",
610 "emargs", "margs", "opt_mtexts", "mtexts", "mtext", "pp_expr", YY_NULLPTR
615 /* YYTOKNUM[NUM] -- (External) token number corresponding to the
616 (internal) symbol number NUM (which must be that of a token). */
617 static const yytype_uint16 yytoknum
[] =
619 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
620 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
621 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
622 285, 286, 287, 288, 289, 290, 291, 292, 63, 58,
623 293, 294, 124, 94, 38, 295, 296, 60, 297, 62,
624 298, 299, 300, 43, 45, 42, 47, 126, 33, 44,
629 #define YYPACT_NINF -27
631 #define yypact_value_is_default(Yystate) \
632 (!!((Yystate) == (-27)))
634 #define YYTABLE_NINF -1
636 #define yytable_value_is_error(Yytable_value) \
639 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
641 static const yytype_int16 yypact
[] =
643 -27, 142, -27, -26, -3, -12, -2, 30, -3, 41,
644 91, 21, 2, -19, -19, -19, -19, 32, -27, -19,
645 -27, -27, -27, -23, -27, -27, -27, -27, -27, -27,
646 -27, -3, -3, -3, -3, -3, 38, 66, 109, -27,
647 85, -27, 113, 133, 115, -27, 124, -27, -27, -27,
648 179, -9, 278, 280, 281, 282, 129, 283, -27, 271,
649 -10, -10, -27, -27, 57, -27, -3, -3, -3, -3,
650 -3, -3, -3, -3, -3, -3, -3, -3, -3, -3,
651 -3, -3, -3, -3, -27, -27, -27, -27, -27, 285,
652 3, -27, -27, -27, -27, -27, -27, -27, -27, -27,
653 277, -27, 239, -27, 238, -27, 132, 167, 182, 196,
654 209, 221, 231, 231, 111, 111, 111, 111, 61, 61,
655 -10, -10, -27, -27, -27, -27, 4, 19, 266, -27,
656 -3, -27, 6, -27, 276, -27, -27, -27, -27, 290,
657 19, -27, -27, -27, 151, -27, 7, -27, -27, -27,
661 /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
662 Performed when YYTABLE does not specify something else to do. Zero
663 means the default is an error. */
664 static const yytype_uint8 yydefact
[] =
666 2, 0, 1, 0, 0, 0, 0, 0, 0, 0,
667 0, 0, 0, 28, 28, 28, 28, 0, 36, 28,
668 3, 27, 26, 0, 61, 54, 53, 56, 55, 58,
669 57, 0, 0, 0, 0, 0, 0, 0, 0, 10,
670 0, 11, 0, 0, 0, 21, 0, 30, 31, 32,
671 0, 29, 0, 0, 0, 0, 37, 0, 59, 0,
672 79, 80, 81, 82, 0, 6, 0, 0, 0, 0,
673 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
674 0, 0, 0, 0, 7, 8, 9, 4, 5, 0,
675 0, 22, 33, 34, 35, 23, 24, 25, 12, 42,
676 0, 38, 39, 13, 0, 83, 0, 62, 63, 74,
677 72, 73, 64, 65, 66, 68, 67, 69, 77, 78,
678 70, 71, 75, 76, 15, 16, 0, 43, 0, 60,
679 0, 17, 0, 50, 0, 52, 47, 48, 49, 0,
680 44, 45, 40, 41, 84, 18, 0, 51, 14, 46,
684 /* YYPGOTO[NTERM-NUM]. */
685 static const yytype_int16 yypgoto
[] =
687 -27, -27, -27, -11, -27, -27, -27, -27, -27, -27,
691 /* YYDEFGOTO[NTERM-NUM]. */
692 static const yytype_int16 yydefgoto
[] =
694 -1, 1, 20, 50, 51, 56, 100, 101, 102, 139,
698 /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
699 positive, shift that token. If negative, reduce the rule whose
700 number is the opposite. If YYTABLE_NINF, syntax error. */
701 static const yytype_uint8 yytable
[] =
703 40, 58, 21, 52, 53, 54, 47, 23, 57, 48,
704 49, 22, 37, 45, 125, 131, 92, 145, 150, 93,
705 94, 24, 38, 60, 61, 62, 63, 64, 25, 26,
706 27, 28, 29, 30, 46, 126, 132, 59, 146, 151,
707 133, 39, 134, 135, 136, 82, 83, 137, 138, 65,
708 31, 32, 41, 44, 33, 34, 55, 35, 106, 107,
709 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
710 118, 119, 120, 121, 122, 123, 66, 84, 67, 68,
711 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
712 79, 80, 81, 82, 83, 66, 86, 67, 68, 69,
713 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
714 80, 81, 82, 83, 80, 81, 82, 83, 105, 42,
715 85, 43, 144, 66, 87, 67, 68, 69, 70, 71,
716 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
717 82, 83, 2, 89, 88, 3, 4, 5, 6, 7,
718 8, 9, 90, 99, 10, 11, 12, 13, 14, 15,
719 16, 17, 78, 79, 80, 81, 82, 83, 18, 19,
720 66, 130, 67, 68, 69, 70, 71, 72, 73, 74,
721 75, 76, 77, 78, 79, 80, 81, 82, 83, 66,
722 91, 67, 68, 69, 70, 71, 72, 73, 74, 75,
723 76, 77, 78, 79, 80, 81, 82, 83, 68, 69,
724 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
725 80, 81, 82, 83, 69, 70, 71, 72, 73, 74,
726 75, 76, 77, 78, 79, 80, 81, 82, 83, 70,
727 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
728 81, 82, 83, 71, 72, 73, 74, 75, 76, 77,
729 78, 79, 80, 81, 82, 83, 72, 73, 74, 75,
730 76, 77, 78, 79, 80, 81, 82, 83, 74, 75,
731 76, 77, 78, 79, 80, 81, 82, 83, 142, 95,
732 143, 96, 97, 98, 103, 104, 124, 127, 128, 129,
736 static const yytype_uint8 yycheck
[] =
738 8, 24, 28, 14, 15, 16, 25, 10, 19, 28,
739 29, 37, 24, 11, 11, 11, 25, 11, 11, 28,
740 29, 24, 24, 31, 32, 33, 34, 35, 31, 32,
741 33, 34, 35, 36, 32, 32, 32, 60, 32, 32,
742 21, 11, 23, 24, 25, 55, 56, 28, 29, 11,
743 53, 54, 11, 32, 57, 58, 24, 60, 66, 67,
744 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
745 78, 79, 80, 81, 82, 83, 38, 11, 40, 41,
746 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
747 52, 53, 54, 55, 56, 38, 11, 40, 41, 42,
748 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
749 53, 54, 55, 56, 53, 54, 55, 56, 61, 28,
750 11, 30, 130, 38, 11, 40, 41, 42, 43, 44,
751 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
752 55, 56, 0, 28, 11, 3, 4, 5, 6, 7,
753 8, 9, 28, 24, 12, 13, 14, 15, 16, 17,
754 18, 19, 51, 52, 53, 54, 55, 56, 26, 27,
755 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
756 48, 49, 50, 51, 52, 53, 54, 55, 56, 38,
757 11, 40, 41, 42, 43, 44, 45, 46, 47, 48,
758 49, 50, 51, 52, 53, 54, 55, 56, 41, 42,
759 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
760 53, 54, 55, 56, 42, 43, 44, 45, 46, 47,
761 48, 49, 50, 51, 52, 53, 54, 55, 56, 43,
762 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
763 54, 55, 56, 44, 45, 46, 47, 48, 49, 50,
764 51, 52, 53, 54, 55, 56, 45, 46, 47, 48,
765 49, 50, 51, 52, 53, 54, 55, 56, 47, 48,
766 49, 50, 51, 52, 53, 54, 55, 56, 22, 11,
767 24, 11, 11, 11, 11, 24, 11, 20, 59, 61,
771 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
772 symbol of state STATE-NUM. */
773 static const yytype_uint8 yystos
[] =
775 0, 63, 0, 3, 4, 5, 6, 7, 8, 9,
776 12, 13, 14, 15, 16, 17, 18, 19, 26, 27,
777 64, 28, 37, 10, 24, 31, 32, 33, 34, 35,
778 36, 53, 54, 57, 58, 60, 74, 24, 24, 11,
779 74, 11, 28, 30, 32, 11, 32, 25, 28, 29,
780 65, 66, 65, 65, 65, 24, 67, 65, 24, 60,
781 74, 74, 74, 74, 74, 11, 38, 40, 41, 42,
782 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
783 53, 54, 55, 56, 11, 11, 11, 11, 11, 28,
784 28, 11, 25, 28, 29, 11, 11, 11, 11, 24,
785 68, 69, 70, 11, 24, 61, 74, 74, 74, 74,
786 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
787 74, 74, 74, 74, 11, 11, 32, 20, 59, 61,
788 39, 11, 32, 21, 23, 24, 25, 28, 29, 71,
789 72, 73, 22, 24, 74, 11, 32, 24, 11, 73,
793 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
794 static const yytype_uint8 yyr1
[] =
796 0, 62, 63, 63, 64, 64, 64, 64, 64, 64,
797 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
798 64, 64, 64, 64, 64, 64, 64, 64, 65, 65,
799 66, 66, 66, 66, 66, 66, 67, 68, 68, 69,
800 69, 70, 70, 71, 71, 72, 72, 73, 73, 73,
801 73, 73, 73, 74, 74, 74, 74, 74, 74, 74,
802 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
803 74, 74, 74, 74, 74, 74, 74, 74, 74, 74,
807 /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
808 static const yytype_uint8 yyr2
[] =
810 0, 2, 0, 2, 3, 3, 3, 3, 3, 3,
811 2, 2, 3, 3, 6, 4, 4, 5, 6, 7,
812 8, 2, 3, 3, 3, 3, 2, 2, 0, 1,
813 1, 1, 1, 2, 2, 2, 0, 0, 1, 1,
814 3, 3, 1, 0, 1, 1, 2, 1, 1, 1,
815 1, 2, 1, 1, 1, 1, 1, 1, 1, 2,
816 4, 1, 3, 3, 3, 3, 3, 3, 3, 3,
817 3, 3, 3, 3, 3, 3, 3, 3, 3, 2,
822 #define yyerrok (yyerrstatus = 0)
823 #define yyclearin (yychar = YYEMPTY)
827 #define YYACCEPT goto yyacceptlab
828 #define YYABORT goto yyabortlab
829 #define YYERROR goto yyerrorlab
832 #define YYRECOVERING() (!!yyerrstatus)
834 #define YYBACKUP(Token, Value) \
836 if (yychar == YYEMPTY) \
840 YYPOPSTACK (yylen); \
846 yyerror (YY_("syntax error: cannot back up")); \
851 /* Error token number */
853 #define YYERRCODE 256
857 /* Enable debugging if requested. */
861 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
862 # define YYFPRINTF fprintf
865 # define YYDPRINTF(Args) \
871 /* This macro is provided for backward compatibility. */
872 #ifndef YY_LOCATION_PRINT
873 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
877 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
881 YYFPRINTF (stderr, "%s ", Title); \
882 yy_symbol_print (stderr, \
884 YYFPRINTF (stderr, "\n"); \
889 /*----------------------------------------.
890 | Print this symbol's value on YYOUTPUT. |
891 `----------------------------------------*/
894 yy_symbol_value_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
896 FILE *yyo
= yyoutput
;
901 if (yytype
< YYNTOKENS
)
902 YYPRINT (yyoutput
, yytoknum
[yytype
], *yyvaluep
);
908 /*--------------------------------.
909 | Print this symbol on YYOUTPUT. |
910 `--------------------------------*/
913 yy_symbol_print (FILE *yyoutput
, int yytype
, YYSTYPE
const * const yyvaluep
)
915 YYFPRINTF (yyoutput
, "%s %s (",
916 yytype
< YYNTOKENS
? "token" : "nterm", yytname
[yytype
]);
918 yy_symbol_value_print (yyoutput
, yytype
, yyvaluep
);
919 YYFPRINTF (yyoutput
, ")");
922 /*------------------------------------------------------------------.
923 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
925 `------------------------------------------------------------------*/
928 yy_stack_print (yytype_int16
*yybottom
, yytype_int16
*yytop
)
930 YYFPRINTF (stderr
, "Stack now");
931 for (; yybottom
<= yytop
; yybottom
++)
933 int yybot
= *yybottom
;
934 YYFPRINTF (stderr
, " %d", yybot
);
936 YYFPRINTF (stderr
, "\n");
939 # define YY_STACK_PRINT(Bottom, Top) \
942 yy_stack_print ((Bottom), (Top)); \
946 /*------------------------------------------------.
947 | Report that the YYRULE is going to be reduced. |
948 `------------------------------------------------*/
951 yy_reduce_print (yytype_int16
*yyssp
, YYSTYPE
*yyvsp
, int yyrule
)
953 unsigned long int yylno
= yyrline
[yyrule
];
954 int yynrhs
= yyr2
[yyrule
];
956 YYFPRINTF (stderr
, "Reducing stack by rule %d (line %lu):\n",
958 /* The symbols being reduced. */
959 for (yyi
= 0; yyi
< yynrhs
; yyi
++)
961 YYFPRINTF (stderr
, " $%d = ", yyi
+ 1);
962 yy_symbol_print (stderr
,
963 yystos
[yyssp
[yyi
+ 1 - yynrhs
]],
964 &(yyvsp
[(yyi
+ 1) - (yynrhs
)])
966 YYFPRINTF (stderr
, "\n");
970 # define YY_REDUCE_PRINT(Rule) \
973 yy_reduce_print (yyssp, yyvsp, Rule); \
976 /* Nonzero means print parse trace. It is left uninitialized so that
977 multiple parsers can coexist. */
980 # define YYDPRINTF(Args)
981 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
982 # define YY_STACK_PRINT(Bottom, Top)
983 # define YY_REDUCE_PRINT(Rule)
984 #endif /* !YYDEBUG */
987 /* YYINITDEPTH -- initial size of the parser's stacks. */
989 # define YYINITDEPTH 200
992 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
993 if the built-in stack extension method is used).
995 Do not make this value too large; the results are undefined if
996 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
997 evaluated with infinite-precision integer arithmetic. */
1000 # define YYMAXDEPTH 10000
1007 # if defined __GLIBC__ && defined _STRING_H
1008 # define yystrlen strlen
1010 /* Return the length of YYSTR. */
1012 yystrlen (const char *yystr
)
1015 for (yylen
= 0; yystr
[yylen
]; yylen
++)
1023 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1024 # define yystpcpy stpcpy
1026 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1029 yystpcpy (char *yydest
, const char *yysrc
)
1032 const char *yys
= yysrc
;
1034 while ((*yyd
++ = *yys
++) != '\0')
1043 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1044 quotes and backslashes, so that it's suitable for yyerror. The
1045 heuristic is that double-quoting is unnecessary unless the string
1046 contains an apostrophe, a comma, or backslash (other than
1047 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1048 null, do not copy; instead, return the length of what the result
1051 yytnamerr (char *yyres
, const char *yystr
)
1056 char const *yyp
= yystr
;
1063 goto do_not_strip_quotes
;
1067 goto do_not_strip_quotes
;
1080 do_not_strip_quotes
: ;
1084 return yystrlen (yystr
);
1086 return yystpcpy (yyres
, yystr
) - yyres
;
1090 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1091 about the unexpected token YYTOKEN for the state stack whose top is
1094 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1095 not large enough to hold the message. In that case, also set
1096 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1097 required number of bytes is too large to store. */
1099 yysyntax_error (YYSIZE_T
*yymsg_alloc
, char **yymsg
,
1100 yytype_int16
*yyssp
, int yytoken
)
1102 YYSIZE_T yysize0
= yytnamerr (YY_NULLPTR
, yytname
[yytoken
]);
1103 YYSIZE_T yysize
= yysize0
;
1104 enum { YYERROR_VERBOSE_ARGS_MAXIMUM
= 5 };
1105 /* Internationalized format string. */
1106 const char *yyformat
= YY_NULLPTR
;
1107 /* Arguments of yyformat. */
1108 char const *yyarg
[YYERROR_VERBOSE_ARGS_MAXIMUM
];
1109 /* Number of reported tokens (one for the "unexpected", one per
1113 /* There are many possibilities here to consider:
1114 - If this state is a consistent state with a default action, then
1115 the only way this function was invoked is if the default action
1116 is an error action. In that case, don't check for expected
1117 tokens because there are none.
1118 - The only way there can be no lookahead present (in yychar) is if
1119 this state is a consistent state with a default action. Thus,
1120 detecting the absence of a lookahead is sufficient to determine
1121 that there is no unexpected or expected token to report. In that
1122 case, just report a simple "syntax error".
1123 - Don't assume there isn't a lookahead just because this state is a
1124 consistent state with a default action. There might have been a
1125 previous inconsistent state, consistent state with a non-default
1126 action, or user semantic action that manipulated yychar.
1127 - Of course, the expected token list depends on states to have
1128 correct lookahead information, and it depends on the parser not
1129 to perform extra reductions after fetching a lookahead from the
1130 scanner and before detecting a syntax error. Thus, state merging
1131 (from LALR or IELR) and default reductions corrupt the expected
1132 token list. However, the list is correct for canonical LR with
1133 one exception: it will still contain any token that will not be
1134 accepted due to an error action in a later state.
1136 if (yytoken
!= YYEMPTY
)
1138 int yyn
= yypact
[*yyssp
];
1139 yyarg
[yycount
++] = yytname
[yytoken
];
1140 if (!yypact_value_is_default (yyn
))
1142 /* Start YYX at -YYN if negative to avoid negative indexes in
1143 YYCHECK. In other words, skip the first -YYN actions for
1144 this state because they are default actions. */
1145 int yyxbegin
= yyn
< 0 ? -yyn
: 0;
1146 /* Stay within bounds of both yycheck and yytname. */
1147 int yychecklim
= YYLAST
- yyn
+ 1;
1148 int yyxend
= yychecklim
< YYNTOKENS
? yychecklim
: YYNTOKENS
;
1151 for (yyx
= yyxbegin
; yyx
< yyxend
; ++yyx
)
1152 if (yycheck
[yyx
+ yyn
] == yyx
&& yyx
!= YYTERROR
1153 && !yytable_value_is_error (yytable
[yyx
+ yyn
]))
1155 if (yycount
== YYERROR_VERBOSE_ARGS_MAXIMUM
)
1161 yyarg
[yycount
++] = yytname
[yyx
];
1163 YYSIZE_T yysize1
= yysize
+ yytnamerr (YY_NULLPTR
, yytname
[yyx
]);
1164 if (! (yysize
<= yysize1
1165 && yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1175 # define YYCASE_(N, S) \
1179 YYCASE_(0, YY_("syntax error"));
1180 YYCASE_(1, YY_("syntax error, unexpected %s"));
1181 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1182 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1183 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1184 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1189 YYSIZE_T yysize1
= yysize
+ yystrlen (yyformat
);
1190 if (! (yysize
<= yysize1
&& yysize1
<= YYSTACK_ALLOC_MAXIMUM
))
1195 if (*yymsg_alloc
< yysize
)
1197 *yymsg_alloc
= 2 * yysize
;
1198 if (! (yysize
<= *yymsg_alloc
1199 && *yymsg_alloc
<= YYSTACK_ALLOC_MAXIMUM
))
1200 *yymsg_alloc
= YYSTACK_ALLOC_MAXIMUM
;
1204 /* Avoid sprintf, as that infringes on the user's name space.
1205 Don't have undefined behavior even if the translation
1206 produced a string with the wrong number of "%s"s. */
1210 while ((*yyp
= *yyformat
) != '\0')
1211 if (*yyp
== '%' && yyformat
[1] == 's' && yyi
< yycount
)
1213 yyp
+= yytnamerr (yyp
, yyarg
[yyi
++]);
1224 #endif /* YYERROR_VERBOSE */
1226 /*-----------------------------------------------.
1227 | Release the memory associated to this symbol. |
1228 `-----------------------------------------------*/
1231 yydestruct (const char *yymsg
, int yytype
, YYSTYPE
*yyvaluep
)
1236 YY_SYMBOL_PRINT (yymsg
, yytype
, yyvaluep
, yylocationp
);
1238 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1240 YY_IGNORE_MAYBE_UNINITIALIZED_END
1246 /* The lookahead symbol. */
1249 /* The semantic value of the lookahead symbol. */
1251 /* Number of syntax errors so far. */
1263 /* Number of tokens to shift before error messages enabled. */
1266 /* The stacks and their tools:
1267 'yyss': related to states.
1268 'yyvs': related to semantic values.
1270 Refer to the stacks through separate pointers, to allow yyoverflow
1271 to reallocate them elsewhere. */
1273 /* The state stack. */
1274 yytype_int16 yyssa
[YYINITDEPTH
];
1276 yytype_int16
*yyssp
;
1278 /* The semantic value stack. */
1279 YYSTYPE yyvsa
[YYINITDEPTH
];
1283 YYSIZE_T yystacksize
;
1287 /* Lookahead token as an internal (translated) token number. */
1289 /* The variables used to return semantic value and location from the
1294 /* Buffer for error messages, and its allocated size. */
1296 char *yymsg
= yymsgbuf
;
1297 YYSIZE_T yymsg_alloc
= sizeof yymsgbuf
;
1300 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1302 /* The number of symbols on the RHS of the reduced rule.
1303 Keep to zero when no symbol should be popped. */
1306 yyssp
= yyss
= yyssa
;
1307 yyvsp
= yyvs
= yyvsa
;
1308 yystacksize
= YYINITDEPTH
;
1310 YYDPRINTF ((stderr
, "Starting parse\n"));
1315 yychar
= YYEMPTY
; /* Cause a token to be read. */
1318 /*------------------------------------------------------------.
1319 | yynewstate -- Push a new state, which is found in yystate. |
1320 `------------------------------------------------------------*/
1322 /* In all cases, when you get here, the value and location stacks
1323 have just been pushed. So pushing a state here evens the stacks. */
1329 if (yyss
+ yystacksize
- 1 <= yyssp
)
1331 /* Get the current used size of the three stacks, in elements. */
1332 YYSIZE_T yysize
= yyssp
- yyss
+ 1;
1336 /* Give user a chance to reallocate the stack. Use copies of
1337 these so that the &'s don't force the real ones into
1339 YYSTYPE
*yyvs1
= yyvs
;
1340 yytype_int16
*yyss1
= yyss
;
1342 /* Each stack pointer address is followed by the size of the
1343 data in use in that stack, in bytes. This used to be a
1344 conditional around just the two extra args, but that might
1345 be undefined if yyoverflow is a macro. */
1346 yyoverflow (YY_("memory exhausted"),
1347 &yyss1
, yysize
* sizeof (*yyssp
),
1348 &yyvs1
, yysize
* sizeof (*yyvsp
),
1354 #else /* no yyoverflow */
1355 # ifndef YYSTACK_RELOCATE
1356 goto yyexhaustedlab
;
1358 /* Extend the stack our own way. */
1359 if (YYMAXDEPTH
<= yystacksize
)
1360 goto yyexhaustedlab
;
1362 if (YYMAXDEPTH
< yystacksize
)
1363 yystacksize
= YYMAXDEPTH
;
1366 yytype_int16
*yyss1
= yyss
;
1367 union yyalloc
*yyptr
=
1368 (union yyalloc
*) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize
));
1370 goto yyexhaustedlab
;
1371 YYSTACK_RELOCATE (yyss_alloc
, yyss
);
1372 YYSTACK_RELOCATE (yyvs_alloc
, yyvs
);
1373 # undef YYSTACK_RELOCATE
1375 YYSTACK_FREE (yyss1
);
1378 #endif /* no yyoverflow */
1380 yyssp
= yyss
+ yysize
- 1;
1381 yyvsp
= yyvs
+ yysize
- 1;
1383 YYDPRINTF ((stderr
, "Stack size increased to %lu\n",
1384 (unsigned long int) yystacksize
));
1386 if (yyss
+ yystacksize
- 1 <= yyssp
)
1390 YYDPRINTF ((stderr
, "Entering state %d\n", yystate
));
1392 if (yystate
== YYFINAL
)
1402 /* Do appropriate processing given the current state. Read a
1403 lookahead token if we need one and don't already have one. */
1405 /* First try to decide what to do without reference to lookahead token. */
1406 yyn
= yypact
[yystate
];
1407 if (yypact_value_is_default (yyn
))
1410 /* Not known => get a lookahead token if don't already have one. */
1412 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
1413 if (yychar
== YYEMPTY
)
1415 YYDPRINTF ((stderr
, "Reading a token: "));
1419 if (yychar
<= YYEOF
)
1421 yychar
= yytoken
= YYEOF
;
1422 YYDPRINTF ((stderr
, "Now at end of input.\n"));
1426 yytoken
= YYTRANSLATE (yychar
);
1427 YY_SYMBOL_PRINT ("Next token is", yytoken
, &yylval
, &yylloc
);
1430 /* If the proper action on seeing token YYTOKEN is to reduce or to
1431 detect an error, take that action. */
1433 if (yyn
< 0 || YYLAST
< yyn
|| yycheck
[yyn
] != yytoken
)
1438 if (yytable_value_is_error (yyn
))
1444 /* Count tokens shifted since error; after three, turn off error
1449 /* Shift the lookahead token. */
1450 YY_SYMBOL_PRINT ("Shifting", yytoken
, &yylval
, &yylloc
);
1452 /* Discard the shifted token. */
1456 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1458 YY_IGNORE_MAYBE_UNINITIALIZED_END
1463 /*-----------------------------------------------------------.
1464 | yydefault -- do the default action for the current state. |
1465 `-----------------------------------------------------------*/
1467 yyn
= yydefact
[yystate
];
1473 /*-----------------------------.
1474 | yyreduce -- Do a reduction. |
1475 `-----------------------------*/
1477 /* yyn is the number of a rule to reduce with. */
1480 /* If YYLEN is nonzero, implement the default value of the action:
1483 Otherwise, the following line sets YYVAL to garbage.
1484 This behavior is undocumented and Bison
1485 users should not rely upon it. Assigning to YYVAL
1486 unconditionally makes the parser a bit smaller, and it avoids a
1487 GCC warning that YYVAL may be used uninitialized. */
1488 yyval
= yyvsp
[1-yylen
];
1491 YY_REDUCE_PRINT (yyn
);
1495 #line 186 "ppy.y" /* yacc.c:1646 */
1496 { pp_do_include((yyvsp
[-1].cptr
), 1); }
1497 #line 1498 "ppy.tab.c" /* yacc.c:1646 */
1501 #line 187 "ppy.y" /* yacc.c:1646 */
1502 { pp_do_include((yyvsp
[-1].cptr
), 0); }
1503 #line 1504 "ppy.tab.c" /* yacc.c:1646 */
1507 #line 188 "ppy.y" /* yacc.c:1646 */
1508 { pp_next_if_state(boolean(&(yyvsp
[-1].cval
))); }
1509 #line 1510 "ppy.tab.c" /* yacc.c:1646 */
1513 #line 189 "ppy.y" /* yacc.c:1646 */
1514 { pp_next_if_state(pplookup((yyvsp
[-1].cptr
)) != NULL
); free((yyvsp
[-1].cptr
)); }
1515 #line 1516 "ppy.tab.c" /* yacc.c:1646 */
1519 #line 190 "ppy.y" /* yacc.c:1646 */
1521 int t
= pplookup((yyvsp
[-1].cptr
)) == NULL
;
1522 if(pp_incl_state
.state
== 0 && t
&& !pp_incl_state
.seen_junk
)
1524 pp_incl_state
.state
= 1;
1525 pp_incl_state
.ppp
= (yyvsp
[-1].cptr
);
1526 pp_incl_state
.ifdepth
= pp_get_if_depth();
1528 else if(pp_incl_state
.state
!= 1)
1530 pp_incl_state
.state
= -1;
1531 free((yyvsp
[-1].cptr
));
1534 free((yyvsp
[-1].cptr
));
1535 pp_next_if_state(t
);
1537 fprintf(stderr
, "tIFNDEF: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n",
1538 pp_status
.input
, pp_status
.line_number
, pp_incl_state
.state
, pp_incl_state
.ppp
, pp_incl_state
.ifdepth
);
1540 #line 1541 "ppy.tab.c" /* yacc.c:1646 */
1544 #line 210 "ppy.y" /* yacc.c:1646 */
1546 pp_if_state_t s
= pp_pop_if();
1551 pp_push_if(if_elif
);
1554 pp_push_if(boolean(&(yyvsp
[-1].cval
)) ? if_true
: if_false
);
1557 pp_push_if(if_ignore
);
1561 ppy_error("#elif cannot follow #else");
1566 pp_internal_error(__FILE__
, __LINE__
, "Invalid pp_if_state (%d) in #elif directive", s
);
1569 #line 1570 "ppy.tab.c" /* yacc.c:1646 */
1573 #line 234 "ppy.y" /* yacc.c:1646 */
1575 pp_if_state_t s
= pp_pop_if();
1579 pp_push_if(if_elsefalse
);
1582 pp_push_if(if_elif
);
1585 pp_push_if(if_elsetrue
);
1588 pp_push_if(if_ignore
);
1592 ppy_error("#else clause already defined");
1597 pp_internal_error(__FILE__
, __LINE__
, "Invalid pp_if_state (%d) in #else directive", s
);
1600 #line 1601 "ppy.tab.c" /* yacc.c:1646 */
1604 #line 260 "ppy.y" /* yacc.c:1646 */
1606 if(pp_pop_if() != if_error
)
1608 if(pp_incl_state
.ifdepth
== pp_get_if_depth() && pp_incl_state
.state
== 1)
1610 pp_incl_state
.state
= 2;
1611 pp_incl_state
.seen_junk
= 0;
1613 else if(pp_incl_state
.state
!= 1)
1615 pp_incl_state
.state
= -1;
1618 fprintf(stderr
, "tENDIF: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n",
1619 pp_status
.input
, pp_status
.line_number
, pp_incl_state
.state
, pp_incl_state
.ppp
, pp_incl_state
.ifdepth
);
1622 #line 1623 "ppy.tab.c" /* yacc.c:1646 */
1626 #line 277 "ppy.y" /* yacc.c:1646 */
1627 { pp_del_define((yyvsp
[-1].cptr
)); free((yyvsp
[-1].cptr
)); }
1628 #line 1629 "ppy.tab.c" /* yacc.c:1646 */
1632 #line 278 "ppy.y" /* yacc.c:1646 */
1633 { pp_add_define((yyvsp
[-2].cptr
), (yyvsp
[-1].cptr
)); free((yyvsp
[-2].cptr
)); free((yyvsp
[-1].cptr
)); }
1634 #line 1635 "ppy.tab.c" /* yacc.c:1646 */
1638 #line 279 "ppy.y" /* yacc.c:1646 */
1640 pp_add_macro((yyvsp
[-5].cptr
), macro_args
, nmacro_args
, (yyvsp
[-1].mtext
));
1642 #line 1643 "ppy.tab.c" /* yacc.c:1646 */
1646 #line 282 "ppy.y" /* yacc.c:1646 */
1647 { if((yyvsp
[-1].cptr
)) pp_writestring("# %d %s\n", (yyvsp
[-2].sint
) , (yyvsp
[-1].cptr
)); free((yyvsp
[-1].cptr
)); }
1648 #line 1649 "ppy.tab.c" /* yacc.c:1646 */
1652 #line 283 "ppy.y" /* yacc.c:1646 */
1653 { if((yyvsp
[-1].cptr
)) pp_writestring("# %d %s\n", (yyvsp
[-2].sint
) , (yyvsp
[-1].cptr
)); free((yyvsp
[-1].cptr
)); }
1654 #line 1655 "ppy.tab.c" /* yacc.c:1646 */
1658 #line 285 "ppy.y" /* yacc.c:1646 */
1659 { if((yyvsp
[-2].cptr
)) pp_writestring("# %d %s %d\n", (yyvsp
[-3].sint
), (yyvsp
[-2].cptr
), (yyvsp
[-1].sint
)); free((yyvsp
[-2].cptr
)); }
1660 #line 1661 "ppy.tab.c" /* yacc.c:1646 */
1664 #line 287 "ppy.y" /* yacc.c:1646 */
1665 { if((yyvsp
[-3].cptr
)) pp_writestring("# %d %s %d %d\n", (yyvsp
[-4].sint
) ,(yyvsp
[-3].cptr
), (yyvsp
[-2].sint
), (yyvsp
[-1].sint
)); free((yyvsp
[-3].cptr
)); }
1666 #line 1667 "ppy.tab.c" /* yacc.c:1646 */
1670 #line 289 "ppy.y" /* yacc.c:1646 */
1671 { if((yyvsp
[-4].cptr
)) pp_writestring("# %d %s %d %d %d\n", (yyvsp
[-5].sint
) ,(yyvsp
[-4].cptr
) ,(yyvsp
[-3].sint
) ,(yyvsp
[-2].sint
), (yyvsp
[-1].sint
)); free((yyvsp
[-4].cptr
)); }
1672 #line 1673 "ppy.tab.c" /* yacc.c:1646 */
1676 #line 291 "ppy.y" /* yacc.c:1646 */
1677 { if((yyvsp
[-5].cptr
)) pp_writestring("# %d %s %d %d %d %d\n", (yyvsp
[-6].sint
) ,(yyvsp
[-5].cptr
) ,(yyvsp
[-4].sint
) ,(yyvsp
[-3].sint
), (yyvsp
[-2].sint
), (yyvsp
[-1].sint
)); free((yyvsp
[-5].cptr
)); }
1678 #line 1679 "ppy.tab.c" /* yacc.c:1646 */
1682 #line 293 "ppy.y" /* yacc.c:1646 */
1683 { ppy_error("#error directive: '%s'", (yyvsp
[-1].cptr
)); free((yyvsp
[-1].cptr
)); }
1684 #line 1685 "ppy.tab.c" /* yacc.c:1646 */
1688 #line 294 "ppy.y" /* yacc.c:1646 */
1689 { ppy_warning("#warning directive: '%s'", (yyvsp
[-1].cptr
)); free((yyvsp
[-1].cptr
)); }
1690 #line 1691 "ppy.tab.c" /* yacc.c:1646 */
1694 #line 295 "ppy.y" /* yacc.c:1646 */
1695 { pp_writestring("#pragma %s\n", (yyvsp
[-1].cptr
) ? (yyvsp
[-1].cptr
) : ""); free((yyvsp
[-1].cptr
)); }
1696 #line 1697 "ppy.tab.c" /* yacc.c:1646 */
1700 #line 296 "ppy.y" /* yacc.c:1646 */
1701 { if(pp_status
.pedantic
) ppy_warning("#ident ignored (arg: '%s')", (yyvsp
[-1].cptr
)); free((yyvsp
[-1].cptr
)); }
1702 #line 1703 "ppy.tab.c" /* yacc.c:1646 */
1706 #line 297 "ppy.y" /* yacc.c:1646 */
1710 int nl
=strlen((yyvsp
[0].cptr
)) +3;
1711 char *fn
=pp_xmalloc(nl
);
1714 sprintf(fn
,"\"%s\"",(yyvsp
[0].cptr
));
1715 pp_do_include(fn
,1);
1717 free((yyvsp
[0].cptr
));
1720 #line 1721 "ppy.tab.c" /* yacc.c:1646 */
1724 #line 310 "ppy.y" /* yacc.c:1646 */
1726 pp_do_include((yyvsp
[0].cptr
),1);
1728 #line 1729 "ppy.tab.c" /* yacc.c:1646 */
1732 #line 316 "ppy.y" /* yacc.c:1646 */
1733 { (yyval
.cptr
) = NULL
; }
1734 #line 1735 "ppy.tab.c" /* yacc.c:1646 */
1738 #line 317 "ppy.y" /* yacc.c:1646 */
1739 { (yyval
.cptr
) = (yyvsp
[0].cptr
); }
1740 #line 1741 "ppy.tab.c" /* yacc.c:1646 */
1744 #line 320 "ppy.y" /* yacc.c:1646 */
1745 { (yyval
.cptr
) = (yyvsp
[0].cptr
); }
1746 #line 1747 "ppy.tab.c" /* yacc.c:1646 */
1750 #line 321 "ppy.y" /* yacc.c:1646 */
1751 { (yyval
.cptr
) = (yyvsp
[0].cptr
); }
1752 #line 1753 "ppy.tab.c" /* yacc.c:1646 */
1756 #line 322 "ppy.y" /* yacc.c:1646 */
1757 { (yyval
.cptr
) = (yyvsp
[0].cptr
); }
1758 #line 1759 "ppy.tab.c" /* yacc.c:1646 */
1762 #line 323 "ppy.y" /* yacc.c:1646 */
1763 { (yyval
.cptr
) = merge_text((yyvsp
[-1].cptr
), (yyvsp
[0].cptr
)); }
1764 #line 1765 "ppy.tab.c" /* yacc.c:1646 */
1768 #line 324 "ppy.y" /* yacc.c:1646 */
1769 { (yyval
.cptr
) = merge_text((yyvsp
[-1].cptr
), (yyvsp
[0].cptr
)); }
1770 #line 1771 "ppy.tab.c" /* yacc.c:1646 */
1774 #line 325 "ppy.y" /* yacc.c:1646 */
1775 { (yyval
.cptr
) = merge_text((yyvsp
[-1].cptr
), (yyvsp
[0].cptr
)); }
1776 #line 1777 "ppy.tab.c" /* yacc.c:1646 */
1780 #line 328 "ppy.y" /* yacc.c:1646 */
1781 { macro_args
= NULL
; nmacro_args
= 0; }
1782 #line 1783 "ppy.tab.c" /* yacc.c:1646 */
1786 #line 331 "ppy.y" /* yacc.c:1646 */
1787 { (yyval
.sint
) = 0; macro_args
= NULL
; nmacro_args
= 0; }
1788 #line 1789 "ppy.tab.c" /* yacc.c:1646 */
1792 #line 332 "ppy.y" /* yacc.c:1646 */
1793 { (yyval
.sint
) = nmacro_args
; }
1794 #line 1795 "ppy.tab.c" /* yacc.c:1646 */
1798 #line 335 "ppy.y" /* yacc.c:1646 */
1799 { (yyval
.marg
) = (yyvsp
[0].marg
); }
1800 #line 1801 "ppy.tab.c" /* yacc.c:1646 */
1804 #line 336 "ppy.y" /* yacc.c:1646 */
1805 { (yyval
.marg
) = add_new_marg(NULL
, arg_list
); nmacro_args
*= -1; }
1806 #line 1807 "ppy.tab.c" /* yacc.c:1646 */
1810 #line 339 "ppy.y" /* yacc.c:1646 */
1811 { (yyval
.marg
) = add_new_marg((yyvsp
[0].cptr
), arg_single
); }
1812 #line 1813 "ppy.tab.c" /* yacc.c:1646 */
1816 #line 340 "ppy.y" /* yacc.c:1646 */
1817 { (yyval
.marg
) = add_new_marg((yyvsp
[0].cptr
), arg_single
); }
1818 #line 1819 "ppy.tab.c" /* yacc.c:1646 */
1822 #line 344 "ppy.y" /* yacc.c:1646 */
1823 { (yyval
.mtext
) = NULL
; }
1824 #line 1825 "ppy.tab.c" /* yacc.c:1646 */
1828 #line 345 "ppy.y" /* yacc.c:1646 */
1830 for((yyval
.mtext
) = (yyvsp
[0].mtext
); (yyval
.mtext
) && (yyval
.mtext
)->prev
; (yyval
.mtext
) = (yyval
.mtext
)->prev
)
1833 #line 1834 "ppy.tab.c" /* yacc.c:1646 */
1837 #line 351 "ppy.y" /* yacc.c:1646 */
1838 { (yyval
.mtext
) = (yyvsp
[0].mtext
); }
1839 #line 1840 "ppy.tab.c" /* yacc.c:1646 */
1843 #line 352 "ppy.y" /* yacc.c:1646 */
1844 { (yyval
.mtext
) = combine_mtext((yyvsp
[-1].mtext
), (yyvsp
[0].mtext
)); }
1845 #line 1846 "ppy.tab.c" /* yacc.c:1646 */
1849 #line 355 "ppy.y" /* yacc.c:1646 */
1850 { (yyval
.mtext
) = new_mtext((yyvsp
[0].cptr
), 0, exp_text
); }
1851 #line 1852 "ppy.tab.c" /* yacc.c:1646 */
1855 #line 356 "ppy.y" /* yacc.c:1646 */
1856 { (yyval
.mtext
) = new_mtext((yyvsp
[0].cptr
), 0, exp_text
); }
1857 #line 1858 "ppy.tab.c" /* yacc.c:1646 */
1861 #line 357 "ppy.y" /* yacc.c:1646 */
1862 { (yyval
.mtext
) = new_mtext((yyvsp
[0].cptr
), 0, exp_text
); }
1863 #line 1864 "ppy.tab.c" /* yacc.c:1646 */
1867 #line 358 "ppy.y" /* yacc.c:1646 */
1868 { (yyval
.mtext
) = new_mtext(NULL
, 0, exp_concat
); }
1869 #line 1870 "ppy.tab.c" /* yacc.c:1646 */
1873 #line 359 "ppy.y" /* yacc.c:1646 */
1875 int mat
= marg_index((yyvsp
[0].cptr
));
1877 ppy_error("Stringification identifier must be an argument parameter");
1879 (yyval
.mtext
) = new_mtext(NULL
, mat
, exp_stringize
);
1881 #line 1882 "ppy.tab.c" /* yacc.c:1646 */
1885 #line 366 "ppy.y" /* yacc.c:1646 */
1887 int mat
= marg_index((yyvsp
[0].cptr
));
1889 (yyval
.mtext
) = new_mtext(NULL
, mat
, exp_subst
);
1890 else if((yyvsp
[0].cptr
))
1891 (yyval
.mtext
) = new_mtext((yyvsp
[0].cptr
), 0, exp_text
);
1893 #line 1894 "ppy.tab.c" /* yacc.c:1646 */
1897 #line 375 "ppy.y" /* yacc.c:1646 */
1898 { (yyval
.cval
).type
= cv_sint
; (yyval
.cval
).val
.si
= (yyvsp
[0].sint
); }
1899 #line 1900 "ppy.tab.c" /* yacc.c:1646 */
1903 #line 376 "ppy.y" /* yacc.c:1646 */
1904 { (yyval
.cval
).type
= cv_uint
; (yyval
.cval
).val
.ui
= (yyvsp
[0].uint
); }
1905 #line 1906 "ppy.tab.c" /* yacc.c:1646 */
1909 #line 377 "ppy.y" /* yacc.c:1646 */
1910 { (yyval
.cval
).type
= cv_slong
; (yyval
.cval
).val
.sl
= (yyvsp
[0].slong
); }
1911 #line 1912 "ppy.tab.c" /* yacc.c:1646 */
1915 #line 378 "ppy.y" /* yacc.c:1646 */
1916 { (yyval
.cval
).type
= cv_ulong
; (yyval
.cval
).val
.ul
= (yyvsp
[0].ulong
); }
1917 #line 1918 "ppy.tab.c" /* yacc.c:1646 */
1921 #line 379 "ppy.y" /* yacc.c:1646 */
1922 { (yyval
.cval
).type
= cv_sll
; (yyval
.cval
).val
.sll
= (yyvsp
[0].sll
); }
1923 #line 1924 "ppy.tab.c" /* yacc.c:1646 */
1927 #line 380 "ppy.y" /* yacc.c:1646 */
1928 { (yyval
.cval
).type
= cv_ull
; (yyval
.cval
).val
.ull
= (yyvsp
[0].ull
); }
1929 #line 1930 "ppy.tab.c" /* yacc.c:1646 */
1933 #line 381 "ppy.y" /* yacc.c:1646 */
1934 { (yyval
.cval
).type
= cv_sint
; (yyval
.cval
).val
.si
= pplookup((yyvsp
[0].cptr
)) != NULL
; }
1935 #line 1936 "ppy.tab.c" /* yacc.c:1646 */
1939 #line 382 "ppy.y" /* yacc.c:1646 */
1940 { (yyval
.cval
).type
= cv_sint
; (yyval
.cval
).val
.si
= pplookup((yyvsp
[-1].cptr
)) != NULL
; }
1941 #line 1942 "ppy.tab.c" /* yacc.c:1646 */
1945 #line 383 "ppy.y" /* yacc.c:1646 */
1946 { (yyval
.cval
).type
= cv_sint
; (yyval
.cval
).val
.si
= 0; }
1947 #line 1948 "ppy.tab.c" /* yacc.c:1646 */
1951 #line 384 "ppy.y" /* yacc.c:1646 */
1952 { (yyval
.cval
).type
= cv_sint
; (yyval
.cval
).val
.si
= boolean(&(yyvsp
[-2].cval
)) || boolean(&(yyvsp
[0].cval
)); }
1953 #line 1954 "ppy.tab.c" /* yacc.c:1646 */
1957 #line 385 "ppy.y" /* yacc.c:1646 */
1958 { (yyval
.cval
).type
= cv_sint
; (yyval
.cval
).val
.si
= boolean(&(yyvsp
[-2].cval
)) && boolean(&(yyvsp
[0].cval
)); }
1959 #line 1960 "ppy.tab.c" /* yacc.c:1646 */
1963 #line 386 "ppy.y" /* yacc.c:1646 */
1964 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), ==); }
1965 #line 1966 "ppy.tab.c" /* yacc.c:1646 */
1969 #line 387 "ppy.y" /* yacc.c:1646 */
1970 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), !=); }
1971 #line 1972 "ppy.tab.c" /* yacc.c:1646 */
1975 #line 388 "ppy.y" /* yacc.c:1646 */
1976 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), <); }
1977 #line 1978 "ppy.tab.c" /* yacc.c:1646 */
1981 #line 389 "ppy.y" /* yacc.c:1646 */
1982 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), >); }
1983 #line 1984 "ppy.tab.c" /* yacc.c:1646 */
1987 #line 390 "ppy.y" /* yacc.c:1646 */
1988 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), <=); }
1989 #line 1990 "ppy.tab.c" /* yacc.c:1646 */
1993 #line 391 "ppy.y" /* yacc.c:1646 */
1994 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), >=); }
1995 #line 1996 "ppy.tab.c" /* yacc.c:1646 */
1999 #line 392 "ppy.y" /* yacc.c:1646 */
2000 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), +); }
2001 #line 2002 "ppy.tab.c" /* yacc.c:1646 */
2005 #line 393 "ppy.y" /* yacc.c:1646 */
2006 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), -); }
2007 #line 2008 "ppy.tab.c" /* yacc.c:1646 */
2011 #line 394 "ppy.y" /* yacc.c:1646 */
2012 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), ^); }
2013 #line 2014 "ppy.tab.c" /* yacc.c:1646 */
2017 #line 395 "ppy.y" /* yacc.c:1646 */
2018 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), &); }
2019 #line 2020 "ppy.tab.c" /* yacc.c:1646 */
2023 #line 396 "ppy.y" /* yacc.c:1646 */
2024 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), |); }
2025 #line 2026 "ppy.tab.c" /* yacc.c:1646 */
2029 #line 397 "ppy.y" /* yacc.c:1646 */
2030 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), *); }
2031 #line 2032 "ppy.tab.c" /* yacc.c:1646 */
2035 #line 398 "ppy.y" /* yacc.c:1646 */
2036 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), /); }
2037 #line 2038 "ppy.tab.c" /* yacc.c:1646 */
2041 #line 399 "ppy.y" /* yacc.c:1646 */
2042 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), <<); }
2043 #line 2044 "ppy.tab.c" /* yacc.c:1646 */
2047 #line 400 "ppy.y" /* yacc.c:1646 */
2048 { promote_equal_size(&(yyvsp
[-2].cval
), &(yyvsp
[0].cval
)); BIN_OP((yyval
.cval
), (yyvsp
[-2].cval
), (yyvsp
[0].cval
), >>); }
2049 #line 2050 "ppy.tab.c" /* yacc.c:1646 */
2053 #line 401 "ppy.y" /* yacc.c:1646 */
2054 { (yyval
.cval
) = (yyvsp
[0].cval
); }
2055 #line 2056 "ppy.tab.c" /* yacc.c:1646 */
2059 #line 402 "ppy.y" /* yacc.c:1646 */
2060 { UNARY_OP((yyval
.cval
), (yyvsp
[0].cval
), -); }
2061 #line 2062 "ppy.tab.c" /* yacc.c:1646 */
2065 #line 403 "ppy.y" /* yacc.c:1646 */
2066 { UNARY_OP((yyval
.cval
), (yyvsp
[0].cval
), ~); }
2067 #line 2068 "ppy.tab.c" /* yacc.c:1646 */
2071 #line 404 "ppy.y" /* yacc.c:1646 */
2072 { (yyval
.cval
).type
= cv_sint
; (yyval
.cval
).val
.si
= !boolean(&(yyvsp
[0].cval
)); }
2073 #line 2074 "ppy.tab.c" /* yacc.c:1646 */
2077 #line 405 "ppy.y" /* yacc.c:1646 */
2078 { (yyval
.cval
) = (yyvsp
[-1].cval
); }
2079 #line 2080 "ppy.tab.c" /* yacc.c:1646 */
2083 #line 406 "ppy.y" /* yacc.c:1646 */
2084 { (yyval
.cval
) = boolean(&(yyvsp
[-4].cval
)) ? (yyvsp
[-2].cval
) : (yyvsp
[0].cval
); }
2085 #line 2086 "ppy.tab.c" /* yacc.c:1646 */
2089 #line 2090 "ppy.tab.c" /* yacc.c:1646 */
2092 /* User semantic actions sometimes alter yychar, and that requires
2093 that yytoken be updated with the new translation. We take the
2094 approach of translating immediately before every use of yytoken.
2095 One alternative is translating here after every semantic action,
2096 but that translation would be missed if the semantic action invokes
2097 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
2098 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
2099 incorrect destructor might then be invoked immediately. In the
2100 case of YYERROR or YYBACKUP, subsequent parser actions might lead
2101 to an incorrect destructor call or verbose syntax error message
2102 before the lookahead is translated. */
2103 YY_SYMBOL_PRINT ("-> $$ =", yyr1
[yyn
], &yyval
, &yyloc
);
2107 YY_STACK_PRINT (yyss
, yyssp
);
2111 /* Now 'shift' the result of the reduction. Determine what state
2112 that goes to, based on the state we popped back to and the rule
2113 number reduced by. */
2117 yystate
= yypgoto
[yyn
- YYNTOKENS
] + *yyssp
;
2118 if (0 <= yystate
&& yystate
<= YYLAST
&& yycheck
[yystate
] == *yyssp
)
2119 yystate
= yytable
[yystate
];
2121 yystate
= yydefgoto
[yyn
- YYNTOKENS
];
2126 /*--------------------------------------.
2127 | yyerrlab -- here on detecting error. |
2128 `--------------------------------------*/
2130 /* Make sure we have latest lookahead translation. See comments at
2131 user semantic actions for why this is necessary. */
2132 yytoken
= yychar
== YYEMPTY
? YYEMPTY
: YYTRANSLATE (yychar
);
2134 /* If not already recovering from an error, report this error. */
2138 #if ! YYERROR_VERBOSE
2139 yyerror (YY_("syntax error"));
2141 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
2144 char const *yymsgp
= YY_("syntax error");
2145 int yysyntax_error_status
;
2146 yysyntax_error_status
= YYSYNTAX_ERROR
;
2147 if (yysyntax_error_status
== 0)
2149 else if (yysyntax_error_status
== 1)
2151 if (yymsg
!= yymsgbuf
)
2152 YYSTACK_FREE (yymsg
);
2153 yymsg
= (char *) YYSTACK_ALLOC (yymsg_alloc
);
2157 yymsg_alloc
= sizeof yymsgbuf
;
2158 yysyntax_error_status
= 2;
2162 yysyntax_error_status
= YYSYNTAX_ERROR
;
2167 if (yysyntax_error_status
== 2)
2168 goto yyexhaustedlab
;
2170 # undef YYSYNTAX_ERROR
2176 if (yyerrstatus
== 3)
2178 /* If just tried and failed to reuse lookahead token after an
2179 error, discard it. */
2181 if (yychar
<= YYEOF
)
2183 /* Return failure if at end of input. */
2184 if (yychar
== YYEOF
)
2189 yydestruct ("Error: discarding",
2195 /* Else will try to reuse lookahead token after shifting the error
2200 /*---------------------------------------------------.
2201 | yyerrorlab -- error raised explicitly by YYERROR. |
2202 `---------------------------------------------------*/
2205 /* Pacify compilers like GCC when the user code never invokes
2206 YYERROR and the label yyerrorlab therefore never appears in user
2208 if (/*CONSTCOND*/ 0)
2211 /* Do not reclaim the symbols of the rule whose action triggered
2215 YY_STACK_PRINT (yyss
, yyssp
);
2220 /*-------------------------------------------------------------.
2221 | yyerrlab1 -- common code for both syntax error and YYERROR. |
2222 `-------------------------------------------------------------*/
2224 yyerrstatus
= 3; /* Each real token shifted decrements this. */
2228 yyn
= yypact
[yystate
];
2229 if (!yypact_value_is_default (yyn
))
2232 if (0 <= yyn
&& yyn
<= YYLAST
&& yycheck
[yyn
] == YYTERROR
)
2240 /* Pop the current state because it cannot handle the error token. */
2245 yydestruct ("Error: popping",
2246 yystos
[yystate
], yyvsp
);
2249 YY_STACK_PRINT (yyss
, yyssp
);
2252 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2254 YY_IGNORE_MAYBE_UNINITIALIZED_END
2257 /* Shift the error token. */
2258 YY_SYMBOL_PRINT ("Shifting", yystos
[yyn
], yyvsp
, yylsp
);
2264 /*-------------------------------------.
2265 | yyacceptlab -- YYACCEPT comes here. |
2266 `-------------------------------------*/
2271 /*-----------------------------------.
2272 | yyabortlab -- YYABORT comes here. |
2273 `-----------------------------------*/
2278 #if !defined yyoverflow || YYERROR_VERBOSE
2279 /*-------------------------------------------------.
2280 | yyexhaustedlab -- memory exhaustion comes here. |
2281 `-------------------------------------------------*/
2283 yyerror (YY_("memory exhausted"));
2289 if (yychar
!= YYEMPTY
)
2291 /* Make sure we have latest lookahead translation. See comments at
2292 user semantic actions for why this is necessary. */
2293 yytoken
= YYTRANSLATE (yychar
);
2294 yydestruct ("Cleanup: discarding lookahead",
2297 /* Do not reclaim the symbols of the rule whose action triggered
2298 this YYABORT or YYACCEPT. */
2300 YY_STACK_PRINT (yyss
, yyssp
);
2301 while (yyssp
!= yyss
)
2303 yydestruct ("Cleanup: popping",
2304 yystos
[*yyssp
], yyvsp
);
2309 YYSTACK_FREE (yyss
);
2312 if (yymsg
!= yymsgbuf
)
2313 YYSTACK_FREE (yymsg
);
2317 #line 409 "ppy.y" /* yacc.c:1906 */
2321 **************************************************************************
2323 **************************************************************************
2326 static void cast_to_sint(cval_t
*v
)
2330 case cv_sint
: break;
2331 case cv_uint
: break;
2332 case cv_slong
: v
->val
.si
= v
->val
.sl
; break;
2333 case cv_ulong
: v
->val
.si
= v
->val
.ul
; break;
2334 case cv_sll
: v
->val
.si
= v
->val
.sll
; break;
2335 case cv_ull
: v
->val
.si
= v
->val
.ull
; break;
2340 static void cast_to_uint(cval_t
*v
)
2344 case cv_sint
: break;
2345 case cv_uint
: break;
2346 case cv_slong
: v
->val
.ui
= v
->val
.sl
; break;
2347 case cv_ulong
: v
->val
.ui
= v
->val
.ul
; break;
2348 case cv_sll
: v
->val
.ui
= v
->val
.sll
; break;
2349 case cv_ull
: v
->val
.ui
= v
->val
.ull
; break;
2354 static void cast_to_slong(cval_t
*v
)
2358 case cv_sint
: v
->val
.sl
= v
->val
.si
; break;
2359 case cv_uint
: v
->val
.sl
= v
->val
.ui
; break;
2360 case cv_slong
: break;
2361 case cv_ulong
: break;
2362 case cv_sll
: v
->val
.sl
= v
->val
.sll
; break;
2363 case cv_ull
: v
->val
.sl
= v
->val
.ull
; break;
2368 static void cast_to_ulong(cval_t
*v
)
2372 case cv_sint
: v
->val
.ul
= v
->val
.si
; break;
2373 case cv_uint
: v
->val
.ul
= v
->val
.ui
; break;
2374 case cv_slong
: break;
2375 case cv_ulong
: break;
2376 case cv_sll
: v
->val
.ul
= v
->val
.sll
; break;
2377 case cv_ull
: v
->val
.ul
= v
->val
.ull
; break;
2382 static void cast_to_sll(cval_t
*v
)
2386 case cv_sint
: v
->val
.sll
= v
->val
.si
; break;
2387 case cv_uint
: v
->val
.sll
= v
->val
.ui
; break;
2388 case cv_slong
: v
->val
.sll
= v
->val
.sl
; break;
2389 case cv_ulong
: v
->val
.sll
= v
->val
.ul
; break;
2396 static void cast_to_ull(cval_t
*v
)
2400 case cv_sint
: v
->val
.ull
= v
->val
.si
; break;
2401 case cv_uint
: v
->val
.ull
= v
->val
.ui
; break;
2402 case cv_slong
: v
->val
.ull
= v
->val
.sl
; break;
2403 case cv_ulong
: v
->val
.ull
= v
->val
.ul
; break;
2411 static void promote_equal_size(cval_t
*v1
, cval_t
*v2
)
2413 #define cv_sizeof(v) ((int)(v->type & SIZE_MASK))
2414 int s1
= cv_sizeof(v1
);
2415 int s2
= cv_sizeof(v2
);
2424 case cv_sint
: cast_to_sint(v2
); break;
2425 case cv_uint
: cast_to_uint(v2
); break;
2426 case cv_slong
: cast_to_slong(v2
); break;
2427 case cv_ulong
: cast_to_ulong(v2
); break;
2428 case cv_sll
: cast_to_sll(v2
); break;
2429 case cv_ull
: cast_to_ull(v2
); break;
2436 case cv_sint
: cast_to_sint(v1
); break;
2437 case cv_uint
: cast_to_uint(v1
); break;
2438 case cv_slong
: cast_to_slong(v1
); break;
2439 case cv_ulong
: cast_to_ulong(v1
); break;
2440 case cv_sll
: cast_to_sll(v1
); break;
2441 case cv_ull
: cast_to_ull(v1
); break;
2447 static int boolean(cval_t
*v
)
2451 case cv_sint
: return v
->val
.si
!= (int)0;
2452 case cv_uint
: return v
->val
.ui
!= (unsigned int)0;
2453 case cv_slong
: return v
->val
.sl
!= (long)0;
2454 case cv_ulong
: return v
->val
.ul
!= (unsigned long)0;
2455 case cv_sll
: return v
->val
.sll
!= (wrc_sll_t
)0;
2456 case cv_ull
: return v
->val
.ull
!= (wrc_ull_t
)0;
2461 static marg_t
*new_marg(char *str
, def_arg_t type
)
2463 marg_t
*ma
= pp_xmalloc(sizeof(marg_t
));
2472 static marg_t
*add_new_marg(char *str
, def_arg_t type
)
2474 marg_t
**new_macro_args
;
2478 new_macro_args
= pp_xrealloc(macro_args
, (nmacro_args
+1) * sizeof(macro_args
[0]));
2481 macro_args
= new_macro_args
;
2482 ma
= new_marg(str
, type
);
2485 macro_args
[nmacro_args
] = ma
;
2490 static int marg_index(char *id
)
2495 for(t
= 0; t
< nmacro_args
; t
++)
2497 if(!strcmp(id
, macro_args
[t
]->arg
))
2500 return t
< nmacro_args
? t
: -1;
2503 static mtext_t
*new_mtext(char *str
, int idx
, def_exp_t type
)
2505 mtext_t
*mt
= pp_xmalloc(sizeof(mtext_t
));
2509 mt
->subst
.argidx
= idx
;
2511 mt
->subst
.text
= str
;
2513 mt
->next
= mt
->prev
= NULL
;
2517 static mtext_t
*combine_mtext(mtext_t
*tail
, mtext_t
*mtp
)
2525 if(tail
->type
== exp_text
&& mtp
->type
== exp_text
)
2528 new_text
= pp_xrealloc(tail
->subst
.text
, strlen(tail
->subst
.text
)+strlen(mtp
->subst
.text
)+1);
2531 tail
->subst
.text
= new_text
;
2532 strcat(tail
->subst
.text
, mtp
->subst
.text
);
2533 free(mtp
->subst
.text
);
2538 if(tail
->type
== exp_concat
&& mtp
->type
== exp_concat
)
2544 if(tail
->type
== exp_concat
&& mtp
->type
== exp_text
)
2546 int len
= strlen(mtp
->subst
.text
);
2549 /* FIXME: should delete space from head of string */
2550 if(isspace(mtp
->subst
.text
[len
-1] & 0xff))
2551 mtp
->subst
.text
[--len
] = '\0';
2558 free(mtp
->subst
.text
);
2564 if(tail
->type
== exp_text
&& mtp
->type
== exp_concat
)
2566 int len
= strlen(tail
->subst
.text
);
2569 if(isspace(tail
->subst
.text
[len
-1] & 0xff))
2570 tail
->subst
.text
[--len
] = '\0';
2577 mtp
->prev
= tail
->prev
;
2578 mtp
->next
= tail
->next
;
2580 tail
->prev
->next
= mtp
;
2581 free(tail
->subst
.text
);
2593 static char *merge_text(char *s1
, char *s2
)
2604 snew
= pp_xrealloc(s1
, l1
+l2
+1);
2611 memcpy(s1
+l1
, s2
, l2
+1);