From 5375e33490eaeefc218211c343e6ccf7ceee0fa9 Mon Sep 17 00:00:00 2001 From: Victor Perevertkin Date: Thu, 28 Jan 2021 06:36:00 +0300 Subject: [PATCH] [CMAKE] Generate Flex and Bison files at build time We have Flex and Bison distributed along with RosBE 2.2 so this should not be a problem --- CMakeLists.txt | 3 +- .../wine/d3dcompiler_43/CMakeLists.txt | 34 +- .../wine/d3dcompiler_43/asmshader.tab.c | 4415 ---------- .../wine/d3dcompiler_43/asmshader.tab.h | 267 - .../wine/d3dcompiler_43/asmshader.yy.c | 3420 -------- .../wine/d3dcompiler_43/asmshader.yy.h | 711 -- dll/directx/wine/d3dcompiler_43/hlsl.tab.c | 4956 ----------- dll/directx/wine/d3dcompiler_43/hlsl.tab.h | 208 - dll/directx/wine/d3dcompiler_43/hlsl.yy.c | 3190 ------- dll/directx/wine/d3dcompiler_43/hlsl.yy.h | 715 -- dll/directx/wine/d3dcompiler_43/ppl.yy.c | 4757 ----------- dll/directx/wine/d3dcompiler_43/ppl.yy.h | 730 -- dll/directx/wine/d3dcompiler_43/ppy.tab.c | 2619 ------ dll/directx/wine/d3dcompiler_43/ppy.tab.h | 129 - dll/win32/jscript/CMakeLists.txt | 10 +- dll/win32/jscript/cc_parser.tab.c | 1846 ---- dll/win32/jscript/cc_parser.tab.h | 87 - dll/win32/jscript/parser.tab.c | 4408 ---------- dll/win32/jscript/parser.tab.h | 140 - dll/win32/msi/CMakeLists.txt | 7 +- dll/win32/msi/cond.tab.c | 2552 ------ dll/win32/msi/sql.tab.c | 2744 ------ dll/win32/msi/sql.tab.h | 137 - dll/win32/msxml3/CMakeLists.txt | 11 +- dll/win32/msxml3/xslpattern.tab.c | 2423 ------ dll/win32/msxml3/xslpattern.tab.h | 88 - dll/win32/msxml3/xslpattern.yy.c | 2240 ----- dll/win32/msxml3/xslpattern.yy.h | 346 - dll/win32/vbscript/CMakeLists.txt | 8 +- dll/win32/vbscript/parser.tab.c | 3961 --------- dll/win32/vbscript/parser.tab.h | 158 - dll/win32/wbemprox/CMakeLists.txt | 7 +- dll/win32/wbemprox/wql.tab.c | 2476 ------ dll/win32/wbemprox/wql.tab.h | 113 - sdk/cmake/bison-flex.cmake | 27 - sdk/tools/widl/CMakeLists.txt | 8 +- sdk/tools/widl/parser.tab.c | 7408 ----------------- sdk/tools/widl/parser.tab.h | 289 - sdk/tools/widl/parser.yy.c | 3039 ------- sdk/tools/widl/parser.yy.h | 698 -- sdk/tools/wpp/CMakeLists.txt | 12 +- sdk/tools/wpp/ppl.yy.c | 4602 ---------- sdk/tools/wpp/ppy.tab.c | 2614 ------ sdk/tools/wpp/ppy.tab.h | 124 - 44 files changed, 54 insertions(+), 68683 deletions(-) delete mode 100644 dll/directx/wine/d3dcompiler_43/asmshader.tab.c delete mode 100644 dll/directx/wine/d3dcompiler_43/asmshader.tab.h delete mode 100644 dll/directx/wine/d3dcompiler_43/asmshader.yy.c delete mode 100644 dll/directx/wine/d3dcompiler_43/asmshader.yy.h delete mode 100644 dll/directx/wine/d3dcompiler_43/hlsl.tab.c delete mode 100644 dll/directx/wine/d3dcompiler_43/hlsl.tab.h delete mode 100644 dll/directx/wine/d3dcompiler_43/hlsl.yy.c delete mode 100644 dll/directx/wine/d3dcompiler_43/hlsl.yy.h delete mode 100644 dll/directx/wine/d3dcompiler_43/ppl.yy.c delete mode 100644 dll/directx/wine/d3dcompiler_43/ppl.yy.h delete mode 100644 dll/directx/wine/d3dcompiler_43/ppy.tab.c delete mode 100644 dll/directx/wine/d3dcompiler_43/ppy.tab.h delete mode 100644 dll/win32/jscript/cc_parser.tab.c delete mode 100644 dll/win32/jscript/cc_parser.tab.h delete mode 100644 dll/win32/jscript/parser.tab.c delete mode 100644 dll/win32/jscript/parser.tab.h delete mode 100644 dll/win32/msi/cond.tab.c delete mode 100644 dll/win32/msi/sql.tab.c delete mode 100644 dll/win32/msi/sql.tab.h delete mode 100644 dll/win32/msxml3/xslpattern.tab.c delete mode 100644 dll/win32/msxml3/xslpattern.tab.h delete mode 100644 dll/win32/msxml3/xslpattern.yy.c delete mode 100644 dll/win32/msxml3/xslpattern.yy.h delete mode 100644 dll/win32/vbscript/parser.tab.c delete mode 100644 dll/win32/vbscript/parser.tab.h delete mode 100644 dll/win32/wbemprox/wql.tab.c delete mode 100644 dll/win32/wbemprox/wql.tab.h delete mode 100644 sdk/cmake/bison-flex.cmake delete mode 100644 sdk/tools/widl/parser.tab.c delete mode 100644 sdk/tools/widl/parser.tab.h delete mode 100644 sdk/tools/widl/parser.yy.c delete mode 100644 sdk/tools/widl/parser.yy.h delete mode 100644 sdk/tools/wpp/ppl.yy.c delete mode 100644 sdk/tools/wpp/ppy.tab.c delete mode 100644 sdk/tools/wpp/ppy.tab.h diff --git a/CMakeLists.txt b/CMakeLists.txt index b91387178d6..5795482d782 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,8 @@ if(MSVC_IDE) endif() # Bison and Flex support -# include(sdk/cmake/bison-flex.cmake) +find_package(BISON REQUIRED) +find_package(FLEX REQUIRED) if(NOT CMAKE_CROSSCOMPILING) set(TOOLS_FOLDER ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/dll/directx/wine/d3dcompiler_43/CMakeLists.txt b/dll/directx/wine/d3dcompiler_43/CMakeLists.txt index 899b51ecb7e..baa23c10e72 100644 --- a/dll/directx/wine/d3dcompiler_43/CMakeLists.txt +++ b/dll/directx/wine/d3dcompiler_43/CMakeLists.txt @@ -17,13 +17,25 @@ list(APPEND SOURCE reflection.c utils.c) +FLEX_TARGET(asmshader_scanner asmshader.l ${CMAKE_CURRENT_BINARY_DIR}/asmshader.yy.c) +BISON_TARGET(asmshader_parser asmshader.y ${CMAKE_CURRENT_BINARY_DIR}/asmshader.tab.c COMPILE_FLAGS "-p asmshader_") +ADD_FLEX_BISON_DEPENDENCY(asmshader_scanner asmshader_parser) + +FLEX_TARGET(hlsl_scanner hlsl.l ${CMAKE_CURRENT_BINARY_DIR}/hlsl.yy.c) +BISON_TARGET(hlsl_parser hlsl.y ${CMAKE_CURRENT_BINARY_DIR}/hlsl.tab.c COMPILE_FLAGS "-p hlsl_") +ADD_FLEX_BISON_DEPENDENCY(hlsl_scanner hlsl_parser) + +FLEX_TARGET(pp_scanner ppl.l ${CMAKE_CURRENT_BINARY_DIR}/ppl.yy.c) +BISON_TARGET(pp_parser ppy.y ${CMAKE_CURRENT_BINARY_DIR}/ppy.tab.c COMPILE_FLAGS "-p ppy_") +ADD_FLEX_BISON_DEPENDENCY(pp_scanner pp_parser) + list(APPEND PCH_SKIP_SOURCE - asmshader.tab.c - asmshader.yy.c - hlsl.tab.c - hlsl.yy.c - ppy.tab.c - ppl.yy.c) + ${FLEX_asmshader_scanner_OUTPUTS} + ${BISON_asmshader_parser_OUTPUTS} + ${FLEX_hlsl_scanner_OUTPUTS} + ${BISON_hlsl_parser_OUTPUTS} + ${FLEX_pp_scanner_OUTPUTS} + ${BISON_pp_parser_OUTPUTS}) add_library(d3dcompiler_43 MODULE ${SOURCE} @@ -32,16 +44,6 @@ add_library(d3dcompiler_43 MODULE ${CMAKE_CURRENT_BINARY_DIR}/d3dcompiler_43_stubs.c ${CMAKE_CURRENT_BINARY_DIR}/d3dcompiler_43.def) -# some files have been generated with relative file paths... -set_source_files_properties( - asmshader.tab.c - asmshader.yy.c - hlsl.tab.c - hlsl.yy.c - ppy.tab.c - ppl.yy.c - PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") - set_module_type(d3dcompiler_43 win32dll) target_link_libraries(d3dcompiler_43 dx10guid uuid wine wpp) add_importlibs(d3dcompiler_43 msvcrt kernel32 ntdll) diff --git a/dll/directx/wine/d3dcompiler_43/asmshader.tab.c b/dll/directx/wine/d3dcompiler_43/asmshader.tab.c deleted file mode 100644 index 4ac2b9dee0d..00000000000 --- a/dll/directx/wine/d3dcompiler_43/asmshader.tab.c +++ /dev/null @@ -1,4415 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse asmshader_parse -#define yylex asmshader_lex -#define yyerror asmshader_error -#define yydebug asmshader_debug -#define yynerrs asmshader_nerrs - -#define yylval asmshader_lval -#define yychar asmshader_char - -/* First part of user prologue. */ -#line 22 "asmshader.y" - -#include "wine/debug.h" - -#include "d3dcompiler_private.h" - -WINE_DEFAULT_DEBUG_CHANNEL(asmshader); - -struct asm_parser asm_ctx; - -void WINAPIV asmparser_message(struct asm_parser *ctx, const char *fmt, ...) -{ - __ms_va_list args; - - __ms_va_start(args, fmt); - compilation_message(&ctx->messages, fmt, args); - __ms_va_end(args); -} - -static void asmshader_error(char const *s) { - asmparser_message(&asm_ctx, "Line %u: Error \"%s\" from bison\n", asm_ctx.line_no, s); - set_parse_status(&asm_ctx.status, PARSE_ERR); -} - -static void set_rel_reg(struct shader_reg *reg, struct rel_reg *rel) { - /* We can have an additional offset without true relative addressing - * ex. c2[ 4 ] */ - reg->regnum += rel->additional_offset; - if(!rel->has_rel_reg) { - reg->rel_reg = NULL; - } else { - reg->rel_reg = d3dcompiler_alloc(sizeof(*reg->rel_reg)); - if(!reg->rel_reg) { - return; - } - reg->rel_reg->type = rel->type; - reg->rel_reg->u.swizzle = rel->swizzle; - reg->rel_reg->regnum = rel->rel_regnum; - } -} - -/* Needed lexer functions declarations */ -int asmshader_lex(void); - - - -#line 124 "asmshader.tab.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_ASMSHADER_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_ASMSHADER_TAB_H_INCLUDED -# define YY_ASMSHADER_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_ASMSHADER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int asmshader_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - INSTR_ADD = 258, - INSTR_NOP = 259, - INSTR_MOV = 260, - INSTR_SUB = 261, - INSTR_MAD = 262, - INSTR_MUL = 263, - INSTR_RCP = 264, - INSTR_RSQ = 265, - INSTR_DP3 = 266, - INSTR_DP4 = 267, - INSTR_MIN = 268, - INSTR_MAX = 269, - INSTR_SLT = 270, - INSTR_SGE = 271, - INSTR_ABS = 272, - INSTR_EXP = 273, - INSTR_LOG = 274, - INSTR_EXPP = 275, - INSTR_LOGP = 276, - INSTR_DST = 277, - INSTR_LRP = 278, - INSTR_FRC = 279, - INSTR_POW = 280, - INSTR_CRS = 281, - INSTR_SGN = 282, - INSTR_NRM = 283, - INSTR_SINCOS = 284, - INSTR_M4x4 = 285, - INSTR_M4x3 = 286, - INSTR_M3x4 = 287, - INSTR_M3x3 = 288, - INSTR_M3x2 = 289, - INSTR_DCL = 290, - INSTR_DEF = 291, - INSTR_DEFB = 292, - INSTR_DEFI = 293, - INSTR_REP = 294, - INSTR_ENDREP = 295, - INSTR_IF = 296, - INSTR_ELSE = 297, - INSTR_ENDIF = 298, - INSTR_BREAK = 299, - INSTR_BREAKP = 300, - INSTR_CALL = 301, - INSTR_CALLNZ = 302, - INSTR_LOOP = 303, - INSTR_RET = 304, - INSTR_ENDLOOP = 305, - INSTR_LABEL = 306, - INSTR_SETP = 307, - INSTR_TEXLDL = 308, - INSTR_LIT = 309, - INSTR_MOVA = 310, - INSTR_CND = 311, - INSTR_CMP = 312, - INSTR_DP2ADD = 313, - INSTR_TEXCOORD = 314, - INSTR_TEXCRD = 315, - INSTR_TEXKILL = 316, - INSTR_TEX = 317, - INSTR_TEXLD = 318, - INSTR_TEXBEM = 319, - INSTR_TEXBEML = 320, - INSTR_TEXREG2AR = 321, - INSTR_TEXREG2GB = 322, - INSTR_TEXREG2RGB = 323, - INSTR_TEXM3x2PAD = 324, - INSTR_TEXM3x2TEX = 325, - INSTR_TEXM3x3PAD = 326, - INSTR_TEXM3x3SPEC = 327, - INSTR_TEXM3x3VSPEC = 328, - INSTR_TEXM3x3TEX = 329, - INSTR_TEXDP3TEX = 330, - INSTR_TEXM3x2DEPTH = 331, - INSTR_TEXDP3 = 332, - INSTR_TEXM3x3 = 333, - INSTR_TEXDEPTH = 334, - INSTR_BEM = 335, - INSTR_DSX = 336, - INSTR_DSY = 337, - INSTR_TEXLDP = 338, - INSTR_TEXLDB = 339, - INSTR_TEXLDD = 340, - INSTR_PHASE = 341, - REG_TEMP = 342, - REG_OUTPUT = 343, - REG_INPUT = 344, - REG_CONSTFLOAT = 345, - REG_CONSTINT = 346, - REG_CONSTBOOL = 347, - REG_TEXTURE = 348, - REG_SAMPLER = 349, - REG_TEXCRDOUT = 350, - REG_OPOS = 351, - REG_OFOG = 352, - REG_OPTS = 353, - REG_VERTEXCOLOR = 354, - REG_FRAGCOLOR = 355, - REG_FRAGDEPTH = 356, - REG_VPOS = 357, - REG_VFACE = 358, - REG_ADDRESS = 359, - REG_LOOP = 360, - REG_PREDICATE = 361, - REG_LABEL = 362, - VER_VS10 = 363, - VER_VS11 = 364, - VER_VS20 = 365, - VER_VS2X = 366, - VER_VS30 = 367, - VER_PS10 = 368, - VER_PS11 = 369, - VER_PS12 = 370, - VER_PS13 = 371, - VER_PS14 = 372, - VER_PS20 = 373, - VER_PS2X = 374, - VER_PS30 = 375, - SHIFT_X2 = 376, - SHIFT_X4 = 377, - SHIFT_X8 = 378, - SHIFT_D2 = 379, - SHIFT_D4 = 380, - SHIFT_D8 = 381, - MOD_SAT = 382, - MOD_PP = 383, - MOD_CENTROID = 384, - COMP_GT = 385, - COMP_LT = 386, - COMP_GE = 387, - COMP_LE = 388, - COMP_EQ = 389, - COMP_NE = 390, - SMOD_BIAS = 391, - SMOD_SCALEBIAS = 392, - SMOD_DZ = 393, - SMOD_DW = 394, - SMOD_ABS = 395, - SMOD_NOT = 396, - SAMPTYPE_1D = 397, - SAMPTYPE_2D = 398, - SAMPTYPE_CUBE = 399, - SAMPTYPE_VOLUME = 400, - USAGE_POSITION = 401, - USAGE_BLENDWEIGHT = 402, - USAGE_BLENDINDICES = 403, - USAGE_NORMAL = 404, - USAGE_PSIZE = 405, - USAGE_TEXCOORD = 406, - USAGE_TANGENT = 407, - USAGE_BINORMAL = 408, - USAGE_TESSFACTOR = 409, - USAGE_POSITIONT = 410, - USAGE_COLOR = 411, - USAGE_FOG = 412, - USAGE_DEPTH = 413, - USAGE_SAMPLE = 414, - COMPONENT = 415, - IMMVAL = 416, - IMMBOOL = 417 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 68 "asmshader.y" - - struct { - float val; - BOOL integer; - } immval; - BOOL immbool; - unsigned int regnum; - struct shader_reg reg; - DWORD srcmod; - DWORD writemask; - struct { - DWORD writemask; - DWORD idx; - DWORD last; - } wm_components; - DWORD swizzle; - struct { - DWORD swizzle; - DWORD idx; - } sw_components; - DWORD component; - struct { - DWORD mod; - DWORD shift; - } modshift; - enum bwriter_comparison_type comptype; - struct { - DWORD dclusage; - unsigned int regnum; - } declaration; - enum bwritersampler_texture_type samplertype; - struct rel_reg rel_reg; - struct src_regs sregs; - -#line 365 "asmshader.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE asmshader_lval; - -int asmshader_parse (void); - -#endif /* !YY_ASMSHADER_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_ASMSHADER_TAB_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 16 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 733 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 171 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 26 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 228 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 552 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 417 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 169, 170, 2, 163, 164, 166, 165, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 167, 2, 168, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 309, 309, 314, 319, 324, 329, 334, 339, 344, - 349, 354, 359, 364, 369, 374, 380, 381, 386, 390, - 395, 401, 406, 411, 416, 421, 426, 431, 436, 441, - 446, 451, 456, 461, 466, 471, 476, 481, 486, 491, - 496, 501, 506, 511, 516, 521, 526, 531, 536, 541, - 546, 551, 556, 561, 573, 585, 608, 631, 653, 675, - 685, 700, 707, 714, 718, 722, 726, 731, 736, 741, - 746, 751, 756, 761, 766, 771, 776, 781, 786, 791, - 796, 801, 806, 811, 816, 821, 826, 831, 836, 841, - 847, 852, 857, 862, 873, 878, 883, 888, 893, 898, - 903, 908, 913, 918, 923, 928, 933, 938, 943, 948, - 953, 958, 963, 968, 973, 978, 985, 993, 1002, 1006, - 1010, 1014, 1020, 1026, 1032, 1036, 1040, 1046, 1050, 1054, - 1058, 1062, 1066, 1070, 1074, 1080, 1086, 1091, 1098, 1113, - 1119, 1135, 1139, 1161, 1166, 1180, 1184, 1197, 1202, 1207, - 1212, 1217, 1222, 1227, 1232, 1237, 1243, 1248, 1259, 1267, - 1275, 1283, 1308, 1322, 1336, 1346, 1350, 1355, 1363, 1371, - 1379, 1388, 1397, 1407, 1411, 1415, 1419, 1423, 1427, 1432, - 1436, 1441, 1445, 1451, 1455, 1459, 1463, 1467, 1471, 1477, - 1481, 1487, 1493, 1499, 1505, 1511, 1515, 1519, 1523, 1527, - 1531, 1536, 1537, 1538, 1539, 1540, 1541, 1543, 1549, 1555, - 1561, 1567, 1573, 1579, 1585, 1591, 1597, 1603, 1609, 1615, - 1621, 1628, 1632, 1637, 1641, 1645, 1649, 1654, 1662 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "INSTR_ADD", "INSTR_NOP", "INSTR_MOV", - "INSTR_SUB", "INSTR_MAD", "INSTR_MUL", "INSTR_RCP", "INSTR_RSQ", - "INSTR_DP3", "INSTR_DP4", "INSTR_MIN", "INSTR_MAX", "INSTR_SLT", - "INSTR_SGE", "INSTR_ABS", "INSTR_EXP", "INSTR_LOG", "INSTR_EXPP", - "INSTR_LOGP", "INSTR_DST", "INSTR_LRP", "INSTR_FRC", "INSTR_POW", - "INSTR_CRS", "INSTR_SGN", "INSTR_NRM", "INSTR_SINCOS", "INSTR_M4x4", - "INSTR_M4x3", "INSTR_M3x4", "INSTR_M3x3", "INSTR_M3x2", "INSTR_DCL", - "INSTR_DEF", "INSTR_DEFB", "INSTR_DEFI", "INSTR_REP", "INSTR_ENDREP", - "INSTR_IF", "INSTR_ELSE", "INSTR_ENDIF", "INSTR_BREAK", "INSTR_BREAKP", - "INSTR_CALL", "INSTR_CALLNZ", "INSTR_LOOP", "INSTR_RET", "INSTR_ENDLOOP", - "INSTR_LABEL", "INSTR_SETP", "INSTR_TEXLDL", "INSTR_LIT", "INSTR_MOVA", - "INSTR_CND", "INSTR_CMP", "INSTR_DP2ADD", "INSTR_TEXCOORD", - "INSTR_TEXCRD", "INSTR_TEXKILL", "INSTR_TEX", "INSTR_TEXLD", - "INSTR_TEXBEM", "INSTR_TEXBEML", "INSTR_TEXREG2AR", "INSTR_TEXREG2GB", - "INSTR_TEXREG2RGB", "INSTR_TEXM3x2PAD", "INSTR_TEXM3x2TEX", - "INSTR_TEXM3x3PAD", "INSTR_TEXM3x3SPEC", "INSTR_TEXM3x3VSPEC", - "INSTR_TEXM3x3TEX", "INSTR_TEXDP3TEX", "INSTR_TEXM3x2DEPTH", - "INSTR_TEXDP3", "INSTR_TEXM3x3", "INSTR_TEXDEPTH", "INSTR_BEM", - "INSTR_DSX", "INSTR_DSY", "INSTR_TEXLDP", "INSTR_TEXLDB", "INSTR_TEXLDD", - "INSTR_PHASE", "REG_TEMP", "REG_OUTPUT", "REG_INPUT", "REG_CONSTFLOAT", - "REG_CONSTINT", "REG_CONSTBOOL", "REG_TEXTURE", "REG_SAMPLER", - "REG_TEXCRDOUT", "REG_OPOS", "REG_OFOG", "REG_OPTS", "REG_VERTEXCOLOR", - "REG_FRAGCOLOR", "REG_FRAGDEPTH", "REG_VPOS", "REG_VFACE", "REG_ADDRESS", - "REG_LOOP", "REG_PREDICATE", "REG_LABEL", "VER_VS10", "VER_VS11", - "VER_VS20", "VER_VS2X", "VER_VS30", "VER_PS10", "VER_PS11", "VER_PS12", - "VER_PS13", "VER_PS14", "VER_PS20", "VER_PS2X", "VER_PS30", "SHIFT_X2", - "SHIFT_X4", "SHIFT_X8", "SHIFT_D2", "SHIFT_D4", "SHIFT_D8", "MOD_SAT", - "MOD_PP", "MOD_CENTROID", "COMP_GT", "COMP_LT", "COMP_GE", "COMP_LE", - "COMP_EQ", "COMP_NE", "SMOD_BIAS", "SMOD_SCALEBIAS", "SMOD_DZ", - "SMOD_DW", "SMOD_ABS", "SMOD_NOT", "SAMPTYPE_1D", "SAMPTYPE_2D", - "SAMPTYPE_CUBE", "SAMPTYPE_VOLUME", "USAGE_POSITION", - "USAGE_BLENDWEIGHT", "USAGE_BLENDINDICES", "USAGE_NORMAL", "USAGE_PSIZE", - "USAGE_TEXCOORD", "USAGE_TANGENT", "USAGE_BINORMAL", "USAGE_TESSFACTOR", - "USAGE_POSITIONT", "USAGE_COLOR", "USAGE_FOG", "USAGE_DEPTH", - "USAGE_SAMPLE", "COMPONENT", "IMMVAL", "IMMBOOL", "'+'", "','", "'.'", - "'-'", "'['", "']'", "'('", "')'", "$accept", "shader", "version_marker", - "instructions", "complexinstr", "instruction", "dreg", "dreg_name", - "writemask", "wm_components", "swizzle", "sw_components", "omods", - "omodifier", "sregs", "sreg", "rel_reg", "immsum", "smod", "relreg_name", - "sreg_name", "comp", "dclusage", "dcl_inputreg", "sampdcl", "predicate", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 43, 44, 46, 45, 91, 93, 40, - 41 -}; -# endif - -#define YYPACT_NINF -458 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-458))) - -#define YYTABLE_NINF -1 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 386, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -458, -458, 11, -458, -458, 389, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - 334, -42, -28, -10, -34, -458, 95, -458, -458, 3, - -34, -34, -34, -34, -458, -458, -34, 3, -458, -458, - -458, -458, -458, -458, -458, -458, 247, -458, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, 647, -55, -458, -458, 647, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 505, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -458, -458, -458, -458, 123, 2, -458, -44, - -40, -39, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, 185, -45, 185, -38, -458, -37, -458, -458, - -458, -458, -458, -458, -38, -34, -34, -38, -38, -38, - -38, -38, 247, 505, 505, 505, 505, 505, 505, 505, - 505, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -458, -458, -76, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, 505, 505, 505, - 505, 505, 505, 505, 505, 505, 505, -458, -57, 22, - -458, -458, -458, -458, -458, -458, -458, -458, -458, -458, - -35, -458, 1, 4, 8, 9, 10, 14, 16, 29, - 49, 50, 51, 54, 55, 57, 58, 60, 68, 69, - 70, 73, 74, 75, 76, 77, 78, 79, 89, 90, - 91, 93, -458, -458, -458, 94, 94, 142, 82, 5, - 96, 6, -57, 185, -37, -34, -58, -43, -38, -38, - 98, 119, 129, 130, 131, 132, 133, -458, 134, 100, - -458, -458, -458, 135, 136, 137, 138, 190, 191, 192, - 193, 194, 195, 204, 205, 343, 344, 345, 346, -458, - 378, 379, 380, 381, 382, 383, 388, 384, -57, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -458, -458, 94, -458, -458, -458, 385, -458, 387, -458, - -37, -43, -458, -458, -458, -458, -154, -57, -458, -458, - -458, -458, -458, -458, -458, -57, -34, -34, -34, -34, - -34, -34, -34, -34, -458, 390, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -34, -34, - -34, -34, -34, -34, -34, -34, -34, -34, -458, 393, - -458, 397, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -458, 394, 395, -43, -458, -57, -30, - -458, -86, -458, -38, -38, -38, -38, -38, -38, -38, - -38, -458, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, - -38, -38, -38, -38, -458, -458, 448, 449, -458, -57, - -458, -458, -57, 396, -458, 453, 454, -458, -84, -63, - 452, 455, 396, -458, 456, -458, 457, 459, -59, -458, - -458, -458 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, 0, 16, 1, 2, 145, 22, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 0, 0, 0, 0, 67, 0, 70, 71, 72, - 0, 0, 0, 0, 78, 79, 0, 0, 145, 145, - 145, 145, 145, 145, 145, 145, 0, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 115, 0, 0, 17, 18, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 223, 224, - 225, 226, 207, 208, 209, 210, 211, 212, 213, 214, - 215, 216, 217, 218, 219, 220, 0, 145, 145, 0, - 0, 0, 181, 182, 183, 184, 185, 186, 187, 189, - 188, 190, 191, 192, 193, 194, 196, 197, 198, 199, - 195, 200, 0, 0, 0, 66, 156, 165, 201, 202, - 203, 204, 205, 206, 68, 0, 0, 74, 75, 76, - 77, 80, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 118, 119, 120, 121, 122, 123, 124, 126, 125, - 127, 129, 128, 130, 131, 132, 134, 135, 136, 137, - 133, 90, 165, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 20, 141, 0, - 19, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 0, 146, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 221, 222, 60, 57, 53, 0, 0, 0, - 0, 0, 141, 0, 165, 0, 0, 141, 69, 73, - 0, 0, 0, 0, 0, 0, 0, 88, 0, 0, - 117, 116, 91, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 92, - 0, 0, 0, 0, 0, 0, 0, 0, 141, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 58, 54, 55, 62, 59, 61, 0, 65, 0, 164, - 165, 141, 157, 179, 180, 171, 0, 141, 174, 173, - 175, 176, 177, 178, 158, 141, 0, 0, 0, 0, - 0, 0, 0, 0, 139, 138, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 143, 142, - 227, 0, 21, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 39, 38, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 56, 0, 0, 141, 160, 141, 0, - 166, 0, 159, 81, 82, 83, 84, 85, 86, 87, - 89, 140, 93, 96, 97, 98, 99, 100, 101, 108, - 102, 103, 104, 105, 106, 107, 109, 110, 111, 112, - 113, 94, 95, 114, 144, 228, 0, 0, 162, 141, - 161, 172, 141, 0, 167, 0, 0, 163, 0, 0, - 0, 0, 0, 168, 0, 169, 0, 0, 0, 63, - 64, 170 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -458, -458, -458, -458, -458, 17, -92, -458, -293, -458, - -309, -458, 491, -458, -56, 306, -231, -457, -399, 146, - -132, 21, -458, -206, -458, -458 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 14, 15, 17, 104, 105, 231, 232, 330, 425, - 357, 449, 107, 271, 185, 186, 317, 406, 415, 407, - 187, 195, 157, 305, 158, 106 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint16 yytable[] = -{ - 194, 331, 488, 399, 197, 198, 199, 200, 414, 489, - 201, 16, 390, 391, 490, 270, 272, 273, 274, 275, - 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, - 296, 297, 298, 299, 300, 301, 403, 404, 159, 451, - 312, 258, 314, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 160, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 403, 404, 539, 533, 408, 542, - 196, 161, 534, 401, 543, 548, 259, 529, 202, 329, - 306, 316, 487, 409, 410, 411, 412, 413, 491, 483, - 544, 392, 395, 405, 544, 545, 492, 182, 356, 551, - 320, 321, 322, 323, 324, 325, 326, 327, 328, 257, - 309, 313, 356, 260, 310, 311, 315, 183, 358, 359, - 316, 531, 184, 188, 189, 190, 191, 192, 193, 318, - 319, 332, 333, 334, 335, 336, 337, 338, 339, 340, - 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 360, 396, 398, 361, 486, - 393, 302, 362, 363, 364, 303, 394, 528, 365, 530, - 366, 400, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 367, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 302, 368, 369, 370, 303, 304, 371, 372, - 537, 373, 374, 538, 375, 188, 189, 190, 191, 192, - 193, 302, 376, 377, 378, 303, 182, 379, 380, 381, - 382, 383, 384, 385, 261, 262, 263, 264, 265, 266, - 267, 268, 269, 386, 387, 388, 183, 389, 397, 329, - 424, 184, 416, 261, 262, 263, 264, 265, 266, 267, - 268, 269, 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 172, 417, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 418, 419, 420, 421, 422, 423, 426, - 427, 428, 429, 452, 453, 454, 455, 456, 457, 458, - 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, - 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, - 479, 480, 481, 482, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 430, 431, 432, 433, 434, 435, - 493, 494, 495, 496, 497, 498, 499, 500, 436, 437, - 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, - 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, - 522, 523, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 155, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 438, 439, 440, - 441, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, - 137, 156, 442, 443, 444, 445, 446, 447, 448, 484, - 501, 485, 102, 524, 450, 526, 527, 405, 103, 203, - 204, 205, 206, 207, 208, 209, 210, 525, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 211, 212, 213, 214, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 535, 536, 540, 541, 546, 531, 549, 547, - 550, 402, 0, 0, 0, 0, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 532, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 307, 308, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101 -}; - -static const yytype_int16 yycheck[] = -{ - 56, 232, 401, 312, 60, 61, 62, 63, 317, 163, - 66, 0, 305, 306, 168, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, - 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 137, 104, 105, 90, 358, - 182, 106, 184, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 92, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 104, 105, 533, 163, 121, 163, - 59, 91, 168, 314, 168, 542, 141, 486, 67, 165, - 88, 167, 401, 136, 137, 138, 139, 140, 407, 392, - 163, 307, 308, 161, 163, 168, 415, 141, 165, 168, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 102, - 164, 166, 165, 106, 164, 164, 164, 161, 106, 164, - 167, 161, 166, 130, 131, 132, 133, 134, 135, 195, - 196, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 164, 161, 161, 164, 400, - 88, 89, 164, 164, 164, 93, 94, 486, 164, 488, - 164, 313, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 164, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 89, 164, 164, 164, 93, 94, 164, 164, - 529, 164, 164, 532, 164, 130, 131, 132, 133, 134, - 135, 89, 164, 164, 164, 93, 141, 164, 164, 164, - 164, 164, 164, 164, 121, 122, 123, 124, 125, 126, - 127, 128, 129, 164, 164, 164, 161, 164, 162, 165, - 160, 166, 164, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 164, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 359, 360, 361, 362, 363, 364, 365, - 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, - 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, - 103, 104, 105, 106, 164, 164, 164, 164, 164, 164, - 416, 417, 418, 419, 420, 421, 422, 423, 164, 164, - 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, - 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, - 446, 447, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 156, 157, 158, 159, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, 164, 164, 164, - 164, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 164, 164, 164, 164, 164, 164, 160, 164, - 160, 164, 163, 160, 170, 161, 161, 161, 169, 68, - 69, 70, 71, 72, 73, 74, 75, 170, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 164, 164, 161, 161, 164, 161, 161, 164, - 161, 315, -1, -1, -1, -1, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 489, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 157, 158, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 172, 173, 0, 174, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 163, 169, 175, 176, 196, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 142, 143, - 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, - 154, 155, 156, 157, 158, 159, 183, 193, 195, 90, - 92, 91, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 99, 100, 101, 102, 103, 104, 105, - 106, 107, 141, 161, 166, 185, 186, 191, 130, 131, - 132, 133, 134, 135, 185, 192, 192, 185, 185, 185, - 185, 185, 192, 183, 183, 183, 183, 183, 183, 183, - 183, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, - 106, 177, 178, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 183, 183, 183, 183, 176, 106, 141, - 176, 121, 122, 123, 124, 125, 126, 127, 128, 129, - 177, 184, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 89, 93, 94, 194, 88, 183, 183, 164, - 164, 164, 191, 166, 191, 164, 167, 187, 185, 185, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 165, - 179, 187, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, - 177, 177, 177, 177, 177, 177, 165, 181, 106, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 179, 179, 194, 88, 94, 194, 161, 162, 161, 181, - 191, 187, 186, 104, 105, 161, 188, 190, 121, 136, - 137, 138, 139, 140, 181, 189, 164, 164, 164, 164, - 164, 164, 164, 164, 160, 180, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 160, 182, - 170, 181, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 179, 164, 164, 187, 181, 189, 163, - 168, 181, 181, 185, 185, 185, 185, 185, 185, 185, - 185, 160, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 160, 170, 161, 161, 181, 189, - 181, 161, 190, 163, 168, 164, 164, 181, 181, 188, - 161, 161, 163, 168, 163, 168, 164, 164, 188, 161, - 161, 168 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 171, 172, 173, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 174, 174, 175, 175, - 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 177, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 179, 180, - 180, 181, 181, 182, 182, 183, 183, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 185, 185, 186, 186, - 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, - 187, 188, 188, 189, 189, 189, 189, 189, 189, 190, - 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, - 191, 192, 192, 192, 192, 192, 192, 193, 193, 193, - 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, - 193, 194, 194, 195, 195, 195, 195, 196, 196 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 2, 1, 2, - 2, 5, 1, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 3, 4, 4, 5, 3, 4, 4, - 3, 4, 4, 10, 10, 4, 2, 1, 2, 3, - 1, 1, 1, 3, 2, 2, 2, 2, 1, 1, - 2, 5, 5, 5, 5, 5, 5, 5, 3, 5, - 2, 3, 3, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 1, 2, 2, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, - 2, 0, 2, 1, 2, 0, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 4, - 4, 5, 5, 6, 3, 0, 3, 4, 6, 6, - 8, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 4, 5 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 310 "asmshader.y" - { - asm_ctx.funcs->end(&asm_ctx); - } -#line 1900 "asmshader.tab.c" - break; - - case 3: -#line 315 "asmshader.y" - { - TRACE("Vertex shader 1.0\n"); - create_vs10_parser(&asm_ctx); - } -#line 1909 "asmshader.tab.c" - break; - - case 4: -#line 320 "asmshader.y" - { - TRACE("Vertex shader 1.1\n"); - create_vs11_parser(&asm_ctx); - } -#line 1918 "asmshader.tab.c" - break; - - case 5: -#line 325 "asmshader.y" - { - TRACE("Vertex shader 2.0\n"); - create_vs20_parser(&asm_ctx); - } -#line 1927 "asmshader.tab.c" - break; - - case 6: -#line 330 "asmshader.y" - { - TRACE("Vertex shader 2.x\n"); - create_vs2x_parser(&asm_ctx); - } -#line 1936 "asmshader.tab.c" - break; - - case 7: -#line 335 "asmshader.y" - { - TRACE("Vertex shader 3.0\n"); - create_vs30_parser(&asm_ctx); - } -#line 1945 "asmshader.tab.c" - break; - - case 8: -#line 340 "asmshader.y" - { - TRACE("Pixel shader 1.0\n"); - create_ps10_parser(&asm_ctx); - } -#line 1954 "asmshader.tab.c" - break; - - case 9: -#line 345 "asmshader.y" - { - TRACE("Pixel shader 1.1\n"); - create_ps11_parser(&asm_ctx); - } -#line 1963 "asmshader.tab.c" - break; - - case 10: -#line 350 "asmshader.y" - { - TRACE("Pixel shader 1.2\n"); - create_ps12_parser(&asm_ctx); - } -#line 1972 "asmshader.tab.c" - break; - - case 11: -#line 355 "asmshader.y" - { - TRACE("Pixel shader 1.3\n"); - create_ps13_parser(&asm_ctx); - } -#line 1981 "asmshader.tab.c" - break; - - case 12: -#line 360 "asmshader.y" - { - TRACE("Pixel shader 1.4\n"); - create_ps14_parser(&asm_ctx); - } -#line 1990 "asmshader.tab.c" - break; - - case 13: -#line 365 "asmshader.y" - { - TRACE("Pixel shader 2.0\n"); - create_ps20_parser(&asm_ctx); - } -#line 1999 "asmshader.tab.c" - break; - - case 14: -#line 370 "asmshader.y" - { - TRACE("Pixel shader 2.x\n"); - create_ps2x_parser(&asm_ctx); - } -#line 2008 "asmshader.tab.c" - break; - - case 15: -#line 375 "asmshader.y" - { - TRACE("Pixel shader 3.0\n"); - create_ps30_parser(&asm_ctx); - } -#line 2017 "asmshader.tab.c" - break; - - case 17: -#line 382 "asmshader.y" - { - /* Nothing to do */ - } -#line 2025 "asmshader.tab.c" - break; - - case 18: -#line 387 "asmshader.y" - { - - } -#line 2033 "asmshader.tab.c" - break; - - case 19: -#line 391 "asmshader.y" - { - TRACE("predicate\n"); - asm_ctx.funcs->predicate(&asm_ctx, &(yyvsp[-1].reg)); - } -#line 2042 "asmshader.tab.c" - break; - - case 20: -#line 396 "asmshader.y" - { - TRACE("coissue\n"); - asm_ctx.funcs->coissue(&asm_ctx); - } -#line 2051 "asmshader.tab.c" - break; - - case 21: -#line 402 "asmshader.y" - { - TRACE("ADD\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ADD, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2060 "asmshader.tab.c" - break; - - case 22: -#line 407 "asmshader.y" - { - TRACE("NOP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_NOP, 0, 0, 0, 0, 0, 0); - } -#line 2069 "asmshader.tab.c" - break; - - case 23: -#line 412 "asmshader.y" - { - TRACE("MOV\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MOV, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2078 "asmshader.tab.c" - break; - - case 24: -#line 417 "asmshader.y" - { - TRACE("SUB\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SUB, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2087 "asmshader.tab.c" - break; - - case 25: -#line 422 "asmshader.y" - { - TRACE("MAD\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MAD, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 3); - } -#line 2096 "asmshader.tab.c" - break; - - case 26: -#line 427 "asmshader.y" - { - TRACE("MUL\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MUL, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2105 "asmshader.tab.c" - break; - - case 27: -#line 432 "asmshader.y" - { - TRACE("RCP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_RCP, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2114 "asmshader.tab.c" - break; - - case 28: -#line 437 "asmshader.y" - { - TRACE("RSQ\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_RSQ, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2123 "asmshader.tab.c" - break; - - case 29: -#line 442 "asmshader.y" - { - TRACE("DP3\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DP3, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2132 "asmshader.tab.c" - break; - - case 30: -#line 447 "asmshader.y" - { - TRACE("DP4\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DP4, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2141 "asmshader.tab.c" - break; - - case 31: -#line 452 "asmshader.y" - { - TRACE("MIN\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MIN, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2150 "asmshader.tab.c" - break; - - case 32: -#line 457 "asmshader.y" - { - TRACE("MAX\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MAX, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2159 "asmshader.tab.c" - break; - - case 33: -#line 462 "asmshader.y" - { - TRACE("SLT\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SLT, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2168 "asmshader.tab.c" - break; - - case 34: -#line 467 "asmshader.y" - { - TRACE("SGE\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SGE, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2177 "asmshader.tab.c" - break; - - case 35: -#line 472 "asmshader.y" - { - TRACE("ABS\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ABS, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2186 "asmshader.tab.c" - break; - - case 36: -#line 477 "asmshader.y" - { - TRACE("EXP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_EXP, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2195 "asmshader.tab.c" - break; - - case 37: -#line 482 "asmshader.y" - { - TRACE("LOG\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LOG, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2204 "asmshader.tab.c" - break; - - case 38: -#line 487 "asmshader.y" - { - TRACE("LOGP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LOGP, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2213 "asmshader.tab.c" - break; - - case 39: -#line 492 "asmshader.y" - { - TRACE("EXPP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_EXPP, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2222 "asmshader.tab.c" - break; - - case 40: -#line 497 "asmshader.y" - { - TRACE("DST\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DST, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2231 "asmshader.tab.c" - break; - - case 41: -#line 502 "asmshader.y" - { - TRACE("LRP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LRP, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 3); - } -#line 2240 "asmshader.tab.c" - break; - - case 42: -#line 507 "asmshader.y" - { - TRACE("FRC\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_FRC, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2249 "asmshader.tab.c" - break; - - case 43: -#line 512 "asmshader.y" - { - TRACE("POW\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_POW, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2258 "asmshader.tab.c" - break; - - case 44: -#line 517 "asmshader.y" - { - TRACE("CRS\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CRS, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2267 "asmshader.tab.c" - break; - - case 45: -#line 522 "asmshader.y" - { - TRACE("SGN\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SGN, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 3); - } -#line 2276 "asmshader.tab.c" - break; - - case 46: -#line 527 "asmshader.y" - { - TRACE("NRM\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_NRM, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2285 "asmshader.tab.c" - break; - - case 47: -#line 532 "asmshader.y" - { - TRACE("SINCOS\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SINCOS, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2294 "asmshader.tab.c" - break; - - case 48: -#line 537 "asmshader.y" - { - TRACE("M4x4\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M4x4, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2303 "asmshader.tab.c" - break; - - case 49: -#line 542 "asmshader.y" - { - TRACE("M4x3\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M4x3, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2312 "asmshader.tab.c" - break; - - case 50: -#line 547 "asmshader.y" - { - TRACE("M3x4\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M3x4, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2321 "asmshader.tab.c" - break; - - case 51: -#line 552 "asmshader.y" - { - TRACE("M3x3\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M3x3, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2330 "asmshader.tab.c" - break; - - case 52: -#line 557 "asmshader.y" - { - TRACE("M3x2\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_M3x2, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2339 "asmshader.tab.c" - break; - - case 53: -#line 562 "asmshader.y" - { - struct shader_reg reg; - TRACE("Output reg declaration\n"); - ZeroMemory(®, sizeof(reg)); - reg.type = BWRITERSPR_OUTPUT; - reg.regnum = (yyvsp[0].regnum); - reg.rel_reg = NULL; - reg.srcmod = 0; - reg.u.writemask = BWRITERSP_WRITEMASK_ALL; - asm_ctx.funcs->dcl_output(&asm_ctx, (yyvsp[-1].declaration).dclusage, (yyvsp[-1].declaration).regnum, ®); - } -#line 2355 "asmshader.tab.c" - break; - - case 54: -#line 574 "asmshader.y" - { - struct shader_reg reg; - TRACE("Output reg declaration\n"); - ZeroMemory(®, sizeof(reg)); - reg.type = BWRITERSPR_OUTPUT; - reg.regnum = (yyvsp[-1].regnum); - reg.rel_reg = NULL; - reg.srcmod = 0; - reg.u.writemask = (yyvsp[0].writemask); - asm_ctx.funcs->dcl_output(&asm_ctx, (yyvsp[-2].declaration).dclusage, (yyvsp[-2].declaration).regnum, ®); - } -#line 2371 "asmshader.tab.c" - break; - - case 55: -#line 586 "asmshader.y" - { - struct shader_reg reg; - TRACE("Input reg declaration\n"); - if((yyvsp[-1].modshift).shift != 0) { - asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - if(asm_ctx.shader->version == BWRITERPS_VERSION(2, 0) || - asm_ctx.shader->version == BWRITERPS_VERSION(2, 1)) { - asmparser_message(&asm_ctx, "Line %u: Declaration not supported in PS 2\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - ZeroMemory(®, sizeof(reg)); - reg.type = (yyvsp[0].reg).type; - reg.regnum = (yyvsp[0].reg).regnum; - reg.rel_reg = NULL; - reg.srcmod = 0; - reg.u.writemask = BWRITERSP_WRITEMASK_ALL; - asm_ctx.funcs->dcl_input(&asm_ctx, (yyvsp[-2].declaration).dclusage, (yyvsp[-2].declaration).regnum, (yyvsp[-1].modshift).mod, ®); - } -#line 2398 "asmshader.tab.c" - break; - - case 56: -#line 609 "asmshader.y" - { - struct shader_reg reg; - TRACE("Input reg declaration\n"); - if((yyvsp[-2].modshift).shift != 0) { - asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - if(asm_ctx.shader->version == BWRITERPS_VERSION(2, 0) || - asm_ctx.shader->version == BWRITERPS_VERSION(2, 1)) { - asmparser_message(&asm_ctx, "Line %u: Declaration not supported in PS 2\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - ZeroMemory(®, sizeof(reg)); - reg.type = (yyvsp[-1].reg).type; - reg.regnum = (yyvsp[-1].reg).regnum; - reg.rel_reg = NULL; - reg.srcmod = 0; - reg.u.writemask = (yyvsp[0].writemask); - asm_ctx.funcs->dcl_input(&asm_ctx, (yyvsp[-3].declaration).dclusage, (yyvsp[-3].declaration).regnum, (yyvsp[-2].modshift).mod, ®); - } -#line 2425 "asmshader.tab.c" - break; - - case 57: -#line 632 "asmshader.y" - { - struct shader_reg reg; - TRACE("Input reg declaration\n"); - if((yyvsp[-1].modshift).shift != 0) { - asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - if(asm_ctx.shader->type != ST_PIXEL) { - asmparser_message(&asm_ctx, "Line %u: Declaration needs a semantic\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - ZeroMemory(®, sizeof(reg)); - reg.type = (yyvsp[0].reg).type; - reg.regnum = (yyvsp[0].reg).regnum; - reg.rel_reg = NULL; - reg.srcmod = 0; - reg.u.writemask = BWRITERSP_WRITEMASK_ALL; - asm_ctx.funcs->dcl_input(&asm_ctx, 0, 0, (yyvsp[-1].modshift).mod, ®); - } -#line 2451 "asmshader.tab.c" - break; - - case 58: -#line 654 "asmshader.y" - { - struct shader_reg reg; - TRACE("Input reg declaration\n"); - if((yyvsp[-2].modshift).shift != 0) { - asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - if(asm_ctx.shader->type != ST_PIXEL) { - asmparser_message(&asm_ctx, "Line %u: Declaration needs a semantic\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - ZeroMemory(®, sizeof(reg)); - reg.type = (yyvsp[-1].reg).type; - reg.regnum = (yyvsp[-1].reg).regnum; - reg.rel_reg = NULL; - reg.srcmod = 0; - reg.u.writemask = (yyvsp[0].writemask); - asm_ctx.funcs->dcl_input(&asm_ctx, 0, 0, (yyvsp[-2].modshift).mod, ®); - } -#line 2477 "asmshader.tab.c" - break; - - case 59: -#line 676 "asmshader.y" - { - TRACE("Sampler declared\n"); - if((yyvsp[-1].modshift).shift != 0) { - asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - asm_ctx.funcs->dcl_sampler(&asm_ctx, (yyvsp[-2].samplertype), (yyvsp[-1].modshift).mod, (yyvsp[0].regnum), asm_ctx.line_no); - } -#line 2491 "asmshader.tab.c" - break; - - case 60: -#line 686 "asmshader.y" - { - TRACE("Sampler declared\n"); - if((yyvsp[-1].modshift).shift != 0) { - asmparser_message(&asm_ctx, "Line %u: Shift modifier not allowed here\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - if(asm_ctx.shader->type != ST_PIXEL) { - asmparser_message(&asm_ctx, "Line %u: Declaration needs a sampler type\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - asm_ctx.funcs->dcl_sampler(&asm_ctx, BWRITERSTT_UNKNOWN, (yyvsp[-1].modshift).mod, (yyvsp[0].regnum), asm_ctx.line_no); - } -#line 2510 "asmshader.tab.c" - break; - - case 61: -#line 701 "asmshader.y" - { - TRACE("Error rule: sampler decl of input reg\n"); - asmparser_message(&asm_ctx, "Line %u: Sampler declarations of input regs is not valid\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 2521 "asmshader.tab.c" - break; - - case 62: -#line 708 "asmshader.y" - { - TRACE("Error rule: sampler decl of output reg\n"); - asmparser_message(&asm_ctx, "Line %u: Sampler declarations of output regs is not valid\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 2532 "asmshader.tab.c" - break; - - case 63: -#line 715 "asmshader.y" - { - asm_ctx.funcs->constF(&asm_ctx, (yyvsp[-8].regnum), (yyvsp[-6].immval).val, (yyvsp[-4].immval).val, (yyvsp[-2].immval).val, (yyvsp[0].immval).val); - } -#line 2540 "asmshader.tab.c" - break; - - case 64: -#line 719 "asmshader.y" - { - asm_ctx.funcs->constI(&asm_ctx, (yyvsp[-8].regnum), (yyvsp[-6].immval).val, (yyvsp[-4].immval).val, (yyvsp[-2].immval).val, (yyvsp[0].immval).val); - } -#line 2548 "asmshader.tab.c" - break; - - case 65: -#line 723 "asmshader.y" - { - asm_ctx.funcs->constB(&asm_ctx, (yyvsp[-2].regnum), (yyvsp[0].immbool)); - } -#line 2556 "asmshader.tab.c" - break; - - case 66: -#line 727 "asmshader.y" - { - TRACE("REP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_REP, 0, 0, 0, 0, &(yyvsp[0].sregs), 1); - } -#line 2565 "asmshader.tab.c" - break; - - case 67: -#line 732 "asmshader.y" - { - TRACE("ENDREP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ENDREP, 0, 0, 0, 0, 0, 0); - } -#line 2574 "asmshader.tab.c" - break; - - case 68: -#line 737 "asmshader.y" - { - TRACE("IF\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_IF, 0, 0, 0, 0, &(yyvsp[0].sregs), 1); - } -#line 2583 "asmshader.tab.c" - break; - - case 69: -#line 742 "asmshader.y" - { - TRACE("IFC\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_IFC, 0, 0, (yyvsp[-1].comptype), 0, &(yyvsp[0].sregs), 2); - } -#line 2592 "asmshader.tab.c" - break; - - case 70: -#line 747 "asmshader.y" - { - TRACE("ELSE\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ELSE, 0, 0, 0, 0, 0, 0); - } -#line 2601 "asmshader.tab.c" - break; - - case 71: -#line 752 "asmshader.y" - { - TRACE("ENDIF\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ENDIF, 0, 0, 0, 0, 0, 0); - } -#line 2610 "asmshader.tab.c" - break; - - case 72: -#line 757 "asmshader.y" - { - TRACE("BREAK\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BREAK, 0, 0, 0, 0, 0, 0); - } -#line 2619 "asmshader.tab.c" - break; - - case 73: -#line 762 "asmshader.y" - { - TRACE("BREAKC\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BREAKC, 0, 0, (yyvsp[-1].comptype), 0, &(yyvsp[0].sregs), 2); - } -#line 2628 "asmshader.tab.c" - break; - - case 74: -#line 767 "asmshader.y" - { - TRACE("BREAKP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BREAKP, 0, 0, 0, 0, &(yyvsp[0].sregs), 1); - } -#line 2637 "asmshader.tab.c" - break; - - case 75: -#line 772 "asmshader.y" - { - TRACE("CALL\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CALL, 0, 0, 0, 0, &(yyvsp[0].sregs), 1); - } -#line 2646 "asmshader.tab.c" - break; - - case 76: -#line 777 "asmshader.y" - { - TRACE("CALLNZ\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CALLNZ, 0, 0, 0, 0, &(yyvsp[0].sregs), 2); - } -#line 2655 "asmshader.tab.c" - break; - - case 77: -#line 782 "asmshader.y" - { - TRACE("LOOP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LOOP, 0, 0, 0, 0, &(yyvsp[0].sregs), 2); - } -#line 2664 "asmshader.tab.c" - break; - - case 78: -#line 787 "asmshader.y" - { - TRACE("RET\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_RET, 0, 0, 0, 0, 0, 0); - } -#line 2673 "asmshader.tab.c" - break; - - case 79: -#line 792 "asmshader.y" - { - TRACE("ENDLOOP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_ENDLOOP, 0, 0, 0, 0, 0, 0); - } -#line 2682 "asmshader.tab.c" - break; - - case 80: -#line 797 "asmshader.y" - { - TRACE("LABEL\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LABEL, 0, 0, 0, 0, &(yyvsp[0].sregs), 1); - } -#line 2691 "asmshader.tab.c" - break; - - case 81: -#line 802 "asmshader.y" - { - TRACE("SETP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_SETP, 0, 0, (yyvsp[-3].comptype), &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2700 "asmshader.tab.c" - break; - - case 82: -#line 807 "asmshader.y" - { - TRACE("TEXLDL\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDL, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2709 "asmshader.tab.c" - break; - - case 83: -#line 812 "asmshader.y" - { - TRACE("LIT\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_LIT, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2718 "asmshader.tab.c" - break; - - case 84: -#line 817 "asmshader.y" - { - TRACE("MOVA\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_MOVA, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2727 "asmshader.tab.c" - break; - - case 85: -#line 822 "asmshader.y" - { - TRACE("CND\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CND, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 3); - } -#line 2736 "asmshader.tab.c" - break; - - case 86: -#line 827 "asmshader.y" - { - TRACE("CMP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_CMP, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 3); - } -#line 2745 "asmshader.tab.c" - break; - - case 87: -#line 832 "asmshader.y" - { - TRACE("DP2ADD\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DP2ADD, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 3); - } -#line 2754 "asmshader.tab.c" - break; - - case 88: -#line 837 "asmshader.y" - { - TRACE("TEXCOORD\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXCOORD, (yyvsp[-1].modshift).mod, (yyvsp[-1].modshift).shift, 0, &(yyvsp[0].reg), 0, 0); - } -#line 2763 "asmshader.tab.c" - break; - - case 89: -#line 842 "asmshader.y" - { - TRACE("TEXCRD\n"); - /* texcoord and texcrd share the same opcode */ - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXCOORD, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2773 "asmshader.tab.c" - break; - - case 90: -#line 848 "asmshader.y" - { - TRACE("TEXKILL\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXKILL, 0, 0, 0, &(yyvsp[0].reg), 0, 0); - } -#line 2782 "asmshader.tab.c" - break; - - case 91: -#line 853 "asmshader.y" - { - TRACE("TEX\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEX, (yyvsp[-1].modshift).mod, (yyvsp[-1].modshift).shift, 0, &(yyvsp[0].reg), 0, 0); - } -#line 2791 "asmshader.tab.c" - break; - - case 92: -#line 858 "asmshader.y" - { - TRACE("TEXDEPTH\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXDEPTH, (yyvsp[-1].modshift).mod, (yyvsp[-1].modshift).shift, 0, &(yyvsp[0].reg), 0, 0); - } -#line 2800 "asmshader.tab.c" - break; - - case 93: -#line 863 "asmshader.y" - { - TRACE("TEXLD\n"); - /* There is more than one acceptable syntax for texld: - with 1 sreg (PS 1.4) or - with 2 sregs (PS 2.0+) - Moreover, texld shares the same opcode as the tex instruction, - so there are a total of 3 valid syntaxes - These variations are handled in asmparser.c */ - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEX, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2815 "asmshader.tab.c" - break; - - case 94: -#line 874 "asmshader.y" - { - TRACE("TEXLDP\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDP, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2824 "asmshader.tab.c" - break; - - case 95: -#line 879 "asmshader.y" - { - TRACE("TEXLDB\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDB, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2833 "asmshader.tab.c" - break; - - case 96: -#line 884 "asmshader.y" - { - TRACE("TEXBEM\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXBEM, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2842 "asmshader.tab.c" - break; - - case 97: -#line 889 "asmshader.y" - { - TRACE("TEXBEML\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXBEML, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2851 "asmshader.tab.c" - break; - - case 98: -#line 894 "asmshader.y" - { - TRACE("TEXREG2AR\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXREG2AR, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2860 "asmshader.tab.c" - break; - - case 99: -#line 899 "asmshader.y" - { - TRACE("TEXREG2GB\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXREG2GB, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2869 "asmshader.tab.c" - break; - - case 100: -#line 904 "asmshader.y" - { - TRACE("TEXREG2RGB\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXREG2RGB, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2878 "asmshader.tab.c" - break; - - case 101: -#line 909 "asmshader.y" - { - TRACE("TEXM3x2PAD\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x2PAD, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2887 "asmshader.tab.c" - break; - - case 102: -#line 914 "asmshader.y" - { - TRACE("INSTR_TEXM3x3PAD\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3PAD, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2896 "asmshader.tab.c" - break; - - case 103: -#line 919 "asmshader.y" - { - TRACE("TEXM3x3SPEC\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3SPEC, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2905 "asmshader.tab.c" - break; - - case 104: -#line 924 "asmshader.y" - { - TRACE("TEXM3x3VSPEC\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3VSPEC, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2914 "asmshader.tab.c" - break; - - case 105: -#line 929 "asmshader.y" - { - TRACE("TEXM3x3TEX\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3TEX, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2923 "asmshader.tab.c" - break; - - case 106: -#line 934 "asmshader.y" - { - TRACE("TEXDP3TEX\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXDP3TEX, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2932 "asmshader.tab.c" - break; - - case 107: -#line 939 "asmshader.y" - { - TRACE("TEXM3x2DEPTH\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x2DEPTH, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2941 "asmshader.tab.c" - break; - - case 108: -#line 944 "asmshader.y" - { - TRACE("TEXM3x2TEX\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x2TEX, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2950 "asmshader.tab.c" - break; - - case 109: -#line 949 "asmshader.y" - { - TRACE("TEXDP3\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXDP3, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2959 "asmshader.tab.c" - break; - - case 110: -#line 954 "asmshader.y" - { - TRACE("TEXM3x3\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXM3x3, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2968 "asmshader.tab.c" - break; - - case 111: -#line 959 "asmshader.y" - { - TRACE("BEM\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_BEM, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 2); - } -#line 2977 "asmshader.tab.c" - break; - - case 112: -#line 964 "asmshader.y" - { - TRACE("DSX\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DSX, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2986 "asmshader.tab.c" - break; - - case 113: -#line 969 "asmshader.y" - { - TRACE("DSY\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_DSY, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 1); - } -#line 2995 "asmshader.tab.c" - break; - - case 114: -#line 974 "asmshader.y" - { - TRACE("TEXLDD\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_TEXLDD, (yyvsp[-3].modshift).mod, (yyvsp[-3].modshift).shift, 0, &(yyvsp[-2].reg), &(yyvsp[0].sregs), 4); - } -#line 3004 "asmshader.tab.c" - break; - - case 115: -#line 979 "asmshader.y" - { - TRACE("PHASE\n"); - asm_ctx.funcs->instr(&asm_ctx, BWRITERSIO_PHASE, 0, 0, 0, 0, 0, 0); - } -#line 3013 "asmshader.tab.c" - break; - - case 116: -#line 986 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[-1].reg).regnum; - (yyval.reg).type = (yyvsp[-1].reg).type; - (yyval.reg).u.writemask = BWRITERSP_WRITEMASK_ALL; - (yyval.reg).srcmod = BWRITERSPSM_NONE; - set_rel_reg(&(yyval.reg), &(yyvsp[0].rel_reg)); - } -#line 3025 "asmshader.tab.c" - break; - - case 117: -#line 994 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[-1].reg).regnum; - (yyval.reg).type = (yyvsp[-1].reg).type; - (yyval.reg).u.writemask = (yyvsp[0].writemask); - (yyval.reg).srcmod = BWRITERSPSM_NONE; - (yyval.reg).rel_reg = NULL; - } -#line 3037 "asmshader.tab.c" - break; - - case 118: -#line 1003 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_TEMP; - } -#line 3045 "asmshader.tab.c" - break; - - case 119: -#line 1007 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_OUTPUT; - } -#line 3053 "asmshader.tab.c" - break; - - case 120: -#line 1011 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_INPUT; - } -#line 3061 "asmshader.tab.c" - break; - - case 121: -#line 1015 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register c%u is not a valid destination register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3071 "asmshader.tab.c" - break; - - case 122: -#line 1021 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register i%u is not a valid destination register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3081 "asmshader.tab.c" - break; - - case 123: -#line 1027 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register b%u is not a valid destination register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3091 "asmshader.tab.c" - break; - - case 124: -#line 1033 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_TEXTURE; - } -#line 3099 "asmshader.tab.c" - break; - - case 125: -#line 1037 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_TEXCRDOUT; - } -#line 3107 "asmshader.tab.c" - break; - - case 126: -#line 1041 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register s%u is not a valid destination register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3117 "asmshader.tab.c" - break; - - case 127: -#line 1047 "asmshader.y" - { - (yyval.reg).regnum = BWRITERSRO_POSITION; (yyval.reg).type = BWRITERSPR_RASTOUT; - } -#line 3125 "asmshader.tab.c" - break; - - case 128: -#line 1051 "asmshader.y" - { - (yyval.reg).regnum = BWRITERSRO_POINT_SIZE; (yyval.reg).type = BWRITERSPR_RASTOUT; - } -#line 3133 "asmshader.tab.c" - break; - - case 129: -#line 1055 "asmshader.y" - { - (yyval.reg).regnum = BWRITERSRO_FOG; (yyval.reg).type = BWRITERSPR_RASTOUT; - } -#line 3141 "asmshader.tab.c" - break; - - case 130: -#line 1059 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_ATTROUT; - } -#line 3149 "asmshader.tab.c" - break; - - case 131: -#line 1063 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_COLOROUT; - } -#line 3157 "asmshader.tab.c" - break; - - case 132: -#line 1067 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_DEPTHOUT; - } -#line 3165 "asmshader.tab.c" - break; - - case 133: -#line 1071 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_PREDICATE; - } -#line 3173 "asmshader.tab.c" - break; - - case 134: -#line 1075 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register vPos is not a valid destination register\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3183 "asmshader.tab.c" - break; - - case 135: -#line 1081 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register vFace is not a valid destination register\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3193 "asmshader.tab.c" - break; - - case 136: -#line 1087 "asmshader.y" - { - /* index 0 is hardcoded for the addr register */ - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_ADDR; - } -#line 3202 "asmshader.tab.c" - break; - - case 137: -#line 1092 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register aL is not a valid destination register\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3212 "asmshader.tab.c" - break; - - case 138: -#line 1099 "asmshader.y" - { - if((yyvsp[0].wm_components).writemask == SWIZZLE_ERR) { - asmparser_message(&asm_ctx, "Line %u: Invalid writemask specified\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - /* Provide a correct writemask to prevent following complaints */ - (yyval.writemask) = BWRITERSP_WRITEMASK_ALL; - } - else { - (yyval.writemask) = (yyvsp[0].wm_components).writemask; - TRACE("Writemask: %x\n", (yyval.writemask)); - } - } -#line 3230 "asmshader.tab.c" - break; - - case 139: -#line 1114 "asmshader.y" - { - (yyval.wm_components).writemask = 1 << (yyvsp[0].component); - (yyval.wm_components).last = (yyvsp[0].component); - (yyval.wm_components).idx = 1; - } -#line 3240 "asmshader.tab.c" - break; - - case 140: -#line 1120 "asmshader.y" - { - if((yyvsp[-1].wm_components).writemask == SWIZZLE_ERR || (yyvsp[-1].wm_components).idx == 4) - /* Wrong writemask */ - (yyval.wm_components).writemask = SWIZZLE_ERR; - else { - if((yyvsp[0].component) <= (yyvsp[-1].wm_components).last) - (yyval.wm_components).writemask = SWIZZLE_ERR; - else { - (yyval.wm_components).writemask = (yyvsp[-1].wm_components).writemask | (1 << (yyvsp[0].component)); - (yyval.wm_components).idx = (yyvsp[-1].wm_components).idx + 1; - } - } - } -#line 3258 "asmshader.tab.c" - break; - - case 141: -#line 1135 "asmshader.y" - { - (yyval.swizzle) = BWRITERVS_NOSWIZZLE; - TRACE("Default swizzle: %08x\n", (yyval.swizzle)); - } -#line 3267 "asmshader.tab.c" - break; - - case 142: -#line 1140 "asmshader.y" - { - if((yyvsp[0].sw_components).swizzle == SWIZZLE_ERR) { - asmparser_message(&asm_ctx, "Line %u: Invalid swizzle\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - /* Provide a correct swizzle to prevent following complaints */ - (yyval.swizzle) = BWRITERVS_NOSWIZZLE; - } - else { - DWORD last, i; - - (yyval.swizzle) = (yyvsp[0].sw_components).swizzle << BWRITERVS_SWIZZLE_SHIFT; - /* Fill the swizzle by extending the last component */ - last = ((yyvsp[0].sw_components).swizzle >> 2 * ((yyvsp[0].sw_components).idx - 1)) & 0x03; - for(i = (yyvsp[0].sw_components).idx; i < 4; i++){ - (yyval.swizzle) |= last << (BWRITERVS_SWIZZLE_SHIFT + 2 * i); - } - TRACE("Got a swizzle: %08x\n", (yyval.swizzle)); - } - } -#line 3292 "asmshader.tab.c" - break; - - case 143: -#line 1162 "asmshader.y" - { - (yyval.sw_components).swizzle = (yyvsp[0].component); - (yyval.sw_components).idx = 1; - } -#line 3301 "asmshader.tab.c" - break; - - case 144: -#line 1167 "asmshader.y" - { - if((yyvsp[-1].sw_components).idx == 4) { - /* Too many sw_components */ - (yyval.sw_components).swizzle = SWIZZLE_ERR; - (yyval.sw_components).idx = 4; - } - else { - (yyval.sw_components).swizzle = (yyvsp[-1].sw_components).swizzle | ((yyvsp[0].component) << 2 * (yyvsp[-1].sw_components).idx); - (yyval.sw_components).idx = (yyvsp[-1].sw_components).idx + 1; - } - } -#line 3317 "asmshader.tab.c" - break; - - case 145: -#line 1180 "asmshader.y" - { - (yyval.modshift).mod = 0; - (yyval.modshift).shift = 0; - } -#line 3326 "asmshader.tab.c" - break; - - case 146: -#line 1185 "asmshader.y" - { - (yyval.modshift).mod = (yyvsp[-1].modshift).mod | (yyvsp[0].modshift).mod; - if((yyvsp[-1].modshift).shift && (yyvsp[0].modshift).shift) { - asmparser_message(&asm_ctx, "Line %u: More than one shift flag\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - (yyval.modshift).shift = (yyvsp[-1].modshift).shift; - } else { - (yyval.modshift).shift = (yyvsp[-1].modshift).shift | (yyvsp[0].modshift).shift; - } - } -#line 3342 "asmshader.tab.c" - break; - - case 147: -#line 1198 "asmshader.y" - { - (yyval.modshift).mod = 0; - (yyval.modshift).shift = 1; - } -#line 3351 "asmshader.tab.c" - break; - - case 148: -#line 1203 "asmshader.y" - { - (yyval.modshift).mod = 0; - (yyval.modshift).shift = 2; - } -#line 3360 "asmshader.tab.c" - break; - - case 149: -#line 1208 "asmshader.y" - { - (yyval.modshift).mod = 0; - (yyval.modshift).shift = 3; - } -#line 3369 "asmshader.tab.c" - break; - - case 150: -#line 1213 "asmshader.y" - { - (yyval.modshift).mod = 0; - (yyval.modshift).shift = 15; - } -#line 3378 "asmshader.tab.c" - break; - - case 151: -#line 1218 "asmshader.y" - { - (yyval.modshift).mod = 0; - (yyval.modshift).shift = 14; - } -#line 3387 "asmshader.tab.c" - break; - - case 152: -#line 1223 "asmshader.y" - { - (yyval.modshift).mod = 0; - (yyval.modshift).shift = 13; - } -#line 3396 "asmshader.tab.c" - break; - - case 153: -#line 1228 "asmshader.y" - { - (yyval.modshift).mod = BWRITERSPDM_SATURATE; - (yyval.modshift).shift = 0; - } -#line 3405 "asmshader.tab.c" - break; - - case 154: -#line 1233 "asmshader.y" - { - (yyval.modshift).mod = BWRITERSPDM_PARTIALPRECISION; - (yyval.modshift).shift = 0; - } -#line 3414 "asmshader.tab.c" - break; - - case 155: -#line 1238 "asmshader.y" - { - (yyval.modshift).mod = BWRITERSPDM_MSAMPCENTROID; - (yyval.modshift).shift = 0; - } -#line 3423 "asmshader.tab.c" - break; - - case 156: -#line 1244 "asmshader.y" - { - (yyval.sregs).reg[0] = (yyvsp[0].reg); - (yyval.sregs).count = 1; - } -#line 3432 "asmshader.tab.c" - break; - - case 157: -#line 1249 "asmshader.y" - { - if((yyval.sregs).count == MAX_SRC_REGS){ - asmparser_message(&asm_ctx, "Line %u: Too many source registers in this instruction\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - else - (yyval.sregs).reg[(yyval.sregs).count++] = (yyvsp[0].reg); - } -#line 3446 "asmshader.tab.c" - break; - - case 158: -#line 1260 "asmshader.y" - { - (yyval.reg).type = (yyvsp[-2].reg).type; - (yyval.reg).regnum = (yyvsp[-2].reg).regnum; - (yyval.reg).u.swizzle = (yyvsp[0].swizzle); - (yyval.reg).srcmod = BWRITERSPSM_NONE; - set_rel_reg(&(yyval.reg), &(yyvsp[-1].rel_reg)); - } -#line 3458 "asmshader.tab.c" - break; - - case 159: -#line 1268 "asmshader.y" - { - (yyval.reg).type = (yyvsp[-3].reg).type; - (yyval.reg).regnum = (yyvsp[-3].reg).regnum; - set_rel_reg(&(yyval.reg), &(yyvsp[-2].rel_reg)); - (yyval.reg).srcmod = (yyvsp[-1].srcmod); - (yyval.reg).u.swizzle = (yyvsp[0].swizzle); - } -#line 3470 "asmshader.tab.c" - break; - - case 160: -#line 1276 "asmshader.y" - { - (yyval.reg).type = (yyvsp[-2].reg).type; - (yyval.reg).regnum = (yyvsp[-2].reg).regnum; - (yyval.reg).srcmod = BWRITERSPSM_NEG; - set_rel_reg(&(yyval.reg), &(yyvsp[-1].rel_reg)); - (yyval.reg).u.swizzle = (yyvsp[0].swizzle); - } -#line 3482 "asmshader.tab.c" - break; - - case 161: -#line 1284 "asmshader.y" - { - (yyval.reg).type = (yyvsp[-3].reg).type; - (yyval.reg).regnum = (yyvsp[-3].reg).regnum; - set_rel_reg(&(yyval.reg), &(yyvsp[-2].rel_reg)); - switch((yyvsp[-1].srcmod)) { - case BWRITERSPSM_BIAS: (yyval.reg).srcmod = BWRITERSPSM_BIASNEG; break; - case BWRITERSPSM_X2: (yyval.reg).srcmod = BWRITERSPSM_X2NEG; break; - case BWRITERSPSM_SIGN: (yyval.reg).srcmod = BWRITERSPSM_SIGNNEG; break; - case BWRITERSPSM_ABS: (yyval.reg).srcmod = BWRITERSPSM_ABSNEG; break; - case BWRITERSPSM_DZ: - asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: NEG and DZ\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - break; - case BWRITERSPSM_DW: - asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: NEG and DW\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - break; - default: - FIXME("Unhandled combination of NEGATE and %u\n", (yyvsp[-1].srcmod)); - } - (yyval.reg).u.swizzle = (yyvsp[0].swizzle); - } -#line 3511 "asmshader.tab.c" - break; - - case 162: -#line 1309 "asmshader.y" - { - if((yyvsp[-4].immval).val != 1.0 || (!(yyvsp[-4].immval).integer)) { - asmparser_message(&asm_ctx, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP, " - "%g - reg found\n", asm_ctx.line_no, (yyvsp[-4].immval).val); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - /* Complement - not compatible with other source modifiers */ - (yyval.reg).type = (yyvsp[-2].reg).type; - (yyval.reg).regnum = (yyvsp[-2].reg).regnum; - (yyval.reg).srcmod = BWRITERSPSM_COMP; - set_rel_reg(&(yyval.reg), &(yyvsp[-1].rel_reg)); - (yyval.reg).u.swizzle = (yyvsp[0].swizzle); - } -#line 3529 "asmshader.tab.c" - break; - - case 163: -#line 1323 "asmshader.y" - { - /* For nicer error reporting */ - if((yyvsp[-5].immval).val != 1.0 || (!(yyvsp[-5].immval).integer)) { - asmparser_message(&asm_ctx, "Line %u: Only \"1 - reg\" is valid for D3DSPSM_COMP\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } else { - asmparser_message(&asm_ctx, "Line %u: Incompatible source modifiers: D3DSPSM_COMP and %s\n", - asm_ctx.line_no, - debug_print_srcmod((yyvsp[-1].srcmod))); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - } -#line 3547 "asmshader.tab.c" - break; - - case 164: -#line 1337 "asmshader.y" - { - (yyval.reg).type = (yyvsp[-1].reg).type; - (yyval.reg).regnum = (yyvsp[-1].reg).regnum; - (yyval.reg).rel_reg = NULL; - (yyval.reg).srcmod = BWRITERSPSM_NOT; - (yyval.reg).u.swizzle = (yyvsp[0].swizzle); - } -#line 3559 "asmshader.tab.c" - break; - - case 165: -#line 1346 "asmshader.y" - { - (yyval.rel_reg).has_rel_reg = FALSE; - (yyval.rel_reg).additional_offset = 0; - } -#line 3568 "asmshader.tab.c" - break; - - case 166: -#line 1351 "asmshader.y" - { - (yyval.rel_reg).has_rel_reg = FALSE; - (yyval.rel_reg).additional_offset = (yyvsp[-1].immval).val; - } -#line 3577 "asmshader.tab.c" - break; - - case 167: -#line 1356 "asmshader.y" - { - (yyval.rel_reg).has_rel_reg = TRUE; - (yyval.rel_reg).type = (yyvsp[-2].reg).type; - (yyval.rel_reg).additional_offset = 0; - (yyval.rel_reg).rel_regnum = (yyvsp[-2].reg).regnum; - (yyval.rel_reg).swizzle = (yyvsp[-1].swizzle); - } -#line 3589 "asmshader.tab.c" - break; - - case 168: -#line 1364 "asmshader.y" - { - (yyval.rel_reg).has_rel_reg = TRUE; - (yyval.rel_reg).type = (yyvsp[-2].reg).type; - (yyval.rel_reg).additional_offset = (yyvsp[-4].immval).val; - (yyval.rel_reg).rel_regnum = (yyvsp[-2].reg).regnum; - (yyval.rel_reg).swizzle = (yyvsp[-1].swizzle); - } -#line 3601 "asmshader.tab.c" - break; - - case 169: -#line 1372 "asmshader.y" - { - (yyval.rel_reg).has_rel_reg = TRUE; - (yyval.rel_reg).type = (yyvsp[-4].reg).type; - (yyval.rel_reg).additional_offset = (yyvsp[-1].immval).val; - (yyval.rel_reg).rel_regnum = (yyvsp[-4].reg).regnum; - (yyval.rel_reg).swizzle = (yyvsp[-3].swizzle); - } -#line 3613 "asmshader.tab.c" - break; - - case 170: -#line 1380 "asmshader.y" - { - (yyval.rel_reg).has_rel_reg = TRUE; - (yyval.rel_reg).type = (yyvsp[-4].reg).type; - (yyval.rel_reg).additional_offset = (yyvsp[-6].immval).val + (yyvsp[-1].immval).val; - (yyval.rel_reg).rel_regnum = (yyvsp[-4].reg).regnum; - (yyval.rel_reg).swizzle = (yyvsp[-3].swizzle); - } -#line 3625 "asmshader.tab.c" - break; - - case 171: -#line 1389 "asmshader.y" - { - if(!(yyvsp[0].immval).integer) { - asmparser_message(&asm_ctx, "Line %u: Unexpected float %f\n", - asm_ctx.line_no, (yyvsp[0].immval).val); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - (yyval.immval).val = (yyvsp[0].immval).val; - } -#line 3638 "asmshader.tab.c" - break; - - case 172: -#line 1398 "asmshader.y" - { - if(!(yyvsp[0].immval).integer) { - asmparser_message(&asm_ctx, "Line %u: Unexpected float %f\n", - asm_ctx.line_no, (yyvsp[0].immval).val); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - (yyval.immval).val = (yyvsp[-2].immval).val + (yyvsp[0].immval).val; - } -#line 3651 "asmshader.tab.c" - break; - - case 173: -#line 1408 "asmshader.y" - { - (yyval.srcmod) = BWRITERSPSM_BIAS; - } -#line 3659 "asmshader.tab.c" - break; - - case 174: -#line 1412 "asmshader.y" - { - (yyval.srcmod) = BWRITERSPSM_X2; - } -#line 3667 "asmshader.tab.c" - break; - - case 175: -#line 1416 "asmshader.y" - { - (yyval.srcmod) = BWRITERSPSM_SIGN; - } -#line 3675 "asmshader.tab.c" - break; - - case 176: -#line 1420 "asmshader.y" - { - (yyval.srcmod) = BWRITERSPSM_DZ; - } -#line 3683 "asmshader.tab.c" - break; - - case 177: -#line 1424 "asmshader.y" - { - (yyval.srcmod) = BWRITERSPSM_DW; - } -#line 3691 "asmshader.tab.c" - break; - - case 178: -#line 1428 "asmshader.y" - { - (yyval.srcmod) = BWRITERSPSM_ABS; - } -#line 3699 "asmshader.tab.c" - break; - - case 179: -#line 1433 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_ADDR; - } -#line 3707 "asmshader.tab.c" - break; - - case 180: -#line 1437 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_LOOP; - } -#line 3715 "asmshader.tab.c" - break; - - case 181: -#line 1442 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_TEMP; - } -#line 3723 "asmshader.tab.c" - break; - - case 182: -#line 1446 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register o%u is not a valid source register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3733 "asmshader.tab.c" - break; - - case 183: -#line 1452 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_INPUT; - } -#line 3741 "asmshader.tab.c" - break; - - case 184: -#line 1456 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_CONST; - } -#line 3749 "asmshader.tab.c" - break; - - case 185: -#line 1460 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_CONSTINT; - } -#line 3757 "asmshader.tab.c" - break; - - case 186: -#line 1464 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_CONSTBOOL; - } -#line 3765 "asmshader.tab.c" - break; - - case 187: -#line 1468 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_TEXTURE; - } -#line 3773 "asmshader.tab.c" - break; - - case 188: -#line 1472 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register oT%u is not a valid source register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3783 "asmshader.tab.c" - break; - - case 189: -#line 1478 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_SAMPLER; - } -#line 3791 "asmshader.tab.c" - break; - - case 190: -#line 1482 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register oPos is not a valid source register\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3801 "asmshader.tab.c" - break; - - case 191: -#line 1488 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register oFog is not a valid source register\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3811 "asmshader.tab.c" - break; - - case 192: -#line 1494 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register oD%u is not a valid source register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3821 "asmshader.tab.c" - break; - - case 193: -#line 1500 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register oC%u is not a valid source register\n", - asm_ctx.line_no, (yyvsp[0].regnum)); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3831 "asmshader.tab.c" - break; - - case 194: -#line 1506 "asmshader.y" - { - asmparser_message(&asm_ctx, "Line %u: Register oDepth is not a valid source register\n", - asm_ctx.line_no); - set_parse_status(&asm_ctx.status, PARSE_WARN); - } -#line 3841 "asmshader.tab.c" - break; - - case 195: -#line 1512 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_PREDICATE; - } -#line 3849 "asmshader.tab.c" - break; - - case 196: -#line 1516 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_MISCTYPE; - } -#line 3857 "asmshader.tab.c" - break; - - case 197: -#line 1520 "asmshader.y" - { - (yyval.reg).regnum = 1; (yyval.reg).type = BWRITERSPR_MISCTYPE; - } -#line 3865 "asmshader.tab.c" - break; - - case 198: -#line 1524 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_ADDR; - } -#line 3873 "asmshader.tab.c" - break; - - case 199: -#line 1528 "asmshader.y" - { - (yyval.reg).regnum = 0; (yyval.reg).type = BWRITERSPR_LOOP; - } -#line 3881 "asmshader.tab.c" - break; - - case 200: -#line 1532 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_LABEL; - } -#line 3889 "asmshader.tab.c" - break; - - case 201: -#line 1536 "asmshader.y" - { (yyval.comptype) = BWRITER_COMPARISON_GT; } -#line 3895 "asmshader.tab.c" - break; - - case 202: -#line 1537 "asmshader.y" - { (yyval.comptype) = BWRITER_COMPARISON_LT; } -#line 3901 "asmshader.tab.c" - break; - - case 203: -#line 1538 "asmshader.y" - { (yyval.comptype) = BWRITER_COMPARISON_GE; } -#line 3907 "asmshader.tab.c" - break; - - case 204: -#line 1539 "asmshader.y" - { (yyval.comptype) = BWRITER_COMPARISON_LE; } -#line 3913 "asmshader.tab.c" - break; - - case 205: -#line 1540 "asmshader.y" - { (yyval.comptype) = BWRITER_COMPARISON_EQ; } -#line 3919 "asmshader.tab.c" - break; - - case 206: -#line 1541 "asmshader.y" - { (yyval.comptype) = BWRITER_COMPARISON_NE; } -#line 3925 "asmshader.tab.c" - break; - - case 207: -#line 1544 "asmshader.y" - { - TRACE("dcl_position%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_POSITION; - } -#line 3935 "asmshader.tab.c" - break; - - case 208: -#line 1550 "asmshader.y" - { - TRACE("dcl_blendweight%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_BLENDWEIGHT; - } -#line 3945 "asmshader.tab.c" - break; - - case 209: -#line 1556 "asmshader.y" - { - TRACE("dcl_blendindices%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_BLENDINDICES; - } -#line 3955 "asmshader.tab.c" - break; - - case 210: -#line 1562 "asmshader.y" - { - TRACE("dcl_normal%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_NORMAL; - } -#line 3965 "asmshader.tab.c" - break; - - case 211: -#line 1568 "asmshader.y" - { - TRACE("dcl_psize%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_PSIZE; - } -#line 3975 "asmshader.tab.c" - break; - - case 212: -#line 1574 "asmshader.y" - { - TRACE("dcl_texcoord%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_TEXCOORD; - } -#line 3985 "asmshader.tab.c" - break; - - case 213: -#line 1580 "asmshader.y" - { - TRACE("dcl_tangent%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_TANGENT; - } -#line 3995 "asmshader.tab.c" - break; - - case 214: -#line 1586 "asmshader.y" - { - TRACE("dcl_binormal%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_BINORMAL; - } -#line 4005 "asmshader.tab.c" - break; - - case 215: -#line 1592 "asmshader.y" - { - TRACE("dcl_tessfactor%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_TESSFACTOR; - } -#line 4015 "asmshader.tab.c" - break; - - case 216: -#line 1598 "asmshader.y" - { - TRACE("dcl_positiont%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_POSITIONT; - } -#line 4025 "asmshader.tab.c" - break; - - case 217: -#line 1604 "asmshader.y" - { - TRACE("dcl_color%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_COLOR; - } -#line 4035 "asmshader.tab.c" - break; - - case 218: -#line 1610 "asmshader.y" - { - TRACE("dcl_fog%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_FOG; - } -#line 4045 "asmshader.tab.c" - break; - - case 219: -#line 1616 "asmshader.y" - { - TRACE("dcl_depth%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_DEPTH; - } -#line 4055 "asmshader.tab.c" - break; - - case 220: -#line 1622 "asmshader.y" - { - TRACE("dcl_sample%u\n", (yyvsp[0].regnum)); - (yyval.declaration).regnum = (yyvsp[0].regnum); - (yyval.declaration).dclusage = BWRITERDECLUSAGE_SAMPLE; - } -#line 4065 "asmshader.tab.c" - break; - - case 221: -#line 1629 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_INPUT; - } -#line 4073 "asmshader.tab.c" - break; - - case 222: -#line 1633 "asmshader.y" - { - (yyval.reg).regnum = (yyvsp[0].regnum); (yyval.reg).type = BWRITERSPR_TEXTURE; - } -#line 4081 "asmshader.tab.c" - break; - - case 223: -#line 1638 "asmshader.y" - { - (yyval.samplertype) = BWRITERSTT_1D; - } -#line 4089 "asmshader.tab.c" - break; - - case 224: -#line 1642 "asmshader.y" - { - (yyval.samplertype) = BWRITERSTT_2D; - } -#line 4097 "asmshader.tab.c" - break; - - case 225: -#line 1646 "asmshader.y" - { - (yyval.samplertype) = BWRITERSTT_CUBE; - } -#line 4105 "asmshader.tab.c" - break; - - case 226: -#line 1650 "asmshader.y" - { - (yyval.samplertype) = BWRITERSTT_VOLUME; - } -#line 4113 "asmshader.tab.c" - break; - - case 227: -#line 1655 "asmshader.y" - { - (yyval.reg).type = BWRITERSPR_PREDICATE; - (yyval.reg).regnum = 0; - (yyval.reg).rel_reg = NULL; - (yyval.reg).srcmod = BWRITERSPSM_NONE; - (yyval.reg).u.swizzle = (yyvsp[-1].swizzle); - } -#line 4125 "asmshader.tab.c" - break; - - case 228: -#line 1663 "asmshader.y" - { - (yyval.reg).type = BWRITERSPR_PREDICATE; - (yyval.reg).regnum = 0; - (yyval.reg).rel_reg = NULL; - (yyval.reg).srcmod = BWRITERSPSM_NOT; - (yyval.reg).u.swizzle = (yyvsp[-1].swizzle); - } -#line 4137 "asmshader.tab.c" - break; - - -#line 4141 "asmshader.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 1671 "asmshader.y" - - -struct bwriter_shader *parse_asm_shader(char **messages) -{ - struct bwriter_shader *ret = NULL; - - asm_ctx.shader = NULL; - asm_ctx.status = PARSE_SUCCESS; - asm_ctx.messages.size = asm_ctx.messages.capacity = 0; - asm_ctx.line_no = 1; - - asmshader_parse(); - - if (asm_ctx.status != PARSE_ERR) - ret = asm_ctx.shader; - else if (asm_ctx.shader) - SlDeleteShader(asm_ctx.shader); - - if (messages) - { - if (asm_ctx.messages.size) - { - /* Shrink the buffer to the used size */ - *messages = d3dcompiler_realloc(asm_ctx.messages.string, asm_ctx.messages.size + 1); - if (!*messages) - { - ERR("Out of memory, no messages reported\n"); - d3dcompiler_free(asm_ctx.messages.string); - } - } - else - { - *messages = NULL; - } - } - else - { - if (asm_ctx.messages.capacity) - d3dcompiler_free(asm_ctx.messages.string); - } - - return ret; -} diff --git a/dll/directx/wine/d3dcompiler_43/asmshader.tab.h b/dll/directx/wine/d3dcompiler_43/asmshader.tab.h deleted file mode 100644 index 58408c95844..00000000000 --- a/dll/directx/wine/d3dcompiler_43/asmshader.tab.h +++ /dev/null @@ -1,267 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_ASMSHADER_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_ASMSHADER_TAB_H_INCLUDED -# define YY_ASMSHADER_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_ASMSHADER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int asmshader_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - INSTR_ADD = 258, - INSTR_NOP = 259, - INSTR_MOV = 260, - INSTR_SUB = 261, - INSTR_MAD = 262, - INSTR_MUL = 263, - INSTR_RCP = 264, - INSTR_RSQ = 265, - INSTR_DP3 = 266, - INSTR_DP4 = 267, - INSTR_MIN = 268, - INSTR_MAX = 269, - INSTR_SLT = 270, - INSTR_SGE = 271, - INSTR_ABS = 272, - INSTR_EXP = 273, - INSTR_LOG = 274, - INSTR_EXPP = 275, - INSTR_LOGP = 276, - INSTR_DST = 277, - INSTR_LRP = 278, - INSTR_FRC = 279, - INSTR_POW = 280, - INSTR_CRS = 281, - INSTR_SGN = 282, - INSTR_NRM = 283, - INSTR_SINCOS = 284, - INSTR_M4x4 = 285, - INSTR_M4x3 = 286, - INSTR_M3x4 = 287, - INSTR_M3x3 = 288, - INSTR_M3x2 = 289, - INSTR_DCL = 290, - INSTR_DEF = 291, - INSTR_DEFB = 292, - INSTR_DEFI = 293, - INSTR_REP = 294, - INSTR_ENDREP = 295, - INSTR_IF = 296, - INSTR_ELSE = 297, - INSTR_ENDIF = 298, - INSTR_BREAK = 299, - INSTR_BREAKP = 300, - INSTR_CALL = 301, - INSTR_CALLNZ = 302, - INSTR_LOOP = 303, - INSTR_RET = 304, - INSTR_ENDLOOP = 305, - INSTR_LABEL = 306, - INSTR_SETP = 307, - INSTR_TEXLDL = 308, - INSTR_LIT = 309, - INSTR_MOVA = 310, - INSTR_CND = 311, - INSTR_CMP = 312, - INSTR_DP2ADD = 313, - INSTR_TEXCOORD = 314, - INSTR_TEXCRD = 315, - INSTR_TEXKILL = 316, - INSTR_TEX = 317, - INSTR_TEXLD = 318, - INSTR_TEXBEM = 319, - INSTR_TEXBEML = 320, - INSTR_TEXREG2AR = 321, - INSTR_TEXREG2GB = 322, - INSTR_TEXREG2RGB = 323, - INSTR_TEXM3x2PAD = 324, - INSTR_TEXM3x2TEX = 325, - INSTR_TEXM3x3PAD = 326, - INSTR_TEXM3x3SPEC = 327, - INSTR_TEXM3x3VSPEC = 328, - INSTR_TEXM3x3TEX = 329, - INSTR_TEXDP3TEX = 330, - INSTR_TEXM3x2DEPTH = 331, - INSTR_TEXDP3 = 332, - INSTR_TEXM3x3 = 333, - INSTR_TEXDEPTH = 334, - INSTR_BEM = 335, - INSTR_DSX = 336, - INSTR_DSY = 337, - INSTR_TEXLDP = 338, - INSTR_TEXLDB = 339, - INSTR_TEXLDD = 340, - INSTR_PHASE = 341, - REG_TEMP = 342, - REG_OUTPUT = 343, - REG_INPUT = 344, - REG_CONSTFLOAT = 345, - REG_CONSTINT = 346, - REG_CONSTBOOL = 347, - REG_TEXTURE = 348, - REG_SAMPLER = 349, - REG_TEXCRDOUT = 350, - REG_OPOS = 351, - REG_OFOG = 352, - REG_OPTS = 353, - REG_VERTEXCOLOR = 354, - REG_FRAGCOLOR = 355, - REG_FRAGDEPTH = 356, - REG_VPOS = 357, - REG_VFACE = 358, - REG_ADDRESS = 359, - REG_LOOP = 360, - REG_PREDICATE = 361, - REG_LABEL = 362, - VER_VS10 = 363, - VER_VS11 = 364, - VER_VS20 = 365, - VER_VS2X = 366, - VER_VS30 = 367, - VER_PS10 = 368, - VER_PS11 = 369, - VER_PS12 = 370, - VER_PS13 = 371, - VER_PS14 = 372, - VER_PS20 = 373, - VER_PS2X = 374, - VER_PS30 = 375, - SHIFT_X2 = 376, - SHIFT_X4 = 377, - SHIFT_X8 = 378, - SHIFT_D2 = 379, - SHIFT_D4 = 380, - SHIFT_D8 = 381, - MOD_SAT = 382, - MOD_PP = 383, - MOD_CENTROID = 384, - COMP_GT = 385, - COMP_LT = 386, - COMP_GE = 387, - COMP_LE = 388, - COMP_EQ = 389, - COMP_NE = 390, - SMOD_BIAS = 391, - SMOD_SCALEBIAS = 392, - SMOD_DZ = 393, - SMOD_DW = 394, - SMOD_ABS = 395, - SMOD_NOT = 396, - SAMPTYPE_1D = 397, - SAMPTYPE_2D = 398, - SAMPTYPE_CUBE = 399, - SAMPTYPE_VOLUME = 400, - USAGE_POSITION = 401, - USAGE_BLENDWEIGHT = 402, - USAGE_BLENDINDICES = 403, - USAGE_NORMAL = 404, - USAGE_PSIZE = 405, - USAGE_TEXCOORD = 406, - USAGE_TANGENT = 407, - USAGE_BINORMAL = 408, - USAGE_TESSFACTOR = 409, - USAGE_POSITIONT = 410, - USAGE_COLOR = 411, - USAGE_FOG = 412, - USAGE_DEPTH = 413, - USAGE_SAMPLE = 414, - COMPONENT = 415, - IMMVAL = 416, - IMMBOOL = 417 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 68 "asmshader.y" - - struct { - float val; - BOOL integer; - } immval; - BOOL immbool; - unsigned int regnum; - struct shader_reg reg; - DWORD srcmod; - DWORD writemask; - struct { - DWORD writemask; - DWORD idx; - DWORD last; - } wm_components; - DWORD swizzle; - struct { - DWORD swizzle; - DWORD idx; - } sw_components; - DWORD component; - struct { - DWORD mod; - DWORD shift; - } modshift; - enum bwriter_comparison_type comptype; - struct { - DWORD dclusage; - unsigned int regnum; - } declaration; - enum bwritersampler_texture_type samplertype; - struct rel_reg rel_reg; - struct src_regs sregs; - -#line 255 "asmshader.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE asmshader_lval; - -int asmshader_parse (void); - -#endif /* !YY_ASMSHADER_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_ASMSHADER_TAB_H_INCLUDED */ diff --git a/dll/directx/wine/d3dcompiler_43/asmshader.yy.c b/dll/directx/wine/d3dcompiler_43/asmshader.yy.c deleted file mode 100644 index bf9ca37e361..00000000000 --- a/dll/directx/wine/d3dcompiler_43/asmshader.yy.c +++ /dev/null @@ -1,3420 +0,0 @@ -#line 1 "asmshader.yy.c" - -#line 3 "asmshader.yy.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer asmshader__create_buffer -#define yy_delete_buffer asmshader__delete_buffer -#define yy_scan_buffer asmshader__scan_buffer -#define yy_scan_string asmshader__scan_string -#define yy_scan_bytes asmshader__scan_bytes -#define yy_init_buffer asmshader__init_buffer -#define yy_flush_buffer asmshader__flush_buffer -#define yy_load_buffer_state asmshader__load_buffer_state -#define yy_switch_to_buffer asmshader__switch_to_buffer -#define yypush_buffer_state asmshader_push_buffer_state -#define yypop_buffer_state asmshader_pop_buffer_state -#define yyensure_buffer_stack asmshader_ensure_buffer_stack -#define yy_flex_debug asmshader__flex_debug -#define yyin asmshader_in -#define yyleng asmshader_leng -#define yylex asmshader_lex -#define yylineno asmshader_lineno -#define yyout asmshader_out -#define yyrestart asmshader_restart -#define yytext asmshader_text -#define yywrap asmshader_wrap -#define yyalloc asmshader_alloc -#define yyrealloc asmshader_realloc -#define yyfree asmshader_free - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define asmshader__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer asmshader__create_buffer -#endif - -#ifdef yy_delete_buffer -#define asmshader__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer asmshader__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define asmshader__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer asmshader__scan_buffer -#endif - -#ifdef yy_scan_string -#define asmshader__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string asmshader__scan_string -#endif - -#ifdef yy_scan_bytes -#define asmshader__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes asmshader__scan_bytes -#endif - -#ifdef yy_init_buffer -#define asmshader__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer asmshader__init_buffer -#endif - -#ifdef yy_flush_buffer -#define asmshader__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer asmshader__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define asmshader__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state asmshader__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define asmshader__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer asmshader__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define asmshader_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state asmshader_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define asmshader_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state asmshader_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define asmshader_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack asmshader_ensure_buffer_stack -#endif - -#ifdef yylex -#define asmshader_lex_ALREADY_DEFINED -#else -#define yylex asmshader_lex -#endif - -#ifdef yyrestart -#define asmshader_restart_ALREADY_DEFINED -#else -#define yyrestart asmshader_restart -#endif - -#ifdef yylex_init -#define asmshader_lex_init_ALREADY_DEFINED -#else -#define yylex_init asmshader_lex_init -#endif - -#ifdef yylex_init_extra -#define asmshader_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra asmshader_lex_init_extra -#endif - -#ifdef yylex_destroy -#define asmshader_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy asmshader_lex_destroy -#endif - -#ifdef yyget_debug -#define asmshader_get_debug_ALREADY_DEFINED -#else -#define yyget_debug asmshader_get_debug -#endif - -#ifdef yyset_debug -#define asmshader_set_debug_ALREADY_DEFINED -#else -#define yyset_debug asmshader_set_debug -#endif - -#ifdef yyget_extra -#define asmshader_get_extra_ALREADY_DEFINED -#else -#define yyget_extra asmshader_get_extra -#endif - -#ifdef yyset_extra -#define asmshader_set_extra_ALREADY_DEFINED -#else -#define yyset_extra asmshader_set_extra -#endif - -#ifdef yyget_in -#define asmshader_get_in_ALREADY_DEFINED -#else -#define yyget_in asmshader_get_in -#endif - -#ifdef yyset_in -#define asmshader_set_in_ALREADY_DEFINED -#else -#define yyset_in asmshader_set_in -#endif - -#ifdef yyget_out -#define asmshader_get_out_ALREADY_DEFINED -#else -#define yyget_out asmshader_get_out -#endif - -#ifdef yyset_out -#define asmshader_set_out_ALREADY_DEFINED -#else -#define yyset_out asmshader_set_out -#endif - -#ifdef yyget_leng -#define asmshader_get_leng_ALREADY_DEFINED -#else -#define yyget_leng asmshader_get_leng -#endif - -#ifdef yyget_text -#define asmshader_get_text_ALREADY_DEFINED -#else -#define yyget_text asmshader_get_text -#endif - -#ifdef yyget_lineno -#define asmshader_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno asmshader_get_lineno -#endif - -#ifdef yyset_lineno -#define asmshader_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno asmshader_set_lineno -#endif - -#ifdef yywrap -#define asmshader_wrap_ALREADY_DEFINED -#else -#define yywrap asmshader_wrap -#endif - -#ifdef yyalloc -#define asmshader_alloc_ALREADY_DEFINED -#else -#define yyalloc asmshader_alloc -#endif - -#ifdef yyrealloc -#define asmshader_realloc_ALREADY_DEFINED -#else -#define yyrealloc asmshader_realloc -#endif - -#ifdef yyfree -#define asmshader_free_ALREADY_DEFINED -#else -#define yyfree asmshader_free -#endif - -#ifdef yytext -#define asmshader_text_ALREADY_DEFINED -#else -#define yytext asmshader_text -#endif - -#ifdef yyleng -#define asmshader_leng_ALREADY_DEFINED -#else -#define yyleng asmshader_leng -#endif - -#ifdef yyin -#define asmshader_in_ALREADY_DEFINED -#else -#define yyin asmshader_in -#endif - -#ifdef yyout -#define asmshader_out_ALREADY_DEFINED -#else -#define yyout asmshader_out -#endif - -#ifdef yy_flex_debug -#define asmshader__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug asmshader__flex_debug -#endif - -#ifdef yylineno -#define asmshader_lineno_ALREADY_DEFINED -#else -#define yylineno asmshader_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define asmshader_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -extern int yylineno; -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 174 -#define YY_END_OF_BUFFER 175 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[481] = - { 0, - 0, 0, 175, 173, 171, 172, 173, 149, 173, 141, - 142, 143, 139, 140, 119, 173, 136, 170, 173, 120, - 120, 88, 173, 173, 173, 120, 173, 173, 173, 173, - 86, 173, 120, 173, 173, 87, 171, 172, 0, 168, - 0, 136, 136, 169, 136, 136, 170, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 102, 103, 0, 0, 90, 0, 0, - 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 89, 39, 105, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, - - 0, 0, 0, 0, 0, 104, 0, 0, 0, 85, - 0, 0, 0, 93, 0, 0, 0, 0, 0, 91, - 0, 0, 87, 0, 0, 0, 169, 164, 165, 0, - 0, 0, 0, 0, 0, 0, 124, 125, 126, 0, - 147, 146, 134, 0, 132, 130, 133, 131, 135, 0, - 0, 128, 0, 0, 0, 0, 0, 121, 122, 123, - 15, 1, 78, 0, 0, 55, 54, 24, 33, 34, - 0, 9, 10, 20, 79, 80, 0, 0, 16, 0, - 22, 0, 52, 17, 0, 21, 0, 0, 5, 12, - 11, 3, 6, 2, 26, 98, 97, 0, 0, 0, - - 0, 92, 0, 23, 0, 0, 7, 37, 47, 8, - 0, 14, 25, 0, 13, 4, 60, 0, 0, 0, - 0, 0, 148, 0, 0, 0, 145, 0, 0, 0, - 0, 161, 0, 0, 0, 0, 127, 0, 0, 0, - 0, 0, 44, 35, 36, 0, 40, 0, 0, 0, - 18, 0, 0, 19, 46, 32, 31, 30, 29, 28, - 53, 0, 95, 94, 96, 0, 0, 0, 0, 0, - 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, - 0, 137, 0, 100, 0, 0, 0, 0, 0, 0, - 144, 0, 0, 0, 0, 166, 0, 161, 0, 0, - - 0, 0, 0, 0, 0, 0, 42, 0, 0, 41, - 0, 0, 138, 49, 0, 84, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, - 0, 0, 101, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 160, 162, 0, 0, 154, 0, 0, 0, - 0, 0, 43, 45, 56, 0, 38, 99, 111, 112, - 113, 114, 115, 116, 117, 118, 27, 62, 0, 58, - 0, 75, 0, 82, 83, 51, 81, 0, 0, 106, - 107, 108, 109, 110, 0, 0, 0, 0, 160, 162, - 153, 0, 154, 163, 0, 0, 0, 167, 48, 63, - - 0, 0, 0, 59, 0, 76, 0, 0, 0, 0, - 0, 153, 0, 163, 156, 0, 0, 57, 77, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 157, 0, 0, 129, 150, 156, 0, 155, 73, 0, - 0, 0, 0, 0, 0, 0, 64, 65, 0, 157, - 0, 0, 150, 159, 0, 155, 0, 67, 68, 69, - 0, 72, 0, 66, 0, 0, 159, 158, 0, 70, - 0, 0, 151, 158, 74, 71, 152, 151, 152, 0 - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 5, 1, 6, 1, 1, 1, 1, 7, - 8, 1, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 19, 19, 20, 19, 1, 21, 1, - 1, 1, 1, 1, 1, 1, 22, 23, 1, 24, - 1, 1, 1, 1, 1, 25, 1, 1, 1, 26, - 1, 1, 1, 27, 1, 1, 1, 1, 1, 1, - 28, 1, 29, 1, 30, 1, 31, 32, 33, 34, - - 35, 36, 37, 38, 39, 1, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[56] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 1, 4, 4, 4, 4, 4, 4, 4, - 1, 1, 1, 5, 1, 5, 1, 1, 1, 1, - 6, 1, 7, 1, 8, 3, 1, 1, 9, 1, - 1, 10, 10, 9, 1, 1, 11, 12, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const flex_int16_t yy_base[491] = - { 0, - 0, 0, 889, 890, 886, 890, 884, 890, 883, 890, - 890, 890, 890, 44, 51, 872, 45, 0, 67, 59, - 39, 45, 61, 36, 64, 890, 107, 97, 114, 28, - 151, 91, 107, 165, 43, 124, 882, 890, 880, 890, - 172, 101, 193, 0, 202, 890, 0, 848, 847, 848, - 108, 189, 179, 833, 834, 84, 103, 116, 182, 846, - 99, 832, 178, 890, 890, 827, 840, 226, 831, 837, - 233, 830, 825, 835, 820, 826, 830, 219, 205, 817, - 830, 818, 821, 828, 246, 890, 253, 828, 810, 70, - 813, 804, 803, 123, 812, 803, 812, 807, 809, 260, - - 267, 274, 806, 36, 276, 890, 818, 796, 193, 283, - 802, 114, 800, 296, 796, 111, 801, 794, 810, 303, - 788, 790, 310, 808, 794, 319, 0, 890, 890, 789, - 301, 801, 819, 791, 792, 800, 890, 890, 890, 786, - 890, 890, 890, 793, 890, 890, 890, 890, 890, 782, - 780, 890, 788, 183, 783, 285, 784, 890, 890, 890, - 890, 890, 890, 793, 782, 890, 890, 890, 890, 302, - 791, 890, 890, 890, 890, 890, 786, 296, 775, 771, - 890, 783, 890, 772, 771, 890, 239, 287, 890, 890, - 890, 784, 890, 890, 890, 336, 890, 769, 776, 764, - - 763, 343, 762, 890, 291, 330, 890, 890, 890, 890, - 764, 890, 890, 775, 890, 890, 332, 772, 773, 757, - 352, 360, 890, 756, 759, 759, 890, 752, 756, 764, - 749, 366, 755, 757, 740, 749, 890, 756, 744, 758, - 740, 749, 745, 890, 890, 753, 890, 750, 741, 749, - 890, 748, 741, 890, 890, 890, 890, 890, 890, 890, - 890, 732, 890, 890, 890, 745, 767, 766, 765, 746, - 745, 744, 890, 729, 737, 292, 158, 732, 736, 752, - 733, 890, 732, 890, 754, 753, 752, 733, 732, 731, - 890, 713, 725, 711, 710, 890, 718, 373, 724, 705, - - 718, 711, 716, 714, 705, 706, 702, 691, 711, 890, - 700, 698, 890, 890, 704, 890, 380, 103, 727, 385, - 148, 726, 691, 696, 693, 702, 690, 717, 692, 372, - 679, 694, 890, 356, 391, 716, 393, 395, 715, 686, - 371, 683, 410, 417, 685, 686, 435, 689, 670, 679, - 665, 673, 890, 890, 890, 662, 890, 890, 890, 890, - 890, 890, 890, 890, 890, 890, 890, 665, 658, 890, - 652, 651, 657, 890, 890, 890, 890, 395, 681, 890, - 890, 890, 890, 890, 665, 650, 657, 652, 442, 449, - 456, 644, 463, 470, 638, 651, 635, 890, 890, 890, - - 647, 641, 640, 890, 457, 370, 461, 633, 639, 632, - 634, 495, 624, 502, 509, 616, 630, 890, 890, 610, - 616, 476, 470, 473, 458, 466, 452, 452, 465, 459, - 516, 456, 457, 890, 523, 530, 449, 537, 890, 402, - 412, 392, 409, 407, 388, 395, 890, 890, 407, 544, - 405, 384, 551, 559, 373, 566, 367, 890, 890, 890, - 381, 890, 343, 890, 313, 293, 573, 580, 302, 890, - 195, 49, 587, 594, 890, 890, 601, 608, 615, 890, - 635, 645, 649, 658, 666, 674, 682, 691, 699, 711 - } ; - -static const flex_int16_t yy_def[491] = - { 0, - 480, 1, 480, 480, 480, 480, 480, 480, 481, 480, - 480, 480, 480, 480, 480, 480, 482, 483, 480, 480, - 484, 485, 480, 480, 480, 480, 480, 486, 480, 480, - 480, 480, 487, 480, 488, 489, 480, 480, 481, 480, - 480, 482, 480, 490, 480, 480, 483, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 490, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 0, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480 - } ; - -static const flex_int16_t yy_nxt[946] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 17, 17, 17, 17, 17, 17, - 18, 4, 4, 4, 4, 4, 4, 12, 12, 19, - 20, 21, 22, 23, 24, 25, 26, 4, 27, 4, - 28, 29, 30, 31, 32, 4, 33, 34, 35, 4, - 36, 26, 26, 26, 26, 41, 45, 42, 42, 42, - 42, 42, 42, 42, 43, 43, 43, 43, 43, 43, - 43, 98, 64, 69, 99, 72, 80, 121, 81, 200, - 46, 48, 49, 65, 201, 70, 73, 74, 82, 122, - 66, 75, 67, 76, 83, 77, 477, 50, 51, 52, - - 53, 54, 55, 56, 106, 78, 184, 57, 79, 58, - 84, 59, 45, 185, 60, 61, 364, 62, 145, 63, - 85, 85, 85, 85, 85, 85, 85, 88, 107, 155, - 92, 93, 146, 156, 108, 89, 46, 147, 109, 111, - 90, 112, 86, 91, 94, 212, 131, 124, 132, 125, - 149, 148, 95, 213, 113, 365, 189, 96, 208, 150, - 133, 364, 209, 97, 100, 100, 100, 100, 100, 100, - 100, 126, 101, 102, 103, 190, 104, 105, 114, 114, - 114, 114, 114, 114, 114, 43, 43, 43, 43, 43, - 43, 43, 327, 158, 137, 159, 138, 160, 139, 115, - - 365, 116, 328, 117, 205, 118, 43, 43, 43, 43, - 43, 43, 43, 140, 119, 43, 43, 43, 43, 43, - 43, 43, 206, 134, 236, 151, 152, 476, 46, 153, - 141, 237, 135, 142, 171, 172, 173, 46, 136, 68, - 68, 68, 68, 68, 68, 68, 71, 71, 71, 71, - 71, 71, 71, 174, 256, 257, 258, 175, 176, 85, - 85, 85, 85, 85, 85, 85, 87, 87, 87, 87, - 87, 87, 87, 100, 100, 100, 100, 100, 100, 100, - 196, 196, 196, 196, 196, 196, 196, 197, 197, 202, - 202, 202, 202, 202, 202, 202, 110, 110, 110, 110, - - 110, 110, 110, 259, 260, 267, 268, 269, 198, 114, - 114, 114, 114, 114, 114, 114, 120, 120, 120, 120, - 120, 120, 120, 123, 123, 123, 123, 123, 123, 123, - 221, 224, 239, 244, 248, 325, 249, 240, 326, 475, - 245, 473, 250, 225, 270, 271, 272, 472, 222, 196, - 196, 196, 196, 196, 196, 196, 202, 202, 202, 202, - 202, 202, 202, 275, 276, 277, 285, 286, 287, 380, - 381, 278, 279, 280, 288, 289, 290, 471, 281, 298, - 298, 298, 298, 298, 298, 298, 298, 298, 298, 298, - 298, 298, 298, 359, 360, 361, 362, 363, 359, 360, - - 361, 362, 363, 374, 382, 375, 380, 381, 382, 386, - 405, 406, 376, 470, 424, 469, 377, 425, 426, 468, - 427, 466, 387, 389, 389, 389, 389, 389, 389, 389, - 390, 390, 390, 390, 390, 390, 390, 465, 464, 463, - 462, 461, 460, 383, 459, 458, 457, 383, 393, 393, - 393, 393, 393, 393, 393, 389, 389, 389, 389, 389, - 389, 389, 390, 390, 390, 390, 390, 390, 390, 412, - 412, 412, 412, 412, 412, 412, 393, 393, 393, 393, - 393, 393, 393, 414, 414, 414, 414, 414, 414, 414, - 421, 428, 455, 452, 451, 449, 448, 429, 447, 446, - - 445, 422, 444, 443, 442, 423, 441, 430, 412, 412, - 412, 412, 412, 412, 412, 414, 414, 414, 414, 414, - 414, 414, 436, 436, 436, 436, 436, 436, 436, 450, - 450, 450, 450, 450, 450, 450, 453, 453, 453, 453, - 453, 453, 453, 436, 436, 436, 436, 436, 436, 436, - 456, 456, 456, 456, 456, 456, 456, 450, 450, 450, - 450, 450, 450, 450, 453, 453, 453, 453, 453, 453, - 453, 454, 467, 467, 467, 467, 467, 467, 467, 456, - 456, 456, 456, 456, 456, 456, 467, 467, 467, 467, - 467, 467, 467, 474, 474, 474, 474, 474, 474, 474, - - 478, 478, 478, 478, 478, 478, 478, 474, 474, 474, - 474, 474, 474, 474, 479, 479, 479, 479, 479, 479, - 479, 478, 478, 478, 478, 478, 478, 478, 479, 479, - 479, 479, 479, 479, 479, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 42, 42, 47, - 440, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 68, 439, 438, 437, 68, 435, 434, 68, 71, - 433, 71, 432, 431, 420, 71, 71, 87, 419, 87, - 418, 417, 87, 416, 87, 110, 415, 413, 110, 110, - 411, 410, 409, 110, 120, 408, 407, 404, 120, 403, - - 402, 120, 123, 123, 401, 400, 399, 398, 397, 396, - 123, 127, 395, 127, 127, 127, 127, 127, 127, 127, - 127, 127, 127, 394, 392, 391, 388, 385, 384, 384, - 379, 378, 373, 372, 371, 370, 369, 368, 367, 366, - 366, 358, 357, 356, 355, 354, 353, 352, 351, 350, - 349, 348, 347, 346, 345, 344, 343, 342, 341, 340, - 339, 338, 337, 336, 335, 334, 333, 332, 331, 330, - 329, 324, 323, 322, 321, 320, 319, 318, 317, 316, - 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, - 305, 304, 303, 302, 301, 300, 299, 297, 296, 295, - - 294, 293, 292, 291, 284, 283, 282, 274, 273, 266, - 265, 264, 263, 262, 261, 255, 254, 253, 252, 251, - 247, 246, 243, 242, 241, 238, 235, 234, 233, 232, - 231, 230, 229, 228, 227, 226, 223, 220, 219, 218, - 217, 216, 215, 214, 211, 210, 207, 204, 203, 199, - 195, 194, 193, 192, 191, 188, 187, 186, 183, 182, - 181, 180, 179, 178, 177, 170, 169, 168, 167, 166, - 165, 164, 163, 162, 161, 157, 154, 144, 143, 130, - 129, 128, 40, 37, 44, 40, 38, 37, 480, 3, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480 - } ; - -static const flex_int16_t yy_chk[946] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 14, 17, 14, 14, 14, - 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, - 15, 30, 20, 21, 30, 22, 24, 35, 24, 104, - 17, 19, 19, 20, 104, 21, 22, 22, 24, 35, - 20, 22, 20, 23, 25, 23, 472, 19, 19, 19, - - 19, 19, 19, 19, 32, 23, 90, 19, 23, 19, - 25, 19, 42, 90, 19, 19, 318, 19, 56, 19, - 27, 27, 27, 27, 27, 27, 27, 28, 32, 61, - 29, 29, 56, 61, 32, 28, 42, 57, 32, 33, - 28, 33, 27, 28, 29, 116, 51, 36, 51, 36, - 58, 57, 29, 116, 33, 318, 94, 29, 112, 58, - 51, 321, 112, 29, 31, 31, 31, 31, 31, 31, - 31, 36, 31, 31, 31, 94, 31, 31, 34, 34, - 34, 34, 34, 34, 34, 41, 41, 41, 41, 41, - 41, 41, 277, 63, 53, 63, 53, 63, 53, 34, - - 321, 34, 277, 34, 109, 34, 43, 43, 43, 43, - 43, 43, 43, 53, 34, 45, 45, 45, 45, 45, - 45, 45, 109, 52, 154, 59, 59, 471, 43, 59, - 53, 154, 52, 53, 78, 78, 78, 45, 52, 68, - 68, 68, 68, 68, 68, 68, 71, 71, 71, 71, - 71, 71, 71, 79, 187, 187, 187, 79, 79, 85, - 85, 85, 85, 85, 85, 85, 87, 87, 87, 87, - 87, 87, 87, 100, 100, 100, 100, 100, 100, 100, - 101, 101, 101, 101, 101, 101, 101, 102, 102, 105, - 105, 105, 105, 105, 105, 105, 110, 110, 110, 110, - - 110, 110, 110, 188, 188, 205, 205, 205, 102, 114, - 114, 114, 114, 114, 114, 114, 120, 120, 120, 120, - 120, 120, 120, 123, 123, 123, 123, 123, 123, 123, - 126, 131, 156, 170, 178, 276, 178, 156, 276, 469, - 170, 466, 178, 131, 206, 206, 206, 465, 126, 196, - 196, 196, 196, 196, 196, 196, 202, 202, 202, 202, - 202, 202, 202, 217, 217, 217, 221, 221, 221, 334, - 334, 217, 217, 217, 222, 222, 222, 463, 217, 232, - 232, 232, 232, 232, 232, 232, 298, 298, 298, 298, - 298, 298, 298, 317, 317, 317, 317, 317, 320, 320, - - 320, 320, 320, 330, 335, 330, 337, 337, 338, 341, - 378, 378, 330, 461, 406, 457, 330, 406, 406, 455, - 406, 452, 341, 343, 343, 343, 343, 343, 343, 343, - 344, 344, 344, 344, 344, 344, 344, 451, 449, 446, - 445, 444, 443, 335, 442, 441, 440, 338, 347, 347, - 347, 347, 347, 347, 347, 389, 389, 389, 389, 389, - 389, 389, 390, 390, 390, 390, 390, 390, 390, 391, - 391, 391, 391, 391, 391, 391, 393, 393, 393, 393, - 393, 393, 393, 394, 394, 394, 394, 394, 394, 394, - 405, 407, 437, 433, 432, 430, 429, 407, 428, 427, - - 426, 405, 425, 424, 423, 405, 422, 407, 412, 412, - 412, 412, 412, 412, 412, 414, 414, 414, 414, 414, - 414, 414, 415, 415, 415, 415, 415, 415, 415, 431, - 431, 431, 431, 431, 431, 431, 435, 435, 435, 435, - 435, 435, 435, 436, 436, 436, 436, 436, 436, 436, - 438, 438, 438, 438, 438, 438, 438, 450, 450, 450, - 450, 450, 450, 450, 453, 453, 453, 453, 453, 453, - 453, 435, 454, 454, 454, 454, 454, 454, 454, 456, - 456, 456, 456, 456, 456, 456, 467, 467, 467, 467, - 467, 467, 467, 468, 468, 468, 468, 468, 468, 468, - - 473, 473, 473, 473, 473, 473, 473, 474, 474, 474, - 474, 474, 474, 474, 477, 477, 477, 477, 477, 477, - 477, 478, 478, 478, 478, 478, 478, 478, 479, 479, - 479, 479, 479, 479, 479, 481, 481, 481, 481, 481, - 481, 481, 481, 481, 481, 481, 481, 482, 482, 483, - 421, 483, 483, 483, 483, 483, 483, 483, 483, 483, - 483, 484, 420, 417, 416, 484, 413, 411, 484, 485, - 410, 485, 409, 408, 403, 485, 485, 486, 402, 486, - 401, 397, 486, 396, 486, 487, 395, 392, 487, 487, - 388, 387, 386, 487, 488, 385, 379, 373, 488, 372, - - 371, 488, 489, 489, 369, 368, 356, 352, 351, 350, - 489, 490, 349, 490, 490, 490, 490, 490, 490, 490, - 490, 490, 490, 348, 346, 345, 342, 340, 339, 336, - 332, 331, 329, 328, 327, 326, 325, 324, 323, 322, - 319, 315, 312, 311, 309, 308, 307, 306, 305, 304, - 303, 302, 301, 300, 299, 297, 295, 294, 293, 292, - 290, 289, 288, 287, 286, 285, 283, 281, 280, 279, - 278, 275, 274, 272, 271, 270, 269, 268, 267, 266, - 262, 253, 252, 250, 249, 248, 246, 243, 242, 241, - 240, 239, 238, 236, 235, 234, 233, 231, 230, 229, - - 228, 226, 225, 224, 220, 219, 218, 214, 211, 203, - 201, 200, 199, 198, 192, 185, 184, 182, 180, 179, - 177, 171, 165, 164, 157, 155, 153, 151, 150, 144, - 140, 136, 135, 134, 133, 132, 130, 125, 124, 122, - 121, 119, 118, 117, 115, 113, 111, 108, 107, 103, - 99, 98, 97, 96, 95, 93, 92, 91, 89, 88, - 84, 83, 82, 81, 80, 77, 76, 75, 74, 73, - 72, 70, 69, 67, 66, 62, 60, 55, 54, 50, - 49, 48, 39, 37, 16, 9, 7, 5, 3, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480, 480, 480, 480, 480, 480, - 480, 480, 480, 480, 480 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "asmshader.l" -/* - * Direct3D shader assembler - * - * Copyright 2008 Stefan Dösinger - * Copyright 2009 Matteo Bruni - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ -#line 23 "asmshader.l" -#include "wine/debug.h" - -#include "d3dcompiler_private.h" -#include "asmshader.tab.h" - -WINE_DEFAULT_DEBUG_CHANNEL(asmshader); -#line 1096 "asmshader.yy.c" -#define YY_NO_INPUT 1 -/* Swizzles and writemasks consist of a dot and up to 4 x, y, z or w characters, - * or up to 4 a, r, g, b characters. There are different rules for swizzles and - * writemasks wrt repetition, those are handled in the grammar. - */ -/* Registers */ -/* for relative addressing in the form o[x], v[x] and c[x] */ -/* Not really a register, but it is considered as such */ -/* Comments */ -/* Whitespaces are spaces, tabs and newlines */ -#line 1107 "asmshader.yy.c" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 103 "asmshader.l" - - -#line 106 "asmshader.l" - /* Common instructions(vertex and pixel shaders) */ -#line 1327 "asmshader.yy.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 481 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_current_state != 480 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 107 "asmshader.l" -{return INSTR_ADD; } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 108 "asmshader.l" -{return INSTR_NOP; } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 109 "asmshader.l" -{return INSTR_MOV; } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 110 "asmshader.l" -{return INSTR_SUB; } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 111 "asmshader.l" -{return INSTR_MAD; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 112 "asmshader.l" -{return INSTR_MUL; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 113 "asmshader.l" -{return INSTR_RCP; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 114 "asmshader.l" -{return INSTR_RSQ; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 115 "asmshader.l" -{return INSTR_DP3; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 116 "asmshader.l" -{return INSTR_DP4; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 117 "asmshader.l" -{return INSTR_MIN; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 118 "asmshader.l" -{return INSTR_MAX; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 119 "asmshader.l" -{return INSTR_SLT; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 120 "asmshader.l" -{return INSTR_SGE; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 121 "asmshader.l" -{return INSTR_ABS; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 122 "asmshader.l" -{return INSTR_EXP; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 123 "asmshader.l" -{return INSTR_LOG; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 124 "asmshader.l" -{return INSTR_EXPP; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 125 "asmshader.l" -{return INSTR_LOGP; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 126 "asmshader.l" -{return INSTR_DST; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 127 "asmshader.l" -{return INSTR_LRP; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 128 "asmshader.l" -{return INSTR_FRC; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 129 "asmshader.l" -{return INSTR_POW; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 130 "asmshader.l" -{return INSTR_CRS; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 131 "asmshader.l" -{return INSTR_SGN; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 132 "asmshader.l" -{return INSTR_NRM; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 133 "asmshader.l" -{return INSTR_SINCOS; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 134 "asmshader.l" -{return INSTR_M4x4; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 135 "asmshader.l" -{return INSTR_M4x3; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 136 "asmshader.l" -{return INSTR_M3x4; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 137 "asmshader.l" -{return INSTR_M3x3; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 138 "asmshader.l" -{return INSTR_M3x2; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 139 "asmshader.l" -{return INSTR_DCL; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 140 "asmshader.l" -{return INSTR_DEF; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 141 "asmshader.l" -{return INSTR_DEFB; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 142 "asmshader.l" -{return INSTR_DEFI; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 143 "asmshader.l" -{return INSTR_REP; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 144 "asmshader.l" -{return INSTR_ENDREP; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 145 "asmshader.l" -{return INSTR_IF; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 146 "asmshader.l" -{return INSTR_ELSE; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 147 "asmshader.l" -{return INSTR_ENDIF; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 148 "asmshader.l" -{return INSTR_BREAK; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 149 "asmshader.l" -{return INSTR_BREAKP; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 150 "asmshader.l" -{return INSTR_CALL; } - YY_BREAK -case 45: -YY_RULE_SETUP -#line 151 "asmshader.l" -{return INSTR_CALLNZ; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 152 "asmshader.l" -{return INSTR_LOOP; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 153 "asmshader.l" -{return INSTR_RET; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 154 "asmshader.l" -{return INSTR_ENDLOOP; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 155 "asmshader.l" -{return INSTR_LABEL; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 156 "asmshader.l" -{return INSTR_SETP; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 157 "asmshader.l" -{return INSTR_TEXLDL; } - YY_BREAK -/* Vertex shader only instructions */ -case 52: -YY_RULE_SETUP -#line 160 "asmshader.l" -{return INSTR_LIT; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 161 "asmshader.l" -{return INSTR_MOVA; } - YY_BREAK -/* Pixel shader only instructions */ -case 54: -YY_RULE_SETUP -#line 164 "asmshader.l" -{return INSTR_CND; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 165 "asmshader.l" -{return INSTR_CMP; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 166 "asmshader.l" -{return INSTR_DP2ADD; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 167 "asmshader.l" -{return INSTR_TEXCOORD; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 168 "asmshader.l" -{return INSTR_TEXCRD; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 169 "asmshader.l" -{return INSTR_TEXKILL; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 170 "asmshader.l" -{return INSTR_TEX; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 171 "asmshader.l" -{return INSTR_TEXLD; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 172 "asmshader.l" -{return INSTR_TEXBEM; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 173 "asmshader.l" -{return INSTR_TEXBEML; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 174 "asmshader.l" -{return INSTR_TEXREG2AR; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 175 "asmshader.l" -{return INSTR_TEXREG2GB; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 176 "asmshader.l" -{return INSTR_TEXREG2RGB; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 177 "asmshader.l" -{return INSTR_TEXM3x2PAD; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 178 "asmshader.l" -{return INSTR_TEXM3x2TEX; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 179 "asmshader.l" -{return INSTR_TEXM3x3PAD; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 180 "asmshader.l" -{return INSTR_TEXM3x3SPEC; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 181 "asmshader.l" -{return INSTR_TEXM3x3VSPEC; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 182 "asmshader.l" -{return INSTR_TEXM3x3TEX; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 183 "asmshader.l" -{return INSTR_TEXDP3TEX; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 184 "asmshader.l" -{return INSTR_TEXM3x2DEPTH; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 185 "asmshader.l" -{return INSTR_TEXDP3; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 186 "asmshader.l" -{return INSTR_TEXM3x3; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 187 "asmshader.l" -{return INSTR_TEXDEPTH; } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 188 "asmshader.l" -{return INSTR_BEM; } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 189 "asmshader.l" -{return INSTR_DSX; } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 190 "asmshader.l" -{return INSTR_DSY; } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 191 "asmshader.l" -{return INSTR_TEXLDP; } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 192 "asmshader.l" -{return INSTR_TEXLDB; } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 193 "asmshader.l" -{return INSTR_TEXLDD; } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 194 "asmshader.l" -{return INSTR_PHASE; } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 196 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_TEMP; - } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 200 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_OUTPUT; - } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 204 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_INPUT; - } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 208 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_CONSTFLOAT; - } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 212 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_CONSTINT; - } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 216 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_CONSTBOOL; - } - YY_BREAK -case 91: -YY_RULE_SETUP -#line 220 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_TEXTURE; - } - YY_BREAK -case 92: -YY_RULE_SETUP -#line 224 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 2); - return REG_TEXCRDOUT; - } - YY_BREAK -case 93: -YY_RULE_SETUP -#line 228 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_SAMPLER; - } - YY_BREAK -case 94: -YY_RULE_SETUP -#line 232 "asmshader.l" -{return REG_OPOS; } - YY_BREAK -case 95: -YY_RULE_SETUP -#line 233 "asmshader.l" -{return REG_OFOG; } - YY_BREAK -case 96: -YY_RULE_SETUP -#line 234 "asmshader.l" -{return REG_OPTS; } - YY_BREAK -case 97: -YY_RULE_SETUP -#line 235 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 2); - return REG_VERTEXCOLOR; - } - YY_BREAK -case 98: -YY_RULE_SETUP -#line 239 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 2); - return REG_FRAGCOLOR; - } - YY_BREAK -case 99: -YY_RULE_SETUP -#line 243 "asmshader.l" -{return REG_FRAGDEPTH; } - YY_BREAK -case 100: -YY_RULE_SETUP -#line 244 "asmshader.l" -{return REG_VPOS; } - YY_BREAK -case 101: -YY_RULE_SETUP -#line 245 "asmshader.l" -{return REG_VFACE; } - YY_BREAK -case 102: -YY_RULE_SETUP -#line 246 "asmshader.l" -{return REG_ADDRESS; } - YY_BREAK -case 103: -YY_RULE_SETUP -#line 247 "asmshader.l" -{return REG_LOOP; } - YY_BREAK -case 104: -YY_RULE_SETUP -#line 248 "asmshader.l" -{return REG_PREDICATE; } - YY_BREAK -case 105: -YY_RULE_SETUP -#line 250 "asmshader.l" -{ - asmshader_lval.regnum = atoi(yytext + 1); - return REG_LABEL; - } - YY_BREAK -/* Shader versions. These are important to select the correct - * parser profile. - */ -case 106: -YY_RULE_SETUP -#line 258 "asmshader.l" -{return VER_VS10; } - YY_BREAK -case 107: -YY_RULE_SETUP -#line 259 "asmshader.l" -{return VER_VS11; } - YY_BREAK -case 108: -YY_RULE_SETUP -#line 261 "asmshader.l" -{return VER_VS20; } - YY_BREAK -case 109: -YY_RULE_SETUP -#line 262 "asmshader.l" -{return VER_VS2X; } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 263 "asmshader.l" -{return VER_VS30; } - YY_BREAK -case 111: -YY_RULE_SETUP -#line 265 "asmshader.l" -{return VER_PS10; } - YY_BREAK -case 112: -YY_RULE_SETUP -#line 266 "asmshader.l" -{return VER_PS11; } - YY_BREAK -case 113: -YY_RULE_SETUP -#line 267 "asmshader.l" -{return VER_PS12; } - YY_BREAK -case 114: -YY_RULE_SETUP -#line 268 "asmshader.l" -{return VER_PS13; } - YY_BREAK -case 115: -YY_RULE_SETUP -#line 269 "asmshader.l" -{return VER_PS14; } - YY_BREAK -case 116: -YY_RULE_SETUP -#line 271 "asmshader.l" -{return VER_PS20; } - YY_BREAK -case 117: -YY_RULE_SETUP -#line 272 "asmshader.l" -{return VER_PS2X; } - YY_BREAK -case 118: -YY_RULE_SETUP -#line 273 "asmshader.l" -{return VER_PS30; } - YY_BREAK -case 119: -YY_RULE_SETUP -#line 275 "asmshader.l" -{return yytext[0]; } - YY_BREAK -case 120: -YY_RULE_SETUP -#line 276 "asmshader.l" -{ - switch(yytext[0]) { - case 'x': - case 'r': - asmshader_lval.component = 0; - break; - case 'y': - case 'g': - asmshader_lval.component = 1; - break; - case 'z': - case 'b': - asmshader_lval.component = 2; - break; - case 'w': - case 'a': - asmshader_lval.component = 3; - break; - } - return COMPONENT; - } - YY_BREAK -/* Output modifiers */ -case 121: -YY_RULE_SETUP -#line 299 "asmshader.l" -{return SHIFT_X2; } - YY_BREAK -case 122: -YY_RULE_SETUP -#line 300 "asmshader.l" -{return SHIFT_X4; } - YY_BREAK -case 123: -YY_RULE_SETUP -#line 301 "asmshader.l" -{return SHIFT_X8; } - YY_BREAK -case 124: -YY_RULE_SETUP -#line 302 "asmshader.l" -{return SHIFT_D2; } - YY_BREAK -case 125: -YY_RULE_SETUP -#line 303 "asmshader.l" -{return SHIFT_D4; } - YY_BREAK -case 126: -YY_RULE_SETUP -#line 304 "asmshader.l" -{return SHIFT_D8; } - YY_BREAK -case 127: -YY_RULE_SETUP -#line 305 "asmshader.l" -{return MOD_SAT; } - YY_BREAK -case 128: -YY_RULE_SETUP -#line 306 "asmshader.l" -{return MOD_PP; } - YY_BREAK -case 129: -YY_RULE_SETUP -#line 307 "asmshader.l" -{return MOD_CENTROID; } - YY_BREAK -/* compare params */ -case 130: -YY_RULE_SETUP -#line 310 "asmshader.l" -{return COMP_GT; } - YY_BREAK -case 131: -YY_RULE_SETUP -#line 311 "asmshader.l" -{return COMP_LT; } - YY_BREAK -case 132: -YY_RULE_SETUP -#line 312 "asmshader.l" -{return COMP_GE; } - YY_BREAK -case 133: -YY_RULE_SETUP -#line 313 "asmshader.l" -{return COMP_LE; } - YY_BREAK -case 134: -YY_RULE_SETUP -#line 314 "asmshader.l" -{return COMP_EQ; } - YY_BREAK -case 135: -YY_RULE_SETUP -#line 315 "asmshader.l" -{return COMP_NE; } - YY_BREAK -case 136: -YY_RULE_SETUP -#line 317 "asmshader.l" -{ - asmshader_lval.immval.val = atof(yytext); - asmshader_lval.immval.integer = ((strstr(yytext, ".") == NULL) && (strstr(yytext, "f") == NULL)); - return IMMVAL; - } - YY_BREAK -case 137: -YY_RULE_SETUP -#line 322 "asmshader.l" -{ - asmshader_lval.immbool = TRUE; - return IMMBOOL; - } - YY_BREAK -case 138: -YY_RULE_SETUP -#line 326 "asmshader.l" -{ - asmshader_lval.immbool = FALSE; - return IMMBOOL; - } - YY_BREAK -case 139: -YY_RULE_SETUP -#line 331 "asmshader.l" -{return yytext[0]; } - YY_BREAK -case 140: -YY_RULE_SETUP -#line 332 "asmshader.l" -{return yytext[0]; } - YY_BREAK -case 141: -YY_RULE_SETUP -#line 333 "asmshader.l" -{return yytext[0]; } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 334 "asmshader.l" -{return yytext[0]; } - YY_BREAK -/* for relative addressing */ -case 143: -YY_RULE_SETUP -#line 337 "asmshader.l" -{return yytext[0]; } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 339 "asmshader.l" -{return SMOD_BIAS; } - YY_BREAK -/* No _x2 here; it is identical to MOD_X2 */ -case 145: -YY_RULE_SETUP -#line 341 "asmshader.l" -{return SMOD_SCALEBIAS; } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 342 "asmshader.l" -{return SMOD_DZ; } - YY_BREAK -case 147: -YY_RULE_SETUP -#line 343 "asmshader.l" -{return SMOD_DW; } - YY_BREAK -case 148: -YY_RULE_SETUP -#line 344 "asmshader.l" -{return SMOD_ABS; } - YY_BREAK -case 149: -YY_RULE_SETUP -#line 346 "asmshader.l" -{return SMOD_NOT; } - YY_BREAK -case 150: -YY_RULE_SETUP -#line 348 "asmshader.l" -{ - if(yytext[strlen("_position")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_position")); - } - return USAGE_POSITION; - } - YY_BREAK -case 151: -YY_RULE_SETUP -#line 356 "asmshader.l" -{ - if(yytext[strlen("_blendweight")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_blendweight")); - } - return USAGE_BLENDWEIGHT; - } - YY_BREAK -case 152: -YY_RULE_SETUP -#line 364 "asmshader.l" -{ - if(yytext[strlen("_blendindices")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_blendindices")); - } - return USAGE_BLENDINDICES; - } - YY_BREAK -case 153: -YY_RULE_SETUP -#line 372 "asmshader.l" -{ - if(yytext[strlen("_normal")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_normal")); - } - return USAGE_NORMAL; - } - YY_BREAK -case 154: -YY_RULE_SETUP -#line 380 "asmshader.l" -{ - if(yytext[strlen("_psize")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_psize")); - } - return USAGE_PSIZE; - } - YY_BREAK -case 155: -YY_RULE_SETUP -#line 388 "asmshader.l" -{ - if(yytext[strlen("_texcoord")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_texcoord")); - } - return USAGE_TEXCOORD; - } - YY_BREAK -case 156: -YY_RULE_SETUP -#line 396 "asmshader.l" -{ - if(yytext[strlen("_tangent")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_tangent")); - } - return USAGE_TANGENT; - } - YY_BREAK -case 157: -YY_RULE_SETUP -#line 404 "asmshader.l" -{ - if(yytext[strlen("_binormal")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_binormal")); - } - return USAGE_BINORMAL; - } - YY_BREAK -case 158: -YY_RULE_SETUP -#line 412 "asmshader.l" -{ - if(yytext[strlen("_tessfactor")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_tessfactor")); - } - return USAGE_TESSFACTOR; - } - YY_BREAK -case 159: -YY_RULE_SETUP -#line 420 "asmshader.l" -{ - if(yytext[strlen("_positiont")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_positiont")); - } - return USAGE_POSITIONT; - } - YY_BREAK -case 160: -YY_RULE_SETUP -#line 428 "asmshader.l" -{ - if(yytext[strlen("_color")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_color")); - } - return USAGE_COLOR; - } - YY_BREAK -case 161: -YY_RULE_SETUP -#line 436 "asmshader.l" -{ - if(yytext[strlen("_fog")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_fog")); - } - return USAGE_FOG; - } - YY_BREAK -case 162: -YY_RULE_SETUP -#line 444 "asmshader.l" -{ - if(yytext[strlen("_depth")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_depth")); - } - return USAGE_DEPTH; - } - YY_BREAK -case 163: -YY_RULE_SETUP -#line 452 "asmshader.l" -{ - if(yytext[strlen("_sample")] == '\0') { - asmshader_lval.regnum = 0; - } else { - asmshader_lval.regnum = atoi(yytext + strlen("_sample")); - } - return USAGE_SAMPLE; - } - YY_BREAK -case 164: -YY_RULE_SETUP -#line 461 "asmshader.l" -{ return SAMPTYPE_1D; } - YY_BREAK -case 165: -YY_RULE_SETUP -#line 462 "asmshader.l" -{ return SAMPTYPE_2D; } - YY_BREAK -case 166: -YY_RULE_SETUP -#line 463 "asmshader.l" -{ return SAMPTYPE_CUBE; } - YY_BREAK -case 167: -YY_RULE_SETUP -#line 464 "asmshader.l" -{ return SAMPTYPE_VOLUME; } - YY_BREAK -case 168: -/* rule 168 can match eol */ -YY_RULE_SETUP -#line 466 "asmshader.l" -{ - /* TODO: update current line information */ - TRACE("line info update: %s", yytext); - } - YY_BREAK -/* Skip comments */ -case 169: -YY_RULE_SETUP -#line 472 "asmshader.l" -{ } - YY_BREAK -case 170: -YY_RULE_SETUP -#line 473 "asmshader.l" -{ } - YY_BREAK -case 171: -YY_RULE_SETUP -#line 475 "asmshader.l" -{ /* Do nothing */ } - YY_BREAK -case 172: -/* rule 172 can match eol */ -YY_RULE_SETUP -#line 476 "asmshader.l" -{ - asm_ctx.line_no++; - } - YY_BREAK -case 173: -YY_RULE_SETUP -#line 480 "asmshader.l" -{ - asmparser_message(&asm_ctx, "Line %u: Unexpected input %s\n", asm_ctx.line_no, yytext); - set_parse_status(&asm_ctx.status, PARSE_ERR); - } - YY_BREAK -case 174: -YY_RULE_SETUP -#line 485 "asmshader.l" -ECHO; - YY_BREAK -#line 2434 "asmshader.yy.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 481 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 481 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 480); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - yyfree( (void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 485 "asmshader.l" - - -struct bwriter_shader *SlAssembleShader(const char *text, char **messages) { - struct bwriter_shader *ret = NULL; - YY_BUFFER_STATE buffer; - TRACE("%p, %p\n", text, messages); - - buffer = asmshader__scan_string(text); - asmshader__switch_to_buffer(buffer); - - ret = parse_asm_shader(messages); - - asmshader__delete_buffer(buffer); - - return ret; -} - diff --git a/dll/directx/wine/d3dcompiler_43/asmshader.yy.h b/dll/directx/wine/d3dcompiler_43/asmshader.yy.h deleted file mode 100644 index 4a5a5f772a0..00000000000 --- a/dll/directx/wine/d3dcompiler_43/asmshader.yy.h +++ /dev/null @@ -1,711 +0,0 @@ -#ifndef asmshader_HEADER_H -#define asmshader_HEADER_H 1 -#define asmshader_IN_HEADER 1 - -#line 5 "asmshader.yy.h" - -#line 7 "asmshader.yy.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define asmshader__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer asmshader__create_buffer -#endif - -#ifdef yy_delete_buffer -#define asmshader__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer asmshader__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define asmshader__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer asmshader__scan_buffer -#endif - -#ifdef yy_scan_string -#define asmshader__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string asmshader__scan_string -#endif - -#ifdef yy_scan_bytes -#define asmshader__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes asmshader__scan_bytes -#endif - -#ifdef yy_init_buffer -#define asmshader__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer asmshader__init_buffer -#endif - -#ifdef yy_flush_buffer -#define asmshader__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer asmshader__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define asmshader__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state asmshader__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define asmshader__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer asmshader__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define asmshader_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state asmshader_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define asmshader_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state asmshader_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define asmshader_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack asmshader_ensure_buffer_stack -#endif - -#ifdef yylex -#define asmshader_lex_ALREADY_DEFINED -#else -#define yylex asmshader_lex -#endif - -#ifdef yyrestart -#define asmshader_restart_ALREADY_DEFINED -#else -#define yyrestart asmshader_restart -#endif - -#ifdef yylex_init -#define asmshader_lex_init_ALREADY_DEFINED -#else -#define yylex_init asmshader_lex_init -#endif - -#ifdef yylex_init_extra -#define asmshader_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra asmshader_lex_init_extra -#endif - -#ifdef yylex_destroy -#define asmshader_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy asmshader_lex_destroy -#endif - -#ifdef yyget_debug -#define asmshader_get_debug_ALREADY_DEFINED -#else -#define yyget_debug asmshader_get_debug -#endif - -#ifdef yyset_debug -#define asmshader_set_debug_ALREADY_DEFINED -#else -#define yyset_debug asmshader_set_debug -#endif - -#ifdef yyget_extra -#define asmshader_get_extra_ALREADY_DEFINED -#else -#define yyget_extra asmshader_get_extra -#endif - -#ifdef yyset_extra -#define asmshader_set_extra_ALREADY_DEFINED -#else -#define yyset_extra asmshader_set_extra -#endif - -#ifdef yyget_in -#define asmshader_get_in_ALREADY_DEFINED -#else -#define yyget_in asmshader_get_in -#endif - -#ifdef yyset_in -#define asmshader_set_in_ALREADY_DEFINED -#else -#define yyset_in asmshader_set_in -#endif - -#ifdef yyget_out -#define asmshader_get_out_ALREADY_DEFINED -#else -#define yyget_out asmshader_get_out -#endif - -#ifdef yyset_out -#define asmshader_set_out_ALREADY_DEFINED -#else -#define yyset_out asmshader_set_out -#endif - -#ifdef yyget_leng -#define asmshader_get_leng_ALREADY_DEFINED -#else -#define yyget_leng asmshader_get_leng -#endif - -#ifdef yyget_text -#define asmshader_get_text_ALREADY_DEFINED -#else -#define yyget_text asmshader_get_text -#endif - -#ifdef yyget_lineno -#define asmshader_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno asmshader_get_lineno -#endif - -#ifdef yyset_lineno -#define asmshader_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno asmshader_set_lineno -#endif - -#ifdef yywrap -#define asmshader_wrap_ALREADY_DEFINED -#else -#define yywrap asmshader_wrap -#endif - -#ifdef yyalloc -#define asmshader_alloc_ALREADY_DEFINED -#else -#define yyalloc asmshader_alloc -#endif - -#ifdef yyrealloc -#define asmshader_realloc_ALREADY_DEFINED -#else -#define yyrealloc asmshader_realloc -#endif - -#ifdef yyfree -#define asmshader_free_ALREADY_DEFINED -#else -#define yyfree asmshader_free -#endif - -#ifdef yytext -#define asmshader_text_ALREADY_DEFINED -#else -#define yytext asmshader_text -#endif - -#ifdef yyleng -#define asmshader_leng_ALREADY_DEFINED -#else -#define yyleng asmshader_leng -#endif - -#ifdef yyin -#define asmshader_in_ALREADY_DEFINED -#else -#define yyin asmshader_in -#endif - -#ifdef yyout -#define asmshader_out_ALREADY_DEFINED -#else -#define yyout asmshader_out -#endif - -#ifdef yy_flex_debug -#define asmshader__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug asmshader__flex_debug -#endif - -#ifdef yylineno -#define asmshader_lineno_ALREADY_DEFINED -#else -#define yylineno asmshader_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -/* Begin user sect3 */ - -#define asmshader_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP - -extern int yylineno; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#ifndef asmshader__create_buffer_ALREADY_DEFINED -#undef yy_create_buffer -#endif -#ifndef asmshader__delete_buffer_ALREADY_DEFINED -#undef yy_delete_buffer -#endif -#ifndef asmshader__scan_buffer_ALREADY_DEFINED -#undef yy_scan_buffer -#endif -#ifndef asmshader__scan_string_ALREADY_DEFINED -#undef yy_scan_string -#endif -#ifndef asmshader__scan_bytes_ALREADY_DEFINED -#undef yy_scan_bytes -#endif -#ifndef asmshader__init_buffer_ALREADY_DEFINED -#undef yy_init_buffer -#endif -#ifndef asmshader__flush_buffer_ALREADY_DEFINED -#undef yy_flush_buffer -#endif -#ifndef asmshader__load_buffer_state_ALREADY_DEFINED -#undef yy_load_buffer_state -#endif -#ifndef asmshader__switch_to_buffer_ALREADY_DEFINED -#undef yy_switch_to_buffer -#endif -#ifndef asmshader_push_buffer_state_ALREADY_DEFINED -#undef yypush_buffer_state -#endif -#ifndef asmshader_pop_buffer_state_ALREADY_DEFINED -#undef yypop_buffer_state -#endif -#ifndef asmshader_ensure_buffer_stack_ALREADY_DEFINED -#undef yyensure_buffer_stack -#endif -#ifndef asmshader_lex_ALREADY_DEFINED -#undef yylex -#endif -#ifndef asmshader_restart_ALREADY_DEFINED -#undef yyrestart -#endif -#ifndef asmshader_lex_init_ALREADY_DEFINED -#undef yylex_init -#endif -#ifndef asmshader_lex_init_extra_ALREADY_DEFINED -#undef yylex_init_extra -#endif -#ifndef asmshader_lex_destroy_ALREADY_DEFINED -#undef yylex_destroy -#endif -#ifndef asmshader_get_debug_ALREADY_DEFINED -#undef yyget_debug -#endif -#ifndef asmshader_set_debug_ALREADY_DEFINED -#undef yyset_debug -#endif -#ifndef asmshader_get_extra_ALREADY_DEFINED -#undef yyget_extra -#endif -#ifndef asmshader_set_extra_ALREADY_DEFINED -#undef yyset_extra -#endif -#ifndef asmshader_get_in_ALREADY_DEFINED -#undef yyget_in -#endif -#ifndef asmshader_set_in_ALREADY_DEFINED -#undef yyset_in -#endif -#ifndef asmshader_get_out_ALREADY_DEFINED -#undef yyget_out -#endif -#ifndef asmshader_set_out_ALREADY_DEFINED -#undef yyset_out -#endif -#ifndef asmshader_get_leng_ALREADY_DEFINED -#undef yyget_leng -#endif -#ifndef asmshader_get_text_ALREADY_DEFINED -#undef yyget_text -#endif -#ifndef asmshader_get_lineno_ALREADY_DEFINED -#undef yyget_lineno -#endif -#ifndef asmshader_set_lineno_ALREADY_DEFINED -#undef yyset_lineno -#endif -#ifndef asmshader_get_column_ALREADY_DEFINED -#undef yyget_column -#endif -#ifndef asmshader_set_column_ALREADY_DEFINED -#undef yyset_column -#endif -#ifndef asmshader_wrap_ALREADY_DEFINED -#undef yywrap -#endif -#ifndef asmshader_get_lval_ALREADY_DEFINED -#undef yyget_lval -#endif -#ifndef asmshader_set_lval_ALREADY_DEFINED -#undef yyset_lval -#endif -#ifndef asmshader_get_lloc_ALREADY_DEFINED -#undef yyget_lloc -#endif -#ifndef asmshader_set_lloc_ALREADY_DEFINED -#undef yyset_lloc -#endif -#ifndef asmshader_alloc_ALREADY_DEFINED -#undef yyalloc -#endif -#ifndef asmshader_realloc_ALREADY_DEFINED -#undef yyrealloc -#endif -#ifndef asmshader_free_ALREADY_DEFINED -#undef yyfree -#endif -#ifndef asmshader_text_ALREADY_DEFINED -#undef yytext -#endif -#ifndef asmshader_leng_ALREADY_DEFINED -#undef yyleng -#endif -#ifndef asmshader_in_ALREADY_DEFINED -#undef yyin -#endif -#ifndef asmshader_out_ALREADY_DEFINED -#undef yyout -#endif -#ifndef asmshader__flex_debug_ALREADY_DEFINED -#undef yy_flex_debug -#endif -#ifndef asmshader_lineno_ALREADY_DEFINED -#undef yylineno -#endif -#ifndef asmshader_tables_fload_ALREADY_DEFINED -#undef yytables_fload -#endif -#ifndef asmshader_tables_destroy_ALREADY_DEFINED -#undef yytables_destroy -#endif -#ifndef asmshader_TABLES_NAME_ALREADY_DEFINED -#undef yyTABLES_NAME -#endif - -#line 485 "asmshader.l" - - -#line 709 "asmshader.yy.h" -#undef asmshader_IN_HEADER -#endif /* asmshader_HEADER_H */ diff --git a/dll/directx/wine/d3dcompiler_43/hlsl.tab.c b/dll/directx/wine/d3dcompiler_43/hlsl.tab.c deleted file mode 100644 index d84de231ea7..00000000000 --- a/dll/directx/wine/d3dcompiler_43/hlsl.tab.c +++ /dev/null @@ -1,4956 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse hlsl_parse -#define yylex hlsl_lex -#define yyerror hlsl_error -#define yydebug hlsl_debug -#define yynerrs hlsl_nerrs - -#define yylval hlsl_lval -#define yychar hlsl_char -#define yylloc hlsl_lloc - -/* First part of user prologue. */ -#line 21 "hlsl.y" - -#include "wine/debug.h" - -#include - -#include "d3dcompiler_private.h" - -WINE_DEFAULT_DEBUG_CHANNEL(hlsl_parser); - -int hlsl_lex(void); - -struct hlsl_parse_ctx hlsl_ctx; - -struct YYLTYPE; -static void set_location(struct source_location *loc, const struct YYLTYPE *l); - -void WINAPIV hlsl_message(const char *fmt, ...) -{ - __ms_va_list args; - - __ms_va_start(args, fmt); - compilation_message(&hlsl_ctx.messages, fmt, args); - __ms_va_end(args); -} - -static const char *hlsl_get_error_level_name(enum hlsl_error_level level) -{ - static const char * const names[] = - { - "error", - "warning", - "note", - }; - return names[level]; -} - -void WINAPIV hlsl_report_message(const char *filename, DWORD line, DWORD column, - enum hlsl_error_level level, const char *fmt, ...) -{ - __ms_va_list args; - char *string = NULL; - int rc, size = 0; - - while (1) - { - __ms_va_start(args, fmt); - rc = vsnprintf(string, size, fmt, args); - __ms_va_end(args); - - if (rc >= 0 && rc < size) - break; - - if (rc >= size) - size = rc + 1; - else - size = size ? size * 2 : 32; - - if (!string) - string = d3dcompiler_alloc(size); - else - string = d3dcompiler_realloc(string, size); - if (!string) - { - ERR("Error reallocating memory for a string.\n"); - return; - } - } - - hlsl_message("%s:%u:%u: %s: %s\n", filename, line, column, hlsl_get_error_level_name(level), string); - d3dcompiler_free(string); - - if (level == HLSL_LEVEL_ERROR) - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - else if (level == HLSL_LEVEL_WARNING) - set_parse_status(&hlsl_ctx.status, PARSE_WARN); -} - -static void hlsl_error(const char *s) -{ - hlsl_report_message(hlsl_ctx.source_file, hlsl_ctx.line_no, hlsl_ctx.column, HLSL_LEVEL_ERROR, "%s", s); -} - -static void debug_dump_decl(struct hlsl_type *type, DWORD modifiers, const char *declname, unsigned int line_no) -{ - TRACE("Line %u: ", line_no); - if (modifiers) - TRACE("%s ", debug_modifiers(modifiers)); - TRACE("%s %s;\n", debug_hlsl_type(type), declname); -} - -static void check_invalid_matrix_modifiers(DWORD modifiers, struct source_location *loc) -{ - if (modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)) - { - hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_ERROR, - "'row_major' or 'column_major' modifiers are only allowed for matrices"); - } -} - -static BOOL declare_variable(struct hlsl_ir_var *decl, BOOL local) -{ - BOOL ret; - - TRACE("Declaring variable %s.\n", decl->name); - if (decl->data_type->type == HLSL_CLASS_MATRIX) - { - if (!(decl->modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR))) - { - decl->modifiers |= hlsl_ctx.matrix_majority == HLSL_ROW_MAJOR - ? HLSL_MODIFIER_ROW_MAJOR : HLSL_MODIFIER_COLUMN_MAJOR; - } - } - else - check_invalid_matrix_modifiers(decl->modifiers, &decl->loc); - - if (local) - { - DWORD invalid = decl->modifiers & (HLSL_STORAGE_EXTERN | HLSL_STORAGE_SHARED - | HLSL_STORAGE_GROUPSHARED | HLSL_STORAGE_UNIFORM); - if (invalid) - { - hlsl_report_message(decl->loc.file, decl->loc.line, decl->loc.col, HLSL_LEVEL_ERROR, - "modifier '%s' invalid for local variables", debug_modifiers(invalid)); - } - if (decl->semantic) - { - hlsl_report_message(decl->loc.file, decl->loc.line, decl->loc.col, HLSL_LEVEL_ERROR, - "semantics are not allowed on local variables"); - return FALSE; - } - } - else - { - if (find_function(decl->name)) - { - hlsl_report_message(decl->loc.file, decl->loc.line, decl->loc.col, HLSL_LEVEL_ERROR, - "redefinition of '%s'", decl->name); - return FALSE; - } - } - ret = add_declaration(hlsl_ctx.cur_scope, decl, local); - if (!ret) - { - struct hlsl_ir_var *old = get_variable(hlsl_ctx.cur_scope, decl->name); - - hlsl_report_message(decl->loc.file, decl->loc.line, decl->loc.col, HLSL_LEVEL_ERROR, - "\"%s\" already declared", decl->name); - hlsl_report_message(old->loc.file, old->loc.line, old->loc.col, HLSL_LEVEL_NOTE, - "\"%s\" was previously declared here", old->name); - return FALSE; - } - return TRUE; -} - -static DWORD add_modifier(DWORD modifiers, DWORD mod, const struct YYLTYPE *loc); - -static BOOL check_type_modifiers(DWORD modifiers, struct source_location *loc) -{ - if (modifiers & ~HLSL_TYPE_MODIFIERS_MASK) - { - hlsl_report_message(loc->file, loc->line, loc->col, HLSL_LEVEL_ERROR, - "modifier not allowed on typedefs"); - return FALSE; - } - return TRUE; -} - -static BOOL add_type_to_scope(struct hlsl_scope *scope, struct hlsl_type *def) -{ - if (get_type(scope, def->name, FALSE)) - return FALSE; - - wine_rb_put(&scope->types, def->name, &def->scope_entry); - return TRUE; -} - -static void declare_predefined_types(struct hlsl_scope *scope) -{ - struct hlsl_type *type; - unsigned int x, y, bt; - static const char * const names[] = - { - "float", - "half", - "double", - "int", - "uint", - "bool", - }; - char name[10]; - - for (bt = 0; bt <= HLSL_TYPE_LAST_SCALAR; ++bt) - { - for (y = 1; y <= 4; ++y) - { - for (x = 1; x <= 4; ++x) - { - sprintf(name, "%s%ux%u", names[bt], x, y); - type = new_hlsl_type(d3dcompiler_strdup(name), HLSL_CLASS_MATRIX, bt, x, y); - add_type_to_scope(scope, type); - - if (y == 1) - { - sprintf(name, "%s%u", names[bt], x); - type = new_hlsl_type(d3dcompiler_strdup(name), HLSL_CLASS_VECTOR, bt, x, y); - add_type_to_scope(scope, type); - - if (x == 1) - { - sprintf(name, "%s", names[bt]); - type = new_hlsl_type(d3dcompiler_strdup(name), HLSL_CLASS_SCALAR, bt, x, y); - add_type_to_scope(scope, type); - } - } - } - } - } - - /* DX8 effects predefined types */ - type = new_hlsl_type(d3dcompiler_strdup("DWORD"), HLSL_CLASS_SCALAR, HLSL_TYPE_INT, 1, 1); - add_type_to_scope(scope, type); - type = new_hlsl_type(d3dcompiler_strdup("FLOAT"), HLSL_CLASS_SCALAR, HLSL_TYPE_FLOAT, 1, 1); - add_type_to_scope(scope, type); - type = new_hlsl_type(d3dcompiler_strdup("VECTOR"), HLSL_CLASS_VECTOR, HLSL_TYPE_FLOAT, 4, 1); - add_type_to_scope(scope, type); - type = new_hlsl_type(d3dcompiler_strdup("MATRIX"), HLSL_CLASS_MATRIX, HLSL_TYPE_FLOAT, 4, 4); - add_type_to_scope(scope, type); - type = new_hlsl_type(d3dcompiler_strdup("STRING"), HLSL_CLASS_OBJECT, HLSL_TYPE_STRING, 1, 1); - add_type_to_scope(scope, type); - type = new_hlsl_type(d3dcompiler_strdup("TEXTURE"), HLSL_CLASS_OBJECT, HLSL_TYPE_TEXTURE, 1, 1); - add_type_to_scope(scope, type); - type = new_hlsl_type(d3dcompiler_strdup("PIXELSHADER"), HLSL_CLASS_OBJECT, HLSL_TYPE_PIXELSHADER, 1, 1); - add_type_to_scope(scope, type); - type = new_hlsl_type(d3dcompiler_strdup("VERTEXSHADER"), HLSL_CLASS_OBJECT, HLSL_TYPE_VERTEXSHADER, 1, 1); - add_type_to_scope(scope, type); -} - -static struct hlsl_ir_if *loop_condition(struct list *cond_list) -{ - struct hlsl_ir_node *cond, *not_cond; - struct hlsl_ir_if *out_cond; - struct hlsl_ir_jump *jump; - unsigned int count = list_count(cond_list); - - if (!count) - return NULL; - if (count != 1) - ERR("Got multiple expressions in a for condition.\n"); - - cond = LIST_ENTRY(list_head(cond_list), struct hlsl_ir_node, entry); - out_cond = d3dcompiler_alloc(sizeof(*out_cond)); - if (!out_cond) - { - ERR("Out of memory.\n"); - return NULL; - } - out_cond->node.type = HLSL_IR_IF; - if (!(not_cond = new_unary_expr(HLSL_IR_UNOP_LOGIC_NOT, cond, cond->loc))) - { - ERR("Out of memory.\n"); - d3dcompiler_free(out_cond); - return NULL; - } - out_cond->condition = not_cond; - jump = d3dcompiler_alloc(sizeof(*jump)); - if (!jump) - { - ERR("Out of memory.\n"); - d3dcompiler_free(out_cond); - d3dcompiler_free(not_cond); - return NULL; - } - jump->node.type = HLSL_IR_JUMP; - jump->type = HLSL_IR_JUMP_BREAK; - out_cond->then_instrs = d3dcompiler_alloc(sizeof(*out_cond->then_instrs)); - if (!out_cond->then_instrs) - { - ERR("Out of memory.\n"); - d3dcompiler_free(out_cond); - d3dcompiler_free(not_cond); - d3dcompiler_free(jump); - return NULL; - } - list_init(out_cond->then_instrs); - list_add_head(out_cond->then_instrs, &jump->node.entry); - - return out_cond; -} - -enum loop_type -{ - LOOP_FOR, - LOOP_WHILE, - LOOP_DO_WHILE -}; - -static struct list *create_loop(enum loop_type type, struct list *init, struct list *cond, - struct hlsl_ir_node *iter, struct list *body, struct source_location *loc) -{ - struct list *list = NULL; - struct hlsl_ir_loop *loop = NULL; - struct hlsl_ir_if *cond_jump = NULL; - - list = d3dcompiler_alloc(sizeof(*list)); - if (!list) - goto oom; - list_init(list); - - if (init) - list_move_head(list, init); - - loop = d3dcompiler_alloc(sizeof(*loop)); - if (!loop) - goto oom; - loop->node.type = HLSL_IR_LOOP; - loop->node.loc = *loc; - list_add_tail(list, &loop->node.entry); - loop->body = d3dcompiler_alloc(sizeof(*loop->body)); - if (!loop->body) - goto oom; - list_init(loop->body); - - cond_jump = loop_condition(cond); - if (!cond_jump) - goto oom; - - if (type != LOOP_DO_WHILE) - list_add_tail(loop->body, &cond_jump->node.entry); - - list_move_tail(loop->body, body); - - if (iter) - list_add_tail(loop->body, &iter->entry); - - if (type == LOOP_DO_WHILE) - list_add_tail(loop->body, &cond_jump->node.entry); - - d3dcompiler_free(init); - d3dcompiler_free(cond); - d3dcompiler_free(body); - return list; - -oom: - ERR("Out of memory.\n"); - if (loop) - d3dcompiler_free(loop->body); - d3dcompiler_free(loop); - d3dcompiler_free(cond_jump); - d3dcompiler_free(list); - free_instr_list(init); - free_instr_list(cond); - free_instr(iter); - free_instr_list(body); - return NULL; -} - -static unsigned int initializer_size(const struct parse_initializer *initializer) -{ - unsigned int count = 0, i; - - for (i = 0; i < initializer->args_count; ++i) - { - count += components_count_type(initializer->args[i]->data_type); - } - TRACE("Initializer size = %u.\n", count); - return count; -} - -static void free_parse_initializer(struct parse_initializer *initializer) -{ - unsigned int i; - for (i = 0; i < initializer->args_count; ++i) - free_instr(initializer->args[i]); - d3dcompiler_free(initializer->args); -} - -static struct hlsl_ir_swizzle *new_swizzle(DWORD s, unsigned int components, - struct hlsl_ir_node *val, struct source_location *loc) -{ - struct hlsl_ir_swizzle *swizzle = d3dcompiler_alloc(sizeof(*swizzle)); - - if (!swizzle) - return NULL; - swizzle->node.type = HLSL_IR_SWIZZLE; - swizzle->node.loc = *loc; - swizzle->node.data_type = new_hlsl_type(NULL, HLSL_CLASS_VECTOR, val->data_type->base_type, components, 1); - swizzle->val = val; - swizzle->swizzle = s; - return swizzle; -} - -static struct hlsl_ir_swizzle *get_swizzle(struct hlsl_ir_node *value, const char *swizzle, - struct source_location *loc) -{ - unsigned int len = strlen(swizzle), component = 0; - unsigned int i, set, swiz = 0; - BOOL valid; - - if (value->data_type->type == HLSL_CLASS_MATRIX) - { - /* Matrix swizzle */ - BOOL m_swizzle; - unsigned int inc, x, y; - - if (len < 3 || swizzle[0] != '_') - return NULL; - m_swizzle = swizzle[1] == 'm'; - inc = m_swizzle ? 4 : 3; - - if (len % inc || len > inc * 4) - return NULL; - - for (i = 0; i < len; i += inc) - { - if (swizzle[i] != '_') - return NULL; - if (m_swizzle) - { - if (swizzle[i + 1] != 'm') - return NULL; - x = swizzle[i + 2] - '0'; - y = swizzle[i + 3] - '0'; - } - else - { - x = swizzle[i + 1] - '1'; - y = swizzle[i + 2] - '1'; - } - - if (x >= value->data_type->dimx || y >= value->data_type->dimy) - return NULL; - swiz |= (y << 4 | x) << component * 8; - component++; - } - return new_swizzle(swiz, component, value, loc); - } - - /* Vector swizzle */ - if (len > 4) - return NULL; - - for (set = 0; set < 2; ++set) - { - valid = TRUE; - component = 0; - for (i = 0; i < len; ++i) - { - char c[2][4] = {{'x', 'y', 'z', 'w'}, {'r', 'g', 'b', 'a'}}; - unsigned int s = 0; - - for (s = 0; s < 4; ++s) - { - if (swizzle[i] == c[set][s]) - break; - } - if (s == 4) - { - valid = FALSE; - break; - } - - if (s >= value->data_type->dimx) - return NULL; - swiz |= s << component * 2; - component++; - } - if (valid) - return new_swizzle(swiz, component, value, loc); - } - - return NULL; -} - -static void struct_var_initializer(struct list *list, struct hlsl_ir_var *var, - struct parse_initializer *initializer) -{ - struct hlsl_type *type = var->data_type; - struct hlsl_struct_field *field; - struct hlsl_ir_node *assignment; - struct hlsl_ir_deref *deref; - unsigned int i = 0; - - if (initializer_size(initializer) != components_count_type(type)) - { - hlsl_report_message(var->loc.file, var->loc.line, var->loc.col, HLSL_LEVEL_ERROR, - "structure initializer mismatch"); - free_parse_initializer(initializer); - return; - } - - LIST_FOR_EACH_ENTRY(field, type->e.elements, struct hlsl_struct_field, entry) - { - struct hlsl_ir_node *node = initializer->args[i]; - - if (i++ >= initializer->args_count) - { - d3dcompiler_free(initializer->args); - return; - } - if (components_count_type(field->type) == components_count_type(node->data_type)) - { - deref = new_record_deref(&new_var_deref(var)->node, field); - if (!deref) - { - ERR("Out of memory.\n"); - break; - } - deref->node.loc = node->loc; - assignment = make_assignment(&deref->node, ASSIGN_OP_ASSIGN, BWRITERSP_WRITEMASK_ALL, node); - list_add_tail(list, &assignment->entry); - } - else - FIXME("Initializing with \"mismatched\" fields is not supported yet.\n"); - } - - /* Free initializer elements in excess. */ - for (; i < initializer->args_count; ++i) - free_instr(initializer->args[i]); - d3dcompiler_free(initializer->args); -} - -static struct list *declare_vars(struct hlsl_type *basic_type, DWORD modifiers, struct list *var_list) -{ - struct hlsl_type *type; - struct parse_variable_def *v, *v_next; - struct hlsl_ir_var *var; - struct hlsl_ir_node *assignment; - BOOL ret, local = TRUE; - struct list *statements_list = d3dcompiler_alloc(sizeof(*statements_list)); - - if (!statements_list) - { - ERR("Out of memory.\n"); - LIST_FOR_EACH_ENTRY_SAFE(v, v_next, var_list, struct parse_variable_def, entry) - d3dcompiler_free(v); - d3dcompiler_free(var_list); - return NULL; - } - list_init(statements_list); - - if (!var_list) - return statements_list; - - LIST_FOR_EACH_ENTRY_SAFE(v, v_next, var_list, struct parse_variable_def, entry) - { - var = d3dcompiler_alloc(sizeof(*var)); - if (!var) - { - ERR("Out of memory.\n"); - d3dcompiler_free(v); - continue; - } - if (v->array_size) - type = new_array_type(basic_type, v->array_size); - else - type = basic_type; - var->data_type = type; - var->loc = v->loc; - var->name = v->name; - var->modifiers = modifiers; - var->semantic = v->semantic; - var->reg_reservation = v->reg_reservation; - debug_dump_decl(type, modifiers, v->name, v->loc.line); - - if (hlsl_ctx.cur_scope == hlsl_ctx.globals) - { - var->modifiers |= HLSL_STORAGE_UNIFORM; - local = FALSE; - } - - if (var->modifiers & HLSL_MODIFIER_CONST && !(var->modifiers & HLSL_STORAGE_UNIFORM) && !v->initializer.args_count) - { - hlsl_report_message(v->loc.file, v->loc.line, v->loc.col, - HLSL_LEVEL_ERROR, "const variable without initializer"); - free_declaration(var); - d3dcompiler_free(v); - continue; - } - - ret = declare_variable(var, local); - if (!ret) - { - free_declaration(var); - d3dcompiler_free(v); - continue; - } - TRACE("Declared variable %s.\n", var->name); - - if (v->initializer.args_count) - { - unsigned int size = initializer_size(&v->initializer); - - TRACE("Variable with initializer.\n"); - if (type->type <= HLSL_CLASS_LAST_NUMERIC - && type->dimx * type->dimy != size && size != 1) - { - if (size < type->dimx * type->dimy) - { - hlsl_report_message(v->loc.file, v->loc.line, v->loc.col, HLSL_LEVEL_ERROR, - "'%s' initializer does not match", v->name); - free_parse_initializer(&v->initializer); - d3dcompiler_free(v); - continue; - } - } - if ((type->type == HLSL_CLASS_STRUCT || type->type == HLSL_CLASS_ARRAY) - && components_count_type(type) != size) - { - hlsl_report_message(v->loc.file, v->loc.line, v->loc.col, HLSL_LEVEL_ERROR, - "'%s' initializer does not match", v->name); - free_parse_initializer(&v->initializer); - d3dcompiler_free(v); - continue; - } - - if (type->type == HLSL_CLASS_STRUCT) - { - struct_var_initializer(statements_list, var, &v->initializer); - d3dcompiler_free(v); - continue; - } - if (type->type > HLSL_CLASS_LAST_NUMERIC) - { - FIXME("Initializers for non scalar/struct variables not supported yet.\n"); - free_parse_initializer(&v->initializer); - d3dcompiler_free(v); - continue; - } - if (v->array_size > 0) - { - FIXME("Initializing arrays is not supported yet.\n"); - free_parse_initializer(&v->initializer); - d3dcompiler_free(v); - continue; - } - if (v->initializer.args_count > 1) - { - FIXME("Complex initializers are not supported yet.\n"); - free_parse_initializer(&v->initializer); - d3dcompiler_free(v); - continue; - } - - assignment = make_assignment(&new_var_deref(var)->node, ASSIGN_OP_ASSIGN, - BWRITERSP_WRITEMASK_ALL, v->initializer.args[0]); - d3dcompiler_free(v->initializer.args); - list_add_tail(statements_list, &assignment->entry); - } - d3dcompiler_free(v); - } - d3dcompiler_free(var_list); - return statements_list; -} - -static BOOL add_struct_field(struct list *fields, struct hlsl_struct_field *field) -{ - struct hlsl_struct_field *f; - - LIST_FOR_EACH_ENTRY(f, fields, struct hlsl_struct_field, entry) - { - if (!strcmp(f->name, field->name)) - return FALSE; - } - list_add_tail(fields, &field->entry); - return TRUE; -} - -static struct list *gen_struct_fields(struct hlsl_type *type, DWORD modifiers, struct list *fields) -{ - struct parse_variable_def *v, *v_next; - struct hlsl_struct_field *field; - struct list *list; - - list = d3dcompiler_alloc(sizeof(*list)); - if (!list) - { - ERR("Out of memory.\n"); - return NULL; - } - list_init(list); - LIST_FOR_EACH_ENTRY_SAFE(v, v_next, fields, struct parse_variable_def, entry) - { - debug_dump_decl(type, 0, v->name, v->loc.line); - field = d3dcompiler_alloc(sizeof(*field)); - if (!field) - { - ERR("Out of memory.\n"); - d3dcompiler_free(v); - return list; - } - field->type = type; - field->name = v->name; - field->modifiers = modifiers; - field->semantic = v->semantic; - if (v->initializer.args_count) - { - hlsl_report_message(v->loc.file, v->loc.line, v->loc.col, HLSL_LEVEL_ERROR, - "struct field with an initializer.\n"); - free_parse_initializer(&v->initializer); - } - list_add_tail(list, &field->entry); - d3dcompiler_free(v); - } - d3dcompiler_free(fields); - return list; -} - -static struct hlsl_type *new_struct_type(const char *name, DWORD modifiers, struct list *fields) -{ - struct hlsl_type *type = d3dcompiler_alloc(sizeof(*type)); - - if (!type) - { - ERR("Out of memory.\n"); - return NULL; - } - type->type = HLSL_CLASS_STRUCT; - type->name = name; - type->dimx = type->dimy = 1; - type->modifiers = modifiers; - type->e.elements = fields; - - list_add_tail(&hlsl_ctx.types, &type->entry); - - return type; -} - -static BOOL add_typedef(DWORD modifiers, struct hlsl_type *orig_type, struct list *list, - struct source_location *loc) -{ - BOOL ret; - struct hlsl_type *type; - struct parse_variable_def *v, *v_next; - - if (!check_type_modifiers(modifiers, loc)) - { - LIST_FOR_EACH_ENTRY_SAFE(v, v_next, list, struct parse_variable_def, entry) - d3dcompiler_free(v); - d3dcompiler_free(list); - return FALSE; - } - - LIST_FOR_EACH_ENTRY_SAFE(v, v_next, list, struct parse_variable_def, entry) - { - if (v->array_size) - type = new_array_type(orig_type, v->array_size); - else - type = clone_hlsl_type(orig_type); - if (!type) - { - ERR("Out of memory\n"); - return FALSE; - } - d3dcompiler_free((void *)type->name); - type->name = v->name; - type->modifiers |= modifiers; - - if (type->type != HLSL_CLASS_MATRIX) - check_invalid_matrix_modifiers(type->modifiers, &v->loc); - - ret = add_type_to_scope(hlsl_ctx.cur_scope, type); - if (!ret) - { - hlsl_report_message(v->loc.file, v->loc.line, v->loc.col, HLSL_LEVEL_ERROR, - "redefinition of custom type '%s'", v->name); - } - d3dcompiler_free(v); - } - d3dcompiler_free(list); - return TRUE; -} - -static BOOL add_func_parameter(struct list *list, struct parse_parameter *param, const struct source_location *loc) -{ - struct hlsl_ir_var *decl = d3dcompiler_alloc(sizeof(*decl)); - - if (!decl) - { - ERR("Out of memory.\n"); - return FALSE; - } - decl->data_type = param->type; - decl->loc = *loc; - decl->name = param->name; - decl->semantic = param->semantic; - decl->reg_reservation = param->reg_reservation; - decl->modifiers = param->modifiers; - - if (!add_declaration(hlsl_ctx.cur_scope, decl, FALSE)) - { - free_declaration(decl); - return FALSE; - } - list_add_tail(list, &decl->param_entry); - return TRUE; -} - -static struct reg_reservation *parse_reg_reservation(const char *reg_string) -{ - struct reg_reservation *reg_res; - enum bwritershader_param_register_type type; - DWORD regnum = 0; - - switch (reg_string[0]) - { - case 'c': - type = BWRITERSPR_CONST; - break; - case 'i': - type = BWRITERSPR_CONSTINT; - break; - case 'b': - type = BWRITERSPR_CONSTBOOL; - break; - case 's': - type = BWRITERSPR_SAMPLER; - break; - default: - FIXME("Unsupported register type.\n"); - return NULL; - } - - if (!sscanf(reg_string + 1, "%u", ®num)) - { - FIXME("Unsupported register reservation syntax.\n"); - return NULL; - } - - reg_res = d3dcompiler_alloc(sizeof(*reg_res)); - if (!reg_res) - { - ERR("Out of memory.\n"); - return NULL; - } - reg_res->type = type; - reg_res->regnum = regnum; - return reg_res; -} - -static const struct hlsl_ir_function_decl *get_overloaded_func(struct wine_rb_tree *funcs, char *name, - struct list *params, BOOL exact_signature) -{ - struct hlsl_ir_function *func; - struct wine_rb_entry *entry; - - entry = wine_rb_get(funcs, name); - if (entry) - { - func = WINE_RB_ENTRY_VALUE(entry, struct hlsl_ir_function, entry); - - entry = wine_rb_get(&func->overloads, params); - if (!entry) - { - if (!exact_signature) - FIXME("No exact match, search for a compatible overloaded function (if any).\n"); - return NULL; - } - return WINE_RB_ENTRY_VALUE(entry, struct hlsl_ir_function_decl, entry); - } - return NULL; -} - - -#line 943 "hlsl.tab.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_HLSL_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_HLSL_TAB_H_INCLUDED -# define YY_HLSL_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_HLSL_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int hlsl_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - KW_BLENDSTATE = 258, - KW_BREAK = 259, - KW_BUFFER = 260, - KW_CBUFFER = 261, - KW_COLUMN_MAJOR = 262, - KW_COMPILE = 263, - KW_CONST = 264, - KW_CONTINUE = 265, - KW_DEPTHSTENCILSTATE = 266, - KW_DEPTHSTENCILVIEW = 267, - KW_DISCARD = 268, - KW_DO = 269, - KW_DOUBLE = 270, - KW_ELSE = 271, - KW_EXTERN = 272, - KW_FALSE = 273, - KW_FOR = 274, - KW_GEOMETRYSHADER = 275, - KW_GROUPSHARED = 276, - KW_IF = 277, - KW_IN = 278, - KW_INLINE = 279, - KW_INOUT = 280, - KW_MATRIX = 281, - KW_NAMESPACE = 282, - KW_NOINTERPOLATION = 283, - KW_OUT = 284, - KW_PASS = 285, - KW_PIXELSHADER = 286, - KW_PRECISE = 287, - KW_RASTERIZERSTATE = 288, - KW_RENDERTARGETVIEW = 289, - KW_RETURN = 290, - KW_REGISTER = 291, - KW_ROW_MAJOR = 292, - KW_SAMPLER = 293, - KW_SAMPLER1D = 294, - KW_SAMPLER2D = 295, - KW_SAMPLER3D = 296, - KW_SAMPLERCUBE = 297, - KW_SAMPLER_STATE = 298, - KW_SAMPLERCOMPARISONSTATE = 299, - KW_SHARED = 300, - KW_STATEBLOCK = 301, - KW_STATEBLOCK_STATE = 302, - KW_STATIC = 303, - KW_STRING = 304, - KW_STRUCT = 305, - KW_SWITCH = 306, - KW_TBUFFER = 307, - KW_TECHNIQUE = 308, - KW_TECHNIQUE10 = 309, - KW_TEXTURE = 310, - KW_TEXTURE1D = 311, - KW_TEXTURE1DARRAY = 312, - KW_TEXTURE2D = 313, - KW_TEXTURE2DARRAY = 314, - KW_TEXTURE2DMS = 315, - KW_TEXTURE2DMSARRAY = 316, - KW_TEXTURE3D = 317, - KW_TEXTURE3DARRAY = 318, - KW_TEXTURECUBE = 319, - KW_TRUE = 320, - KW_TYPEDEF = 321, - KW_UNIFORM = 322, - KW_VECTOR = 323, - KW_VERTEXSHADER = 324, - KW_VOID = 325, - KW_VOLATILE = 326, - KW_WHILE = 327, - OP_INC = 328, - OP_DEC = 329, - OP_AND = 330, - OP_OR = 331, - OP_EQ = 332, - OP_LEFTSHIFT = 333, - OP_LEFTSHIFTASSIGN = 334, - OP_RIGHTSHIFT = 335, - OP_RIGHTSHIFTASSIGN = 336, - OP_ELLIPSIS = 337, - OP_LE = 338, - OP_GE = 339, - OP_NE = 340, - OP_ADDASSIGN = 341, - OP_SUBASSIGN = 342, - OP_MULASSIGN = 343, - OP_DIVASSIGN = 344, - OP_MODASSIGN = 345, - OP_ANDASSIGN = 346, - OP_ORASSIGN = 347, - OP_XORASSIGN = 348, - OP_UNKNOWN1 = 349, - OP_UNKNOWN2 = 350, - OP_UNKNOWN3 = 351, - OP_UNKNOWN4 = 352, - PRE_LINE = 353, - VAR_IDENTIFIER = 354, - TYPE_IDENTIFIER = 355, - NEW_IDENTIFIER = 356, - STRING = 357, - C_FLOAT = 358, - C_INTEGER = 359 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 890 "hlsl.y" - - struct hlsl_type *type; - INT intval; - FLOAT floatval; - BOOL boolval; - char *name; - DWORD modifiers; - struct hlsl_ir_node *instr; - struct list *list; - struct parse_function function; - struct parse_parameter parameter; - struct parse_initializer initializer; - struct parse_variable_def *variable_def; - struct parse_if_body if_body; - enum parse_unary_op unary_op; - enum parse_assign_op assign_op; - struct reg_reservation *reg_reservation; - struct parse_colon_attribute colon_attribute; - -#line 1111 "hlsl.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE YYLTYPE; -struct YYLTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - -extern YYSTYPE hlsl_lval; -extern YYLTYPE hlsl_lloc; -int hlsl_parse (void); - -#endif /* !YY_HLSL_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_HLSL_TAB_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ - && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; - YYLTYPE yyls_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 820 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 129 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 64 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 174 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 320 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 359 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 120, 2, 2, 2, 124, 125, 2, - 108, 109, 122, 118, 111, 119, 117, 123, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 110, 105, - 112, 114, 113, 128, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 115, 2, 116, 126, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 106, 127, 107, 121, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 1074, 1074, 1076, 1113, 1117, 1120, 1125, 1147, 1164, - 1165, 1167, 1193, 1203, 1204, 1205, 1208, 1212, 1231, 1235, - 1240, 1247, 1254, 1284, 1289, 1296, 1300, 1301, 1304, 1308, - 1313, 1319, 1325, 1330, 1339, 1344, 1349, 1363, 1377, 1388, - 1391, 1402, 1406, 1410, 1415, 1419, 1438, 1458, 1462, 1467, - 1472, 1477, 1482, 1487, 1495, 1513, 1514, 1515, 1526, 1534, - 1543, 1549, 1555, 1563, 1569, 1572, 1577, 1583, 1589, 1598, - 1611, 1614, 1622, 1625, 1629, 1633, 1637, 1641, 1645, 1649, - 1653, 1657, 1661, 1665, 1670, 1677, 1681, 1686, 1691, 1698, - 1706, 1710, 1715, 1719, 1726, 1727, 1728, 1729, 1730, 1731, - 1734, 1757, 1781, 1786, 1792, 1807, 1822, 1830, 1842, 1847, - 1855, 1869, 1883, 1897, 1917, 1922, 1926, 1942, 1958, 2012, - 2072, 2110, 2114, 2127, 2140, 2157, 2189, 2193, 2197, 2201, - 2206, 2210, 2217, 2224, 2232, 2236, 2243, 2251, 2255, 2259, - 2264, 2268, 2275, 2282, 2289, 2297, 2301, 2308, 2316, 2320, - 2325, 2329, 2334, 2338, 2343, 2347, 2352, 2356, 2361, 2365, - 2370, 2374, 2391, 2395, 2399, 2403, 2407, 2411, 2415, 2419, - 2423, 2427, 2431, 2436, 2440 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "KW_BLENDSTATE", "KW_BREAK", "KW_BUFFER", - "KW_CBUFFER", "KW_COLUMN_MAJOR", "KW_COMPILE", "KW_CONST", "KW_CONTINUE", - "KW_DEPTHSTENCILSTATE", "KW_DEPTHSTENCILVIEW", "KW_DISCARD", "KW_DO", - "KW_DOUBLE", "KW_ELSE", "KW_EXTERN", "KW_FALSE", "KW_FOR", - "KW_GEOMETRYSHADER", "KW_GROUPSHARED", "KW_IF", "KW_IN", "KW_INLINE", - "KW_INOUT", "KW_MATRIX", "KW_NAMESPACE", "KW_NOINTERPOLATION", "KW_OUT", - "KW_PASS", "KW_PIXELSHADER", "KW_PRECISE", "KW_RASTERIZERSTATE", - "KW_RENDERTARGETVIEW", "KW_RETURN", "KW_REGISTER", "KW_ROW_MAJOR", - "KW_SAMPLER", "KW_SAMPLER1D", "KW_SAMPLER2D", "KW_SAMPLER3D", - "KW_SAMPLERCUBE", "KW_SAMPLER_STATE", "KW_SAMPLERCOMPARISONSTATE", - "KW_SHARED", "KW_STATEBLOCK", "KW_STATEBLOCK_STATE", "KW_STATIC", - "KW_STRING", "KW_STRUCT", "KW_SWITCH", "KW_TBUFFER", "KW_TECHNIQUE", - "KW_TECHNIQUE10", "KW_TEXTURE", "KW_TEXTURE1D", "KW_TEXTURE1DARRAY", - "KW_TEXTURE2D", "KW_TEXTURE2DARRAY", "KW_TEXTURE2DMS", - "KW_TEXTURE2DMSARRAY", "KW_TEXTURE3D", "KW_TEXTURE3DARRAY", - "KW_TEXTURECUBE", "KW_TRUE", "KW_TYPEDEF", "KW_UNIFORM", "KW_VECTOR", - "KW_VERTEXSHADER", "KW_VOID", "KW_VOLATILE", "KW_WHILE", "OP_INC", - "OP_DEC", "OP_AND", "OP_OR", "OP_EQ", "OP_LEFTSHIFT", - "OP_LEFTSHIFTASSIGN", "OP_RIGHTSHIFT", "OP_RIGHTSHIFTASSIGN", - "OP_ELLIPSIS", "OP_LE", "OP_GE", "OP_NE", "OP_ADDASSIGN", "OP_SUBASSIGN", - "OP_MULASSIGN", "OP_DIVASSIGN", "OP_MODASSIGN", "OP_ANDASSIGN", - "OP_ORASSIGN", "OP_XORASSIGN", "OP_UNKNOWN1", "OP_UNKNOWN2", - "OP_UNKNOWN3", "OP_UNKNOWN4", "PRE_LINE", "VAR_IDENTIFIER", - "TYPE_IDENTIFIER", "NEW_IDENTIFIER", "STRING", "C_FLOAT", "C_INTEGER", - "';'", "'{'", "'}'", "'('", "')'", "':'", "','", "'<'", "'>'", "'='", - "'['", "']'", "'.'", "'+'", "'-'", "'!'", "'~'", "'*'", "'/'", "'%'", - "'&'", "'^'", "'|'", "'?'", "$accept", "hlsl_prog", "preproc_directive", - "struct_declaration", "struct_spec", "named_struct_spec", - "unnamed_struct_spec", "any_identifier", "fields_list", "field", - "func_declaration", "func_prototype", "compound_statement", - "scope_start", "var_identifier", "colon_attribute", "semantic", - "register_opt", "parameters", "param_list", "parameter", "input_mods", - "input_mod", "type", "base_type", "declaration_statement", "typedef", - "type_specs", "type_spec", "declaration", "variables_def_optional", - "variables_def", "variable_def", "array", "var_modifiers", - "complex_initializer", "initializer_expr", "initializer_expr_list", - "boolean", "statement_list", "statement", "jump_statement", - "selection_statement", "if_body", "loop_statement", "expr_statement", - "primary_expr", "postfix_expr", "unary_expr", "unary_op", "mul_expr", - "add_expr", "shift_expr", "relational_expr", "equality_expr", - "bitand_expr", "bitxor_expr", "bitor_expr", "logicand_expr", - "logicor_expr", "conditional_expr", "assignment_expr", "assign_op", - "expr", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 59, 123, 125, 40, 41, - 58, 44, 60, 62, 61, 91, 93, 46, 43, 45, - 33, 126, 42, 47, 37, 38, 94, 124, 63 -}; -# endif - -#define YYPACT_NINF -228 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-228))) - -#define YYTABLE_NINF -35 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -228, 673, -228, 749, 749, 749, 749, 749, 749, 749, - 749, 749, 749, 749, 749, -66, -228, -228, -228, 80, - -228, -228, -228, 107, -228, -228, -228, 38, -228, -228, - -228, -228, -228, -228, -228, -228, -228, 80, 38, -228, - -228, -228, -228, -228, -228, -64, -51, -72, -228, -228, - -44, -228, -29, -228, -228, -228, -228, -228, 24, -20, - -228, -228, 83, -228, -64, -55, -228, 80, 612, 33, - -228, 80, -228, 353, 5, 1, -228, 8, 5, 77, - 92, 95, -10, -228, -228, 80, 4, -228, -228, 612, - 612, -228, -228, -228, 612, -228, -228, -228, -228, 257, - -228, -228, -15, 137, 612, 97, 70, -54, 86, -24, - 118, 96, 129, 175, -58, -228, -228, -76, -3, 141, - -228, -228, -228, 353, 150, 152, 612, 160, -228, -228, - -228, 38, 245, -228, -228, -228, -228, -228, 21, 172, - 167, 20, -228, 168, -228, -228, -228, -228, -228, -228, - 257, -38, 173, -228, -228, 612, 80, -228, -228, -228, - -228, -228, -228, -228, -228, -228, -228, -228, 612, -228, - 612, 612, 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, 612, 612, - -228, 178, -228, 432, 215, -228, 612, 23, 612, 11, - -228, -228, -228, -228, 184, -228, 80, -228, 365, 169, - 185, 182, 183, -85, -228, 612, -12, -228, -228, -228, - -228, -228, -228, 97, 97, 70, 70, -54, -54, -54, - -54, 86, 86, -24, 118, 96, 129, 175, 128, -228, - 80, 612, -228, -228, -228, 186, 472, 82, -228, 85, - 189, 28, 29, 80, -228, 188, 191, -228, 720, 33, - 194, -228, 98, -228, 612, 122, 10, 612, 472, 257, - 472, 353, 353, 200, -228, 66, -228, -228, -228, -228, - -228, -228, 257, -228, 612, -228, 612, -228, -228, 80, - -228, 551, 123, 612, 612, 289, -228, -228, 193, -228, - -228, 80, -228, -228, 206, -228, 204, 126, 135, 353, - -228, 33, -228, -228, 353, 353, -228, -228, -228, -228 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 72, 1, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 0, 6, 5, 56, 64, - 9, 10, 3, 0, 4, 57, 55, 0, 83, 81, - 73, 77, 74, 75, 82, 76, 78, 0, 0, 79, - 80, 7, 13, 14, 15, 70, 0, 65, 66, 21, - 25, 20, 0, 48, 49, 50, 51, 52, 0, 0, - 47, 53, 0, 44, 70, 0, 60, 0, 72, 28, - 8, 0, 23, 72, 0, 54, 16, 0, 0, 13, - 15, 0, 0, 62, 59, 0, 0, 91, 90, 72, - 72, 113, 110, 111, 72, 126, 127, 128, 129, 0, - 112, 115, 121, 130, 72, 134, 137, 140, 145, 148, - 150, 152, 154, 156, 158, 160, 173, 0, 0, 68, - 29, 30, 67, 72, 0, 0, 72, 0, 108, 96, - 94, 0, 72, 92, 97, 98, 99, 95, 0, 0, - 0, 72, 16, 0, 25, 63, 61, 58, 122, 123, - 0, 0, 0, 116, 117, 72, 0, 168, 169, 163, - 164, 165, 166, 167, 170, 171, 172, 162, 72, 124, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 71, 0, 31, 72, 0, 25, 72, 0, 72, 0, - 24, 93, 109, 54, 0, 12, 0, 17, 0, 72, - 0, 39, 0, 70, 114, 72, 0, 118, 161, 131, - 132, 133, 130, 135, 136, 138, 139, 143, 144, 141, - 142, 146, 147, 149, 151, 153, 155, 157, 0, 174, - 0, 72, 69, 84, 87, 0, 72, 0, 100, 0, - 0, 0, 0, 0, 11, 0, 35, 36, 72, 28, - 0, 88, 0, 119, 72, 0, 0, 72, 72, 0, - 72, 72, 72, 0, 19, 0, 45, 39, 41, 43, - 42, 40, 0, 22, 72, 120, 72, 159, 32, 0, - 85, 72, 0, 72, 72, 102, 101, 104, 0, 18, - 37, 0, 125, 89, 0, 86, 0, 0, 0, 72, - 46, 28, 33, 105, 72, 72, 103, 38, 107, 106 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -228, -228, -228, -228, 308, -228, -120, -36, 179, -228, - -228, -228, 299, -110, -228, -227, -228, -228, -228, -228, - 46, -228, -228, -13, 67, 323, -228, 259, 243, 84, - -228, -4, 258, -47, -1, -228, -173, 90, -228, -228, - -104, -228, -228, -228, -228, -208, -228, -228, -23, -228, - 74, 99, -5, 103, 149, 151, 148, 153, 147, -228, - -228, -99, -228, -52 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 17, 18, 19, 20, 21, 45, 141, 207, - 22, 23, 129, 73, 81, 119, 120, 121, 212, 256, - 257, 258, 281, 199, 63, 130, 25, 65, 66, 26, - 46, 82, 48, 69, 99, 242, 261, 262, 100, 132, - 133, 134, 135, 296, 136, 137, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 168, 138 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 27, 64, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 38, 39, 40, 62, 47, 117, 83, 187, 194, - 243, 206, 77, 215, 175, 67, 176, 3, 201, 4, - 68, 64, 283, 191, 211, 189, 41, 5, 270, 71, - 190, 6, 151, 53, 54, 55, 56, 57, 7, 64, - 84, 68, 8, 181, 70, 139, 85, 9, 153, 154, - 293, 182, 294, 72, 52, 10, 148, 149, 11, 218, - 188, 214, 131, 189, 197, 60, 53, 54, 55, 56, - 57, 169, 192, 74, 317, 246, 152, 13, 58, 206, - 239, 14, 78, 150, 244, 145, 42, 43, 44, 189, - 155, 71, 156, 216, 263, 61, 59, -14, 60, 147, - 42, 43, 44, 303, 142, 85, 244, 290, 303, 215, - 217, 291, 131, 42, 75, 44, 202, 205, 248, 203, - 76, 131, 189, 274, 189, 76, 238, 213, 61, 71, - 208, 140, 244, 118, 247, 143, 249, 219, 220, 221, - 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 287, 260, 295, 297, 177, - 178, 299, 227, 228, 229, 230, 3, 71, 4, 42, - 43, 44, 79, 43, 80, -26, 5, 244, 173, 174, - 6, 271, 244, 189, 272, 253, 189, 7, 179, 180, - -27, 8, 251, 144, 265, 316, 9, 285, 208, 286, - 318, 319, 49, 50, 10, 292, 157, 11, 158, 170, - 171, 172, 184, 159, 160, 161, 162, 163, 164, 165, - 166, 288, 306, 289, 189, 314, 13, 189, 264, 189, - 14, 307, 308, 183, 315, 269, 189, 223, 224, 275, - 186, 167, 3, 304, 4, 193, 185, 282, 195, 123, - 196, 302, 5, 87, 124, 311, 6, 125, 198, 301, - 131, 131, 203, 7, 225, 226, 254, 8, 204, 210, - 126, 215, 9, 52, 231, 232, 240, 245, 250, 255, - 10, -34, 259, 11, 267, 53, 54, 55, 56, 57, - 273, 276, 277, 284, 298, 309, 310, 139, 131, 313, - 88, 12, 13, 131, 131, 312, 14, 127, 89, 90, - 37, 209, 51, 300, 24, 59, 86, 60, 146, 122, - 268, 266, 233, 235, 237, 234, 0, 0, 0, 236, - 0, 0, 0, 0, 91, 0, 0, 0, 92, 93, - 128, 50, 200, 94, 0, 0, 0, 61, 0, 0, - 3, 0, 4, 95, 96, 97, 98, 123, 0, 0, - 5, 87, 124, 0, 6, 125, 0, 0, 0, 0, - 0, 7, 0, 0, 0, 8, 0, 0, 126, 0, - 9, 52, 0, 0, 0, 0, 0, 0, 10, 0, - 0, 11, 0, 53, 54, 55, 56, 57, 0, 0, - 0, 0, 0, 0, 0, 252, 0, 0, 88, 12, - 13, 0, 0, 0, 14, 127, 89, 90, 0, 0, - 0, 0, 0, 59, 0, 60, 0, 0, 0, 3, - 0, 4, 0, 0, 0, 0, 0, 0, 0, 5, - 87, 0, 91, 6, 0, 0, 92, 93, 128, 50, - 7, 94, 0, 0, 8, 61, 0, 0, 0, 9, - 0, 95, 96, 97, 98, 0, 0, 10, 0, 3, - 11, 4, 0, 0, 0, 0, 0, 0, 0, 5, - 87, 0, 0, 6, 0, 0, 0, 88, 0, 13, - 7, 0, 0, 14, 8, 89, 90, 0, 0, 9, - 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 91, 0, 0, 0, 92, 93, 88, 241, 13, - 94, 0, 0, 14, 0, 89, 90, 0, 0, 0, - 95, 96, 97, 98, 0, 0, 0, 0, 3, 0, - 4, 0, 0, 0, 0, 0, 0, 0, 5, 87, - 0, 91, 6, 0, 0, 92, 93, 128, 0, 7, - 94, 0, 0, 8, 0, 0, 0, 0, 9, 0, - 95, 96, 97, 98, 0, 0, 10, 0, 0, 11, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 88, 0, 13, 3, - 0, 4, 14, 0, 89, 90, 0, 0, 0, 5, - 87, 0, 0, 6, 0, 0, 0, 0, 0, 0, - 7, 0, 0, 0, 8, 0, 0, 0, 0, 9, - 91, 0, 0, 0, 92, 93, 0, 10, 305, 94, - 11, 0, 0, 0, 0, 0, 0, 0, 0, 95, - 96, 97, 98, 2, 0, 0, 0, 88, 0, 13, - 3, 0, 4, 14, 0, 89, 90, 0, 0, 0, - 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, - 0, 7, 0, 0, 0, 8, 0, 0, 0, 0, - 9, 91, 0, 0, 0, 92, 93, 0, 10, 0, - 94, 11, 0, 0, 0, 0, 0, 3, 0, 4, - 95, 96, 97, 98, 0, 0, 0, 5, 0, 12, - 13, 6, 0, 278, 14, 279, 0, 0, 7, 280, - 0, 0, 8, 0, 0, 0, 3, 9, 4, 0, - 0, 0, 0, 0, 0, 10, 5, 0, 11, 0, - 6, 15, 0, 0, 0, 0, 0, 7, 16, 0, - 0, 8, 0, 0, 0, 0, 9, 13, 0, 0, - 0, 14, 0, 0, 10, 0, 0, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, - 14 -}; - -static const yytype_int16 yycheck[] = -{ - 1, 37, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 27, 19, 68, 64, 76, 123, - 193, 141, 58, 108, 78, 38, 80, 7, 132, 9, - 115, 67, 259, 36, 144, 111, 102, 17, 246, 111, - 116, 21, 94, 38, 39, 40, 41, 42, 28, 85, - 105, 115, 32, 77, 105, 50, 111, 37, 73, 74, - 268, 85, 270, 107, 26, 45, 89, 90, 48, 168, - 128, 109, 73, 111, 126, 70, 38, 39, 40, 41, - 42, 104, 118, 112, 311, 195, 99, 67, 50, 209, - 189, 71, 112, 94, 193, 105, 99, 100, 101, 111, - 115, 111, 117, 155, 116, 100, 68, 106, 70, 105, - 99, 100, 101, 286, 106, 111, 215, 107, 291, 108, - 156, 111, 123, 99, 100, 101, 105, 107, 105, 100, - 106, 132, 111, 105, 111, 106, 188, 150, 100, 111, - 141, 74, 241, 110, 196, 78, 198, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 264, 213, 271, 272, 83, - 84, 105, 177, 178, 179, 180, 7, 111, 9, 99, - 100, 101, 99, 100, 101, 108, 17, 286, 118, 119, - 21, 109, 291, 111, 109, 208, 111, 28, 112, 113, - 108, 32, 206, 108, 240, 309, 37, 109, 209, 111, - 314, 315, 105, 106, 45, 267, 79, 48, 81, 122, - 123, 124, 126, 86, 87, 88, 89, 90, 91, 92, - 93, 109, 109, 111, 111, 109, 67, 111, 110, 111, - 71, 293, 294, 125, 109, 246, 111, 173, 174, 253, - 75, 114, 7, 289, 9, 114, 127, 258, 108, 14, - 108, 284, 17, 18, 19, 301, 21, 22, 108, 282, - 271, 272, 100, 28, 175, 176, 107, 32, 111, 111, - 35, 108, 37, 26, 181, 182, 108, 72, 104, 104, - 45, 109, 109, 48, 108, 38, 39, 40, 41, 42, - 111, 113, 111, 109, 104, 16, 113, 50, 309, 105, - 65, 66, 67, 314, 315, 109, 71, 72, 73, 74, - 12, 142, 23, 277, 1, 68, 67, 70, 85, 71, - 246, 241, 183, 185, 187, 184, -1, -1, -1, 186, - -1, -1, -1, -1, 99, -1, -1, -1, 103, 104, - 105, 106, 107, 108, -1, -1, -1, 100, -1, -1, - 7, -1, 9, 118, 119, 120, 121, 14, -1, -1, - 17, 18, 19, -1, 21, 22, -1, -1, -1, -1, - -1, 28, -1, -1, -1, 32, -1, -1, 35, -1, - 37, 26, -1, -1, -1, -1, -1, -1, 45, -1, - -1, 48, -1, 38, 39, 40, 41, 42, -1, -1, - -1, -1, -1, -1, -1, 50, -1, -1, 65, 66, - 67, -1, -1, -1, 71, 72, 73, 74, -1, -1, - -1, -1, -1, 68, -1, 70, -1, -1, -1, 7, - -1, 9, -1, -1, -1, -1, -1, -1, -1, 17, - 18, -1, 99, 21, -1, -1, 103, 104, 105, 106, - 28, 108, -1, -1, 32, 100, -1, -1, -1, 37, - -1, 118, 119, 120, 121, -1, -1, 45, -1, 7, - 48, 9, -1, -1, -1, -1, -1, -1, -1, 17, - 18, -1, -1, 21, -1, -1, -1, 65, -1, 67, - 28, -1, -1, 71, 32, 73, 74, -1, -1, 37, - -1, -1, -1, -1, -1, -1, -1, 45, -1, -1, - 48, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 99, -1, -1, -1, 103, 104, 65, 106, 67, - 108, -1, -1, 71, -1, 73, 74, -1, -1, -1, - 118, 119, 120, 121, -1, -1, -1, -1, 7, -1, - 9, -1, -1, -1, -1, -1, -1, -1, 17, 18, - -1, 99, 21, -1, -1, 103, 104, 105, -1, 28, - 108, -1, -1, 32, -1, -1, -1, -1, 37, -1, - 118, 119, 120, 121, -1, -1, 45, -1, -1, 48, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 65, -1, 67, 7, - -1, 9, 71, -1, 73, 74, -1, -1, -1, 17, - 18, -1, -1, 21, -1, -1, -1, -1, -1, -1, - 28, -1, -1, -1, 32, -1, -1, -1, -1, 37, - 99, -1, -1, -1, 103, 104, -1, 45, 107, 108, - 48, -1, -1, -1, -1, -1, -1, -1, -1, 118, - 119, 120, 121, 0, -1, -1, -1, 65, -1, 67, - 7, -1, 9, 71, -1, 73, 74, -1, -1, -1, - 17, -1, -1, -1, 21, -1, -1, -1, -1, -1, - -1, 28, -1, -1, -1, 32, -1, -1, -1, -1, - 37, 99, -1, -1, -1, 103, 104, -1, 45, -1, - 108, 48, -1, -1, -1, -1, -1, 7, -1, 9, - 118, 119, 120, 121, -1, -1, -1, 17, -1, 66, - 67, 21, -1, 23, 71, 25, -1, -1, 28, 29, - -1, -1, 32, -1, -1, -1, 7, 37, 9, -1, - -1, -1, -1, -1, -1, 45, 17, -1, 48, -1, - 21, 98, -1, -1, -1, -1, -1, 28, 105, -1, - -1, 32, -1, -1, -1, -1, 37, 67, -1, -1, - -1, 71, -1, -1, 45, -1, -1, 48, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 67, -1, -1, -1, - 71 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 130, 0, 7, 9, 17, 21, 28, 32, 37, - 45, 48, 66, 67, 71, 98, 105, 131, 132, 133, - 134, 135, 139, 140, 154, 155, 158, 163, 163, 163, - 163, 163, 163, 163, 163, 163, 163, 133, 163, 163, - 163, 102, 99, 100, 101, 136, 159, 160, 161, 105, - 106, 141, 26, 38, 39, 40, 41, 42, 50, 68, - 70, 100, 152, 153, 136, 156, 157, 152, 115, 162, - 105, 111, 107, 142, 112, 100, 106, 136, 112, 99, - 101, 143, 160, 162, 105, 111, 156, 18, 65, 73, - 74, 99, 103, 104, 108, 118, 119, 120, 121, 163, - 167, 175, 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 192, 110, 144, - 145, 146, 161, 14, 19, 22, 35, 72, 105, 141, - 154, 163, 168, 169, 170, 171, 173, 174, 192, 50, - 153, 137, 106, 153, 108, 105, 157, 105, 177, 177, - 163, 192, 152, 73, 74, 115, 117, 79, 81, 86, - 87, 88, 89, 90, 91, 92, 93, 114, 191, 177, - 122, 123, 124, 118, 119, 78, 80, 83, 84, 112, - 113, 77, 85, 125, 126, 127, 75, 76, 128, 111, - 116, 36, 136, 114, 169, 108, 108, 192, 108, 152, - 107, 169, 105, 100, 111, 107, 135, 138, 163, 137, - 111, 142, 147, 152, 109, 108, 192, 136, 190, 177, - 177, 177, 177, 179, 179, 180, 180, 181, 181, 181, - 181, 182, 182, 183, 184, 185, 186, 187, 192, 190, - 108, 106, 164, 165, 190, 72, 142, 192, 105, 192, - 104, 160, 50, 152, 107, 104, 148, 149, 150, 109, - 162, 165, 166, 116, 110, 136, 166, 108, 158, 163, - 174, 109, 109, 111, 105, 160, 113, 111, 23, 25, - 29, 151, 163, 144, 109, 109, 111, 190, 109, 111, - 107, 111, 192, 174, 174, 169, 172, 169, 104, 105, - 149, 152, 177, 165, 136, 107, 109, 192, 192, 16, - 113, 136, 109, 105, 109, 109, 169, 144, 169, 169 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 129, 130, 130, 130, 130, 130, 131, 132, 133, - 133, 134, 135, 136, 136, 136, 137, 137, 138, 138, - 139, 139, 140, 141, 141, 142, 143, 143, 144, 144, - 144, 145, 146, 146, 147, 147, 148, 148, 149, 150, - 150, 151, 151, 151, 152, 152, 152, 153, 153, 153, - 153, 153, 153, 153, 153, 154, 154, 154, 155, 155, - 156, 156, 157, 158, 159, 159, 160, 160, 161, 161, - 162, 162, 163, 163, 163, 163, 163, 163, 163, 163, - 163, 163, 163, 163, 164, 164, 164, 165, 166, 166, - 167, 167, 168, 168, 169, 169, 169, 169, 169, 169, - 170, 171, 172, 172, 173, 173, 173, 173, 174, 174, - 175, 175, 175, 175, 175, 176, 176, 176, 176, 176, - 176, 177, 177, 177, 177, 177, 178, 178, 178, 178, - 179, 179, 179, 179, 180, 180, 180, 181, 181, 181, - 182, 182, 182, 182, 182, 183, 183, 183, 184, 184, - 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, - 190, 190, 191, 191, 191, 191, 191, 191, 191, 191, - 191, 191, 191, 192, 192 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 2, 2, 2, 2, 3, 1, - 1, 6, 5, 1, 1, 1, 0, 2, 4, 3, - 2, 2, 7, 2, 4, 0, 1, 1, 0, 1, - 1, 2, 5, 7, 1, 2, 1, 3, 5, 0, - 2, 1, 1, 1, 1, 6, 8, 1, 1, 1, - 1, 1, 1, 1, 2, 1, 1, 1, 5, 4, - 1, 3, 2, 4, 0, 1, 1, 3, 3, 5, - 0, 3, 0, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 1, 3, 4, 1, 1, 3, - 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, - 3, 5, 1, 3, 5, 7, 8, 8, 1, 2, - 1, 1, 1, 1, 3, 1, 2, 2, 3, 4, - 5, 1, 2, 2, 2, 6, 1, 1, 1, 1, - 1, 3, 3, 3, 1, 3, 3, 1, 3, 3, - 1, 3, 3, 3, 3, 1, 3, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 5, - 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) -#endif - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL - -/* Print *YYLOCP on YYO. Private, do not rely on its existence. */ - -YY_ATTRIBUTE_UNUSED -static int -yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp) -{ - int res = 0; - int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0; - if (0 <= yylocp->first_line) - { - res += YYFPRINTF (yyo, "%d", yylocp->first_line); - if (0 <= yylocp->first_column) - res += YYFPRINTF (yyo, ".%d", yylocp->first_column); - } - if (0 <= yylocp->last_line) - { - if (yylocp->first_line < yylocp->last_line) - { - res += YYFPRINTF (yyo, "-%d", yylocp->last_line); - if (0 <= end_col) - res += YYFPRINTF (yyo, ".%d", end_col); - } - else if (0 <= end_col && yylocp->first_column < end_col) - res += YYFPRINTF (yyo, "-%d", end_col); - } - return res; - } - -# define YY_LOCATION_PRINT(File, Loc) \ - yy_location_print_ (File, &(Loc)) - -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, Location); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (yylocationp); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - YY_LOCATION_PRINT (yyo, *yylocationp); - YYFPRINTF (yyo, ": "); - yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - , &(yylsp[(yyi + 1) - (yynrhs)]) ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, yylsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) -{ - YYUSE (yyvaluep); - YYUSE (yylocationp); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Location data for the lookahead symbol. */ -YYLTYPE yylloc -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL - = { 1, 1, 1, 1 } -# endif -; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - 'yyls': related to locations. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yylsp = yyls = yylsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - yylsp[0] = yylloc; - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - yyls = yyls1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); - YYSTACK_RELOCATE (yyls_alloc, yyls); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - *++yylsp = yylloc; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - /* Default location. */ - YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); - yyerror_range[1] = yyloc; - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 1074 "hlsl.y" - { - } -#line 2687 "hlsl.tab.c" - break; - - case 3: -#line 1077 "hlsl.y" - { - const struct hlsl_ir_function_decl *decl; - - decl = get_overloaded_func(&hlsl_ctx.functions, (yyvsp[0].function).name, (yyvsp[0].function).decl->parameters, TRUE); - if (decl && !decl->func->intrinsic) - { - if (decl->body && (yyvsp[0].function).decl->body) - { - hlsl_report_message((yyvsp[0].function).decl->loc.file, (yyvsp[0].function).decl->loc.line, - (yyvsp[0].function).decl->loc.col, HLSL_LEVEL_ERROR, - "redefinition of function %s", debugstr_a((yyvsp[0].function).name)); - YYABORT; - } - else if (!compare_hlsl_types(decl->return_type, (yyvsp[0].function).decl->return_type)) - { - hlsl_report_message((yyvsp[0].function).decl->loc.file, (yyvsp[0].function).decl->loc.line, - (yyvsp[0].function).decl->loc.col, HLSL_LEVEL_ERROR, - "redefining function %s with a different return type", - debugstr_a((yyvsp[0].function).name)); - hlsl_report_message(decl->loc.file, decl->loc.line, decl->loc.col, HLSL_LEVEL_NOTE, - "%s previously declared here", - debugstr_a((yyvsp[0].function).name)); - YYABORT; - } - } - - if ((yyvsp[0].function).decl->return_type->base_type == HLSL_TYPE_VOID && (yyvsp[0].function).decl->semantic) - { - hlsl_report_message((yyvsp[0].function).decl->loc.file, (yyvsp[0].function).decl->loc.line, - (yyvsp[0].function).decl->loc.col, HLSL_LEVEL_ERROR, - "void function with a semantic"); - } - - TRACE("Adding function '%s' to the function list.\n", (yyvsp[0].function).name); - add_function_decl(&hlsl_ctx.functions, (yyvsp[0].function).name, (yyvsp[0].function).decl, FALSE); - } -#line 2728 "hlsl.tab.c" - break; - - case 4: -#line 1114 "hlsl.y" - { - TRACE("Declaration statement parsed.\n"); - } -#line 2736 "hlsl.tab.c" - break; - - case 5: -#line 1118 "hlsl.y" - { - } -#line 2743 "hlsl.tab.c" - break; - - case 6: -#line 1121 "hlsl.y" - { - TRACE("Skipping stray semicolon.\n"); - } -#line 2751 "hlsl.tab.c" - break; - - case 7: -#line 1126 "hlsl.y" - { - const char **new_array = NULL; - - TRACE("Updating line information to file %s, line %u\n", debugstr_a((yyvsp[0].name)), (yyvsp[-1].intval)); - hlsl_ctx.line_no = (yyvsp[-1].intval); - if (strcmp((yyvsp[0].name), hlsl_ctx.source_file)) - new_array = d3dcompiler_realloc(hlsl_ctx.source_files, - sizeof(*hlsl_ctx.source_files) * (hlsl_ctx.source_files_count + 1)); - - if (new_array) - { - hlsl_ctx.source_files = new_array; - hlsl_ctx.source_files[hlsl_ctx.source_files_count++] = (yyvsp[0].name); - hlsl_ctx.source_file = (yyvsp[0].name); - } - else - { - d3dcompiler_free((yyvsp[0].name)); - } - } -#line 2776 "hlsl.tab.c" - break; - - case 8: -#line 1148 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[0])); - if (!(yyvsp[-1].list)) - { - if (!(yyvsp[-2].type)->name) - { - hlsl_report_message(loc.file, loc.line, loc.col, - HLSL_LEVEL_ERROR, "anonymous struct declaration with no variables"); - } - check_type_modifiers((yyvsp[-2].type)->modifiers, &loc); - } - (yyval.list) = declare_vars((yyvsp[-2].type), 0, (yyvsp[-1].list)); - } -#line 2796 "hlsl.tab.c" - break; - - case 11: -#line 1168 "hlsl.y" - { - BOOL ret; - struct source_location loc; - - TRACE("Structure %s declaration.\n", debugstr_a((yyvsp[-3].name))); - set_location(&loc, &(yylsp[-5])); - check_invalid_matrix_modifiers((yyvsp[-5].modifiers), &loc); - (yyval.type) = new_struct_type((yyvsp[-3].name), (yyvsp[-5].modifiers), (yyvsp[-1].list)); - - if (get_variable(hlsl_ctx.cur_scope, (yyvsp[-3].name))) - { - hlsl_report_message(hlsl_ctx.source_file, (yylsp[-3]).first_line, (yylsp[-3]).first_column, - HLSL_LEVEL_ERROR, "redefinition of '%s'", (yyvsp[-3].name)); - YYABORT; - } - - ret = add_type_to_scope(hlsl_ctx.cur_scope, (yyval.type)); - if (!ret) - { - hlsl_report_message(hlsl_ctx.source_file, (yylsp[-3]).first_line, (yylsp[-3]).first_column, - HLSL_LEVEL_ERROR, "redefinition of struct '%s'", (yyvsp[-3].name)); - YYABORT; - } - } -#line 2825 "hlsl.tab.c" - break; - - case 12: -#line 1194 "hlsl.y" - { - struct source_location loc; - - TRACE("Anonymous structure declaration.\n"); - set_location(&loc, &(yylsp[-4])); - check_invalid_matrix_modifiers((yyvsp[-4].modifiers), &loc); - (yyval.type) = new_struct_type(NULL, (yyvsp[-4].modifiers), (yyvsp[-1].list)); - } -#line 2838 "hlsl.tab.c" - break; - - case 16: -#line 1208 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - } -#line 2847 "hlsl.tab.c" - break; - - case 17: -#line 1213 "hlsl.y" - { - BOOL ret; - struct hlsl_struct_field *field, *next; - - (yyval.list) = (yyvsp[-1].list); - LIST_FOR_EACH_ENTRY_SAFE(field, next, (yyvsp[0].list), struct hlsl_struct_field, entry) - { - ret = add_struct_field((yyval.list), field); - if (ret == FALSE) - { - hlsl_report_message(hlsl_ctx.source_file, (yylsp[0]).first_line, (yylsp[0]).first_column, - HLSL_LEVEL_ERROR, "redefinition of '%s'", field->name); - d3dcompiler_free(field); - } - } - d3dcompiler_free((yyvsp[0].list)); - } -#line 2869 "hlsl.tab.c" - break; - - case 18: -#line 1232 "hlsl.y" - { - (yyval.list) = gen_struct_fields((yyvsp[-2].type), (yyvsp[-3].modifiers), (yyvsp[-1].list)); - } -#line 2877 "hlsl.tab.c" - break; - - case 19: -#line 1236 "hlsl.y" - { - (yyval.list) = gen_struct_fields((yyvsp[-2].type), 0, (yyvsp[-1].list)); - } -#line 2885 "hlsl.tab.c" - break; - - case 20: -#line 1241 "hlsl.y" - { - TRACE("Function %s parsed.\n", (yyvsp[-1].function).name); - (yyval.function) = (yyvsp[-1].function); - (yyval.function).decl->body = (yyvsp[0].list); - pop_scope(&hlsl_ctx); - } -#line 2896 "hlsl.tab.c" - break; - - case 21: -#line 1248 "hlsl.y" - { - TRACE("Function prototype for %s.\n", (yyvsp[-1].function).name); - (yyval.function) = (yyvsp[-1].function); - pop_scope(&hlsl_ctx); - } -#line 2906 "hlsl.tab.c" - break; - - case 22: -#line 1255 "hlsl.y" - { - if (get_variable(hlsl_ctx.globals, (yyvsp[-4].name))) - { - hlsl_report_message(hlsl_ctx.source_file, (yylsp[-4]).first_line, (yylsp[-4]).first_column, - HLSL_LEVEL_ERROR, "redefinition of '%s'\n", (yyvsp[-4].name)); - YYABORT; - } - if ((yyvsp[-5].type)->base_type == HLSL_TYPE_VOID && (yyvsp[0].colon_attribute).semantic) - { - hlsl_report_message(hlsl_ctx.source_file, (yylsp[0]).first_line, (yylsp[0]).first_column, - HLSL_LEVEL_ERROR, "void function with a semantic"); - } - - if ((yyvsp[0].colon_attribute).reg_reservation) - { - FIXME("Unexpected register reservation for a function.\n"); - d3dcompiler_free((yyvsp[0].colon_attribute).reg_reservation); - } - (yyval.function).decl = new_func_decl((yyvsp[-5].type), (yyvsp[-2].list)); - if (!(yyval.function).decl) - { - ERR("Out of memory.\n"); - YYABORT; - } - (yyval.function).name = (yyvsp[-4].name); - (yyval.function).decl->semantic = (yyvsp[0].colon_attribute).semantic; - set_location(&(yyval.function).decl->loc, &(yylsp[-4])); - } -#line 2939 "hlsl.tab.c" - break; - - case 23: -#line 1285 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - } -#line 2948 "hlsl.tab.c" - break; - - case 24: -#line 1290 "hlsl.y" - { - pop_scope(&hlsl_ctx); - (yyval.list) = (yyvsp[-1].list); - } -#line 2957 "hlsl.tab.c" - break; - - case 25: -#line 1296 "hlsl.y" - { - push_scope(&hlsl_ctx); - } -#line 2965 "hlsl.tab.c" - break; - - case 28: -#line 1304 "hlsl.y" - { - (yyval.colon_attribute).semantic = NULL; - (yyval.colon_attribute).reg_reservation = NULL; - } -#line 2974 "hlsl.tab.c" - break; - - case 29: -#line 1309 "hlsl.y" - { - (yyval.colon_attribute).semantic = (yyvsp[0].name); - (yyval.colon_attribute).reg_reservation = NULL; - } -#line 2983 "hlsl.tab.c" - break; - - case 30: -#line 1314 "hlsl.y" - { - (yyval.colon_attribute).semantic = NULL; - (yyval.colon_attribute).reg_reservation = (yyvsp[0].reg_reservation); - } -#line 2992 "hlsl.tab.c" - break; - - case 31: -#line 1320 "hlsl.y" - { - (yyval.name) = (yyvsp[0].name); - } -#line 3000 "hlsl.tab.c" - break; - - case 32: -#line 1326 "hlsl.y" - { - (yyval.reg_reservation) = parse_reg_reservation((yyvsp[-1].name)); - d3dcompiler_free((yyvsp[-1].name)); - } -#line 3009 "hlsl.tab.c" - break; - - case 33: -#line 1331 "hlsl.y" - { - FIXME("Ignoring shader target %s in a register reservation.\n", debugstr_a((yyvsp[-3].name))); - d3dcompiler_free((yyvsp[-3].name)); - - (yyval.reg_reservation) = parse_reg_reservation((yyvsp[-1].name)); - d3dcompiler_free((yyvsp[-1].name)); - } -#line 3021 "hlsl.tab.c" - break; - - case 34: -#line 1340 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - } -#line 3030 "hlsl.tab.c" - break; - - case 35: -#line 1345 "hlsl.y" - { - (yyval.list) = (yyvsp[0].list); - } -#line 3038 "hlsl.tab.c" - break; - - case 36: -#line 1350 "hlsl.y" - { - struct source_location loc; - - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - set_location(&loc, &(yylsp[0])); - if (!add_func_parameter((yyval.list), &(yyvsp[0].parameter), &loc)) - { - ERR("Error adding function parameter %s.\n", (yyvsp[0].parameter).name); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - } -#line 3056 "hlsl.tab.c" - break; - - case 37: -#line 1364 "hlsl.y" - { - struct source_location loc; - - (yyval.list) = (yyvsp[-2].list); - set_location(&loc, &(yylsp[0])); - if (!add_func_parameter((yyval.list), &(yyvsp[0].parameter), &loc)) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "duplicate parameter %s", (yyvsp[0].parameter).name); - YYABORT; - } - } -#line 3073 "hlsl.tab.c" - break; - - case 38: -#line 1378 "hlsl.y" - { - (yyval.parameter).modifiers = (yyvsp[-4].modifiers) ? (yyvsp[-4].modifiers) : HLSL_MODIFIER_IN; - (yyval.parameter).modifiers |= (yyvsp[-3].modifiers); - (yyval.parameter).type = (yyvsp[-2].type); - (yyval.parameter).name = (yyvsp[-1].name); - (yyval.parameter).semantic = (yyvsp[0].colon_attribute).semantic; - (yyval.parameter).reg_reservation = (yyvsp[0].colon_attribute).reg_reservation; - } -#line 3086 "hlsl.tab.c" - break; - - case 39: -#line 1388 "hlsl.y" - { - (yyval.modifiers) = 0; - } -#line 3094 "hlsl.tab.c" - break; - - case 40: -#line 1392 "hlsl.y" - { - if ((yyvsp[-1].modifiers) & (yyvsp[0].modifiers)) - { - hlsl_report_message(hlsl_ctx.source_file, (yylsp[0]).first_line, (yylsp[0]).first_column, - HLSL_LEVEL_ERROR, "duplicate input-output modifiers"); - YYABORT; - } - (yyval.modifiers) = (yyvsp[-1].modifiers) | (yyvsp[0].modifiers); - } -#line 3108 "hlsl.tab.c" - break; - - case 41: -#line 1403 "hlsl.y" - { - (yyval.modifiers) = HLSL_MODIFIER_IN; - } -#line 3116 "hlsl.tab.c" - break; - - case 42: -#line 1407 "hlsl.y" - { - (yyval.modifiers) = HLSL_MODIFIER_OUT; - } -#line 3124 "hlsl.tab.c" - break; - - case 43: -#line 1411 "hlsl.y" - { - (yyval.modifiers) = HLSL_MODIFIER_IN | HLSL_MODIFIER_OUT; - } -#line 3132 "hlsl.tab.c" - break; - - case 44: -#line 1416 "hlsl.y" - { - (yyval.type) = (yyvsp[0].type); - } -#line 3140 "hlsl.tab.c" - break; - - case 45: -#line 1420 "hlsl.y" - { - if ((yyvsp[-3].type)->type != HLSL_CLASS_SCALAR) - { - hlsl_message("Line %u: vectors of non-scalar types are not allowed.\n", - hlsl_ctx.line_no); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - if ((yyvsp[-1].intval) < 1 || (yyvsp[-1].intval) > 4) - { - hlsl_message("Line %u: vector size must be between 1 and 4.\n", - hlsl_ctx.line_no); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - - (yyval.type) = new_hlsl_type(NULL, HLSL_CLASS_VECTOR, (yyvsp[-3].type)->base_type, (yyvsp[-1].intval), 1); - } -#line 3163 "hlsl.tab.c" - break; - - case 46: -#line 1439 "hlsl.y" - { - if ((yyvsp[-5].type)->type != HLSL_CLASS_SCALAR) - { - hlsl_message("Line %u: matrices of non-scalar types are not allowed.\n", - hlsl_ctx.line_no); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - if ((yyvsp[-3].intval) < 1 || (yyvsp[-3].intval) > 4 || (yyvsp[-1].intval) < 1 || (yyvsp[-1].intval) > 4) - { - hlsl_message("Line %u: matrix dimensions must be between 1 and 4.\n", - hlsl_ctx.line_no); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - - (yyval.type) = new_hlsl_type(NULL, HLSL_CLASS_MATRIX, (yyvsp[-5].type)->base_type, (yyvsp[-3].intval), (yyvsp[-1].intval)); - } -#line 3186 "hlsl.tab.c" - break; - - case 47: -#line 1459 "hlsl.y" - { - (yyval.type) = new_hlsl_type(d3dcompiler_strdup("void"), HLSL_CLASS_OBJECT, HLSL_TYPE_VOID, 1, 1); - } -#line 3194 "hlsl.tab.c" - break; - - case 48: -#line 1463 "hlsl.y" - { - (yyval.type) = new_hlsl_type(d3dcompiler_strdup("sampler"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - (yyval.type)->sampler_dim = HLSL_SAMPLER_DIM_GENERIC; - } -#line 3203 "hlsl.tab.c" - break; - - case 49: -#line 1468 "hlsl.y" - { - (yyval.type) = new_hlsl_type(d3dcompiler_strdup("sampler1D"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - (yyval.type)->sampler_dim = HLSL_SAMPLER_DIM_1D; - } -#line 3212 "hlsl.tab.c" - break; - - case 50: -#line 1473 "hlsl.y" - { - (yyval.type) = new_hlsl_type(d3dcompiler_strdup("sampler2D"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - (yyval.type)->sampler_dim = HLSL_SAMPLER_DIM_2D; - } -#line 3221 "hlsl.tab.c" - break; - - case 51: -#line 1478 "hlsl.y" - { - (yyval.type) = new_hlsl_type(d3dcompiler_strdup("sampler3D"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - (yyval.type)->sampler_dim = HLSL_SAMPLER_DIM_3D; - } -#line 3230 "hlsl.tab.c" - break; - - case 52: -#line 1483 "hlsl.y" - { - (yyval.type) = new_hlsl_type(d3dcompiler_strdup("samplerCUBE"), HLSL_CLASS_OBJECT, HLSL_TYPE_SAMPLER, 1, 1); - (yyval.type)->sampler_dim = HLSL_SAMPLER_DIM_CUBE; - } -#line 3239 "hlsl.tab.c" - break; - - case 53: -#line 1488 "hlsl.y" - { - struct hlsl_type *type; - - type = get_type(hlsl_ctx.cur_scope, (yyvsp[0].name), TRUE); - (yyval.type) = type; - d3dcompiler_free((yyvsp[0].name)); - } -#line 3251 "hlsl.tab.c" - break; - - case 54: -#line 1496 "hlsl.y" - { - struct hlsl_type *type; - - type = get_type(hlsl_ctx.cur_scope, (yyvsp[0].name), TRUE); - if (type->type != HLSL_CLASS_STRUCT) - { - hlsl_message("Line %u: redefining %s as a structure.\n", - hlsl_ctx.line_no, (yyvsp[0].name)); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - } - else - { - (yyval.type) = type; - } - d3dcompiler_free((yyvsp[0].name)); - } -#line 3272 "hlsl.tab.c" - break; - - case 57: -#line 1516 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - if (!(yyval.list)) - { - ERR("Out of memory\n"); - YYABORT; - } - list_init((yyval.list)); - } -#line 3286 "hlsl.tab.c" - break; - - case 58: -#line 1527 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-4])); - if (!add_typedef((yyvsp[-3].modifiers), (yyvsp[-2].type), (yyvsp[-1].list), &loc)) - YYABORT; - } -#line 3298 "hlsl.tab.c" - break; - - case 59: -#line 1535 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-3])); - if (!add_typedef(0, (yyvsp[-2].type), (yyvsp[-1].list), &loc)) - YYABORT; - } -#line 3310 "hlsl.tab.c" - break; - - case 60: -#line 1544 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - list_add_head((yyval.list), &(yyvsp[0].variable_def)->entry); - } -#line 3320 "hlsl.tab.c" - break; - - case 61: -#line 1550 "hlsl.y" - { - (yyval.list) = (yyvsp[-2].list); - list_add_tail((yyval.list), &(yyvsp[0].variable_def)->entry); - } -#line 3329 "hlsl.tab.c" - break; - - case 62: -#line 1556 "hlsl.y" - { - (yyval.variable_def) = d3dcompiler_alloc(sizeof(*(yyval.variable_def))); - set_location(&(yyval.variable_def)->loc, &(yylsp[-1])); - (yyval.variable_def)->name = (yyvsp[-1].name); - (yyval.variable_def)->array_size = (yyvsp[0].intval); - } -#line 3340 "hlsl.tab.c" - break; - - case 63: -#line 1564 "hlsl.y" - { - (yyval.list) = declare_vars((yyvsp[-2].type), (yyvsp[-3].modifiers), (yyvsp[-1].list)); - } -#line 3348 "hlsl.tab.c" - break; - - case 64: -#line 1569 "hlsl.y" - { - (yyval.list) = NULL; - } -#line 3356 "hlsl.tab.c" - break; - - case 65: -#line 1573 "hlsl.y" - { - (yyval.list) = (yyvsp[0].list); - } -#line 3364 "hlsl.tab.c" - break; - - case 66: -#line 1578 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - list_add_head((yyval.list), &(yyvsp[0].variable_def)->entry); - } -#line 3374 "hlsl.tab.c" - break; - - case 67: -#line 1584 "hlsl.y" - { - (yyval.list) = (yyvsp[-2].list); - list_add_tail((yyval.list), &(yyvsp[0].variable_def)->entry); - } -#line 3383 "hlsl.tab.c" - break; - - case 68: -#line 1590 "hlsl.y" - { - (yyval.variable_def) = d3dcompiler_alloc(sizeof(*(yyval.variable_def))); - set_location(&(yyval.variable_def)->loc, &(yylsp[-2])); - (yyval.variable_def)->name = (yyvsp[-2].name); - (yyval.variable_def)->array_size = (yyvsp[-1].intval); - (yyval.variable_def)->semantic = (yyvsp[0].colon_attribute).semantic; - (yyval.variable_def)->reg_reservation = (yyvsp[0].colon_attribute).reg_reservation; - } -#line 3396 "hlsl.tab.c" - break; - - case 69: -#line 1599 "hlsl.y" - { - TRACE("Declaration with initializer.\n"); - (yyval.variable_def) = d3dcompiler_alloc(sizeof(*(yyval.variable_def))); - set_location(&(yyval.variable_def)->loc, &(yylsp[-4])); - (yyval.variable_def)->name = (yyvsp[-4].name); - (yyval.variable_def)->array_size = (yyvsp[-3].intval); - (yyval.variable_def)->semantic = (yyvsp[-2].colon_attribute).semantic; - (yyval.variable_def)->reg_reservation = (yyvsp[-2].colon_attribute).reg_reservation; - (yyval.variable_def)->initializer = (yyvsp[0].initializer); - } -#line 3411 "hlsl.tab.c" - break; - - case 70: -#line 1611 "hlsl.y" - { - (yyval.intval) = 0; - } -#line 3419 "hlsl.tab.c" - break; - - case 71: -#line 1615 "hlsl.y" - { - FIXME("Array.\n"); - (yyval.intval) = 0; - free_instr((yyvsp[-1].instr)); - } -#line 3429 "hlsl.tab.c" - break; - - case 72: -#line 1622 "hlsl.y" - { - (yyval.modifiers) = 0; - } -#line 3437 "hlsl.tab.c" - break; - - case 73: -#line 1626 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_STORAGE_EXTERN, &(yylsp[-1])); - } -#line 3445 "hlsl.tab.c" - break; - - case 74: -#line 1630 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_STORAGE_NOINTERPOLATION, &(yylsp[-1])); - } -#line 3453 "hlsl.tab.c" - break; - - case 75: -#line 1634 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_MODIFIER_PRECISE, &(yylsp[-1])); - } -#line 3461 "hlsl.tab.c" - break; - - case 76: -#line 1638 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_STORAGE_SHARED, &(yylsp[-1])); - } -#line 3469 "hlsl.tab.c" - break; - - case 77: -#line 1642 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_STORAGE_GROUPSHARED, &(yylsp[-1])); - } -#line 3477 "hlsl.tab.c" - break; - - case 78: -#line 1646 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_STORAGE_STATIC, &(yylsp[-1])); - } -#line 3485 "hlsl.tab.c" - break; - - case 79: -#line 1650 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_STORAGE_UNIFORM, &(yylsp[-1])); - } -#line 3493 "hlsl.tab.c" - break; - - case 80: -#line 1654 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_STORAGE_VOLATILE, &(yylsp[-1])); - } -#line 3501 "hlsl.tab.c" - break; - - case 81: -#line 1658 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_MODIFIER_CONST, &(yylsp[-1])); - } -#line 3509 "hlsl.tab.c" - break; - - case 82: -#line 1662 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_MODIFIER_ROW_MAJOR, &(yylsp[-1])); - } -#line 3517 "hlsl.tab.c" - break; - - case 83: -#line 1666 "hlsl.y" - { - (yyval.modifiers) = add_modifier((yyvsp[0].modifiers), HLSL_MODIFIER_COLUMN_MAJOR, &(yylsp[-1])); - } -#line 3525 "hlsl.tab.c" - break; - - case 84: -#line 1671 "hlsl.y" - { - (yyval.initializer).args_count = 1; - if (!((yyval.initializer).args = d3dcompiler_alloc(sizeof(*(yyval.initializer).args)))) - YYABORT; - (yyval.initializer).args[0] = (yyvsp[0].instr); - } -#line 3536 "hlsl.tab.c" - break; - - case 85: -#line 1678 "hlsl.y" - { - (yyval.initializer) = (yyvsp[-1].initializer); - } -#line 3544 "hlsl.tab.c" - break; - - case 86: -#line 1682 "hlsl.y" - { - (yyval.initializer) = (yyvsp[-2].initializer); - } -#line 3552 "hlsl.tab.c" - break; - - case 87: -#line 1687 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 3560 "hlsl.tab.c" - break; - - case 88: -#line 1692 "hlsl.y" - { - (yyval.initializer).args_count = 1; - if (!((yyval.initializer).args = d3dcompiler_alloc(sizeof(*(yyval.initializer).args)))) - YYABORT; - (yyval.initializer).args[0] = (yyvsp[0].instr); - } -#line 3571 "hlsl.tab.c" - break; - - case 89: -#line 1699 "hlsl.y" - { - (yyval.initializer) = (yyvsp[-2].initializer); - if (!((yyval.initializer).args = d3dcompiler_realloc((yyval.initializer).args, ((yyval.initializer).args_count + 1) * sizeof(*(yyval.initializer).args)))) - YYABORT; - (yyval.initializer).args[(yyval.initializer).args_count++] = (yyvsp[0].instr); - } -#line 3582 "hlsl.tab.c" - break; - - case 90: -#line 1707 "hlsl.y" - { - (yyval.boolval) = TRUE; - } -#line 3590 "hlsl.tab.c" - break; - - case 91: -#line 1711 "hlsl.y" - { - (yyval.boolval) = FALSE; - } -#line 3598 "hlsl.tab.c" - break; - - case 92: -#line 1716 "hlsl.y" - { - (yyval.list) = (yyvsp[0].list); - } -#line 3606 "hlsl.tab.c" - break; - - case 93: -#line 1720 "hlsl.y" - { - (yyval.list) = (yyvsp[-1].list); - list_move_tail((yyval.list), (yyvsp[0].list)); - d3dcompiler_free((yyvsp[0].list)); - } -#line 3616 "hlsl.tab.c" - break; - - case 100: -#line 1735 "hlsl.y" - { - struct hlsl_ir_jump *jump = d3dcompiler_alloc(sizeof(*jump)); - if (!jump) - { - ERR("Out of memory\n"); - YYABORT; - } - jump->node.type = HLSL_IR_JUMP; - set_location(&jump->node.loc, &(yylsp[-2])); - jump->type = HLSL_IR_JUMP_RETURN; - jump->node.data_type = (yyvsp[-1].instr)->data_type; - jump->return_value = (yyvsp[-1].instr); - - FIXME("Check for valued return on void function.\n"); - FIXME("Implicit conversion to the return type if needed, " - "error out if conversion not possible.\n"); - - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - list_add_tail((yyval.list), &jump->node.entry); - } -#line 3642 "hlsl.tab.c" - break; - - case 101: -#line 1758 "hlsl.y" - { - struct hlsl_ir_if *instr = d3dcompiler_alloc(sizeof(*instr)); - if (!instr) - { - ERR("Out of memory\n"); - YYABORT; - } - instr->node.type = HLSL_IR_IF; - set_location(&instr->node.loc, &(yylsp[-4])); - instr->condition = (yyvsp[-2].instr); - instr->then_instrs = (yyvsp[0].if_body).then_instrs; - instr->else_instrs = (yyvsp[0].if_body).else_instrs; - if ((yyvsp[-2].instr)->data_type->dimx > 1 || (yyvsp[-2].instr)->data_type->dimy > 1) - { - hlsl_report_message(instr->node.loc.file, instr->node.loc.line, - instr->node.loc.col, HLSL_LEVEL_ERROR, - "if condition requires a scalar"); - } - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - list_add_head((yyval.list), &instr->node.entry); - } -#line 3669 "hlsl.tab.c" - break; - - case 102: -#line 1782 "hlsl.y" - { - (yyval.if_body).then_instrs = (yyvsp[0].list); - (yyval.if_body).else_instrs = NULL; - } -#line 3678 "hlsl.tab.c" - break; - - case 103: -#line 1787 "hlsl.y" - { - (yyval.if_body).then_instrs = (yyvsp[-2].list); - (yyval.if_body).else_instrs = (yyvsp[0].list); - } -#line 3687 "hlsl.tab.c" - break; - - case 104: -#line 1793 "hlsl.y" - { - struct source_location loc; - struct list *cond = d3dcompiler_alloc(sizeof(*cond)); - - if (!cond) - { - ERR("Out of memory.\n"); - YYABORT; - } - list_init(cond); - list_add_head(cond, &(yyvsp[-2].instr)->entry); - set_location(&loc, &(yylsp[-4])); - (yyval.list) = create_loop(LOOP_WHILE, NULL, cond, NULL, (yyvsp[0].list), &loc); - } -#line 3706 "hlsl.tab.c" - break; - - case 105: -#line 1808 "hlsl.y" - { - struct source_location loc; - struct list *cond = d3dcompiler_alloc(sizeof(*cond)); - - if (!cond) - { - ERR("Out of memory.\n"); - YYABORT; - } - list_init(cond); - list_add_head(cond, &(yyvsp[-2].instr)->entry); - set_location(&loc, &(yylsp[-6])); - (yyval.list) = create_loop(LOOP_DO_WHILE, NULL, cond, NULL, (yyvsp[-5].list), &loc); - } -#line 3725 "hlsl.tab.c" - break; - - case 106: -#line 1823 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-7])); - (yyval.list) = create_loop(LOOP_FOR, (yyvsp[-4].list), (yyvsp[-3].list), (yyvsp[-2].instr), (yyvsp[0].list), &loc); - pop_scope(&hlsl_ctx); - } -#line 3737 "hlsl.tab.c" - break; - - case 107: -#line 1831 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-7])); - if (!(yyvsp[-4].list)) - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_WARNING, - "no expressions in for loop initializer"); - (yyval.list) = create_loop(LOOP_FOR, (yyvsp[-4].list), (yyvsp[-3].list), (yyvsp[-2].instr), (yyvsp[0].list), &loc); - pop_scope(&hlsl_ctx); - } -#line 3752 "hlsl.tab.c" - break; - - case 108: -#line 1843 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - } -#line 3761 "hlsl.tab.c" - break; - - case 109: -#line 1848 "hlsl.y" - { - (yyval.list) = d3dcompiler_alloc(sizeof(*(yyval.list))); - list_init((yyval.list)); - if ((yyvsp[-1].instr)) - list_add_head((yyval.list), &(yyvsp[-1].instr)->entry); - } -#line 3772 "hlsl.tab.c" - break; - - case 110: -#line 1856 "hlsl.y" - { - struct hlsl_ir_constant *c = d3dcompiler_alloc(sizeof(*c)); - if (!c) - { - ERR("Out of memory.\n"); - YYABORT; - } - c->node.type = HLSL_IR_CONSTANT; - set_location(&c->node.loc, &yylloc); - c->node.data_type = new_hlsl_type(d3dcompiler_strdup("float"), HLSL_CLASS_SCALAR, HLSL_TYPE_FLOAT, 1, 1); - c->v.value.f[0] = (yyvsp[0].floatval); - (yyval.instr) = &c->node; - } -#line 3790 "hlsl.tab.c" - break; - - case 111: -#line 1870 "hlsl.y" - { - struct hlsl_ir_constant *c = d3dcompiler_alloc(sizeof(*c)); - if (!c) - { - ERR("Out of memory.\n"); - YYABORT; - } - c->node.type = HLSL_IR_CONSTANT; - set_location(&c->node.loc, &yylloc); - c->node.data_type = new_hlsl_type(d3dcompiler_strdup("int"), HLSL_CLASS_SCALAR, HLSL_TYPE_INT, 1, 1); - c->v.value.i[0] = (yyvsp[0].intval); - (yyval.instr) = &c->node; - } -#line 3808 "hlsl.tab.c" - break; - - case 112: -#line 1884 "hlsl.y" - { - struct hlsl_ir_constant *c = d3dcompiler_alloc(sizeof(*c)); - if (!c) - { - ERR("Out of memory.\n"); - YYABORT; - } - c->node.type = HLSL_IR_CONSTANT; - set_location(&c->node.loc, &yylloc); - c->node.data_type = new_hlsl_type(d3dcompiler_strdup("bool"), HLSL_CLASS_SCALAR, HLSL_TYPE_BOOL, 1, 1); - c->v.value.b[0] = (yyvsp[0].boolval); - (yyval.instr) = &c->node; - } -#line 3826 "hlsl.tab.c" - break; - - case 113: -#line 1898 "hlsl.y" - { - struct hlsl_ir_deref *deref; - struct hlsl_ir_var *var; - - if (!(var = get_variable(hlsl_ctx.cur_scope, (yyvsp[0].name)))) - { - hlsl_message("Line %d: variable '%s' not declared\n", - hlsl_ctx.line_no, (yyvsp[0].name)); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - if ((deref = new_var_deref(var))) - { - (yyval.instr) = &deref->node; - set_location(&(yyval.instr)->loc, &(yylsp[0])); - } - else - (yyval.instr) = NULL; - } -#line 3850 "hlsl.tab.c" - break; - - case 114: -#line 1918 "hlsl.y" - { - (yyval.instr) = (yyvsp[-1].instr); - } -#line 3858 "hlsl.tab.c" - break; - - case 115: -#line 1923 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 3866 "hlsl.tab.c" - break; - - case 116: -#line 1927 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[0])); - if ((yyvsp[-1].instr)->data_type->modifiers & HLSL_MODIFIER_CONST) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "modifying a const expression"); - YYABORT; - } - (yyval.instr) = new_unary_expr(HLSL_IR_UNOP_POSTINC, (yyvsp[-1].instr), loc); - /* Post increment/decrement expressions are considered const */ - (yyval.instr)->data_type = clone_hlsl_type((yyval.instr)->data_type); - (yyval.instr)->data_type->modifiers |= HLSL_MODIFIER_CONST; - } -#line 3886 "hlsl.tab.c" - break; - - case 117: -#line 1943 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[0])); - if ((yyvsp[-1].instr)->data_type->modifiers & HLSL_MODIFIER_CONST) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "modifying a const expression"); - YYABORT; - } - (yyval.instr) = new_unary_expr(HLSL_IR_UNOP_POSTDEC, (yyvsp[-1].instr), loc); - /* Post increment/decrement expressions are considered const */ - (yyval.instr)->data_type = clone_hlsl_type((yyval.instr)->data_type); - (yyval.instr)->data_type->modifiers |= HLSL_MODIFIER_CONST; - } -#line 3906 "hlsl.tab.c" - break; - - case 118: -#line 1959 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - if ((yyvsp[-2].instr)->data_type->type == HLSL_CLASS_STRUCT) - { - struct hlsl_type *type = (yyvsp[-2].instr)->data_type; - struct hlsl_struct_field *field; - - (yyval.instr) = NULL; - LIST_FOR_EACH_ENTRY(field, type->e.elements, struct hlsl_struct_field, entry) - { - if (!strcmp((yyvsp[0].name), field->name)) - { - struct hlsl_ir_deref *deref = new_record_deref((yyvsp[-2].instr), field); - - if (!deref) - { - ERR("Out of memory\n"); - YYABORT; - } - deref->node.loc = loc; - (yyval.instr) = &deref->node; - break; - } - } - if (!(yyval.instr)) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "invalid subscript %s", debugstr_a((yyvsp[0].name))); - YYABORT; - } - } - else if ((yyvsp[-2].instr)->data_type->type <= HLSL_CLASS_LAST_NUMERIC) - { - struct hlsl_ir_swizzle *swizzle; - - swizzle = get_swizzle((yyvsp[-2].instr), (yyvsp[0].name), &loc); - if (!swizzle) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "invalid swizzle %s", debugstr_a((yyvsp[0].name))); - YYABORT; - } - (yyval.instr) = &swizzle->node; - } - else - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "invalid subscript %s", debugstr_a((yyvsp[0].name))); - YYABORT; - } - } -#line 3964 "hlsl.tab.c" - break; - - case 119: -#line 2013 "hlsl.y" - { - /* This may be an array dereference or a vector/matrix - * subcomponent access. - * We store it as an array dereference in any case. */ - struct hlsl_ir_deref *deref = d3dcompiler_alloc(sizeof(*deref)); - struct hlsl_type *expr_type = (yyvsp[-3].instr)->data_type; - struct source_location loc; - - TRACE("Array dereference from type %s\n", debug_hlsl_type(expr_type)); - if (!deref) - { - ERR("Out of memory\n"); - YYABORT; - } - deref->node.type = HLSL_IR_DEREF; - set_location(&loc, &(yylsp[-2])); - deref->node.loc = loc; - if (expr_type->type == HLSL_CLASS_ARRAY) - { - deref->node.data_type = expr_type->e.array.type; - } - else if (expr_type->type == HLSL_CLASS_MATRIX) - { - deref->node.data_type = new_hlsl_type(NULL, HLSL_CLASS_VECTOR, expr_type->base_type, expr_type->dimx, 1); - } - else if (expr_type->type == HLSL_CLASS_VECTOR) - { - deref->node.data_type = new_hlsl_type(NULL, HLSL_CLASS_SCALAR, expr_type->base_type, 1, 1); - } - else - { - if (expr_type->type == HLSL_CLASS_SCALAR) - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "array-indexed expression is scalar"); - else - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "expression is not array-indexable"); - d3dcompiler_free(deref); - free_instr((yyvsp[-3].instr)); - free_instr((yyvsp[-1].instr)); - YYABORT; - } - if ((yyvsp[-1].instr)->data_type->type != HLSL_CLASS_SCALAR) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "array index is not scalar"); - d3dcompiler_free(deref); - free_instr((yyvsp[-3].instr)); - free_instr((yyvsp[-1].instr)); - YYABORT; - } - deref->type = HLSL_IR_DEREF_ARRAY; - deref->v.array.array = (yyvsp[-3].instr); - deref->v.array.index = (yyvsp[-1].instr); - - (yyval.instr) = &deref->node; - } -#line 4026 "hlsl.tab.c" - break; - - case 120: -#line 2073 "hlsl.y" - { - struct hlsl_ir_constructor *constructor; - - TRACE("%s constructor.\n", debug_hlsl_type((yyvsp[-3].type))); - if ((yyvsp[-4].modifiers)) - { - hlsl_message("Line %u: unexpected modifier in a constructor.\n", - hlsl_ctx.line_no); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - if ((yyvsp[-3].type)->type > HLSL_CLASS_LAST_NUMERIC) - { - hlsl_message("Line %u: constructors are allowed only for numeric data types.\n", - hlsl_ctx.line_no); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - if ((yyvsp[-3].type)->dimx * (yyvsp[-3].type)->dimy != initializer_size(&(yyvsp[-1].initializer))) - { - hlsl_message("Line %u: wrong number of components in constructor.\n", - hlsl_ctx.line_no); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - YYABORT; - } - assert((yyvsp[-1].initializer).args_count <= ARRAY_SIZE(constructor->args)); - - constructor = d3dcompiler_alloc(sizeof(*constructor)); - constructor->node.type = HLSL_IR_CONSTRUCTOR; - set_location(&constructor->node.loc, &(yylsp[-2])); - constructor->node.data_type = (yyvsp[-3].type); - constructor->args_count = (yyvsp[-1].initializer).args_count; - memcpy(constructor->args, (yyvsp[-1].initializer).args, (yyvsp[-1].initializer).args_count * sizeof(*(yyvsp[-1].initializer).args)); - d3dcompiler_free((yyvsp[-1].initializer).args); - (yyval.instr) = &constructor->node; - } -#line 4067 "hlsl.tab.c" - break; - - case 121: -#line 2111 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4075 "hlsl.tab.c" - break; - - case 122: -#line 2115 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - if ((yyvsp[0].instr)->data_type->modifiers & HLSL_MODIFIER_CONST) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "modifying a const expression"); - YYABORT; - } - (yyval.instr) = new_unary_expr(HLSL_IR_UNOP_PREINC, (yyvsp[0].instr), loc); - } -#line 4092 "hlsl.tab.c" - break; - - case 123: -#line 2128 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - if ((yyvsp[0].instr)->data_type->modifiers & HLSL_MODIFIER_CONST) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "modifying a const expression"); - YYABORT; - } - (yyval.instr) = new_unary_expr(HLSL_IR_UNOP_PREDEC, (yyvsp[0].instr), loc); - } -#line 4109 "hlsl.tab.c" - break; - - case 124: -#line 2141 "hlsl.y" - { - enum hlsl_ir_expr_op ops[] = {0, HLSL_IR_UNOP_NEG, - HLSL_IR_UNOP_LOGIC_NOT, HLSL_IR_UNOP_BIT_NOT}; - struct source_location loc; - - if ((yyvsp[-1].unary_op) == UNARY_OP_PLUS) - { - (yyval.instr) = (yyvsp[0].instr); - } - else - { - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_unary_expr(ops[(yyvsp[-1].unary_op)], (yyvsp[0].instr), loc); - } - } -#line 4129 "hlsl.tab.c" - break; - - case 125: -#line 2158 "hlsl.y" - { - struct hlsl_ir_expr *expr; - struct hlsl_type *src_type = (yyvsp[0].instr)->data_type; - struct hlsl_type *dst_type; - struct source_location loc; - - set_location(&loc, &(yylsp[-3])); - if ((yyvsp[-4].modifiers)) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "unexpected modifier in a cast"); - YYABORT; - } - - if ((yyvsp[-2].intval)) - dst_type = new_array_type((yyvsp[-3].type), (yyvsp[-2].intval)); - else - dst_type = (yyvsp[-3].type); - - if (!compatible_data_types(src_type, dst_type)) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "can't cast from %s to %s", - debug_hlsl_type(src_type), debug_hlsl_type(dst_type)); - YYABORT; - } - - expr = new_cast((yyvsp[0].instr), dst_type, &loc); - (yyval.instr) = expr ? &expr->node : NULL; - } -#line 4164 "hlsl.tab.c" - break; - - case 126: -#line 2190 "hlsl.y" - { - (yyval.unary_op) = UNARY_OP_PLUS; - } -#line 4172 "hlsl.tab.c" - break; - - case 127: -#line 2194 "hlsl.y" - { - (yyval.unary_op) = UNARY_OP_MINUS; - } -#line 4180 "hlsl.tab.c" - break; - - case 128: -#line 2198 "hlsl.y" - { - (yyval.unary_op) = UNARY_OP_LOGICNOT; - } -#line 4188 "hlsl.tab.c" - break; - - case 129: -#line 2202 "hlsl.y" - { - (yyval.unary_op) = UNARY_OP_BITNOT; - } -#line 4196 "hlsl.tab.c" - break; - - case 130: -#line 2207 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4204 "hlsl.tab.c" - break; - - case 131: -#line 2211 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_MUL, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4215 "hlsl.tab.c" - break; - - case 132: -#line 2218 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_DIV, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4226 "hlsl.tab.c" - break; - - case 133: -#line 2225 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_MOD, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4237 "hlsl.tab.c" - break; - - case 134: -#line 2233 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4245 "hlsl.tab.c" - break; - - case 135: -#line 2237 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_ADD, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4256 "hlsl.tab.c" - break; - - case 136: -#line 2244 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_SUB, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4267 "hlsl.tab.c" - break; - - case 137: -#line 2252 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4275 "hlsl.tab.c" - break; - - case 138: -#line 2256 "hlsl.y" - { - FIXME("Left shift\n"); - } -#line 4283 "hlsl.tab.c" - break; - - case 139: -#line 2260 "hlsl.y" - { - FIXME("Right shift\n"); - } -#line 4291 "hlsl.tab.c" - break; - - case 140: -#line 2265 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4299 "hlsl.tab.c" - break; - - case 141: -#line 2269 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_LESS, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4310 "hlsl.tab.c" - break; - - case 142: -#line 2276 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_GREATER, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4321 "hlsl.tab.c" - break; - - case 143: -#line 2283 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_LEQUAL, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4332 "hlsl.tab.c" - break; - - case 144: -#line 2290 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_GEQUAL, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4343 "hlsl.tab.c" - break; - - case 145: -#line 2298 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4351 "hlsl.tab.c" - break; - - case 146: -#line 2302 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_EQUAL, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4362 "hlsl.tab.c" - break; - - case 147: -#line 2309 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - (yyval.instr) = new_binary_expr(HLSL_IR_BINOP_NEQUAL, (yyvsp[-2].instr), (yyvsp[0].instr), loc); - } -#line 4373 "hlsl.tab.c" - break; - - case 148: -#line 2317 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4381 "hlsl.tab.c" - break; - - case 149: -#line 2321 "hlsl.y" - { - FIXME("bitwise AND\n"); - } -#line 4389 "hlsl.tab.c" - break; - - case 150: -#line 2326 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4397 "hlsl.tab.c" - break; - - case 151: -#line 2330 "hlsl.y" - { - FIXME("bitwise XOR\n"); - } -#line 4405 "hlsl.tab.c" - break; - - case 152: -#line 2335 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4413 "hlsl.tab.c" - break; - - case 153: -#line 2339 "hlsl.y" - { - FIXME("bitwise OR\n"); - } -#line 4421 "hlsl.tab.c" - break; - - case 154: -#line 2344 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4429 "hlsl.tab.c" - break; - - case 155: -#line 2348 "hlsl.y" - { - FIXME("logic AND\n"); - } -#line 4437 "hlsl.tab.c" - break; - - case 156: -#line 2353 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4445 "hlsl.tab.c" - break; - - case 157: -#line 2357 "hlsl.y" - { - FIXME("logic OR\n"); - } -#line 4453 "hlsl.tab.c" - break; - - case 158: -#line 2362 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4461 "hlsl.tab.c" - break; - - case 159: -#line 2366 "hlsl.y" - { - FIXME("ternary operator\n"); - } -#line 4469 "hlsl.tab.c" - break; - - case 160: -#line 2371 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4477 "hlsl.tab.c" - break; - - case 161: -#line 2375 "hlsl.y" - { - struct source_location loc; - - set_location(&loc, &(yylsp[-1])); - if ((yyvsp[-2].instr)->data_type->modifiers & HLSL_MODIFIER_CONST) - { - hlsl_report_message(loc.file, loc.line, loc.col, HLSL_LEVEL_ERROR, - "l-value is const"); - YYABORT; - } - (yyval.instr) = make_assignment((yyvsp[-2].instr), (yyvsp[-1].assign_op), BWRITERSP_WRITEMASK_ALL, (yyvsp[0].instr)); - if (!(yyval.instr)) - YYABORT; - (yyval.instr)->loc = loc; - } -#line 4497 "hlsl.tab.c" - break; - - case 162: -#line 2392 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_ASSIGN; - } -#line 4505 "hlsl.tab.c" - break; - - case 163: -#line 2396 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_ADD; - } -#line 4513 "hlsl.tab.c" - break; - - case 164: -#line 2400 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_SUB; - } -#line 4521 "hlsl.tab.c" - break; - - case 165: -#line 2404 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_MUL; - } -#line 4529 "hlsl.tab.c" - break; - - case 166: -#line 2408 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_DIV; - } -#line 4537 "hlsl.tab.c" - break; - - case 167: -#line 2412 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_MOD; - } -#line 4545 "hlsl.tab.c" - break; - - case 168: -#line 2416 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_LSHIFT; - } -#line 4553 "hlsl.tab.c" - break; - - case 169: -#line 2420 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_RSHIFT; - } -#line 4561 "hlsl.tab.c" - break; - - case 170: -#line 2424 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_AND; - } -#line 4569 "hlsl.tab.c" - break; - - case 171: -#line 2428 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_OR; - } -#line 4577 "hlsl.tab.c" - break; - - case 172: -#line 2432 "hlsl.y" - { - (yyval.assign_op) = ASSIGN_OP_XOR; - } -#line 4585 "hlsl.tab.c" - break; - - case 173: -#line 2437 "hlsl.y" - { - (yyval.instr) = (yyvsp[0].instr); - } -#line 4593 "hlsl.tab.c" - break; - - case 174: -#line 2441 "hlsl.y" - { - FIXME("Comma expression\n"); - } -#line 4601 "hlsl.tab.c" - break; - - -#line 4605 "hlsl.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - *++yylsp = yyloc; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - yyerror_range[1] = yylloc; - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, &yylloc); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - yyerror_range[1] = *yylsp; - yydestruct ("Error: popping", - yystos[yystate], yyvsp, yylsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - yyerror_range[2] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); - *++yylsp = yyloc; - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, &yylloc); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, yylsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 2445 "hlsl.y" - - -static void set_location(struct source_location *loc, const struct YYLTYPE *l) -{ - loc->file = hlsl_ctx.source_file; - loc->line = l->first_line; - loc->col = l->first_column; -} - -static DWORD add_modifier(DWORD modifiers, DWORD mod, const struct YYLTYPE *loc) -{ - if (modifiers & mod) - { - hlsl_report_message(hlsl_ctx.source_file, loc->first_line, loc->first_column, HLSL_LEVEL_ERROR, - "modifier '%s' already specified", debug_modifiers(mod)); - return modifiers; - } - if (mod & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR) - && modifiers & (HLSL_MODIFIER_ROW_MAJOR | HLSL_MODIFIER_COLUMN_MAJOR)) - { - hlsl_report_message(hlsl_ctx.source_file, loc->first_line, loc->first_column, HLSL_LEVEL_ERROR, - "more than one matrix majority keyword"); - return modifiers; - } - return modifiers | mod; -} - -static void dump_function_decl(struct wine_rb_entry *entry, void *context) -{ - struct hlsl_ir_function_decl *func = WINE_RB_ENTRY_VALUE(entry, struct hlsl_ir_function_decl, entry); - if (func->body) - debug_dump_ir_function_decl(func); -} - -static void dump_function(struct wine_rb_entry *entry, void *context) -{ - struct hlsl_ir_function *func = WINE_RB_ENTRY_VALUE(entry, struct hlsl_ir_function, entry); - wine_rb_for_each_entry(&func->overloads, dump_function_decl, NULL); -} - -struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD minor, - const char *entrypoint, char **messages) -{ - struct hlsl_scope *scope, *next_scope; - struct hlsl_type *hlsl_type, *next_type; - struct hlsl_ir_var *var, *next_var; - unsigned int i; - - hlsl_ctx.status = PARSE_SUCCESS; - hlsl_ctx.messages.size = hlsl_ctx.messages.capacity = 0; - hlsl_ctx.line_no = hlsl_ctx.column = 1; - hlsl_ctx.source_file = d3dcompiler_strdup(""); - hlsl_ctx.source_files = d3dcompiler_alloc(sizeof(*hlsl_ctx.source_files)); - if (hlsl_ctx.source_files) - hlsl_ctx.source_files[0] = hlsl_ctx.source_file; - hlsl_ctx.source_files_count = 1; - hlsl_ctx.cur_scope = NULL; - hlsl_ctx.matrix_majority = HLSL_COLUMN_MAJOR; - list_init(&hlsl_ctx.scopes); - list_init(&hlsl_ctx.types); - init_functions_tree(&hlsl_ctx.functions); - - push_scope(&hlsl_ctx); - hlsl_ctx.globals = hlsl_ctx.cur_scope; - declare_predefined_types(hlsl_ctx.globals); - - hlsl_parse(); - - if (TRACE_ON(hlsl_parser)) - { - TRACE("IR dump.\n"); - wine_rb_for_each_entry(&hlsl_ctx.functions, dump_function, NULL); - } - - TRACE("Compilation status = %d\n", hlsl_ctx.status); - if (messages) - { - if (hlsl_ctx.messages.size) - *messages = hlsl_ctx.messages.string; - else - *messages = NULL; - } - else - { - if (hlsl_ctx.messages.capacity) - d3dcompiler_free(hlsl_ctx.messages.string); - } - - for (i = 0; i < hlsl_ctx.source_files_count; ++i) - d3dcompiler_free((void *)hlsl_ctx.source_files[i]); - d3dcompiler_free(hlsl_ctx.source_files); - - TRACE("Freeing functions IR.\n"); - wine_rb_destroy(&hlsl_ctx.functions, free_function_rb, NULL); - - TRACE("Freeing variables.\n"); - LIST_FOR_EACH_ENTRY_SAFE(scope, next_scope, &hlsl_ctx.scopes, struct hlsl_scope, entry) - { - LIST_FOR_EACH_ENTRY_SAFE(var, next_var, &scope->vars, struct hlsl_ir_var, scope_entry) - { - free_declaration(var); - } - wine_rb_destroy(&scope->types, NULL, NULL); - d3dcompiler_free(scope); - } - - TRACE("Freeing types.\n"); - LIST_FOR_EACH_ENTRY_SAFE(hlsl_type, next_type, &hlsl_ctx.types, struct hlsl_type, entry) - { - free_hlsl_type(hlsl_type); - } - - return NULL; -} diff --git a/dll/directx/wine/d3dcompiler_43/hlsl.tab.h b/dll/directx/wine/d3dcompiler_43/hlsl.tab.h deleted file mode 100644 index e2f1a686bf1..00000000000 --- a/dll/directx/wine/d3dcompiler_43/hlsl.tab.h +++ /dev/null @@ -1,208 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_HLSL_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_HLSL_TAB_H_INCLUDED -# define YY_HLSL_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_HLSL_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int hlsl_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - KW_BLENDSTATE = 258, - KW_BREAK = 259, - KW_BUFFER = 260, - KW_CBUFFER = 261, - KW_COLUMN_MAJOR = 262, - KW_COMPILE = 263, - KW_CONST = 264, - KW_CONTINUE = 265, - KW_DEPTHSTENCILSTATE = 266, - KW_DEPTHSTENCILVIEW = 267, - KW_DISCARD = 268, - KW_DO = 269, - KW_DOUBLE = 270, - KW_ELSE = 271, - KW_EXTERN = 272, - KW_FALSE = 273, - KW_FOR = 274, - KW_GEOMETRYSHADER = 275, - KW_GROUPSHARED = 276, - KW_IF = 277, - KW_IN = 278, - KW_INLINE = 279, - KW_INOUT = 280, - KW_MATRIX = 281, - KW_NAMESPACE = 282, - KW_NOINTERPOLATION = 283, - KW_OUT = 284, - KW_PASS = 285, - KW_PIXELSHADER = 286, - KW_PRECISE = 287, - KW_RASTERIZERSTATE = 288, - KW_RENDERTARGETVIEW = 289, - KW_RETURN = 290, - KW_REGISTER = 291, - KW_ROW_MAJOR = 292, - KW_SAMPLER = 293, - KW_SAMPLER1D = 294, - KW_SAMPLER2D = 295, - KW_SAMPLER3D = 296, - KW_SAMPLERCUBE = 297, - KW_SAMPLER_STATE = 298, - KW_SAMPLERCOMPARISONSTATE = 299, - KW_SHARED = 300, - KW_STATEBLOCK = 301, - KW_STATEBLOCK_STATE = 302, - KW_STATIC = 303, - KW_STRING = 304, - KW_STRUCT = 305, - KW_SWITCH = 306, - KW_TBUFFER = 307, - KW_TECHNIQUE = 308, - KW_TECHNIQUE10 = 309, - KW_TEXTURE = 310, - KW_TEXTURE1D = 311, - KW_TEXTURE1DARRAY = 312, - KW_TEXTURE2D = 313, - KW_TEXTURE2DARRAY = 314, - KW_TEXTURE2DMS = 315, - KW_TEXTURE2DMSARRAY = 316, - KW_TEXTURE3D = 317, - KW_TEXTURE3DARRAY = 318, - KW_TEXTURECUBE = 319, - KW_TRUE = 320, - KW_TYPEDEF = 321, - KW_UNIFORM = 322, - KW_VECTOR = 323, - KW_VERTEXSHADER = 324, - KW_VOID = 325, - KW_VOLATILE = 326, - KW_WHILE = 327, - OP_INC = 328, - OP_DEC = 329, - OP_AND = 330, - OP_OR = 331, - OP_EQ = 332, - OP_LEFTSHIFT = 333, - OP_LEFTSHIFTASSIGN = 334, - OP_RIGHTSHIFT = 335, - OP_RIGHTSHIFTASSIGN = 336, - OP_ELLIPSIS = 337, - OP_LE = 338, - OP_GE = 339, - OP_NE = 340, - OP_ADDASSIGN = 341, - OP_SUBASSIGN = 342, - OP_MULASSIGN = 343, - OP_DIVASSIGN = 344, - OP_MODASSIGN = 345, - OP_ANDASSIGN = 346, - OP_ORASSIGN = 347, - OP_XORASSIGN = 348, - OP_UNKNOWN1 = 349, - OP_UNKNOWN2 = 350, - OP_UNKNOWN3 = 351, - OP_UNKNOWN4 = 352, - PRE_LINE = 353, - VAR_IDENTIFIER = 354, - TYPE_IDENTIFIER = 355, - NEW_IDENTIFIER = 356, - STRING = 357, - C_FLOAT = 358, - C_INTEGER = 359 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 890 "hlsl.y" - - struct hlsl_type *type; - INT intval; - FLOAT floatval; - BOOL boolval; - char *name; - DWORD modifiers; - struct hlsl_ir_node *instr; - struct list *list; - struct parse_function function; - struct parse_parameter parameter; - struct parse_initializer initializer; - struct parse_variable_def *variable_def; - struct parse_if_body if_body; - enum parse_unary_op unary_op; - enum parse_assign_op assign_op; - struct reg_reservation *reg_reservation; - struct parse_colon_attribute colon_attribute; - -#line 182 "hlsl.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - -/* Location type. */ -#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED -typedef struct YYLTYPE YYLTYPE; -struct YYLTYPE -{ - int first_line; - int first_column; - int last_line; - int last_column; -}; -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - -extern YYSTYPE hlsl_lval; -extern YYLTYPE hlsl_lloc; -int hlsl_parse (void); - -#endif /* !YY_HLSL_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_HLSL_TAB_H_INCLUDED */ diff --git a/dll/directx/wine/d3dcompiler_43/hlsl.yy.c b/dll/directx/wine/d3dcompiler_43/hlsl.yy.c deleted file mode 100644 index 43b3bdb45d7..00000000000 --- a/dll/directx/wine/d3dcompiler_43/hlsl.yy.c +++ /dev/null @@ -1,3190 +0,0 @@ -#line 1 "hlsl.yy.c" - -#line 3 "hlsl.yy.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer hlsl__create_buffer -#define yy_delete_buffer hlsl__delete_buffer -#define yy_scan_buffer hlsl__scan_buffer -#define yy_scan_string hlsl__scan_string -#define yy_scan_bytes hlsl__scan_bytes -#define yy_init_buffer hlsl__init_buffer -#define yy_flush_buffer hlsl__flush_buffer -#define yy_load_buffer_state hlsl__load_buffer_state -#define yy_switch_to_buffer hlsl__switch_to_buffer -#define yypush_buffer_state hlsl_push_buffer_state -#define yypop_buffer_state hlsl_pop_buffer_state -#define yyensure_buffer_stack hlsl_ensure_buffer_stack -#define yy_flex_debug hlsl__flex_debug -#define yyin hlsl_in -#define yyleng hlsl_leng -#define yylex hlsl_lex -#define yylineno hlsl_lineno -#define yyout hlsl_out -#define yyrestart hlsl_restart -#define yytext hlsl_text -#define yywrap hlsl_wrap -#define yyalloc hlsl_alloc -#define yyrealloc hlsl_realloc -#define yyfree hlsl_free - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define hlsl__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer hlsl__create_buffer -#endif - -#ifdef yy_delete_buffer -#define hlsl__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer hlsl__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define hlsl__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer hlsl__scan_buffer -#endif - -#ifdef yy_scan_string -#define hlsl__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string hlsl__scan_string -#endif - -#ifdef yy_scan_bytes -#define hlsl__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes hlsl__scan_bytes -#endif - -#ifdef yy_init_buffer -#define hlsl__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer hlsl__init_buffer -#endif - -#ifdef yy_flush_buffer -#define hlsl__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer hlsl__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define hlsl__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state hlsl__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define hlsl__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer hlsl__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define hlsl_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state hlsl_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define hlsl_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state hlsl_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define hlsl_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack hlsl_ensure_buffer_stack -#endif - -#ifdef yylex -#define hlsl_lex_ALREADY_DEFINED -#else -#define yylex hlsl_lex -#endif - -#ifdef yyrestart -#define hlsl_restart_ALREADY_DEFINED -#else -#define yyrestart hlsl_restart -#endif - -#ifdef yylex_init -#define hlsl_lex_init_ALREADY_DEFINED -#else -#define yylex_init hlsl_lex_init -#endif - -#ifdef yylex_init_extra -#define hlsl_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra hlsl_lex_init_extra -#endif - -#ifdef yylex_destroy -#define hlsl_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy hlsl_lex_destroy -#endif - -#ifdef yyget_debug -#define hlsl_get_debug_ALREADY_DEFINED -#else -#define yyget_debug hlsl_get_debug -#endif - -#ifdef yyset_debug -#define hlsl_set_debug_ALREADY_DEFINED -#else -#define yyset_debug hlsl_set_debug -#endif - -#ifdef yyget_extra -#define hlsl_get_extra_ALREADY_DEFINED -#else -#define yyget_extra hlsl_get_extra -#endif - -#ifdef yyset_extra -#define hlsl_set_extra_ALREADY_DEFINED -#else -#define yyset_extra hlsl_set_extra -#endif - -#ifdef yyget_in -#define hlsl_get_in_ALREADY_DEFINED -#else -#define yyget_in hlsl_get_in -#endif - -#ifdef yyset_in -#define hlsl_set_in_ALREADY_DEFINED -#else -#define yyset_in hlsl_set_in -#endif - -#ifdef yyget_out -#define hlsl_get_out_ALREADY_DEFINED -#else -#define yyget_out hlsl_get_out -#endif - -#ifdef yyset_out -#define hlsl_set_out_ALREADY_DEFINED -#else -#define yyset_out hlsl_set_out -#endif - -#ifdef yyget_leng -#define hlsl_get_leng_ALREADY_DEFINED -#else -#define yyget_leng hlsl_get_leng -#endif - -#ifdef yyget_text -#define hlsl_get_text_ALREADY_DEFINED -#else -#define yyget_text hlsl_get_text -#endif - -#ifdef yyget_lineno -#define hlsl_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno hlsl_get_lineno -#endif - -#ifdef yyset_lineno -#define hlsl_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno hlsl_set_lineno -#endif - -#ifdef yywrap -#define hlsl_wrap_ALREADY_DEFINED -#else -#define yywrap hlsl_wrap -#endif - -#ifdef yyalloc -#define hlsl_alloc_ALREADY_DEFINED -#else -#define yyalloc hlsl_alloc -#endif - -#ifdef yyrealloc -#define hlsl_realloc_ALREADY_DEFINED -#else -#define yyrealloc hlsl_realloc -#endif - -#ifdef yyfree -#define hlsl_free_ALREADY_DEFINED -#else -#define yyfree hlsl_free -#endif - -#ifdef yytext -#define hlsl_text_ALREADY_DEFINED -#else -#define yytext hlsl_text -#endif - -#ifdef yyleng -#define hlsl_leng_ALREADY_DEFINED -#else -#define yyleng hlsl_leng -#endif - -#ifdef yyin -#define hlsl_in_ALREADY_DEFINED -#else -#define yyin hlsl_in -#endif - -#ifdef yyout -#define hlsl_out_ALREADY_DEFINED -#else -#define yyout hlsl_out -#endif - -#ifdef yy_flex_debug -#define hlsl__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug hlsl__flex_debug -#endif - -#ifdef yylineno -#define hlsl_lineno_ALREADY_DEFINED -#else -#define yylineno hlsl_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define hlsl_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -extern int yylineno; -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 125 -#define YY_END_OF_BUFFER 126 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[717] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 126, 124, 108, 109, 124, 124, 124, 124, 124, 124, - 124, 124, 124, 124, 106, 106, 124, 124, 124, 124, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 124, 110, - 93, 123, 122, 123, 116, 123, 125, 118, 119, 125, - 125, 115, 114, 115, 115, 121, 120, 121, 108, 109, - 85, 94, 95, 90, 75, 91, 88, 73, 86, 74, - 87, 97, 0, 101, 107, 89, 102, 105, 106, 0, - - 103, 0, 96, 78, 83, 77, 84, 80, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 15, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 23, 24, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 92, - 76, 122, 116, 0, 118, 119, 0, 117, 114, 0, - 120, 82, 0, 101, 107, 0, 102, 0, 0, 104, - 79, 81, 100, 100, 100, 100, 100, 100, 100, 100, - - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 20, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 2, 100, 100, 30, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 3, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 0, 0, 0, 101, 0, 102, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 1, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - - 17, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 31, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 65, 100, 100, 100, - 100, 100, 100, 100, 70, 100, 100, 0, 0, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 6, - 100, 100, 100, 10, 100, 100, 100, 100, 100, 100, - 100, 100, 19, 100, 100, 100, 26, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - - 100, 100, 100, 100, 100, 100, 4, 100, 100, 100, - 100, 72, 0, 0, 100, 7, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 16, 100, 100, 18, 100, 25, 27, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 36, 100, 100, - 45, 100, 48, 49, 50, 51, 100, 100, 100, 100, - 100, 100, 100, 100, 68, 100, 100, 0, 0, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 8, 100, - 9, 100, 100, 14, 100, 100, 100, 100, 100, 100, - 33, 100, 100, 100, 100, 38, 100, 100, 52, 100, - - 100, 55, 66, 100, 67, 100, 100, 111, 0, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 11, 100, 100, 100, 100, 100, 37, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 71, 0, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 28, 100, 100, 99, 39, 40, 41, 100, 100, 100, - 100, 53, 56, 58, 62, 100, 0, 5, 100, 100, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 100, 100, 100, 100, 46, 100, 100, 100, - - 0, 100, 100, 32, 100, 100, 100, 100, 100, 60, - 100, 100, 100, 100, 22, 100, 100, 42, 100, 100, - 54, 64, 0, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 69, 98, 100, 100, 100, 100, 0, 0, - 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, - 100, 100, 43, 100, 0, 0, 0, 100, 100, 21, - 100, 100, 100, 57, 59, 100, 63, 100, 100, 100, - 0, 0, 100, 100, 34, 100, 100, 100, 29, 100, - 100, 0, 0, 100, 13, 35, 100, 61, 47, 0, - 0, 12, 100, 0, 0, 100, 0, 0, 100, 0, - - 0, 100, 0, 0, 100, 0, 0, 44, 0, 0, - 112, 0, 0, 0, 113, 0 - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 5, 6, 7, 1, 8, 9, 1, 10, - 11, 12, 13, 1, 14, 15, 16, 17, 18, 19, - 20, 21, 21, 21, 21, 22, 22, 23, 1, 24, - 25, 26, 1, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 36, 36, 36, 37, 36, 36, 38, - 36, 39, 40, 41, 42, 43, 36, 36, 36, 36, - 1, 1, 1, 1, 44, 1, 45, 46, 47, 48, - - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 1, 71, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[72] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - 3, 3, 1, 1, 1, 1, 1, 3, 3, 3, - 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 1 - } ; - -static const flex_int16_t yy_base[725] = - { 0, - 0, 65, 74, 80, 83, 101, 70, 72, 76, 78, - 938, 939, 935, 939, 933, 910, 81, 909, 97, 908, - 96, 98, 96, 94, 126, 118, 909, 101, 906, 102, - 0, 64, 881, 880, 875, 104, 882, 877, 876, 859, - 861, 110, 101, 109, 112, 120, 114, 863, 86, 136, - 103, 128, 93, 135, 152, 126, 147, 869, 158, 184, - 895, 939, 939, 916, 198, 856, 939, 915, 939, 913, - 909, 939, 939, 911, 868, 939, 939, 909, 909, 939, - 939, 939, 939, 939, 939, 939, 939, 939, 939, 939, - 939, 939, 895, 213, 0, 939, 268, 841, 0, 236, - - 939, 0, 939, 883, 939, 939, 939, 882, 0, 857, - 855, 844, 844, 834, 838, 842, 842, 830, 835, 832, - 846, 144, 829, 848, 847, 166, 153, 828, 825, 831, - 825, 822, 176, 830, 823, 831, 819, 823, 0, 154, - 823, 816, 815, 821, 810, 823, 826, 810, 810, 188, - 826, 174, 804, 813, 167, 191, 198, 816, 803, 212, - 211, 201, 807, 214, 813, 818, 802, 215, 810, 939, - 939, 939, 274, 817, 859, 939, 854, 939, 939, 812, - 939, 939, 291, 939, 0, 308, 939, 314, 323, 0, - 939, 939, 800, 807, 792, 798, 805, 789, 804, 791, - - 786, 785, 789, 802, 797, 798, 794, 781, 779, 776, - 780, 188, 794, 789, 790, 790, 790, 785, 776, 776, - 782, 767, 0, 780, 769, 762, 773, 760, 773, 761, - 777, 772, 0, 762, 757, 0, 755, 770, 750, 751, - 758, 760, 754, 746, 766, 749, 746, 745, 748, 756, - 740, 249, 739, 752, 749, 740, 735, 735, 738, 747, - 0, 746, 222, 741, 735, 728, 727, 742, 744, 732, - 736, 731, 329, 378, 342, 433, 737, 735, 731, 733, - 725, 731, 730, 722, 712, 727, 0, 720, 722, 723, - 709, 714, 717, 705, 715, 702, 702, 720, 708, 706, - - 0, 709, 699, 711, 701, 698, 699, 692, 702, 708, - 690, 688, 706, 0, 697, 704, 699, 694, 683, 681, - 682, 686, 686, 692, 676, 690, 679, 225, 679, 689, - 688, 684, 675, 676, 666, 663, 0, 249, 670, 670, - 676, 675, 666, 659, 0, 659, 673, 664, 676, 679, - 656, 677, 652, 675, 652, 651, 663, 649, 642, 0, - 660, 650, 651, 662, 647, 648, 654, 640, 652, 647, - 652, 640, 0, 649, 633, 646, 0, 626, 637, 632, - 642, 626, 626, 624, 640, 639, 621, 635, 625, 637, - 632, 632, 631, 628, 631, 629, 624, 610, 621, 623, - - 618, 625, 607, 619, 622, 604, 0, 607, 602, 618, - 609, 0, 616, 603, 595, 0, 594, 595, 604, 602, - 613, 591, 603, 611, 588, 605, 599, 600, 581, 581, - 596, 0, 596, 589, 0, 589, 0, 0, 591, 594, - 576, 578, 587, 586, 570, 584, 570, 0, 577, 568, - 0, 573, 584, 0, 0, 0, 565, 565, 561, 575, - 573, 565, 564, 571, 0, 563, 562, 615, 571, 570, - 565, 544, 567, 541, 565, 579, 334, 556, 0, 550, - 0, 561, 556, 0, 560, 539, 557, 554, 540, 537, - 0, 549, 535, 536, 536, 347, 535, 546, 0, 527, - - 542, 350, 0, 541, 0, 541, 539, 585, 522, 521, - 526, 543, 534, 532, 518, 520, 547, 546, 545, 530, - 529, 510, 0, 525, 509, 521, 510, 520, 0, 505, - 504, 534, 533, 532, 520, 498, 513, 514, 509, 526, - 525, 524, 512, 0, 491, 503, 504, 498, 500, 486, - 496, 489, 517, 278, 516, 495, 488, 477, 495, 490, - 0, 482, 488, 0, 0, 0, 0, 507, 471, 479, - 470, 514, 0, 0, 0, 502, 475, 0, 450, 457, - 439, 460, 450, 438, 435, 434, 455, 432, 444, 433, - 428, 442, 444, 424, 455, 441, 440, 418, 464, 448, - - 411, 422, 429, 0, 412, 411, 429, 411, 410, 443, - 408, 407, 405, 401, 0, 400, 419, 0, 398, 398, - 0, 0, 273, 236, 411, 414, 415, 395, 411, 403, - 385, 401, 0, 0, 392, 397, 394, 378, 314, 355, - 377, 387, 377, 374, 384, 383, 366, 365, 371, 363, - 370, 382, 0, 381, 369, 366, 365, 378, 373, 0, - 372, 371, 356, 0, 0, 373, 0, 357, 351, 348, - 354, 342, 344, 340, 0, 339, 346, 335, 0, 339, - 352, 328, 346, 340, 0, 0, 329, 0, 0, 329, - 327, 0, 93, 134, 160, 164, 195, 190, 237, 241, - - 240, 255, 278, 275, 289, 301, 370, 0, 315, 374, - 939, 316, 377, 381, 939, 939, 504, 508, 512, 516, - 518, 522, 526, 379 - } ; - -static const flex_int16_t yy_def[725] = - { 0, - 716, 1, 717, 717, 718, 718, 719, 719, 720, 720, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 25, 716, 716, 716, 716, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 722, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 723, 716, 716, 25, 26, 716, - - 716, 724, 716, 716, 716, 716, 716, 716, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 716, - 716, 716, 716, 716, 716, 716, 722, 716, 716, 716, - 716, 716, 716, 716, 723, 716, 716, 716, 716, 724, - 716, 716, 721, 721, 721, 721, 721, 721, 721, 721, - - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 716, 716, 716, 716, 716, 716, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 716, 716, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 716, 716, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 716, 716, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - - 721, 721, 721, 721, 721, 721, 721, 716, 716, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 716, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 716, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - - 716, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 716, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 716, 716, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 716, 716, 716, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 716, 716, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 716, 716, 721, 721, 721, 721, 721, 721, 716, - 716, 721, 721, 716, 716, 721, 716, 716, 721, 716, - - 716, 721, 716, 716, 721, 716, 716, 721, 716, 716, - 716, 716, 716, 716, 716, 0, 716, 716, 716, 716, - 716, 716, 716, 716 - } ; - -static const flex_int16_t yy_nxt[1011] = - { 0, - 12, 13, 14, 15, 16, 12, 17, 18, 19, 12, - 12, 20, 21, 22, 23, 24, 25, 26, 26, 26, - 26, 26, 27, 28, 29, 30, 12, 31, 32, 31, - 33, 31, 31, 34, 31, 31, 31, 35, 36, 37, - 38, 31, 39, 31, 40, 41, 42, 43, 44, 45, - 46, 31, 47, 31, 31, 48, 49, 50, 51, 52, - 31, 53, 54, 55, 56, 57, 58, 31, 31, 31, - 59, 60, 73, 74, 73, 74, 63, 64, 77, 78, - 77, 78, 63, 64, 68, 69, 70, 82, 71, 61, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - - 65, 65, 68, 69, 70, 85, 71, 83, 88, 95, - 93, 90, 94, 94, 94, 94, 94, 94, 96, 110, - 89, 86, 91, 92, 104, 105, 107, 108, 111, 75, - 142, 75, 696, 66, 99, 99, 99, 99, 99, 66, - 97, 152, 98, 98, 98, 98, 98, 99, 115, 127, - 143, 153, 116, 128, 122, 123, 134, 100, 101, 129, - 101, 124, 147, 139, 131, 125, 132, 148, 126, 130, - 135, 140, 149, 136, 100, 101, 133, 101, 137, 154, - 144, 138, 170, 164, 145, 716, 155, 156, 165, 150, - 82, 697, 151, 102, 146, 166, 101, 159, 157, 167, - - 160, 158, 213, 161, 698, 168, 205, 206, 214, 227, - 83, 247, 228, 162, 173, 173, 173, 173, 173, 173, - 163, 210, 211, 212, 242, 248, 243, 699, 171, 94, - 94, 94, 94, 94, 94, 220, 238, 244, 700, 221, - 239, 249, 251, 701, 183, 184, 240, 184, 188, 188, - 294, 295, 189, 189, 189, 189, 189, 189, 255, 252, - 250, 183, 184, 258, 184, 260, 263, 268, 256, 261, - 269, 339, 259, 395, 639, 641, 264, 396, 642, 257, - 340, 702, 640, 184, 94, 94, 94, 94, 94, 94, - 173, 173, 173, 173, 173, 173, 404, 703, 704, 186, - - 187, 329, 187, 273, 273, 586, 405, 274, 274, 274, - 274, 274, 274, 330, 587, 639, 186, 187, 705, 187, - 275, 275, 706, 640, 276, 276, 276, 276, 276, 276, - 189, 189, 189, 189, 189, 189, 707, 708, 187, 189, - 189, 189, 189, 189, 189, 274, 274, 274, 274, 274, - 274, 517, 518, 519, 709, 101, 655, 101, 276, 276, - 276, 276, 276, 276, 532, 533, 534, 540, 541, 542, - 655, 710, 101, 712, 101, 710, 535, 713, 714, 543, - 711, 190, 714, 695, 711, 694, 693, 715, 692, 691, - 536, 715, 690, 101, 274, 274, 274, 274, 274, 274, - - 689, 656, 261, 688, 687, 686, 685, 684, 683, 682, - 184, 681, 184, 680, 679, 656, 657, 678, 677, 676, - 675, 674, 673, 672, 671, 670, 669, 184, 668, 184, - 657, 667, 666, 665, 664, 663, 662, 661, 660, 659, - 658, 654, 653, 652, 651, 650, 649, 648, 184, 276, - 276, 276, 276, 276, 276, 647, 646, 645, 644, 643, - 638, 637, 636, 635, 287, 187, 634, 187, 633, 632, - 631, 630, 629, 628, 627, 626, 625, 624, 623, 622, - 621, 261, 187, 620, 187, 619, 618, 617, 616, 615, - 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, - - 604, 603, 602, 187, 62, 62, 62, 62, 67, 67, - 67, 67, 72, 72, 72, 72, 76, 76, 76, 76, - 109, 109, 177, 177, 177, 177, 185, 601, 185, 185, - 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, - 287, 590, 589, 588, 585, 584, 583, 582, 581, 580, - 579, 578, 577, 576, 575, 574, 573, 572, 571, 570, - 569, 568, 567, 566, 565, 564, 563, 233, 562, 561, - 560, 559, 558, 557, 556, 555, 554, 553, 552, 551, - 550, 549, 548, 547, 546, 545, 508, 544, 407, 407, - 261, 539, 538, 537, 531, 530, 529, 528, 233, 527, - - 526, 525, 233, 524, 523, 522, 521, 520, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 407, 506, - 505, 504, 503, 502, 501, 500, 499, 498, 497, 496, - 495, 494, 493, 492, 233, 491, 490, 489, 488, 233, - 487, 486, 485, 484, 287, 483, 482, 481, 480, 479, - 478, 477, 476, 475, 474, 473, 472, 471, 470, 469, - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 261, 261, 451, - 450, 449, 448, 447, 446, 233, 445, 444, 443, 442, - 441, 440, 439, 438, 437, 436, 233, 435, 434, 433, - - 432, 431, 287, 430, 429, 428, 427, 426, 425, 424, - 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, - 413, 412, 411, 410, 409, 407, 408, 407, 406, 261, - 403, 402, 401, 400, 399, 398, 397, 394, 393, 261, - 392, 391, 390, 389, 388, 387, 386, 385, 384, 383, - 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, - 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, - 362, 287, 361, 287, 360, 359, 358, 357, 356, 355, - 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, - 344, 343, 342, 341, 338, 337, 336, 261, 335, 334, - - 333, 332, 331, 328, 327, 326, 325, 324, 323, 322, - 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, - 311, 310, 309, 233, 308, 307, 306, 233, 305, 304, - 303, 302, 287, 301, 300, 299, 298, 297, 296, 293, - 292, 291, 287, 290, 289, 287, 288, 287, 286, 285, - 284, 283, 282, 281, 280, 279, 278, 277, 272, 178, - 175, 271, 270, 267, 266, 265, 262, 254, 253, 246, - 245, 241, 237, 236, 235, 234, 233, 232, 231, 230, - 229, 226, 225, 224, 223, 222, 219, 218, 217, 216, - 215, 209, 208, 207, 204, 203, 202, 201, 200, 199, - - 198, 197, 196, 195, 194, 193, 192, 191, 716, 182, - 79, 181, 180, 179, 178, 176, 175, 174, 172, 106, - 169, 141, 121, 120, 119, 118, 117, 114, 113, 112, - 106, 103, 87, 84, 81, 80, 79, 716, 11, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716 - } ; - -static const flex_int16_t yy_chk[1011] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 7, 7, 8, 8, 3, 3, 9, 9, - 10, 10, 4, 4, 5, 5, 5, 17, 5, 2, - 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, - - 4, 4, 6, 6, 6, 19, 6, 17, 21, 24, - 23, 22, 23, 23, 23, 23, 23, 23, 24, 32, - 21, 19, 22, 22, 28, 28, 30, 30, 32, 7, - 49, 8, 693, 3, 26, 26, 26, 26, 26, 4, - 25, 53, 25, 25, 25, 25, 25, 25, 36, 43, - 49, 53, 36, 43, 42, 42, 45, 25, 25, 43, - 25, 42, 51, 47, 44, 42, 44, 51, 42, 43, - 45, 47, 52, 45, 25, 25, 44, 25, 46, 54, - 50, 46, 59, 56, 50, 26, 54, 54, 56, 52, - 60, 694, 52, 25, 50, 57, 25, 55, 54, 57, - - 55, 54, 127, 55, 695, 57, 122, 122, 127, 140, - 60, 155, 140, 55, 65, 65, 65, 65, 65, 65, - 55, 126, 126, 126, 152, 155, 152, 696, 59, 94, - 94, 94, 94, 94, 94, 133, 150, 152, 697, 133, - 150, 156, 157, 698, 94, 94, 150, 94, 100, 100, - 212, 212, 100, 100, 100, 100, 100, 100, 160, 157, - 156, 94, 94, 161, 94, 162, 164, 168, 160, 162, - 168, 263, 161, 328, 623, 624, 164, 328, 624, 160, - 263, 699, 623, 94, 97, 97, 97, 97, 97, 97, - 173, 173, 173, 173, 173, 173, 338, 700, 701, 97, - - 97, 252, 97, 183, 183, 554, 338, 183, 183, 183, - 183, 183, 183, 252, 554, 639, 97, 97, 702, 97, - 186, 186, 703, 639, 186, 186, 186, 186, 186, 186, - 188, 188, 188, 188, 188, 188, 704, 705, 97, 189, - 189, 189, 189, 189, 189, 273, 273, 273, 273, 273, - 273, 477, 477, 477, 706, 189, 640, 189, 275, 275, - 275, 275, 275, 275, 496, 496, 496, 502, 502, 502, - 655, 707, 189, 709, 189, 710, 496, 712, 713, 502, - 707, 724, 714, 691, 710, 690, 687, 713, 684, 683, - 496, 714, 682, 189, 274, 274, 274, 274, 274, 274, - - 681, 640, 680, 678, 677, 676, 674, 673, 672, 671, - 274, 670, 274, 669, 668, 655, 640, 666, 663, 662, - 661, 659, 658, 657, 656, 654, 652, 274, 651, 274, - 655, 650, 649, 648, 647, 646, 645, 644, 643, 642, - 641, 638, 637, 636, 635, 632, 631, 630, 274, 276, - 276, 276, 276, 276, 276, 629, 628, 627, 626, 625, - 620, 619, 617, 616, 614, 276, 613, 276, 612, 611, - 610, 609, 608, 607, 606, 605, 603, 602, 601, 600, - 599, 598, 276, 597, 276, 596, 595, 594, 593, 592, - 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, - - 581, 580, 579, 276, 717, 717, 717, 717, 718, 718, - 718, 718, 719, 719, 719, 719, 720, 720, 720, 720, - 721, 721, 722, 722, 722, 722, 723, 577, 723, 723, - 576, 572, 571, 570, 569, 568, 563, 562, 560, 559, - 558, 557, 556, 555, 553, 552, 551, 550, 549, 548, - 547, 546, 545, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 528, 527, 526, - 525, 524, 522, 521, 520, 519, 518, 517, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 506, 504, - 501, 500, 498, 497, 495, 494, 493, 492, 490, 489, - - 488, 487, 486, 485, 483, 482, 480, 478, 476, 475, - 474, 473, 472, 471, 470, 469, 468, 467, 466, 464, - 463, 462, 461, 460, 459, 458, 457, 453, 452, 450, - 449, 447, 446, 445, 444, 443, 442, 441, 440, 439, - 436, 434, 433, 431, 430, 429, 428, 427, 426, 425, - 424, 423, 422, 421, 420, 419, 418, 417, 415, 414, - 413, 411, 410, 409, 408, 406, 405, 404, 403, 402, - 401, 400, 399, 398, 397, 396, 395, 394, 393, 392, - 391, 390, 389, 388, 387, 386, 385, 384, 383, 382, - 381, 380, 379, 378, 376, 375, 374, 372, 371, 370, - - 369, 368, 367, 366, 365, 364, 363, 362, 361, 359, - 358, 357, 356, 355, 354, 353, 352, 351, 350, 349, - 348, 347, 346, 344, 343, 342, 341, 340, 339, 336, - 335, 334, 333, 332, 331, 330, 329, 327, 326, 325, - 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, - 313, 312, 311, 310, 309, 308, 307, 306, 305, 304, - 303, 302, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 286, 285, 284, 283, 282, - 281, 280, 279, 278, 277, 272, 271, 270, 269, 268, - 267, 266, 265, 264, 262, 260, 259, 258, 257, 256, - - 255, 254, 253, 251, 250, 249, 248, 247, 246, 245, - 244, 243, 242, 241, 240, 239, 238, 237, 235, 234, - 232, 231, 230, 229, 228, 227, 226, 225, 224, 222, - 221, 220, 219, 218, 217, 216, 215, 214, 213, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, - 200, 199, 198, 197, 196, 195, 194, 193, 180, 177, - 175, 174, 169, 167, 166, 165, 163, 159, 158, 154, - 153, 151, 149, 148, 147, 146, 145, 144, 143, 142, - 141, 138, 137, 136, 135, 134, 132, 131, 130, 129, - 128, 125, 124, 123, 121, 120, 119, 118, 117, 116, - - 115, 114, 113, 112, 111, 110, 108, 104, 98, 93, - 79, 78, 75, 74, 71, 70, 68, 66, 64, 61, - 58, 48, 41, 40, 39, 38, 37, 35, 34, 33, - 29, 27, 20, 18, 16, 15, 13, 11, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716, - - 716, 716, 716, 716, 716, 716, 716, 716, 716, 716 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "hlsl.l" -/* - * HLSL parser - * - * Copyright 2008 Stefan Dösinger - * Copyright 2012 Matteo Bruni for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ -#line 23 "hlsl.l" -#include "wine/debug.h" - -#define YY_NO_UNISTD_H -#include "d3dcompiler_private.h" -#include "hlsl.tab.h" - -WINE_DEFAULT_DEBUG_CHANNEL(hlsl_parser); - -#define YY_USER_ACTION \ - do { \ - hlsl_lloc.first_column = hlsl_ctx.column; \ - hlsl_lloc.first_line = hlsl_ctx.line_no; \ - hlsl_ctx.column += yyleng; \ - } while(0); - -#line 1202 "hlsl.yy.c" -#define YY_NO_INPUT 1 - -#line 1205 "hlsl.yy.c" - -#define INITIAL 0 -#define pp 1 -#define pp_line 2 -#define pp_pragma 3 -#define pp_ignore 4 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 58 "hlsl.l" - -#line 1429 "hlsl.yy.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 717 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_current_state != 716 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 59 "hlsl.l" -{ - hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx.line_no, yytext); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - } - YY_BREAK -case 2: -YY_RULE_SETUP -#line 63 "hlsl.l" -{ - hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx.line_no, yytext); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 67 "hlsl.l" -{ - hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx.line_no, yytext); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 71 "hlsl.l" -{ - hlsl_message("Line %u: Reserved keyword \"%s\" used.\n", hlsl_ctx.line_no, yytext); - set_parse_status(&hlsl_ctx.status, PARSE_ERR); - } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 76 "hlsl.l" -{return KW_BLENDSTATE; } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 77 "hlsl.l" -{return KW_BREAK; } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 78 "hlsl.l" -{return KW_BUFFER; } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 79 "hlsl.l" -{return KW_CBUFFER; } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 80 "hlsl.l" -{return KW_COMPILE; } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 81 "hlsl.l" -{return KW_CONST; } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 82 "hlsl.l" -{return KW_CONTINUE; } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 83 "hlsl.l" -{return KW_DEPTHSTENCILSTATE; } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 84 "hlsl.l" -{return KW_DEPTHSTENCILVIEW; } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 85 "hlsl.l" -{return KW_DISCARD; } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 86 "hlsl.l" -{return KW_DO; } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 87 "hlsl.l" -{return KW_DOUBLE; } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 88 "hlsl.l" -{return KW_ELSE; } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 89 "hlsl.l" -{return KW_EXTERN; } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 90 "hlsl.l" -{return KW_FALSE; } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 91 "hlsl.l" -{return KW_FOR; } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 92 "hlsl.l" -{return KW_GEOMETRYSHADER; } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 93 "hlsl.l" -{return KW_GROUPSHARED; } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 94 "hlsl.l" -{return KW_IF; } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 95 "hlsl.l" -{return KW_IN; } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 96 "hlsl.l" -{return KW_INLINE; } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 97 "hlsl.l" -{return KW_INOUT; } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 98 "hlsl.l" -{return KW_MATRIX; } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 99 "hlsl.l" -{return KW_NAMESPACE; } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 100 "hlsl.l" -{return KW_NOINTERPOLATION; } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 101 "hlsl.l" -{return KW_OUT; } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 102 "hlsl.l" -{return KW_PASS; } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 103 "hlsl.l" -{return KW_PIXELSHADER; } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 104 "hlsl.l" -{return KW_PRECISE; } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 105 "hlsl.l" -{return KW_RASTERIZERSTATE; } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 106 "hlsl.l" -{return KW_RENDERTARGETVIEW; } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 107 "hlsl.l" -{return KW_RETURN; } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 108 "hlsl.l" -{return KW_REGISTER; } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 109 "hlsl.l" -{return KW_SAMPLER; } - YY_BREAK -case 39: -YY_RULE_SETUP -#line 110 "hlsl.l" -{return KW_SAMPLER1D; } - YY_BREAK -case 40: -YY_RULE_SETUP -#line 111 "hlsl.l" -{return KW_SAMPLER2D; } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 112 "hlsl.l" -{return KW_SAMPLER3D; } - YY_BREAK -case 42: -YY_RULE_SETUP -#line 113 "hlsl.l" -{return KW_SAMPLERCUBE; } - YY_BREAK -case 43: -YY_RULE_SETUP -#line 114 "hlsl.l" -{return KW_SAMPLER_STATE; } - YY_BREAK -case 44: -YY_RULE_SETUP -#line 115 "hlsl.l" -{return KW_SAMPLERCOMPARISONSTATE;} - YY_BREAK -case 45: -YY_RULE_SETUP -#line 116 "hlsl.l" -{return KW_SHARED; } - YY_BREAK -case 46: -YY_RULE_SETUP -#line 117 "hlsl.l" -{return KW_STATEBLOCK; } - YY_BREAK -case 47: -YY_RULE_SETUP -#line 118 "hlsl.l" -{return KW_STATEBLOCK_STATE; } - YY_BREAK -case 48: -YY_RULE_SETUP -#line 119 "hlsl.l" -{return KW_STATIC; } - YY_BREAK -case 49: -YY_RULE_SETUP -#line 120 "hlsl.l" -{return KW_STRING; } - YY_BREAK -case 50: -YY_RULE_SETUP -#line 121 "hlsl.l" -{return KW_STRUCT; } - YY_BREAK -case 51: -YY_RULE_SETUP -#line 122 "hlsl.l" -{return KW_SWITCH; } - YY_BREAK -case 52: -YY_RULE_SETUP -#line 123 "hlsl.l" -{return KW_TBUFFER; } - YY_BREAK -case 53: -YY_RULE_SETUP -#line 124 "hlsl.l" -{return KW_TECHNIQUE; } - YY_BREAK -case 54: -YY_RULE_SETUP -#line 125 "hlsl.l" -{return KW_TECHNIQUE10; } - YY_BREAK -case 55: -YY_RULE_SETUP -#line 126 "hlsl.l" -{return KW_TEXTURE; } - YY_BREAK -case 56: -YY_RULE_SETUP -#line 127 "hlsl.l" -{return KW_TEXTURE1D; } - YY_BREAK -case 57: -YY_RULE_SETUP -#line 128 "hlsl.l" -{return KW_TEXTURE1DARRAY; } - YY_BREAK -case 58: -YY_RULE_SETUP -#line 129 "hlsl.l" -{return KW_TEXTURE2D; } - YY_BREAK -case 59: -YY_RULE_SETUP -#line 130 "hlsl.l" -{return KW_TEXTURE2DARRAY; } - YY_BREAK -case 60: -YY_RULE_SETUP -#line 131 "hlsl.l" -{return KW_TEXTURE2DMS; } - YY_BREAK -case 61: -YY_RULE_SETUP -#line 132 "hlsl.l" -{return KW_TEXTURE2DMSARRAY; } - YY_BREAK -case 62: -YY_RULE_SETUP -#line 133 "hlsl.l" -{return KW_TEXTURE3D; } - YY_BREAK -case 63: -YY_RULE_SETUP -#line 134 "hlsl.l" -{return KW_TEXTURE3DARRAY; } - YY_BREAK -case 64: -YY_RULE_SETUP -#line 135 "hlsl.l" -{return KW_TEXTURECUBE; } - YY_BREAK -case 65: -YY_RULE_SETUP -#line 136 "hlsl.l" -{return KW_TRUE; } - YY_BREAK -case 66: -YY_RULE_SETUP -#line 137 "hlsl.l" -{return KW_TYPEDEF; } - YY_BREAK -case 67: -YY_RULE_SETUP -#line 138 "hlsl.l" -{return KW_UNIFORM; } - YY_BREAK -case 68: -YY_RULE_SETUP -#line 139 "hlsl.l" -{return KW_VECTOR; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 140 "hlsl.l" -{return KW_VERTEXSHADER; } - YY_BREAK -case 70: -YY_RULE_SETUP -#line 141 "hlsl.l" -{return KW_VOID; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 142 "hlsl.l" -{return KW_VOLATILE; } - YY_BREAK -case 72: -YY_RULE_SETUP -#line 143 "hlsl.l" -{return KW_WHILE; } - YY_BREAK -case 73: -YY_RULE_SETUP -#line 145 "hlsl.l" -{return OP_INC; } - YY_BREAK -case 74: -YY_RULE_SETUP -#line 146 "hlsl.l" -{return OP_DEC; } - YY_BREAK -case 75: -YY_RULE_SETUP -#line 147 "hlsl.l" -{return OP_AND; } - YY_BREAK -case 76: -YY_RULE_SETUP -#line 148 "hlsl.l" -{return OP_OR; } - YY_BREAK -case 77: -YY_RULE_SETUP -#line 149 "hlsl.l" -{return OP_EQ; } - YY_BREAK -case 78: -YY_RULE_SETUP -#line 150 "hlsl.l" -{return OP_LEFTSHIFT; } - YY_BREAK -case 79: -YY_RULE_SETUP -#line 151 "hlsl.l" -{return OP_LEFTSHIFTASSIGN; } - YY_BREAK -case 80: -YY_RULE_SETUP -#line 152 "hlsl.l" -{return OP_RIGHTSHIFT; } - YY_BREAK -case 81: -YY_RULE_SETUP -#line 153 "hlsl.l" -{return OP_RIGHTSHIFTASSIGN; } - YY_BREAK -case 82: -YY_RULE_SETUP -#line 154 "hlsl.l" -{return OP_ELLIPSIS; } - YY_BREAK -case 83: -YY_RULE_SETUP -#line 155 "hlsl.l" -{return OP_LE; } - YY_BREAK -case 84: -YY_RULE_SETUP -#line 156 "hlsl.l" -{return OP_GE; } - YY_BREAK -case 85: -YY_RULE_SETUP -#line 157 "hlsl.l" -{return OP_NE; } - YY_BREAK -case 86: -YY_RULE_SETUP -#line 158 "hlsl.l" -{return OP_ADDASSIGN; } - YY_BREAK -case 87: -YY_RULE_SETUP -#line 159 "hlsl.l" -{return OP_SUBASSIGN; } - YY_BREAK -case 88: -YY_RULE_SETUP -#line 160 "hlsl.l" -{return OP_MULASSIGN; } - YY_BREAK -case 89: -YY_RULE_SETUP -#line 161 "hlsl.l" -{return OP_DIVASSIGN; } - YY_BREAK -case 90: -YY_RULE_SETUP -#line 162 "hlsl.l" -{return OP_MODASSIGN; } - YY_BREAK -case 91: -YY_RULE_SETUP -#line 163 "hlsl.l" -{return OP_ANDASSIGN; } - YY_BREAK -case 92: -YY_RULE_SETUP -#line 164 "hlsl.l" -{return OP_ORASSIGN; } - YY_BREAK -case 93: -YY_RULE_SETUP -#line 165 "hlsl.l" -{return OP_XORASSIGN; } - YY_BREAK -case 94: -YY_RULE_SETUP -#line 166 "hlsl.l" -{return OP_UNKNOWN1; } - YY_BREAK -case 95: -YY_RULE_SETUP -#line 167 "hlsl.l" -{return OP_UNKNOWN2; } - YY_BREAK -case 96: -YY_RULE_SETUP -#line 168 "hlsl.l" -{return OP_UNKNOWN3; } - YY_BREAK -case 97: -YY_RULE_SETUP -#line 169 "hlsl.l" -{return OP_UNKNOWN4; } - YY_BREAK -case 98: -YY_RULE_SETUP -#line 171 "hlsl.l" -{return KW_COLUMN_MAJOR; } - YY_BREAK -case 99: -YY_RULE_SETUP -#line 172 "hlsl.l" -{return KW_ROW_MAJOR; } - YY_BREAK -case 100: -YY_RULE_SETUP -#line 174 "hlsl.l" -{ - hlsl_lval.name = d3dcompiler_strdup(yytext); - if (get_variable(hlsl_ctx.cur_scope, yytext) - || find_function(yytext)) - return VAR_IDENTIFIER; - else if (get_type(hlsl_ctx.cur_scope, yytext, TRUE)) - return TYPE_IDENTIFIER; - else - return NEW_IDENTIFIER; - } - YY_BREAK -case 101: -YY_RULE_SETUP -#line 185 "hlsl.l" -{ - hlsl_lval.floatval = atof(yytext); - return C_FLOAT; - } - YY_BREAK -case 102: -YY_RULE_SETUP -#line 189 "hlsl.l" -{ - hlsl_lval.floatval = atof(yytext); - return C_FLOAT; - } - YY_BREAK -case 103: -YY_RULE_SETUP -#line 193 "hlsl.l" -{ - hlsl_lval.floatval = atof(yytext); - return C_FLOAT; - } - YY_BREAK -case 104: -YY_RULE_SETUP -#line 197 "hlsl.l" -{ - sscanf(yytext, "0x%x", &hlsl_lval.intval); - return C_INTEGER; - } - YY_BREAK -case 105: -YY_RULE_SETUP -#line 201 "hlsl.l" -{ - sscanf(yytext, "0%o", &hlsl_lval.intval); - return C_INTEGER; - } - YY_BREAK -case 106: -YY_RULE_SETUP -#line 205 "hlsl.l" -{ - hlsl_lval.intval = (atoi(yytext)); - return C_INTEGER; - } - YY_BREAK -case 107: -YY_RULE_SETUP -#line 210 "hlsl.l" -{} - YY_BREAK -case 108: -YY_RULE_SETUP -#line 212 "hlsl.l" -{} - YY_BREAK -case 109: -/* rule 109 can match eol */ -YY_RULE_SETUP -#line 213 "hlsl.l" -{ - hlsl_ctx.line_no++; - hlsl_ctx.column = 1; - } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 218 "hlsl.l" -{ - BEGIN pp; - } - YY_BREAK -case 111: -YY_RULE_SETUP -#line 222 "hlsl.l" -{ - TRACE("Got a #pragma.\n"); - BEGIN pp_pragma; - } - YY_BREAK -case 112: -YY_RULE_SETUP -#line 226 "hlsl.l" -{ - TRACE("#pragma setting row_major mode.\n"); - hlsl_ctx.matrix_majority = HLSL_ROW_MAJOR; - BEGIN pp_ignore; - } - YY_BREAK -case 113: -YY_RULE_SETUP -#line 231 "hlsl.l" -{ - TRACE("#pragma setting column_major mode.\n"); - hlsl_ctx.matrix_majority = HLSL_COLUMN_MAJOR; - BEGIN pp_ignore; - } - YY_BREAK -case 114: -/* rule 114 can match eol */ -YY_RULE_SETUP -#line 236 "hlsl.l" -{ - FIXME("Unsupported preprocessor #pragma directive at line %u.\n", hlsl_ctx.line_no); - BEGIN INITIAL; - } - YY_BREAK -case 115: -YY_RULE_SETUP -#line 240 "hlsl.l" -{} - YY_BREAK -case 116: -YY_RULE_SETUP -#line 241 "hlsl.l" -{ - TRACE("Preprocessor line info.\n"); - BEGIN pp_line; - hlsl_lval.intval = (atoi(yytext)); - return PRE_LINE; - } - YY_BREAK -case 117: -/* rule 117 can match eol */ -YY_RULE_SETUP -#line 247 "hlsl.l" -{ - char *string = d3dcompiler_strdup(yytext + 1); - - BEGIN pp_ignore; - string[strlen(string) - 1] = 0; - hlsl_lval.name = string; - return STRING; - } - YY_BREAK -case 118: -YY_RULE_SETUP -#line 255 "hlsl.l" -{} - YY_BREAK -case 119: -/* rule 119 can match eol */ -YY_RULE_SETUP -#line 256 "hlsl.l" -{ - FIXME("Malformed preprocessor line directive?\n"); - BEGIN INITIAL; - } - YY_BREAK -case 120: -/* rule 120 can match eol */ -YY_RULE_SETUP -#line 260 "hlsl.l" -{ - BEGIN INITIAL; - } - YY_BREAK -case 121: -YY_RULE_SETUP -#line 263 "hlsl.l" -{} - YY_BREAK -case 122: -/* rule 122 can match eol */ -YY_RULE_SETUP -#line 264 "hlsl.l" -{ - FIXME("Unexpected preprocessor directive.\n"); - BEGIN INITIAL; - } - YY_BREAK -case 123: -YY_RULE_SETUP -#line 268 "hlsl.l" -{} - YY_BREAK -case 124: -YY_RULE_SETUP -#line 270 "hlsl.l" -{ - return yytext[0]; - } - YY_BREAK -case 125: -YY_RULE_SETUP -#line 274 "hlsl.l" -ECHO; - YY_BREAK -#line 2194 "hlsl.yy.c" -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(pp): -case YY_STATE_EOF(pp_line): -case YY_STATE_EOF(pp_pragma): -case YY_STATE_EOF(pp_ignore): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 717 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 717 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 716); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - yyfree( (void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 274 "hlsl.l" - - -struct bwriter_shader *parse_hlsl(enum shader_type type, DWORD major, DWORD minor, - const char *entrypoint, char **messages); - -struct bwriter_shader *parse_hlsl_shader(const char *text, enum shader_type type, DWORD major, DWORD minor, - const char *entrypoint, char **messages) -{ - struct bwriter_shader *ret = NULL; - YY_BUFFER_STATE buffer; - - buffer = hlsl__scan_string(text); - hlsl__switch_to_buffer(buffer); - - ret = parse_hlsl(type, major, minor, entrypoint, messages); - - hlsl__delete_buffer(buffer); - return ret; -} - diff --git a/dll/directx/wine/d3dcompiler_43/hlsl.yy.h b/dll/directx/wine/d3dcompiler_43/hlsl.yy.h deleted file mode 100644 index c77233e4734..00000000000 --- a/dll/directx/wine/d3dcompiler_43/hlsl.yy.h +++ /dev/null @@ -1,715 +0,0 @@ -#ifndef hlsl_HEADER_H -#define hlsl_HEADER_H 1 -#define hlsl_IN_HEADER 1 - -#line 5 "hlsl.yy.h" - -#line 7 "hlsl.yy.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define hlsl__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer hlsl__create_buffer -#endif - -#ifdef yy_delete_buffer -#define hlsl__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer hlsl__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define hlsl__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer hlsl__scan_buffer -#endif - -#ifdef yy_scan_string -#define hlsl__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string hlsl__scan_string -#endif - -#ifdef yy_scan_bytes -#define hlsl__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes hlsl__scan_bytes -#endif - -#ifdef yy_init_buffer -#define hlsl__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer hlsl__init_buffer -#endif - -#ifdef yy_flush_buffer -#define hlsl__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer hlsl__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define hlsl__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state hlsl__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define hlsl__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer hlsl__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define hlsl_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state hlsl_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define hlsl_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state hlsl_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define hlsl_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack hlsl_ensure_buffer_stack -#endif - -#ifdef yylex -#define hlsl_lex_ALREADY_DEFINED -#else -#define yylex hlsl_lex -#endif - -#ifdef yyrestart -#define hlsl_restart_ALREADY_DEFINED -#else -#define yyrestart hlsl_restart -#endif - -#ifdef yylex_init -#define hlsl_lex_init_ALREADY_DEFINED -#else -#define yylex_init hlsl_lex_init -#endif - -#ifdef yylex_init_extra -#define hlsl_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra hlsl_lex_init_extra -#endif - -#ifdef yylex_destroy -#define hlsl_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy hlsl_lex_destroy -#endif - -#ifdef yyget_debug -#define hlsl_get_debug_ALREADY_DEFINED -#else -#define yyget_debug hlsl_get_debug -#endif - -#ifdef yyset_debug -#define hlsl_set_debug_ALREADY_DEFINED -#else -#define yyset_debug hlsl_set_debug -#endif - -#ifdef yyget_extra -#define hlsl_get_extra_ALREADY_DEFINED -#else -#define yyget_extra hlsl_get_extra -#endif - -#ifdef yyset_extra -#define hlsl_set_extra_ALREADY_DEFINED -#else -#define yyset_extra hlsl_set_extra -#endif - -#ifdef yyget_in -#define hlsl_get_in_ALREADY_DEFINED -#else -#define yyget_in hlsl_get_in -#endif - -#ifdef yyset_in -#define hlsl_set_in_ALREADY_DEFINED -#else -#define yyset_in hlsl_set_in -#endif - -#ifdef yyget_out -#define hlsl_get_out_ALREADY_DEFINED -#else -#define yyget_out hlsl_get_out -#endif - -#ifdef yyset_out -#define hlsl_set_out_ALREADY_DEFINED -#else -#define yyset_out hlsl_set_out -#endif - -#ifdef yyget_leng -#define hlsl_get_leng_ALREADY_DEFINED -#else -#define yyget_leng hlsl_get_leng -#endif - -#ifdef yyget_text -#define hlsl_get_text_ALREADY_DEFINED -#else -#define yyget_text hlsl_get_text -#endif - -#ifdef yyget_lineno -#define hlsl_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno hlsl_get_lineno -#endif - -#ifdef yyset_lineno -#define hlsl_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno hlsl_set_lineno -#endif - -#ifdef yywrap -#define hlsl_wrap_ALREADY_DEFINED -#else -#define yywrap hlsl_wrap -#endif - -#ifdef yyalloc -#define hlsl_alloc_ALREADY_DEFINED -#else -#define yyalloc hlsl_alloc -#endif - -#ifdef yyrealloc -#define hlsl_realloc_ALREADY_DEFINED -#else -#define yyrealloc hlsl_realloc -#endif - -#ifdef yyfree -#define hlsl_free_ALREADY_DEFINED -#else -#define yyfree hlsl_free -#endif - -#ifdef yytext -#define hlsl_text_ALREADY_DEFINED -#else -#define yytext hlsl_text -#endif - -#ifdef yyleng -#define hlsl_leng_ALREADY_DEFINED -#else -#define yyleng hlsl_leng -#endif - -#ifdef yyin -#define hlsl_in_ALREADY_DEFINED -#else -#define yyin hlsl_in -#endif - -#ifdef yyout -#define hlsl_out_ALREADY_DEFINED -#else -#define yyout hlsl_out -#endif - -#ifdef yy_flex_debug -#define hlsl__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug hlsl__flex_debug -#endif - -#ifdef yylineno -#define hlsl_lineno_ALREADY_DEFINED -#else -#define yylineno hlsl_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -/* Begin user sect3 */ - -#define hlsl_wrap() (/*CONSTCOND*/1) -#define YY_SKIP_YYWRAP - -extern int yylineno; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 -#define pp 1 -#define pp_line 2 -#define pp_pragma 3 -#define pp_ignore 4 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#ifndef hlsl__create_buffer_ALREADY_DEFINED -#undef yy_create_buffer -#endif -#ifndef hlsl__delete_buffer_ALREADY_DEFINED -#undef yy_delete_buffer -#endif -#ifndef hlsl__scan_buffer_ALREADY_DEFINED -#undef yy_scan_buffer -#endif -#ifndef hlsl__scan_string_ALREADY_DEFINED -#undef yy_scan_string -#endif -#ifndef hlsl__scan_bytes_ALREADY_DEFINED -#undef yy_scan_bytes -#endif -#ifndef hlsl__init_buffer_ALREADY_DEFINED -#undef yy_init_buffer -#endif -#ifndef hlsl__flush_buffer_ALREADY_DEFINED -#undef yy_flush_buffer -#endif -#ifndef hlsl__load_buffer_state_ALREADY_DEFINED -#undef yy_load_buffer_state -#endif -#ifndef hlsl__switch_to_buffer_ALREADY_DEFINED -#undef yy_switch_to_buffer -#endif -#ifndef hlsl_push_buffer_state_ALREADY_DEFINED -#undef yypush_buffer_state -#endif -#ifndef hlsl_pop_buffer_state_ALREADY_DEFINED -#undef yypop_buffer_state -#endif -#ifndef hlsl_ensure_buffer_stack_ALREADY_DEFINED -#undef yyensure_buffer_stack -#endif -#ifndef hlsl_lex_ALREADY_DEFINED -#undef yylex -#endif -#ifndef hlsl_restart_ALREADY_DEFINED -#undef yyrestart -#endif -#ifndef hlsl_lex_init_ALREADY_DEFINED -#undef yylex_init -#endif -#ifndef hlsl_lex_init_extra_ALREADY_DEFINED -#undef yylex_init_extra -#endif -#ifndef hlsl_lex_destroy_ALREADY_DEFINED -#undef yylex_destroy -#endif -#ifndef hlsl_get_debug_ALREADY_DEFINED -#undef yyget_debug -#endif -#ifndef hlsl_set_debug_ALREADY_DEFINED -#undef yyset_debug -#endif -#ifndef hlsl_get_extra_ALREADY_DEFINED -#undef yyget_extra -#endif -#ifndef hlsl_set_extra_ALREADY_DEFINED -#undef yyset_extra -#endif -#ifndef hlsl_get_in_ALREADY_DEFINED -#undef yyget_in -#endif -#ifndef hlsl_set_in_ALREADY_DEFINED -#undef yyset_in -#endif -#ifndef hlsl_get_out_ALREADY_DEFINED -#undef yyget_out -#endif -#ifndef hlsl_set_out_ALREADY_DEFINED -#undef yyset_out -#endif -#ifndef hlsl_get_leng_ALREADY_DEFINED -#undef yyget_leng -#endif -#ifndef hlsl_get_text_ALREADY_DEFINED -#undef yyget_text -#endif -#ifndef hlsl_get_lineno_ALREADY_DEFINED -#undef yyget_lineno -#endif -#ifndef hlsl_set_lineno_ALREADY_DEFINED -#undef yyset_lineno -#endif -#ifndef hlsl_get_column_ALREADY_DEFINED -#undef yyget_column -#endif -#ifndef hlsl_set_column_ALREADY_DEFINED -#undef yyset_column -#endif -#ifndef hlsl_wrap_ALREADY_DEFINED -#undef yywrap -#endif -#ifndef hlsl_get_lval_ALREADY_DEFINED -#undef yyget_lval -#endif -#ifndef hlsl_set_lval_ALREADY_DEFINED -#undef yyset_lval -#endif -#ifndef hlsl_get_lloc_ALREADY_DEFINED -#undef yyget_lloc -#endif -#ifndef hlsl_set_lloc_ALREADY_DEFINED -#undef yyset_lloc -#endif -#ifndef hlsl_alloc_ALREADY_DEFINED -#undef yyalloc -#endif -#ifndef hlsl_realloc_ALREADY_DEFINED -#undef yyrealloc -#endif -#ifndef hlsl_free_ALREADY_DEFINED -#undef yyfree -#endif -#ifndef hlsl_text_ALREADY_DEFINED -#undef yytext -#endif -#ifndef hlsl_leng_ALREADY_DEFINED -#undef yyleng -#endif -#ifndef hlsl_in_ALREADY_DEFINED -#undef yyin -#endif -#ifndef hlsl_out_ALREADY_DEFINED -#undef yyout -#endif -#ifndef hlsl__flex_debug_ALREADY_DEFINED -#undef yy_flex_debug -#endif -#ifndef hlsl_lineno_ALREADY_DEFINED -#undef yylineno -#endif -#ifndef hlsl_tables_fload_ALREADY_DEFINED -#undef yytables_fload -#endif -#ifndef hlsl_tables_destroy_ALREADY_DEFINED -#undef yytables_destroy -#endif -#ifndef hlsl_TABLES_NAME_ALREADY_DEFINED -#undef yyTABLES_NAME -#endif - -#line 274 "hlsl.l" - - -#line 713 "hlsl.yy.h" -#undef hlsl_IN_HEADER -#endif /* hlsl_HEADER_H */ diff --git a/dll/directx/wine/d3dcompiler_43/ppl.yy.c b/dll/directx/wine/d3dcompiler_43/ppl.yy.c deleted file mode 100644 index 90019d4cd71..00000000000 --- a/dll/directx/wine/d3dcompiler_43/ppl.yy.c +++ /dev/null @@ -1,4757 +0,0 @@ -#line 1 "ppl.yy.c" - -#line 3 "ppl.yy.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer ppy__create_buffer -#define yy_delete_buffer ppy__delete_buffer -#define yy_scan_buffer ppy__scan_buffer -#define yy_scan_string ppy__scan_string -#define yy_scan_bytes ppy__scan_bytes -#define yy_init_buffer ppy__init_buffer -#define yy_flush_buffer ppy__flush_buffer -#define yy_load_buffer_state ppy__load_buffer_state -#define yy_switch_to_buffer ppy__switch_to_buffer -#define yypush_buffer_state ppy_push_buffer_state -#define yypop_buffer_state ppy_pop_buffer_state -#define yyensure_buffer_stack ppy_ensure_buffer_stack -#define yy_flex_debug ppy__flex_debug -#define yyin ppy_in -#define yyleng ppy_leng -#define yylex ppy_lex -#define yylineno ppy_lineno -#define yyout ppy_out -#define yyrestart ppy_restart -#define yytext ppy_text -#define yywrap ppy_wrap -#define yyalloc ppy_alloc -#define yyrealloc ppy_realloc -#define yyfree ppy_free - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define ppy__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer ppy__create_buffer -#endif - -#ifdef yy_delete_buffer -#define ppy__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer ppy__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define ppy__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer ppy__scan_buffer -#endif - -#ifdef yy_scan_string -#define ppy__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string ppy__scan_string -#endif - -#ifdef yy_scan_bytes -#define ppy__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes ppy__scan_bytes -#endif - -#ifdef yy_init_buffer -#define ppy__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer ppy__init_buffer -#endif - -#ifdef yy_flush_buffer -#define ppy__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer ppy__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define ppy__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state ppy__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define ppy__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer ppy__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define ppy_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state ppy_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define ppy_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state ppy_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define ppy_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack ppy_ensure_buffer_stack -#endif - -#ifdef yylex -#define ppy_lex_ALREADY_DEFINED -#else -#define yylex ppy_lex -#endif - -#ifdef yyrestart -#define ppy_restart_ALREADY_DEFINED -#else -#define yyrestart ppy_restart -#endif - -#ifdef yylex_init -#define ppy_lex_init_ALREADY_DEFINED -#else -#define yylex_init ppy_lex_init -#endif - -#ifdef yylex_init_extra -#define ppy_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra ppy_lex_init_extra -#endif - -#ifdef yylex_destroy -#define ppy_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy ppy_lex_destroy -#endif - -#ifdef yyget_debug -#define ppy_get_debug_ALREADY_DEFINED -#else -#define yyget_debug ppy_get_debug -#endif - -#ifdef yyset_debug -#define ppy_set_debug_ALREADY_DEFINED -#else -#define yyset_debug ppy_set_debug -#endif - -#ifdef yyget_extra -#define ppy_get_extra_ALREADY_DEFINED -#else -#define yyget_extra ppy_get_extra -#endif - -#ifdef yyset_extra -#define ppy_set_extra_ALREADY_DEFINED -#else -#define yyset_extra ppy_set_extra -#endif - -#ifdef yyget_in -#define ppy_get_in_ALREADY_DEFINED -#else -#define yyget_in ppy_get_in -#endif - -#ifdef yyset_in -#define ppy_set_in_ALREADY_DEFINED -#else -#define yyset_in ppy_set_in -#endif - -#ifdef yyget_out -#define ppy_get_out_ALREADY_DEFINED -#else -#define yyget_out ppy_get_out -#endif - -#ifdef yyset_out -#define ppy_set_out_ALREADY_DEFINED -#else -#define yyset_out ppy_set_out -#endif - -#ifdef yyget_leng -#define ppy_get_leng_ALREADY_DEFINED -#else -#define yyget_leng ppy_get_leng -#endif - -#ifdef yyget_text -#define ppy_get_text_ALREADY_DEFINED -#else -#define yyget_text ppy_get_text -#endif - -#ifdef yyget_lineno -#define ppy_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno ppy_get_lineno -#endif - -#ifdef yyset_lineno -#define ppy_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno ppy_set_lineno -#endif - -#ifdef yywrap -#define ppy_wrap_ALREADY_DEFINED -#else -#define yywrap ppy_wrap -#endif - -#ifdef yyalloc -#define ppy_alloc_ALREADY_DEFINED -#else -#define yyalloc ppy_alloc -#endif - -#ifdef yyrealloc -#define ppy_realloc_ALREADY_DEFINED -#else -#define yyrealloc ppy_realloc -#endif - -#ifdef yyfree -#define ppy_free_ALREADY_DEFINED -#else -#define yyfree ppy_free -#endif - -#ifdef yytext -#define ppy_text_ALREADY_DEFINED -#else -#define yytext ppy_text -#endif - -#ifdef yyleng -#define ppy_leng_ALREADY_DEFINED -#else -#define yyleng ppy_leng -#endif - -#ifdef yyin -#define ppy_in_ALREADY_DEFINED -#else -#define yyin ppy_in -#endif - -#ifdef yyout -#define ppy_out_ALREADY_DEFINED -#else -#define yyout ppy_out -#endif - -#ifdef yy_flex_debug -#define ppy__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug ppy__flex_debug -#endif - -#ifdef yylineno -#define ppy_lineno_ALREADY_DEFINED -#else -#define yylineno ppy_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -extern int yylineno; -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 145 -#define YY_END_OF_BUFFER 146 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[421] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 119, 119, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 146, 135, 136, 137, - 123, 144, 124, 135, 134, 135, 136, 1, 21, 16, - 18, 16, 21, 20, 17, 17, 17, 17, 17, 17, - 17, 17, 70, 73, 71, 72, 28, 25, 26, 24, - 28, 23, 28, 28, 125, 133, 126, 144, 127, 128, - 144, 129, 130, 119, 120, 119, 79, 77, 79, 79, - - 76, 79, 80, 84, 86, 85, 144, 81, 92, 88, - 92, 87, 90, 92, 92, 89, 92, 94, 102, 104, - 97, 103, 99, 98, 95, 99, 94, 108, 108, 106, - 105, 108, 116, 115, 112, 113, 109, 110, 111, 116, - 116, 135, 136, 140, 123, 140, 124, 135, 134, 135, - 53, 50, 47, 53, 52, 53, 51, 53, 33, 35, - 53, 53, 53, 53, 49, 53, 53, 60, 57, 58, - 60, 56, 60, 54, 55, 64, 61, 62, 64, 64, - 22, 69, 66, 69, 67, 69, 65, 69, 29, 30, - 32, 32, 32, 29, 1, 142, 145, 143, 141, 141, - - 135, 136, 135, 118, 122, 134, 138, 139, 136, 1, - 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, - 19, 20, 17, 17, 17, 17, 17, 11, 17, 17, - 17, 17, 17, 70, 71, 72, 74, 72, 25, 27, - 28, 125, 132, 131, 132, 127, 129, 119, 119, 119, - 121, 77, 75, 76, 78, 79, 80, 81, 83, 81, - 88, 87, 92, 89, 93, 92, 94, 96, 99, 98, - 98, 95, 101, 99, 94, 108, 106, 105, 108, 107, - 108, 116, 116, 114, 117, 116, 135, 140, 140, 50, - 44, 41, 33, 34, 33, 33, 37, 35, 35, 35, - - 39, 45, 43, 46, 40, 48, 49, 134, 42, 57, - 56, 59, 60, 54, 61, 63, 0, 22, 66, 65, - 69, 68, 69, 29, 31, 32, 29, 142, 141, 122, - 122, 17, 17, 17, 17, 17, 17, 11, 17, 17, - 17, 17, 17, 17, 17, 71, 82, 91, 100, 34, - 34, 33, 33, 33, 36, 35, 35, 35, 134, 122, - 17, 12, 13, 17, 17, 17, 17, 17, 17, 15, - 17, 17, 17, 34, 34, 34, 33, 36, 36, 35, - 134, 17, 12, 13, 14, 4, 7, 9, 17, 17, - 15, 17, 8, 17, 34, 36, 36, 36, 134, 3, - - 14, 4, 7, 9, 10, 17, 6, 8, 17, 36, - 134, 3, 10, 2, 6, 5, 38, 2, 5, 0 - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 5, 6, 7, 1, 1, 8, 9, 10, - 11, 12, 1, 13, 1, 14, 15, 16, 17, 17, - 17, 17, 17, 17, 17, 18, 18, 1, 1, 19, - 20, 21, 1, 1, 22, 22, 22, 22, 22, 22, - 23, 23, 23, 23, 23, 24, 23, 23, 23, 23, - 23, 23, 23, 23, 25, 23, 23, 26, 23, 23, - 1, 27, 1, 1, 28, 1, 29, 30, 31, 32, - - 33, 34, 35, 36, 37, 36, 36, 38, 39, 40, - 41, 42, 36, 43, 44, 45, 46, 36, 47, 48, - 36, 36, 1, 49, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[50] = - { 0, - 1, 2, 3, 2, 1, 4, 5, 1, 6, 7, - 8, 9, 8, 10, 11, 12, 12, 12, 1, 1, - 13, 14, 15, 15, 15, 15, 16, 17, 14, 14, - 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 1 - } ; - -static const flex_int16_t yy_base[467] = - { 0, - 0, 48, 55, 0, 102, 103, 130, 0, 177, 178, - 179, 182, 186, 187, 104, 107, 214, 0, 261, 262, - 289, 0, 338, 0, 386, 389, 414, 439, 466, 0, - 515, 0, 564, 0, 1129, 1128, 399, 403, 612, 638, - 665, 0, 428, 618, 714, 763, 1130, 0, 49, 1920, - 1920, 1920, 1920, 96, 0, 109, 118, 1920, 1920, 811, - 1920, 1126, 111, 111, 858, 1095, 154, 161, 1090, 1083, - 1085, 1095, 0, 1920, 184, 124, 1920, 196, 1920, 1920, - 254, 1920, 0, 199, 0, 1920, 1920, 269, 0, 1920, - 1120, 0, 1920, 0, 1920, 263, 1920, 208, 1920, 267, - - 1112, 277, 0, 1920, 1920, 1920, 271, 281, 1920, 393, - 1920, 396, 1920, 1107, 396, 0, 406, 0, 1920, 1920, - 1113, 1920, 400, 905, 0, 418, 954, 1920, 430, 1920, - 1920, 433, 0, 1920, 1920, 1920, 1920, 1920, 1920, 432, - 435, 0, 449, 1920, 1920, 1920, 1920, 444, 0, 1003, - 1920, 456, 1920, 1099, 1920, 1110, 1920, 449, 1037, 714, - 443, 1097, 603, 0, 623, 1083, 1066, 1920, 615, 1920, - 619, 0, 632, 0, 1920, 1920, 644, 1920, 635, 634, - 635, 1920, 655, 1920, 1920, 646, 0, 659, 0, 1920, - 1920, 725, 738, 741, 1920, 742, 1920, 1920, 0, 735, - - 0, 747, 741, 1920, 0, 0, 1920, 1111, 755, 1920, - 0, 0, 1079, 747, 754, 1074, 1067, 1069, 1079, 1920, - 1920, 1104, 1069, 717, 1070, 1058, 1067, 777, 1063, 1052, - 1062, 1056, 1041, 0, 0, 1920, 1920, 1079, 787, 1920, - 1078, 0, 1920, 1920, 1077, 0, 0, 0, 743, 765, - 1920, 791, 1920, 1069, 1920, 1075, 0, 1920, 794, 1074, - 795, 798, 1062, 0, 1920, 1071, 0, 1920, 789, 0, - 1085, 0, 801, 1070, 0, 804, 1920, 1920, 807, 1920, - 1069, 0, 804, 1920, 1920, 1068, 806, 1920, 0, 818, - 1920, 1920, 847, 843, 874, 799, 0, 905, 903, 800, - - 1920, 1920, 1920, 1920, 1920, 1920, 1066, 1026, 1920, 823, - 0, 1920, 1048, 0, 824, 1920, 1047, 816, 871, 0, - 1920, 1920, 1027, 0, 1920, 1006, 872, 876, 0, 1134, - 0, 969, 971, 948, 943, 906, 897, 880, 875, 871, - 864, 844, 835, 833, 799, 0, 884, 1920, 890, 907, - 845, 618, 863, 873, 914, 889, 910, 912, 799, 1183, - 795, 938, 942, 796, 786, 747, 702, 695, 614, 959, - 610, 598, 428, 932, 945, 946, 1920, 947, 952, 1920, - 406, 395, 975, 984, 985, 990, 993, 994, 385, 372, - 997, 365, 998, 247, 1920, 966, 991, 994, 241, 1023, - - 1024, 1029, 1032, 1033, 1036, 153, 1037, 1040, 74, 1920, - 22, 1041, 1044, 1045, 1054, 1055, 0, 1062, 1063, 1920, - 1232, 1249, 1266, 1283, 1300, 1317, 1334, 1351, 1368, 1385, - 1402, 1419, 1436, 1453, 1466, 1468, 1485, 1502, 1519, 1536, - 1553, 1570, 1587, 1604, 1615, 1632, 1649, 1655, 1672, 1689, - 1706, 1712, 1729, 1746, 1763, 1769, 1786, 1792, 1809, 1826, - 1834, 1851, 1868, 1885, 1056, 1902 - } ; - -static const flex_int16_t yy_def[467] = - { 0, - 420, 1, 420, 3, 421, 421, 420, 7, 422, 422, - 423, 423, 424, 424, 425, 425, 420, 17, 426, 426, - 420, 21, 420, 23, 427, 427, 428, 428, 420, 29, - 420, 31, 420, 33, 429, 429, 430, 430, 431, 431, - 420, 41, 432, 432, 433, 433, 420, 434, 420, 420, - 420, 420, 420, 435, 436, 435, 420, 420, 420, 420, - 420, 60, 420, 420, 60, 65, 65, 65, 65, 65, - 65, 65, 437, 420, 438, 420, 420, 420, 420, 420, - 420, 420, 436, 420, 439, 420, 420, 440, 441, 420, - 440, 442, 420, 443, 420, 444, 420, 420, 420, 420, - - 445, 420, 446, 420, 420, 420, 447, 420, 420, 420, - 420, 420, 420, 420, 420, 448, 420, 449, 420, 420, - 420, 420, 450, 451, 452, 420, 452, 420, 420, 420, - 420, 420, 453, 420, 420, 420, 420, 420, 420, 454, - 420, 434, 420, 420, 420, 420, 420, 435, 436, 455, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 436, 420, 436, 420, 420, 420, 420, - 420, 456, 420, 457, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 458, 459, 460, 420, - 420, 420, 420, 460, 420, 420, 420, 420, 461, 461, - - 434, 420, 435, 420, 462, 436, 420, 420, 420, 420, - 60, 65, 65, 65, 65, 65, 65, 65, 65, 420, - 420, 420, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 437, 463, 420, 420, 420, 420, 420, - 420, 439, 420, 420, 420, 441, 442, 443, 444, 444, - 420, 420, 420, 445, 420, 420, 446, 420, 420, 420, - 420, 420, 420, 448, 420, 420, 449, 420, 450, 464, - 451, 452, 420, 420, 127, 420, 420, 420, 420, 420, - 420, 453, 454, 420, 420, 420, 435, 420, 455, 420, - 420, 420, 420, 420, 420, 420, 465, 420, 420, 420, - - 420, 420, 420, 420, 420, 420, 420, 436, 420, 420, - 456, 420, 420, 457, 420, 420, 420, 420, 420, 458, - 420, 420, 420, 460, 420, 420, 460, 420, 461, 466, - 462, 65, 65, 65, 65, 65, 65, 420, 65, 65, - 65, 65, 65, 65, 65, 463, 420, 420, 420, 420, - 420, 420, 420, 420, 465, 420, 420, 420, 436, 466, - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, - 65, 65, 65, 420, 420, 420, 420, 420, 420, 420, - 436, 65, 420, 420, 65, 65, 65, 65, 65, 65, - 420, 65, 65, 65, 420, 420, 420, 420, 436, 65, - - 420, 420, 420, 420, 65, 65, 65, 420, 65, 420, - 436, 420, 420, 65, 420, 65, 436, 420, 420, 0, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420 - } ; - -static const flex_int16_t yy_nxt[1970] = - { 0, - 48, 49, 50, 49, 48, 51, 52, 48, 53, 48, - 48, 48, 48, 48, 54, 48, 48, 48, 48, 48, - 48, 55, 55, 55, 55, 55, 56, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 48, 57, - 202, 57, 202, 417, 58, 59, 60, 61, 62, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 63, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 64, 59, 65, 65, 65, 66, 67, 65, 65, - 65, 68, 69, 65, 65, 65, 70, 65, 65, 65, - - 71, 72, 65, 59, 74, 74, 95, 204, 416, 95, - 205, 207, 208, 221, 222, 96, 75, 75, 96, 209, - 420, 209, 204, 420, 210, 205, 237, 238, 76, 76, - 77, 78, 79, 78, 77, 80, 77, 77, 77, 77, - 77, 77, 77, 77, 81, 77, 77, 77, 82, 77, - 77, 83, 83, 83, 83, 83, 84, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 77, 86, - 86, 86, 87, 87, 86, 414, 236, 90, 86, 86, - 90, 224, 227, 225, 228, 204, 226, 239, 205, 239, - - 229, 240, 241, 88, 88, 91, 93, 93, 91, 252, - 236, 252, 91, 91, 97, 98, 99, 98, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 100, 97, - 97, 97, 97, 97, 97, 101, 101, 101, 101, 101, - 102, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 97, 104, 104, 204, 105, 105, 205, 106, - 106, 244, 245, 411, 250, 107, 107, 251, 204, 255, - 256, 205, 204, 259, 260, 205, 409, 108, 108, 109, - 110, 111, 110, 109, 109, 109, 109, 109, 109, 112, - - 109, 113, 114, 115, 109, 109, 109, 109, 109, 109, - 116, 116, 116, 116, 116, 117, 116, 116, 116, 116, - 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, - 116, 116, 116, 116, 116, 116, 116, 109, 118, 118, - 119, 118, 118, 120, 121, 118, 122, 118, 118, 118, - 118, 118, 123, 124, 124, 124, 118, 118, 118, 125, - 125, 125, 125, 125, 126, 127, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 118, 129, 130, 129, - 129, 130, 129, 407, 261, 131, 261, 262, 131, 262, - - 177, 178, 177, 406, 177, 178, 177, 204, 265, 266, - 205, 204, 132, 179, 205, 132, 134, 179, 405, 135, - 273, 274, 136, 137, 138, 180, 139, 400, 140, 180, - 190, 276, 277, 276, 191, 280, 281, 285, 286, 278, - 141, 134, 192, 284, 135, 399, 205, 136, 137, 138, - 202, 139, 202, 140, 193, 420, 279, 290, 420, 290, - 204, 301, 302, 205, 394, 141, 142, 143, 144, 143, - 142, 145, 146, 142, 147, 142, 142, 142, 142, 142, - 148, 142, 142, 142, 142, 142, 142, 149, 149, 149, - 149, 149, 150, 149, 149, 149, 149, 149, 149, 149, - - 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, - 149, 149, 149, 149, 142, 151, 152, 153, 152, 154, - 155, 151, 156, 157, 151, 151, 151, 151, 151, 158, - 159, 160, 160, 161, 162, 163, 164, 164, 164, 164, - 164, 165, 164, 164, 164, 164, 166, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 167, 168, 169, 170, 169, 168, 168, - 168, 168, 168, 168, 168, 168, 168, 168, 171, 168, - 168, 168, 168, 168, 168, 172, 172, 172, 172, 172, - 173, 172, 172, 172, 172, 172, 172, 172, 172, 172, - - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 168, 78, 79, 78, 310, 80, 310, 194, - 190, 194, 304, 305, 195, 306, 307, 181, 181, 181, - 204, 393, 192, 205, 312, 313, 316, 317, 84, 78, - 79, 78, 377, 80, 193, 315, 204, 315, 392, 205, - 318, 318, 318, 181, 181, 181, 319, 204, 319, 390, - 205, 322, 323, 377, 84, 182, 183, 184, 183, 182, - 182, 182, 182, 182, 185, 185, 182, 182, 182, 186, - 182, 182, 182, 182, 182, 182, 187, 187, 187, 187, - 187, 188, 187, 187, 187, 187, 187, 187, 187, 187, - - 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, - 187, 187, 187, 182, 52, 196, 197, 196, 52, 198, - 52, 52, 52, 52, 52, 52, 52, 389, 200, 298, - 298, 298, 52, 52, 52, 388, 204, 299, 300, 205, - 325, 326, 327, 328, 327, 328, 204, 210, 202, 330, - 202, 299, 420, 333, 420, 420, 209, 420, 209, 300, - 334, 210, 52, 52, 196, 197, 196, 52, 198, 52, - 52, 52, 52, 52, 52, 52, 250, 200, 338, 251, - 338, 52, 52, 52, 224, 227, 225, 228, 239, 226, - 239, 387, 252, 229, 252, 347, 261, 347, 261, 262, - - 420, 262, 349, 420, 349, 276, 277, 276, 339, 280, - 281, 52, 211, 278, 211, 420, 340, 420, 420, 290, - 420, 290, 354, 358, 310, 315, 310, 315, 386, 385, - 279, 318, 318, 318, 382, 381, 354, 358, 373, 212, - 212, 212, 213, 214, 212, 212, 212, 215, 216, 212, - 212, 212, 217, 212, 212, 212, 218, 219, 212, 420, - 294, 420, 293, 293, 294, 372, 350, 351, 376, 371, - 295, 296, 319, 327, 319, 327, 370, 328, 210, 328, - 350, 338, 376, 338, 295, 347, 377, 347, 351, 212, - 212, 349, 296, 349, 212, 212, 377, 352, 353, 212, - - 377, 369, 368, 212, 212, 270, 270, 367, 270, 270, - 377, 352, 270, 380, 270, 270, 270, 270, 270, 353, - 298, 298, 298, 270, 270, 270, 356, 357, 299, 300, - 374, 375, 270, 380, 380, 380, 366, 378, 379, 383, - 356, 383, 299, 384, 374, 384, 365, 380, 357, 380, - 300, 378, 375, 270, 267, 267, 395, 267, 267, 379, - 391, 267, 391, 267, 267, 267, 267, 267, 395, 395, - 396, 397, 267, 267, 267, 398, 383, 395, 383, 364, - 363, 275, 395, 395, 396, 384, 401, 384, 401, 398, - 410, 402, 397, 402, 403, 404, 403, 404, 391, 408, - - 391, 408, 267, 287, 362, 361, 289, 287, 325, 287, - 287, 410, 287, 287, 410, 287, 287, 410, 287, 287, - 287, 287, 287, 287, 412, 401, 412, 401, 410, 322, - 402, 410, 402, 403, 404, 403, 404, 413, 415, 413, - 415, 408, 412, 408, 412, 413, 418, 413, 418, 316, - 312, 287, 293, 293, 294, 415, 419, 415, 419, 359, - 295, 296, 297, 418, 419, 418, 419, 355, 306, 355, - 285, 280, 273, 265, 295, 348, 259, 255, 253, 244, - 240, 237, 296, 345, 297, 270, 270, 344, 270, 270, - 343, 342, 270, 341, 270, 270, 270, 270, 270, 337, - - 336, 335, 332, 270, 270, 270, 221, 233, 232, 231, - 230, 223, 270, 207, 309, 308, 303, 292, 291, 268, - 263, 253, 420, 233, 232, 231, 230, 223, 220, 420, - 175, 175, 420, 270, 331, 331, 420, 331, 331, 331, - 331, 331, 331, 331, 331, 331, 331, 420, 420, 420, - 420, 420, 331, 331, 331, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 331, 331, 331, 420, 331, 331, 331, 331, - 331, 331, 331, 331, 331, 331, 420, 420, 420, 420, - - 420, 331, 331, 331, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 331, 73, 73, 73, 73, 73, 73, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 73, 85, - 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, - 85, 85, 85, 85, 85, 85, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, - 89, 89, 89, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 103, 103, 103, - 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 103, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 133, 133, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 133, 133, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 176, 176, 176, 176, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, - - 176, 176, 77, 77, 77, 77, 77, 77, 77, 77, - 77, 77, 77, 77, 77, 77, 77, 77, 77, 189, - 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, - 189, 189, 189, 189, 189, 189, 199, 199, 199, 199, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, - 199, 199, 199, 201, 420, 420, 420, 420, 420, 201, - 201, 201, 201, 420, 201, 201, 203, 420, 420, 420, - 203, 420, 203, 203, 203, 203, 203, 203, 203, 206, - 420, 206, 206, 420, 206, 234, 234, 420, 234, 234, - 234, 234, 234, 234, 234, 420, 234, 234, 234, 234, - - 420, 234, 235, 235, 235, 235, 235, 235, 235, 235, - 235, 235, 235, 235, 235, 235, 235, 235, 235, 242, - 242, 420, 420, 242, 242, 242, 242, 242, 242, 242, - 242, 242, 242, 242, 420, 242, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, - 243, 243, 243, 246, 246, 420, 246, 246, 420, 246, - 246, 246, 246, 246, 246, 246, 246, 246, 420, 246, - 247, 247, 420, 247, 247, 247, 247, 247, 247, 247, - 247, 247, 420, 247, 247, 420, 247, 248, 248, 420, - 248, 248, 248, 248, 248, 420, 248, 248, 248, 248, - - 248, 248, 248, 248, 249, 249, 420, 249, 249, 249, - 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, - 249, 254, 420, 420, 420, 420, 254, 420, 254, 254, - 420, 254, 257, 257, 420, 420, 257, 420, 257, 257, - 257, 257, 420, 257, 257, 257, 257, 420, 257, 258, - 258, 258, 258, 258, 258, 258, 258, 258, 258, 258, - 258, 258, 258, 258, 258, 258, 264, 420, 264, 264, - 420, 264, 267, 267, 420, 420, 420, 420, 267, 267, - 267, 267, 420, 420, 267, 420, 420, 420, 267, 269, - 269, 420, 420, 420, 420, 269, 269, 269, 269, 269, - - 269, 269, 269, 269, 420, 269, 271, 271, 420, 420, - 420, 420, 271, 271, 271, 271, 420, 271, 271, 271, - 271, 420, 271, 272, 420, 272, 272, 420, 272, 282, - 282, 420, 420, 282, 420, 420, 420, 282, 282, 420, - 282, 282, 282, 282, 420, 282, 283, 283, 420, 420, - 283, 420, 420, 420, 283, 283, 283, 283, 283, 283, - 283, 420, 283, 288, 288, 288, 288, 288, 288, 288, - 288, 288, 288, 288, 288, 288, 288, 288, 288, 288, - 311, 420, 311, 311, 420, 311, 314, 314, 420, 314, - 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, - - 314, 314, 314, 320, 420, 320, 320, 420, 320, 321, - 321, 321, 321, 321, 321, 321, 321, 321, 321, 321, - 321, 321, 321, 321, 321, 321, 324, 324, 420, 324, - 420, 324, 324, 324, 324, 324, 420, 324, 324, 324, - 324, 420, 324, 329, 329, 329, 420, 329, 329, 329, - 329, 331, 331, 420, 331, 331, 331, 331, 331, 331, - 331, 331, 331, 331, 331, 331, 331, 331, 346, 346, - 420, 346, 346, 346, 346, 346, 420, 346, 420, 346, - 346, 346, 346, 420, 346, 270, 270, 420, 420, 420, - 420, 270, 270, 270, 270, 420, 420, 270, 420, 420, - - 420, 270, 360, 360, 420, 360, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 360, 360, 360, 47, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420 - } ; - -static const flex_int16_t yy_chk[1970] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 49, 2, 49, 411, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 5, 6, 15, 54, 409, 16, - 54, 56, 56, 64, 64, 15, 5, 6, 16, 57, - 56, 57, 63, 56, 57, 63, 76, 76, 5, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, - 10, 11, 9, 10, 12, 406, 75, 11, 13, 14, - 12, 67, 68, 67, 68, 75, 67, 78, 75, 78, - - 68, 84, 84, 9, 10, 11, 13, 14, 12, 98, - 75, 98, 13, 14, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 19, 20, 81, 19, 20, 81, 19, - 20, 88, 88, 399, 96, 19, 20, 96, 100, 102, - 102, 100, 107, 108, 108, 107, 394, 19, 20, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 25, 25, 25, - 26, 26, 26, 392, 110, 25, 110, 112, 26, 112, - - 37, 37, 37, 390, 38, 38, 38, 115, 117, 117, - 115, 123, 25, 37, 123, 26, 27, 38, 389, 27, - 126, 126, 27, 27, 27, 37, 27, 382, 27, 38, - 43, 129, 129, 129, 43, 132, 132, 141, 141, 129, - 27, 28, 43, 140, 28, 381, 140, 28, 28, 28, - 143, 28, 143, 28, 43, 148, 129, 152, 148, 152, - 158, 161, 161, 158, 373, 28, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 39, 39, 39, 169, 39, 169, 44, - 44, 44, 163, 163, 44, 165, 165, 39, 39, 39, - 171, 372, 44, 171, 173, 173, 180, 180, 39, 40, - 40, 40, 352, 40, 44, 177, 179, 177, 371, 179, - 181, 181, 181, 40, 40, 40, 183, 186, 183, 369, - 186, 188, 188, 352, 40, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 368, 45, 160, - 160, 160, 45, 45, 45, 367, 192, 160, 160, 192, - 193, 193, 194, 196, 194, 196, 200, 194, 202, 200, - 202, 160, 203, 224, 249, 203, 209, 249, 209, 160, - 224, 209, 45, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 250, 46, 228, 250, - 228, 46, 46, 46, 214, 215, 214, 215, 239, 214, - 239, 366, 252, 215, 252, 259, 261, 259, 261, 262, - - 269, 262, 273, 269, 273, 276, 276, 276, 228, 279, - 279, 46, 60, 276, 60, 283, 228, 287, 283, 290, - 287, 290, 296, 300, 310, 315, 310, 315, 365, 364, - 276, 318, 318, 318, 361, 359, 296, 300, 345, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 65, - 294, 65, 293, 293, 293, 344, 294, 294, 351, 343, - 293, 293, 319, 327, 319, 327, 342, 328, 327, 328, - 294, 338, 351, 338, 293, 347, 353, 347, 294, 65, - 65, 349, 293, 349, 65, 65, 354, 295, 295, 65, - - 353, 341, 340, 65, 65, 124, 124, 339, 124, 124, - 354, 295, 124, 356, 124, 124, 124, 124, 124, 295, - 298, 298, 298, 124, 124, 124, 299, 299, 298, 298, - 350, 350, 124, 357, 356, 358, 337, 355, 355, 362, - 299, 362, 298, 363, 350, 363, 336, 357, 299, 358, - 298, 355, 350, 124, 127, 127, 374, 127, 127, 355, - 370, 127, 370, 127, 127, 127, 127, 127, 375, 376, - 378, 378, 127, 127, 127, 379, 383, 374, 383, 335, - 334, 127, 375, 376, 378, 384, 385, 384, 385, 379, - 396, 386, 378, 386, 387, 388, 387, 388, 391, 393, - - 391, 393, 127, 150, 333, 332, 150, 150, 326, 150, - 150, 396, 150, 150, 397, 150, 150, 398, 150, 150, - 150, 150, 150, 150, 400, 401, 400, 401, 397, 323, - 402, 398, 402, 403, 404, 403, 404, 405, 407, 405, - 407, 408, 412, 408, 412, 413, 414, 413, 414, 317, - 313, 150, 159, 159, 159, 415, 416, 415, 416, 308, - 159, 159, 159, 418, 419, 418, 419, 465, 307, 465, - 286, 281, 274, 266, 159, 263, 260, 256, 254, 245, - 241, 238, 159, 233, 159, 271, 271, 232, 271, 271, - 231, 230, 271, 229, 271, 271, 271, 271, 271, 227, - - 226, 225, 223, 271, 271, 271, 222, 219, 218, 217, - 216, 213, 271, 208, 167, 166, 162, 156, 154, 121, - 114, 101, 91, 72, 71, 70, 69, 66, 62, 47, - 36, 35, 0, 271, 330, 330, 0, 330, 330, 330, - 330, 330, 330, 330, 330, 330, 330, 0, 0, 0, - 0, 0, 330, 330, 330, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 330, 360, 360, 0, 360, 360, 360, 360, - 360, 360, 360, 360, 360, 360, 0, 0, 0, 0, - - 0, 360, 360, 360, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 360, 421, 421, 421, 421, 421, 421, 421, 421, - 421, 421, 421, 421, 421, 421, 421, 421, 421, 422, - 422, 422, 422, 422, 422, 422, 422, 422, 422, 422, - 422, 422, 422, 422, 422, 422, 423, 423, 423, 423, - 423, 423, 423, 423, 423, 423, 423, 423, 423, 423, - 423, 423, 423, 424, 424, 424, 424, 424, 424, 424, - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, - - 425, 425, 425, 425, 425, 425, 425, 425, 425, 425, - 425, 425, 425, 425, 425, 425, 425, 426, 426, 426, - 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, - 426, 426, 426, 426, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 428, 428, 428, 428, 428, 428, 428, 428, 428, - 428, 428, 428, 428, 428, 428, 428, 428, 429, 429, - 429, 429, 429, 429, 429, 429, 429, 429, 429, 429, - 429, 429, 429, 429, 429, 430, 430, 430, 430, 430, - 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, - - 430, 430, 431, 431, 431, 431, 431, 431, 431, 431, - 431, 431, 431, 431, 431, 431, 431, 431, 431, 432, - 432, 432, 432, 432, 432, 432, 432, 432, 432, 432, - 432, 432, 432, 432, 432, 432, 433, 433, 433, 433, - 433, 433, 433, 433, 433, 433, 433, 433, 433, 433, - 433, 433, 433, 434, 0, 0, 0, 0, 0, 434, - 434, 434, 434, 0, 434, 434, 435, 0, 0, 0, - 435, 0, 435, 435, 435, 435, 435, 435, 435, 436, - 0, 436, 436, 0, 436, 437, 437, 0, 437, 437, - 437, 437, 437, 437, 437, 0, 437, 437, 437, 437, - - 0, 437, 438, 438, 438, 438, 438, 438, 438, 438, - 438, 438, 438, 438, 438, 438, 438, 438, 438, 439, - 439, 0, 0, 439, 439, 439, 439, 439, 439, 439, - 439, 439, 439, 439, 0, 439, 440, 440, 440, 440, - 440, 440, 440, 440, 440, 440, 440, 440, 440, 440, - 440, 440, 440, 441, 441, 0, 441, 441, 0, 441, - 441, 441, 441, 441, 441, 441, 441, 441, 0, 441, - 442, 442, 0, 442, 442, 442, 442, 442, 442, 442, - 442, 442, 0, 442, 442, 0, 442, 443, 443, 0, - 443, 443, 443, 443, 443, 0, 443, 443, 443, 443, - - 443, 443, 443, 443, 444, 444, 0, 444, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 444, 444, 444, - 444, 445, 0, 0, 0, 0, 445, 0, 445, 445, - 0, 445, 446, 446, 0, 0, 446, 0, 446, 446, - 446, 446, 0, 446, 446, 446, 446, 0, 446, 447, - 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, - 447, 447, 447, 447, 447, 447, 448, 0, 448, 448, - 0, 448, 449, 449, 0, 0, 0, 0, 449, 449, - 449, 449, 0, 0, 449, 0, 0, 0, 449, 450, - 450, 0, 0, 0, 0, 450, 450, 450, 450, 450, - - 450, 450, 450, 450, 0, 450, 451, 451, 0, 0, - 0, 0, 451, 451, 451, 451, 0, 451, 451, 451, - 451, 0, 451, 452, 0, 452, 452, 0, 452, 453, - 453, 0, 0, 453, 0, 0, 0, 453, 453, 0, - 453, 453, 453, 453, 0, 453, 454, 454, 0, 0, - 454, 0, 0, 0, 454, 454, 454, 454, 454, 454, - 454, 0, 454, 455, 455, 455, 455, 455, 455, 455, - 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, - 456, 0, 456, 456, 0, 456, 457, 457, 0, 457, - 457, 457, 457, 457, 457, 457, 457, 457, 457, 457, - - 457, 457, 457, 458, 0, 458, 458, 0, 458, 459, - 459, 459, 459, 459, 459, 459, 459, 459, 459, 459, - 459, 459, 459, 459, 459, 459, 460, 460, 0, 460, - 0, 460, 460, 460, 460, 460, 0, 460, 460, 460, - 460, 0, 460, 461, 461, 461, 0, 461, 461, 461, - 461, 462, 462, 0, 462, 462, 462, 462, 462, 462, - 462, 462, 462, 462, 462, 462, 462, 462, 463, 463, - 0, 463, 463, 463, 463, 463, 0, 463, 0, 463, - 463, 463, 463, 0, 463, 464, 464, 0, 0, 0, - 0, 464, 464, 464, 464, 0, 0, 464, 0, 0, - - 0, 464, 466, 466, 0, 466, 466, 466, 466, 466, - 466, 466, 466, 466, 466, 466, 466, 466, 466, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 420, 420 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "ppl.l" -/* -*-C-*- - * Wrc preprocessor lexical analysis - * - * Copyright 1999-2000 Bertho A. Stultiens (BS) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - *------------------------------------------------------------------------- - * The preprocessor's lexographical grammar (approximately): - * - * pp := {ws} # {ws} if {ws} {expr} {ws} \n - * | {ws} # {ws} ifdef {ws} {id} {ws} \n - * | {ws} # {ws} ifndef {ws} {id} {ws} \n - * | {ws} # {ws} elif {ws} {expr} {ws} \n - * | {ws} # {ws} else {ws} \n - * | {ws} # {ws} endif {ws} \n - * | {ws} # {ws} include {ws} < {anytext} > \n - * | {ws} # {ws} include {ws} " {anytext} " \n - * | {ws} # {ws} define {ws} {anytext} \n - * | {ws} # {ws} define( {arglist} ) {ws} {expansion} \n - * | {ws} # {ws} pragma {ws} {anytext} \n - * | {ws} # {ws} ident {ws} {anytext} \n - * | {ws} # {ws} error {ws} {anytext} \n - * | {ws} # {ws} warning {ws} {anytext} \n - * | {ws} # {ws} line {ws} " {anytext} " {number} \n - * | {ws} # {ws} {number} " {anytext} " {number} [ {number} [{number}] ] \n - * | {ws} # {ws} \n - * - * ws := [ \t\r\f\v]* - * - * expr := {expr} [+-*%^/|&] {expr} - * | {expr} {logor|logand} {expr} - * | [!~+-] {expr} - * | {expr} ? {expr} : {expr} - * - * logor := || - * - * logand := && - * - * id := [a-zA-Z_][a-zA-Z0-9_]* - * - * anytext := [^\n]* (see note) - * - * arglist := - * | {id} - * | {arglist} , {id} - * | {arglist} , {id} ... - * - * expansion := {id} - * | # {id} - * | {anytext} - * | {anytext} ## {anytext} - * - * number := [0-9]+ - * - * Note: "anytext" is not always "[^\n]*". This is because the - * trailing context must be considered as well. - * - * The only certain assumption for the preprocessor to make is that - * directives start at the beginning of the line, followed by a '#' - * and end with a newline. - * Any directive may be suffixed with a line-continuation. Also - * classical comment / *...* / (note: no comments within comments, - * therefore spaces) is considered to be a line-continuation - * (according to gcc and egcs AFAIK, ANSI is a bit vague). - * Comments have not been added to the above grammar for simplicity - * reasons. However, it is allowed to enter comment anywhere within - * the directives as long as they do not interfere with the context. - * All comments are considered to be deletable whitespace (both - * classical form "/ *...* /" and C++ form "//...\n"). - * - * All recursive scans, except for macro-expansion, are done by the - * parser, whereas the simple state transitions of non-recursive - * directives are done in the scanner. This results in the many - * exclusive start-conditions of the scanner. - * - * Macro expansions are slightly more difficult because they have to - * prescan the arguments. Parameter substitution is literal if the - * substitution is # or ## (either side). This enables new identifiers - * to be created (see 'info cpp' node Macro|Pitfalls|Prescan for more - * information). - * - * FIXME: Variable macro parameters is recognized, but not yet - * expanded. I have to reread the ANSI standard on the subject (yes, - * ANSI defines it). - * - * The following special defines are supported: - * __FILE__ -> "thissource.c" - * __LINE__ -> 123 - * __DATE__ -> "May 1 2000" - * __TIME__ -> "23:59:59" - * These macros expand, as expected, into their ANSI defined values. - * - * The same include prevention is implemented as gcc and egcs does. - * This results in faster processing because we do not read the text - * at all. Some wine-sources attempt to include the same file 4 or 5 - * times. This strategy also saves a lot blank output-lines, which in - * its turn improves the real resource scanner/parser. - * - */ -/* - * Special flex options and exclusive scanner start-conditions - */ -#define YY_NO_INPUT 1 - - - - - - - - - - - - - - - - - - - - - - -#line 150 "ppl.l" -#include -#include -#include -#include -#include -#include -#include - -#define YY_NO_UNISTD_H - -#include "wpp_private.h" -#include "ppy.tab.h" - -/* - * Make sure that we are running an appropriate version of flex. - */ -#if !defined(YY_FLEX_MAJOR_VERSION) || (1000 * YY_FLEX_MAJOR_VERSION + YY_FLEX_MINOR_VERSION < 2005) -#error Must use flex version 2.5.1 or higher (yy_scan_* routines are required). -#endif - -#define YY_READ_BUF_SIZE 65536 /* So we read most of a file at once */ - -#define yy_current_state() YY_START -#define yy_pp_state(x) yy_pop_state(); yy_push_state(x) - -/* - * Always update the current character position within a line - */ -#define YY_USER_ACTION pp_status.char_number+=ppy_leng; - -/* - * Buffer management for includes and expansions - */ -#define MAXBUFFERSTACK 128 /* Nesting more than 128 includes or macro expansion textss is insane */ - -typedef struct bufferstackentry { - YY_BUFFER_STATE bufferstate; /* Buffer to switch back to */ - void *filehandle; /* Handle to be used with wpp_callbacks->read */ - pp_entry_t *define; /* Points to expanding define or NULL if handling includes */ - int line_number; /* Line that we were handling */ - int char_number; /* The current position on that line */ - char *filename; /* Filename that we were handling */ - int if_depth; /* How many #if:s deep to check matching #endif:s */ - int ncontinuations; /* Remember the continuation state */ - int should_pop; /* Set if we must pop the start-state on EOF */ - /* Include management */ - include_state_t incl; - char *include_filename; -} bufferstackentry_t; - -#define ALLOCBLOCKSIZE (1 << 10) /* Allocate these chunks at a time for string-buffers */ - -/* - * Macro expansion nesting - * We need the stack to handle expansions while scanning - * a macro's arguments. The TOS must always be the macro - * that receives the current expansion from the scanner. - */ -#define MAXMACEXPSTACK 128 /* Nesting more than 128 macro expansions is insane */ - -typedef struct macexpstackentry { - pp_entry_t *ppp; /* This macro we are scanning */ - char **args; /* With these arguments */ - char **ppargs; /* Resulting in these preprocessed arguments */ - int *nnls; /* Number of newlines per argument */ - int nargs; /* And this many arguments scanned */ - int parentheses; /* Nesting level of () */ - int curargsize; /* Current scanning argument's size */ - int curargalloc; /* Current scanning argument's block allocated */ - char *curarg; /* Current scanning argument's content */ -} macexpstackentry_t; - -#define MACROPARENTHESES() (top_macro()->parentheses) - -/* - * Prototypes - */ -static void newline(int); -static int make_number(int radix, YYSTYPE *val, const char *str, int len); -static void put_buffer(const char *s, int len); -/* Buffer management */ -static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop); -static bufferstackentry_t *pop_buffer(void); -/* String functions */ -static void new_string(void); -static void add_string(const char *str, int len); -static char *get_string(void); -static void put_string(void); -static int string_start(void); -/* Macro functions */ -static void push_macro(pp_entry_t *ppp); -static macexpstackentry_t *top_macro(void); -static macexpstackentry_t *pop_macro(void); -static void free_macro(macexpstackentry_t *mep); -static void add_text_to_macro(const char *text, int len); -static void macro_add_arg(int last); -static void macro_add_expansion(void); -/* Expansion */ -static void expand_special(pp_entry_t *ppp); -static void expand_define(pp_entry_t *ppp); -static void expand_macro(macexpstackentry_t *mep); - -/* - * Local variables - */ -static int ncontinuations; - -static int strbuf_idx = 0; -static int strbuf_alloc = 0; -static char *strbuffer = NULL; -static int str_startline; - -static macexpstackentry_t *macexpstack[MAXMACEXPSTACK]; -static int macexpstackidx = 0; - -static bufferstackentry_t bufferstack[MAXBUFFERSTACK]; -static int bufferstackidx = 0; - -/* - * Global variables - */ -include_state_t pp_incl_state = -{ - -1, /* state */ - NULL, /* ppp */ - 0, /* ifdepth */ - 0 /* seen_junk */ -}; - -includelogicentry_t *pp_includelogiclist = NULL; - -#define YY_INPUT(buf,result,max_size) \ - { \ - result = wpp_read(pp_status.file, buf, max_size); \ - } - -#define BUFFERINITIALCAPACITY 256 - -void WINAPIV pp_writestring(const char *format, ...) -{ - __ms_va_list valist; - int len; - static char *buffer; - static int buffercapacity; - char *new_buffer; - - if(buffercapacity == 0) - { - buffer = pp_xmalloc(BUFFERINITIALCAPACITY); - if(buffer == NULL) - return; - buffercapacity = BUFFERINITIALCAPACITY; - } - - __ms_va_start(valist, format); - len = vsnprintf(buffer, buffercapacity, - format, valist); - __ms_va_end(valist); - /* If the string is longer than buffersize, vsnprintf returns - * the string length with glibc >= 2.1, -1 with glibc < 2.1 */ - while(len > buffercapacity || len < 0) - { - do - { - buffercapacity *= 2; - } while(len > buffercapacity); - - new_buffer = pp_xrealloc(buffer, buffercapacity); - if(new_buffer == NULL) - return; - buffer = new_buffer; - __ms_va_start(valist, format); - len = vsnprintf(buffer, buffercapacity, - format, valist); - __ms_va_end(valist); - } - - wpp_write(buffer, len); -} - -#line 1598 "ppl.yy.c" -/* - ************************************************************************** - * The scanner starts here - ************************************************************************** - */ -#line 1604 "ppl.yy.c" - -#define INITIAL 0 -#define pp_pp 1 -#define pp_eol 2 -#define pp_inc 3 -#define pp_dqs 4 -#define pp_sqs 5 -#define pp_iqs 6 -#define pp_comment 7 -#define pp_def 8 -#define pp_define 9 -#define pp_macro 10 -#define pp_mbody 11 -#define pp_macign 12 -#define pp_macscan 13 -#define pp_macexp 14 -#define pp_if 15 -#define pp_ifd 16 -#define pp_ifignored 17 -#define pp_endif 18 -#define pp_line 19 -#define pp_defined 20 -#define pp_ignore 21 -#define RCINCL 22 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - - static int yy_start_stack_ptr = 0; - static int yy_start_stack_depth = 0; - static int *yy_start_stack = NULL; - - static void yy_push_state ( int _new_state ); - - static void yy_pop_state ( void ); - - static int yy_top_state ( void ); - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 338 "ppl.l" - -#line 340 "ppl.l" - /* - * Catch line-continuations. - * Note: Gcc keeps the line-continuations in, for example, strings - * intact. However, I prefer to remove them all so that the next - * scanner will not need to reduce the continuation state. - * - * <*>\\\n newline(0); - */ - - /* - * Detect the leading # of a preprocessor directive. - */ -#line 1869 "ppl.yy.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 421 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_current_state != 420 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 352 "ppl.l" -pp_incl_state.seen_junk++; yy_push_state(pp_pp); - YY_BREAK -/* - * Scan for the preprocessor directives - */ -case 2: -YY_RULE_SETUP -#line 357 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_inc); return tINCLUDE;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 358 "ppl.l" -yy_pp_state(yy_current_state() != pp_ignore ? pp_def : pp_eol); - YY_BREAK -case 4: -YY_RULE_SETUP -#line 359 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tERROR; - YY_BREAK -case 5: -YY_RULE_SETUP -#line 360 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tWARNING; - YY_BREAK -case 6: -YY_RULE_SETUP -#line 361 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tPRAGMA; - YY_BREAK -case 7: -YY_RULE_SETUP -#line 362 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tPPIDENT; - YY_BREAK -case 8: -YY_RULE_SETUP -#line 363 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_ifd); return tUNDEF;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 9: -YY_RULE_SETUP -#line 364 "ppl.l" -yy_pp_state(pp_ifd); return tIFDEF; - YY_BREAK -case 10: -YY_RULE_SETUP -#line 365 "ppl.l" -pp_incl_state.seen_junk--; yy_pp_state(pp_ifd); return tIFNDEF; - YY_BREAK -case 11: -YY_RULE_SETUP -#line 366 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_if);} else {yy_pp_state(pp_ifignored);} return tIF; - YY_BREAK -case 12: -YY_RULE_SETUP -#line 367 "ppl.l" -yy_pp_state(pp_if); return tELIF; - YY_BREAK -case 13: -YY_RULE_SETUP -#line 368 "ppl.l" -yy_pp_state(pp_endif); return tELSE; - YY_BREAK -case 14: -YY_RULE_SETUP -#line 369 "ppl.l" -yy_pp_state(pp_endif); return tENDIF; - YY_BREAK -case 15: -YY_RULE_SETUP -#line 370 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_line); return tLINE;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 16: -YY_RULE_SETUP -#line 371 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_line); return tGCCLINE;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 372 "ppl.l" -ppy_error("Invalid preprocessor token '%s'", ppy_text); - YY_BREAK -case 18: -/* rule 18 can match eol */ -YY_RULE_SETUP -#line 373 "ppl.l" -newline(1); yy_pop_state(); return tNL; /* This could be the null-token */ - YY_BREAK -case 19: -/* rule 19 can match eol */ -YY_RULE_SETUP -#line 374 "ppl.l" -newline(0); - YY_BREAK -case 20: -YY_RULE_SETUP -#line 375 "ppl.l" -ppy_error("Preprocessor junk '%s'", ppy_text); - YY_BREAK -case 21: -YY_RULE_SETUP -#line 376 "ppl.l" -return *ppy_text; - YY_BREAK -/* - * Handle #include and #line - */ -case 22: -YY_RULE_SETUP -#line 381 "ppl.l" -return make_number(10, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 23: -YY_RULE_SETUP -#line 382 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_iqs); - YY_BREAK -case 24: -YY_RULE_SETUP -#line 383 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -case 25: -YY_RULE_SETUP -#line 384 "ppl.l" -; - YY_BREAK -case 26: -/* rule 26 can match eol */ -YY_RULE_SETUP -#line 385 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 27: -/* rule 27 can match eol */ -YY_RULE_SETUP -#line 386 "ppl.l" -newline(0); - YY_BREAK -case 28: -YY_RULE_SETUP -#line 387 "ppl.l" -ppy_error(yy_current_state() == pp_inc ? "Trailing junk in #include" : "Trailing junk in #line"); - YY_BREAK -/* - * Ignore all input when a false clause is parsed - */ -case 29: -YY_RULE_SETUP -#line 392 "ppl.l" -; - YY_BREAK -case 30: -/* rule 30 can match eol */ -YY_RULE_SETUP -#line 393 "ppl.l" -newline(1); - YY_BREAK -case 31: -/* rule 31 can match eol */ -YY_RULE_SETUP -#line 394 "ppl.l" -newline(0); - YY_BREAK -case 32: -YY_RULE_SETUP -#line 395 "ppl.l" -; - YY_BREAK -/* - * Handle #if and #elif. - * These require conditionals to be evaluated, but we do not - * want to jam the scanner normally when we see these tokens. - * Note: tIDENT is handled below. - */ -case 33: -YY_RULE_SETUP -#line 404 "ppl.l" -return make_number(8, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 34: -YY_RULE_SETUP -#line 405 "ppl.l" -ppy_error("Invalid octal digit"); - YY_BREAK -case 35: -YY_RULE_SETUP -#line 406 "ppl.l" -return make_number(10, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 36: -YY_RULE_SETUP -#line 407 "ppl.l" -return make_number(16, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 37: -YY_RULE_SETUP -#line 408 "ppl.l" -ppy_error("Invalid hex number"); - YY_BREAK -case 38: -YY_RULE_SETUP -#line 409 "ppl.l" -yy_push_state(pp_defined); return tDEFINED; - YY_BREAK -case 39: -YY_RULE_SETUP -#line 410 "ppl.l" -return tLSHIFT; - YY_BREAK -case 40: -YY_RULE_SETUP -#line 411 "ppl.l" -return tRSHIFT; - YY_BREAK -case 41: -YY_RULE_SETUP -#line 412 "ppl.l" -return tLOGAND; - YY_BREAK -case 42: -YY_RULE_SETUP -#line 413 "ppl.l" -return tLOGOR; - YY_BREAK -case 43: -YY_RULE_SETUP -#line 414 "ppl.l" -return tEQ; - YY_BREAK -case 44: -YY_RULE_SETUP -#line 415 "ppl.l" -return tNE; - YY_BREAK -case 45: -YY_RULE_SETUP -#line 416 "ppl.l" -return tLTE; - YY_BREAK -case 46: -YY_RULE_SETUP -#line 417 "ppl.l" -return tGTE; - YY_BREAK -case 47: -/* rule 47 can match eol */ -YY_RULE_SETUP -#line 418 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 48: -/* rule 48 can match eol */ -YY_RULE_SETUP -#line 419 "ppl.l" -newline(0); - YY_BREAK -case 49: -YY_RULE_SETUP -#line 420 "ppl.l" -ppy_error("Junk in conditional expression"); - YY_BREAK -case 50: -YY_RULE_SETUP -#line 421 "ppl.l" -; - YY_BREAK -case 51: -YY_RULE_SETUP -#line 422 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 52: -YY_RULE_SETUP -#line 423 "ppl.l" -ppy_error("String constants not allowed in conditionals"); - YY_BREAK -case 53: -YY_RULE_SETUP -#line 424 "ppl.l" -return *ppy_text; - YY_BREAK -case 54: -YY_RULE_SETUP -#line 426 "ppl.l" -ppy_lval.sint = 0; return tSINT; - YY_BREAK -case 55: -/* rule 55 can match eol */ -YY_RULE_SETUP -#line 427 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -/* - * Handle #ifdef, #ifndef and #undef - * to get only an untranslated/unexpanded identifier - */ -case 56: -YY_RULE_SETUP -#line 433 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 57: -YY_RULE_SETUP -#line 434 "ppl.l" -; - YY_BREAK -case 58: -/* rule 58 can match eol */ -YY_RULE_SETUP -#line 435 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 59: -/* rule 59 can match eol */ -YY_RULE_SETUP -#line 436 "ppl.l" -newline(0); - YY_BREAK -case 60: -YY_RULE_SETUP -#line 437 "ppl.l" -ppy_error("Identifier expected"); - YY_BREAK -/* - * Handle #else and #endif. - */ -case 61: -YY_RULE_SETUP -#line 442 "ppl.l" -; - YY_BREAK -case 62: -/* rule 62 can match eol */ -YY_RULE_SETUP -#line 443 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 63: -/* rule 63 can match eol */ -YY_RULE_SETUP -#line 444 "ppl.l" -newline(0); - YY_BREAK -case 64: -YY_RULE_SETUP -#line 445 "ppl.l" -ppy_error("Garbage after #else or #endif."); - YY_BREAK -/* - * Handle the special 'defined' keyword. - * This is necessary to get the identifier prior to any - * substitutions. - */ -case 65: -YY_RULE_SETUP -#line 452 "ppl.l" -yy_pop_state(); ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 66: -YY_RULE_SETUP -#line 453 "ppl.l" -; - YY_BREAK -case 67: -YY_RULE_SETUP -#line 454 "ppl.l" -return *ppy_text; - YY_BREAK -case 68: -/* rule 68 can match eol */ -YY_RULE_SETUP -#line 455 "ppl.l" -newline(0); - YY_BREAK -case 69: -/* rule 69 can match eol */ -YY_RULE_SETUP -#line 456 "ppl.l" -ppy_error("Identifier expected"); - YY_BREAK -/* - * Handle #error, #warning, #pragma and #ident. - * Pass everything literally to the parser, which - * will act appropriately. - * Comments are stripped from the literal text. - */ -case 70: -YY_RULE_SETUP -#line 464 "ppl.l" -if(yy_top_state() != pp_ignore) { ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; } - YY_BREAK -case 71: -YY_RULE_SETUP -#line 465 "ppl.l" -if(yy_top_state() != pp_ignore) { ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; } - YY_BREAK -case 72: -/* rule 72 can match eol */ -YY_RULE_SETUP -#line 466 "ppl.l" -if(yy_top_state() != pp_ignore) { ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; } - YY_BREAK -case 73: -/* rule 73 can match eol */ -YY_RULE_SETUP -#line 467 "ppl.l" -newline(1); yy_pop_state(); if(yy_current_state() != pp_ignore) { return tNL; } - YY_BREAK -case 74: -/* rule 74 can match eol */ -YY_RULE_SETUP -#line 468 "ppl.l" -newline(0); - YY_BREAK -/* - * Handle left side of #define - */ -case 75: -YY_RULE_SETUP -#line 473 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); if(ppy_lval.cptr) ppy_lval.cptr[ppy_leng-1] = '\0'; yy_pp_state(pp_macro); return tMACRO; - YY_BREAK -case 76: -YY_RULE_SETUP -#line 474 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); yy_pp_state(pp_define); return tDEFINE; - YY_BREAK -case 77: -YY_RULE_SETUP -#line 475 "ppl.l" -; - YY_BREAK -case 78: -/* rule 78 can match eol */ -YY_RULE_SETUP -#line 476 "ppl.l" -newline(0); - YY_BREAK -case 79: -/* rule 79 can match eol */ -YY_RULE_SETUP -#line 477 "ppl.l" -perror("Identifier expected"); - YY_BREAK -/* - * Scan the substitution of a define - */ -case 80: -YY_RULE_SETUP -#line 482 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 81: -/* rule 81 can match eol */ -YY_RULE_SETUP -#line 483 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 82: -/* rule 82 can match eol */ -YY_RULE_SETUP -#line 484 "ppl.l" -newline(0); ppy_lval.cptr = pp_xstrdup(" "); return tLITERAL; - YY_BREAK -case 83: -/* rule 83 can match eol */ -YY_RULE_SETUP -#line 485 "ppl.l" -newline(0); - YY_BREAK -case 84: -/* rule 84 can match eol */ -YY_RULE_SETUP -#line 486 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 85: -YY_RULE_SETUP -#line 487 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 86: -YY_RULE_SETUP -#line 488 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -/* - * Scan the definition macro arguments - */ -case 87: -YY_RULE_SETUP -#line 493 "ppl.l" -yy_pp_state(pp_mbody); return tMACROEND; - YY_BREAK -case 88: -YY_RULE_SETUP -#line 494 "ppl.l" -; - YY_BREAK -case 89: -YY_RULE_SETUP -#line 495 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 90: -YY_RULE_SETUP -#line 496 "ppl.l" -return ','; - YY_BREAK -case 91: -YY_RULE_SETUP -#line 497 "ppl.l" -return tELIPSIS; - YY_BREAK -case 92: -/* rule 92 can match eol */ -YY_RULE_SETUP -#line 498 "ppl.l" -ppy_error("Argument identifier expected"); - YY_BREAK -case 93: -/* rule 93 can match eol */ -YY_RULE_SETUP -#line 499 "ppl.l" -newline(0); - YY_BREAK -/* - * Scan the substitution of a macro - */ -case 94: -YY_RULE_SETUP -#line 504 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 95: -YY_RULE_SETUP -#line 505 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 96: -YY_RULE_SETUP -#line 506 "ppl.l" -return tCONCAT; - YY_BREAK -case 97: -YY_RULE_SETUP -#line 507 "ppl.l" -return tSTRINGIZE; - YY_BREAK -case 98: -YY_RULE_SETUP -#line 508 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 99: -YY_RULE_SETUP -#line 509 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 100: -/* rule 100 can match eol */ -YY_RULE_SETUP -#line 510 "ppl.l" -newline(0); ppy_lval.cptr = pp_xstrdup(" "); return tLITERAL; - YY_BREAK -case 101: -/* rule 101 can match eol */ -YY_RULE_SETUP -#line 511 "ppl.l" -newline(0); - YY_BREAK -case 102: -/* rule 102 can match eol */ -YY_RULE_SETUP -#line 512 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 103: -YY_RULE_SETUP -#line 513 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 104: -YY_RULE_SETUP -#line 514 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -/* - * Macro expansion text scanning. - * This state is active just after the identifier is scanned - * that triggers an expansion. We *must* delete the leading - * whitespace before we can start scanning for arguments. - * - * If we do not see a '(' as next trailing token, then we have - * a false alarm. We just continue with a nose-bleed... - */ -case 105: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 525 "ppl.l" -yy_pp_state(pp_macscan); - YY_BREAK -case 106: -/* rule 106 can match eol */ -YY_RULE_SETUP -#line 526 "ppl.l" -{ - if(yy_top_state() != pp_macscan) - newline(0); - } - YY_BREAK -case 107: -/* rule 107 can match eol */ -YY_RULE_SETUP -#line 530 "ppl.l" -newline(0); - YY_BREAK -case 108: -YY_RULE_SETUP -#line 531 "ppl.l" -{ - macexpstackentry_t *mac = pop_macro(); - yy_pop_state(); - put_buffer(mac->ppp->ident, strlen(mac->ppp->ident)); - put_buffer(ppy_text, ppy_leng); - free_macro(mac); - } - YY_BREAK -/* - * Macro expansion argument text scanning. - * This state is active when a macro's arguments are being read for expansion. - */ -case 109: -YY_RULE_SETUP -#line 543 "ppl.l" -{ - if(++MACROPARENTHESES() > 1) - add_text_to_macro(ppy_text, ppy_leng); - } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 547 "ppl.l" -{ - if(--MACROPARENTHESES() == 0) - { - yy_pop_state(); - macro_add_arg(1); - } - else - add_text_to_macro(ppy_text, ppy_leng); - } - YY_BREAK -case 111: -YY_RULE_SETUP -#line 556 "ppl.l" -{ - if(MACROPARENTHESES() > 1) - add_text_to_macro(ppy_text, ppy_leng); - else - macro_add_arg(0); - } - YY_BREAK -case 112: -YY_RULE_SETUP -#line 562 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -case 113: -YY_RULE_SETUP -#line 563 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 114: -YY_RULE_SETUP -#line 564 "ppl.l" -yy_push_state(pp_comment); add_text_to_macro(" ", 1); - YY_BREAK -case 115: -/* rule 115 can match eol */ -YY_RULE_SETUP -#line 565 "ppl.l" -pp_status.line_number++; pp_status.char_number = 1; add_text_to_macro(ppy_text, ppy_leng); - YY_BREAK -case 116: -YY_RULE_SETUP -#line 566 "ppl.l" -add_text_to_macro(ppy_text, ppy_leng); - YY_BREAK -case 117: -/* rule 117 can match eol */ -YY_RULE_SETUP -#line 567 "ppl.l" -newline(0); - YY_BREAK -/* - * Comment handling (almost all start-conditions) - */ -case 118: -YY_RULE_SETUP -#line 572 "ppl.l" -yy_push_state(pp_comment); - YY_BREAK -case 119: -YY_RULE_SETUP -#line 573 "ppl.l" -; - YY_BREAK -case 120: -/* rule 120 can match eol */ -YY_RULE_SETUP -#line 574 "ppl.l" -newline(0); - YY_BREAK -case 121: -YY_RULE_SETUP -#line 575 "ppl.l" -yy_pop_state(); - YY_BREAK -/* - * Remove C++ style comment (almost all start-conditions) - */ -case 122: -YY_RULE_SETUP -#line 580 "ppl.l" -{ - if(ppy_text[ppy_leng-1] == '\\') - ppy_warning("C++ style comment ends with an escaped newline (escape ignored)"); - } - YY_BREAK -/* - * Single, double and <> quoted constants - */ -case 123: -YY_RULE_SETUP -#line 588 "ppl.l" -pp_incl_state.seen_junk++; new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -case 124: -YY_RULE_SETUP -#line 589 "ppl.l" -pp_incl_state.seen_junk++; new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 125: -YY_RULE_SETUP -#line 590 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 126: -YY_RULE_SETUP -#line 591 "ppl.l" -{ - add_string(ppy_text, ppy_leng); - yy_pop_state(); - switch(yy_current_state()) - { - case pp_pp: - case pp_define: - case pp_mbody: - case pp_inc: - case RCINCL: - if (yy_current_state()==RCINCL) yy_pop_state(); - ppy_lval.cptr = get_string(); - return tDQSTRING; - case pp_line: - ppy_lval.cptr = get_string(); - return tDQSTRING; - default: - put_string(); - } - } - YY_BREAK -case 127: -YY_RULE_SETUP -#line 611 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 128: -YY_RULE_SETUP -#line 612 "ppl.l" -{ - add_string(ppy_text, ppy_leng); - yy_pop_state(); - switch(yy_current_state()) - { - case pp_if: - case pp_define: - case pp_mbody: - ppy_lval.cptr = get_string(); - return tSQSTRING; - default: - put_string(); - } - } - YY_BREAK -case 129: -YY_RULE_SETUP -#line 626 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 130: -YY_RULE_SETUP -#line 627 "ppl.l" -{ - add_string(ppy_text, ppy_leng); - yy_pop_state(); - ppy_lval.cptr = get_string(); - return tIQSTRING; - } - YY_BREAK -case 131: -/* rule 131 can match eol */ -YY_RULE_SETUP -#line 633 "ppl.l" -{ - /* - * This is tricky; we need to remove the line-continuation - * from preprocessor strings, but OTOH retain them in all - * other strings. This is because the resource grammar is - * even more braindead than initially analysed and line- - * continuations in strings introduce, sigh, newlines in - * the output. There goes the concept of non-breaking, non- - * spacing whitespace. - */ - switch(yy_top_state()) - { - case pp_pp: - case pp_define: - case pp_mbody: - case pp_inc: - case pp_line: - newline(0); - break; - default: - add_string(ppy_text, ppy_leng); - newline(-1); - } - } - YY_BREAK -case 132: -YY_RULE_SETUP -#line 657 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 133: -/* rule 133 can match eol */ -YY_RULE_SETUP -#line 658 "ppl.l" -{ - newline(1); - add_string(ppy_text, ppy_leng); - ppy_warning("Newline in string constant encountered (started line %d)", string_start()); - } - YY_BREAK -/* - * Identifier scanning - */ -case 134: -YY_RULE_SETUP -#line 667 "ppl.l" -{ - pp_entry_t *ppp; - pp_incl_state.seen_junk++; - if(!(ppp = pplookup(ppy_text))) - { - if(yy_current_state() == pp_inc) - ppy_error("Expected include filename"); - - else if(yy_current_state() == pp_if) - { - ppy_lval.cptr = pp_xstrdup(ppy_text); - return tIDENT; - } - else { - if((yy_current_state()==INITIAL) && (strcasecmp(ppy_text,"RCINCLUDE")==0)){ - yy_push_state(RCINCL); - return tRCINCLUDE; - } - else put_buffer(ppy_text, ppy_leng); - } - } - else if(!ppp->expanding) - { - switch(ppp->type) - { - case def_special: - expand_special(ppp); - break; - case def_define: - expand_define(ppp); - break; - case def_macro: - yy_push_state(pp_macign); - push_macro(ppp); - break; - default: - pp_internal_error(__FILE__, __LINE__, "Invalid define type %d\n", ppp->type); - } - } - else put_buffer(ppy_text, ppy_leng); - } - YY_BREAK -/* - * Everything else that needs to be passed and - * newline and continuation handling - */ -case 135: -YY_RULE_SETUP -#line 713 "ppl.l" -pp_incl_state.seen_junk++; put_buffer(ppy_text, ppy_leng); - YY_BREAK -case 136: -YY_RULE_SETUP -#line 714 "ppl.l" -put_buffer(ppy_text, ppy_leng); - YY_BREAK -case 137: -/* rule 137 can match eol */ -YY_RULE_SETUP -#line 715 "ppl.l" -newline(1); - YY_BREAK -case 138: -/* rule 138 can match eol */ -YY_RULE_SETUP -#line 716 "ppl.l" -newline(0); - YY_BREAK -case 139: -YY_RULE_SETUP -#line 717 "ppl.l" -pp_incl_state.seen_junk++; put_buffer(ppy_text, ppy_leng); - YY_BREAK -/* - * Special catcher for macro argmument expansion to prevent - * newlines to propagate to the output or admin. - */ -case 140: -/* rule 140 can match eol */ -YY_RULE_SETUP -#line 723 "ppl.l" -put_buffer(ppy_text, ppy_leng); - YY_BREAK -case 141: -YY_RULE_SETUP -#line 725 "ppl.l" -{ - ppy_lval.cptr=pp_xstrdup(ppy_text); - yy_pop_state(); - return tRCINCLUDEPATH; - } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 731 "ppl.l" -; - YY_BREAK -case 143: -YY_RULE_SETUP -#line 733 "ppl.l" -{ - new_string(); add_string(ppy_text,ppy_leng);yy_push_state(pp_dqs); - } - YY_BREAK -/* - * This is a 'catch-all' rule to discover errors in the scanner - * in an orderly manner. - */ -case 144: -YY_RULE_SETUP -#line 741 "ppl.l" -pp_incl_state.seen_junk++; ppy_warning("Unmatched text '%c' (0x%02x); please report\n", isprint(*ppy_text & 0xff) ? *ppy_text : ' ', *ppy_text); - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(pp_pp): -case YY_STATE_EOF(pp_eol): -case YY_STATE_EOF(pp_inc): -case YY_STATE_EOF(pp_dqs): -case YY_STATE_EOF(pp_sqs): -case YY_STATE_EOF(pp_iqs): -case YY_STATE_EOF(pp_comment): -case YY_STATE_EOF(pp_def): -case YY_STATE_EOF(pp_define): -case YY_STATE_EOF(pp_macro): -case YY_STATE_EOF(pp_mbody): -case YY_STATE_EOF(pp_macign): -case YY_STATE_EOF(pp_macscan): -case YY_STATE_EOF(pp_macexp): -case YY_STATE_EOF(pp_if): -case YY_STATE_EOF(pp_ifd): -case YY_STATE_EOF(pp_ifignored): -case YY_STATE_EOF(pp_endif): -case YY_STATE_EOF(pp_line): -case YY_STATE_EOF(pp_defined): -case YY_STATE_EOF(pp_ignore): -case YY_STATE_EOF(RCINCL): -#line 743 "ppl.l" -{ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - bufferstackentry_t *bep = pop_buffer(); - - if((!bep && pp_get_if_depth()) || (bep && pp_get_if_depth() != bep->if_depth)) - ppy_warning("Unmatched #if/#endif at end of file"); - - if(!bep) - { - if(YY_START != INITIAL) - { - ppy_error("Unexpected end of file during preprocessing"); - BEGIN(INITIAL); - } - yyterminate(); - } - else if(bep->should_pop == 2) - { - macexpstackentry_t *mac; - mac = pop_macro(); - expand_macro(mac); - } - ppy__delete_buffer(b); - } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 768 "ppl.l" -ECHO; - YY_BREAK -#line 2959 "ppl.yy.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 421 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 421 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 420); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - yyfree( (void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - - static void yy_push_state (int _new_state ) -{ - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; - - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); - - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) yyalloc( new_size ); - - else - (yy_start_stack) = (int *) yyrealloc( - (void *) (yy_start_stack), new_size ); - - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } - - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - - BEGIN(_new_state); -} - - static void yy_pop_state (void) -{ - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); -} - - static int yy_top_state (void) -{ - return (yy_start_stack)[(yy_start_stack_ptr) - 1]; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - - (yy_start_stack_ptr) = 0; - (yy_start_stack_depth) = 0; - (yy_start_stack) = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Destroy the start condition stack. */ - yyfree( (yy_start_stack) ); - (yy_start_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 768 "ppl.l" - -/* - ************************************************************************** - * Support functions - ************************************************************************** - */ - -#ifndef ppy_wrap -int ppy_wrap(void) -{ - return 1; -} -#endif - - -/* - *------------------------------------------------------------------------- - * Output newlines or set them as continuations - * - * Input: -1 - Don't count this one, but update local position (see pp_dqs) - * 0 - Line-continuation seen and cache output - * 1 - Newline seen and flush output - *------------------------------------------------------------------------- - */ -static void newline(int dowrite) -{ - pp_status.line_number++; - pp_status.char_number = 1; - - if(dowrite == -1) - return; - - ncontinuations++; - if(dowrite) - { - for(;ncontinuations; ncontinuations--) - put_buffer("\n", 1); - } -} - - -/* - *------------------------------------------------------------------------- - * Make a number out of an any-base and suffixed string - * - * Possible number extensions: - * - "" int - * - "L" long int - * - "LL" long long int - * - "U" unsigned int - * - "UL" unsigned long int - * - "ULL" unsigned long long int - * - "LU" unsigned long int - * - "LLU" unsigned long long int - * - "LUL" invalid - * - * FIXME: - * The sizes of resulting 'int' and 'long' are compiler specific. - * I depend on sizeof(int) > 2 here (although a relatively safe - * assumption). - * Long longs are not yet implemented because this is very compiler - * specific and I don't want to think too much about the problems. - * - *------------------------------------------------------------------------- - */ -static int make_number(int radix, YYSTYPE *val, const char *str, int len) -{ - int is_l = 0; - int is_ll = 0; - int is_u = 0; - char ext[4]; - long l; - - ext[3] = '\0'; - ext[2] = toupper(str[len-1]); - ext[1] = len > 1 ? toupper(str[len-2]) : ' '; - ext[0] = len > 2 ? toupper(str[len-3]) : ' '; - - if(!strcmp(ext, "LUL")) - { - ppy_error("Invalid constant suffix"); - return 0; - } - else if(!strcmp(ext, "LLU") || !strcmp(ext, "ULL")) - { - is_ll++; - is_u++; - } - else if(!strcmp(ext+1, "LU") || !strcmp(ext+1, "UL")) - { - is_l++; - is_u++; - } - else if(!strcmp(ext+1, "LL")) - { - is_ll++; - } - else if(!strcmp(ext+2, "L")) - { - is_l++; - } - else if(!strcmp(ext+2, "U")) - { - is_u++; - } - - if(is_u && is_ll) - { - errno = 0; - val->ull = _strtoui64(str, NULL, radix); - if (val->ull == ULLONG_MAX && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tULONGLONG; - } - else if(!is_u && is_ll) - { - errno = 0; - val->sll = _strtoi64(str, NULL, radix); - if ((val->sll == LLONG_MIN || val->sll == LLONG_MAX) && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tSLONGLONG; - } - else if(is_u && is_l) - { - errno = 0; - val->ulong = strtoul(str, NULL, radix); - if (val->ulong == ULONG_MAX && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tULONG; - } - else if(!is_u && is_l) - { - errno = 0; - val->slong = strtol(str, NULL, radix); - if ((val->slong == LONG_MIN || val->slong == LONG_MAX) && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tSLONG; - } - else if(is_u && !is_l) - { - unsigned long ul; - errno = 0; - ul = strtoul(str, NULL, radix); - if ((ul == ULONG_MAX && errno == ERANGE) || (ul > UINT_MAX)) - ppy_error("integer constant %s is too large\n", str); - val->uint = (unsigned int)ul; - return tUINT; - } - - /* Else it must be an int... */ - errno = 0; - l = strtol(str, NULL, radix); - if (((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) || - (l > INT_MAX) || (l < INT_MIN)) - ppy_error("integer constant %s is too large\n", str); - val->sint = (int)l; - return tSINT; -} - - -/* - *------------------------------------------------------------------------- - * Macro and define expansion support - * - * FIXME: Variable macro arguments. - *------------------------------------------------------------------------- - */ -static void expand_special(pp_entry_t *ppp) -{ - static char *buf = NULL; - char *new_buf; - - assert(ppp->type == def_special); - - if(!strcmp(ppp->ident, "__LINE__")) - { - new_buf = pp_xrealloc(buf, 32); - if(!new_buf) - return; - buf = new_buf; - sprintf(buf, "%d", pp_status.line_number); - } - else if(!strcmp(ppp->ident, "__FILE__")) - { - new_buf = pp_xrealloc(buf, strlen(pp_status.input) + 3); - if(!new_buf) - return; - buf = new_buf; - sprintf(buf, "\"%s\"", pp_status.input); - } - else - pp_internal_error(__FILE__, __LINE__, "Special macro '%s' not found...\n", ppp->ident); - - if(buf && buf[0]) - { - push_buffer(ppp, NULL, NULL, 0); - yy_scan_string(buf); - } -} - -static void expand_define(pp_entry_t *ppp) -{ - assert(ppp->type == def_define); - - if(ppp->subst.text && ppp->subst.text[0]) - { - push_buffer(ppp, NULL, NULL, 0); - yy_scan_string(ppp->subst.text); - } -} - -static int curdef_idx = 0; -static int curdef_alloc = 0; -static char *curdef_text = NULL; - -static void add_text(const char *str, int len) -{ - int new_alloc; - char *new_text; - - if(len == 0) - return; - if(curdef_idx >= curdef_alloc || curdef_alloc - curdef_idx < len) - { - new_alloc = curdef_alloc + ((len + ALLOCBLOCKSIZE-1) & ~(ALLOCBLOCKSIZE-1)); - new_text = pp_xrealloc(curdef_text, new_alloc * sizeof(curdef_text[0])); - if(!new_text) - return; - curdef_text = new_text; - curdef_alloc = new_alloc; - if(curdef_alloc > 65536) - ppy_warning("Reallocating macro-expansion buffer larger than 64kB"); - } - memcpy(&curdef_text[curdef_idx], str, len); - curdef_idx += len; -} - -static mtext_t *add_expand_text(mtext_t *mtp, macexpstackentry_t *mep, int *nnl) -{ - char *cptr; - char *exp; - int tag; - int n; - - if(mtp == NULL) - return NULL; - - switch(mtp->type) - { - case exp_text: - add_text(mtp->subst.text, strlen(mtp->subst.text)); - break; - - case exp_stringize: - cptr = mep->args[mtp->subst.argidx]; - add_text("\"", 1); - while(*cptr) - { - if(*cptr == '"' || *cptr == '\\') - add_text("\\", 1); - add_text(cptr, 1); - cptr++; - } - add_text("\"", 1); - break; - - case exp_concat: - /* Remove trailing whitespace from current expansion text */ - while(curdef_idx) - { - if(isspace(curdef_text[curdef_idx-1] & 0xff)) - curdef_idx--; - else - break; - } - /* tag current position and recursively expand the next part */ - tag = curdef_idx; - mtp = add_expand_text(mtp->next, mep, nnl); - - /* Now get rid of the leading space of the expansion */ - cptr = &curdef_text[tag]; - n = curdef_idx - tag; - while(n) - { - if(isspace(*cptr & 0xff)) - { - cptr++; - n--; - } - else - break; - } - if(cptr != &curdef_text[tag]) - { - memmove(&curdef_text[tag], cptr, n); - curdef_idx -= (curdef_idx - tag) - n; - } - break; - - case exp_subst: - if((mtp->next && mtp->next->type == exp_concat) || (mtp->prev && mtp->prev->type == exp_concat)) - exp = mep->args[mtp->subst.argidx]; - else - exp = mep->ppargs[mtp->subst.argidx]; - if(exp) - { - add_text(exp, strlen(exp)); - *nnl -= mep->nnls[mtp->subst.argidx]; - cptr = strchr(exp, '\n'); - while(cptr) - { - *cptr = ' '; - cptr = strchr(cptr+1, '\n'); - } - mep->nnls[mtp->subst.argidx] = 0; - } - break; - - default: - pp_internal_error(__FILE__, __LINE__, "Invalid expansion type (%d) in macro expansion\n", mtp->type); - } - return mtp; -} - -static void expand_macro(macexpstackentry_t *mep) -{ - mtext_t *mtp; - int n, k; - char *cptr; - int nnl = 0; - pp_entry_t *ppp = mep->ppp; - int nargs = mep->nargs; - - assert(ppp->type == def_macro); - assert(ppp->expanding == 0); - - if((ppp->nargs >= 0 && nargs != ppp->nargs) || (ppp->nargs < 0 && nargs < -ppp->nargs)) - { - ppy_error("Too %s macro arguments (%d)", nargs < abs(ppp->nargs) ? "few" : "many", nargs); - return; - } - - for(n = 0; n < nargs; n++) - nnl += mep->nnls[n]; - - curdef_idx = 0; - - for(mtp = ppp->subst.mtext; mtp; mtp = mtp->next) - { - if(!(mtp = add_expand_text(mtp, mep, &nnl))) - break; - } - - for(n = 0; n < nnl; n++) - add_text("\n", 1); - - /* To make sure there is room and termination (see below) */ - add_text(" \0", 2); - - /* Strip trailing whitespace from expansion */ - for(k = curdef_idx, cptr = &curdef_text[curdef_idx-1]; k > 0; k--, cptr--) - { - if(!isspace(*cptr & 0xff)) - break; - } - - /* - * We must add *one* whitespace to make sure that there - * is a token-separation after the expansion. - */ - *(++cptr) = ' '; - *(++cptr) = '\0'; - k++; - - /* Strip leading whitespace from expansion */ - for(n = 0, cptr = curdef_text; n < k; n++, cptr++) - { - if(!isspace(*cptr & 0xff)) - break; - } - - if(k - n > 0) - { - push_buffer(ppp, NULL, NULL, 0); - /*yy_scan_bytes(curdef_text + n, k - n);*/ - yy_scan_string(curdef_text + n); - } -} - -/* - *------------------------------------------------------------------------- - * String collection routines - *------------------------------------------------------------------------- - */ -static void new_string(void) -{ -#ifdef DEBUG - if(strbuf_idx) - ppy_warning("new_string: strbuf_idx != 0"); -#endif - strbuf_idx = 0; - str_startline = pp_status.line_number; -} - -static void add_string(const char *str, int len) -{ - int new_alloc; - char *new_buffer; - - if(len == 0) - return; - if(strbuf_idx >= strbuf_alloc || strbuf_alloc - strbuf_idx < len) - { - new_alloc = strbuf_alloc + ((len + ALLOCBLOCKSIZE-1) & ~(ALLOCBLOCKSIZE-1)); - new_buffer = pp_xrealloc(strbuffer, new_alloc * sizeof(strbuffer[0])); - if(!new_buffer) - return; - strbuffer = new_buffer; - strbuf_alloc = new_alloc; - if(strbuf_alloc > 65536) - ppy_warning("Reallocating string buffer larger than 64kB"); - } - memcpy(&strbuffer[strbuf_idx], str, len); - strbuf_idx += len; -} - -static char *get_string(void) -{ - char *str = pp_xmalloc(strbuf_idx + 1); - if(!str) - return NULL; - memcpy(str, strbuffer, strbuf_idx); - str[strbuf_idx] = '\0'; -#ifdef DEBUG - strbuf_idx = 0; -#endif - return str; -} - -static void put_string(void) -{ - put_buffer(strbuffer, strbuf_idx); -#ifdef DEBUG - strbuf_idx = 0; -#endif -} - -static int string_start(void) -{ - return str_startline; -} - - -/* - *------------------------------------------------------------------------- - * Buffer management - *------------------------------------------------------------------------- - */ -static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop) -{ - if(bufferstackidx >= MAXBUFFERSTACK) - pp_internal_error(__FILE__, __LINE__, "Buffer stack overflow"); - - memset(&bufferstack[bufferstackidx], 0, sizeof(bufferstack[0])); - bufferstack[bufferstackidx].bufferstate = YY_CURRENT_BUFFER; - bufferstack[bufferstackidx].filehandle = pp_status.file; - bufferstack[bufferstackidx].define = ppp; - bufferstack[bufferstackidx].line_number = pp_status.line_number; - bufferstack[bufferstackidx].char_number = pp_status.char_number; - bufferstack[bufferstackidx].if_depth = pp_get_if_depth(); - bufferstack[bufferstackidx].should_pop = pop; - bufferstack[bufferstackidx].filename = pp_status.input; - bufferstack[bufferstackidx].ncontinuations = ncontinuations; - bufferstack[bufferstackidx].incl = pp_incl_state; - bufferstack[bufferstackidx].include_filename = incname; - - if(ppp) - ppp->expanding = 1; - else if(filename) - { - /* These will track the ppy_error to the correct file and line */ - pp_status.line_number = 1; - pp_status.char_number = 1; - pp_status.input = filename; - ncontinuations = 0; - } - else if(!pop) - pp_internal_error(__FILE__, __LINE__, "Pushing buffer without knowing where to go to"); - bufferstackidx++; -} - -static bufferstackentry_t *pop_buffer(void) -{ - if(bufferstackidx < 0) - pp_internal_error(__FILE__, __LINE__, "Bufferstack underflow?"); - - if(bufferstackidx == 0) - return NULL; - - bufferstackidx--; - - if(bufferstack[bufferstackidx].define) - bufferstack[bufferstackidx].define->expanding = 0; - else - { - includelogicentry_t *iep = NULL; - - if(!bufferstack[bufferstackidx].should_pop) - { - wpp_close(pp_status.file); - pp_writestring("# %d \"%s\" 2\n", bufferstack[bufferstackidx].line_number, bufferstack[bufferstackidx].filename); - - /* We have EOF, check the include logic */ - if(pp_incl_state.state == 2 && !pp_incl_state.seen_junk && pp_incl_state.ppp) - { - pp_entry_t *ppp = pplookup(pp_incl_state.ppp); - if(ppp) - { - iep = pp_xmalloc(sizeof(includelogicentry_t)); - if (iep) - { - iep->ppp = ppp; - ppp->iep = iep; - iep->filename = bufferstack[bufferstackidx].include_filename; - iep->prev = NULL; - iep->next = pp_includelogiclist; - if(iep->next) - iep->next->prev = iep; - pp_includelogiclist = iep; - } - } - } - free(pp_incl_state.ppp); - pp_incl_state = bufferstack[bufferstackidx].incl; - - } - if (bufferstack[bufferstackidx].include_filename) - { - free(pp_status.input); - pp_status.input = bufferstack[bufferstackidx].filename; - } - pp_status.line_number = bufferstack[bufferstackidx].line_number; - pp_status.char_number = bufferstack[bufferstackidx].char_number; - ncontinuations = bufferstack[bufferstackidx].ncontinuations; - if (!iep) - free(bufferstack[bufferstackidx].include_filename); - } - - pp_status.file = bufferstack[bufferstackidx].filehandle; - ppy__switch_to_buffer(bufferstack[bufferstackidx].bufferstate); - - if(bufferstack[bufferstackidx].should_pop) - { - if(yy_current_state() == pp_macexp) - macro_add_expansion(); - else - pp_internal_error(__FILE__, __LINE__, "Pop buffer and state without macro expansion state"); - yy_pop_state(); - } - - return &bufferstack[bufferstackidx]; -} - - -/* - *------------------------------------------------------------------------- - * Macro nestng support - *------------------------------------------------------------------------- - */ -static void push_macro(pp_entry_t *ppp) -{ - if(macexpstackidx >= MAXMACEXPSTACK) - { - ppy_error("Too many nested macros"); - return; - } - - macexpstack[macexpstackidx] = pp_xmalloc(sizeof(macexpstack[0][0])); - if(!macexpstack[macexpstackidx]) - return; - memset( macexpstack[macexpstackidx], 0, sizeof(macexpstack[0][0])); - macexpstack[macexpstackidx]->ppp = ppp; - macexpstackidx++; -} - -static macexpstackentry_t *top_macro(void) -{ - return macexpstackidx > 0 ? macexpstack[macexpstackidx-1] : NULL; -} - -static macexpstackentry_t *pop_macro(void) -{ - if(macexpstackidx <= 0) - pp_internal_error(__FILE__, __LINE__, "Macro expansion stack underflow\n"); - return macexpstack[--macexpstackidx]; -} - -static void free_macro(macexpstackentry_t *mep) -{ - int i; - - for(i = 0; i < mep->nargs; i++) - free(mep->args[i]); - free(mep->args); - free(mep->nnls); - free(mep->curarg); - free(mep); -} - -static void add_text_to_macro(const char *text, int len) -{ - macexpstackentry_t *mep = top_macro(); - - assert(mep->ppp->expanding == 0); - - if(mep->curargalloc - mep->curargsize <= len+1) /* +1 for '\0' */ - { - char *new_curarg; - int new_alloc = mep->curargalloc + ((ALLOCBLOCKSIZE > len+1) ? ALLOCBLOCKSIZE : len+1); - new_curarg = pp_xrealloc(mep->curarg, new_alloc * sizeof(mep->curarg[0])); - if(!new_curarg) - return; - mep->curarg = new_curarg; - mep->curargalloc = new_alloc; - } - memcpy(mep->curarg + mep->curargsize, text, len); - mep->curargsize += len; - mep->curarg[mep->curargsize] = '\0'; -} - -static void macro_add_arg(int last) -{ - int nnl = 0; - char *cptr; - char **new_args, **new_ppargs; - int *new_nnls; - macexpstackentry_t *mep = top_macro(); - - assert(mep->ppp->expanding == 0); - - new_args = pp_xrealloc(mep->args, (mep->nargs+1) * sizeof(mep->args[0])); - if(!new_args) - return; - mep->args = new_args; - - new_ppargs = pp_xrealloc(mep->ppargs, (mep->nargs+1) * sizeof(mep->ppargs[0])); - if(!new_ppargs) - return; - mep->ppargs = new_ppargs; - - new_nnls = pp_xrealloc(mep->nnls, (mep->nargs+1) * sizeof(mep->nnls[0])); - if(!new_nnls) - return; - mep->nnls = new_nnls; - - mep->args[mep->nargs] = pp_xstrdup(mep->curarg ? mep->curarg : ""); - if(!mep->args[mep->nargs]) - return; - cptr = mep->args[mep->nargs]-1; - while((cptr = strchr(cptr+1, '\n'))) - { - nnl++; - } - mep->nnls[mep->nargs] = nnl; - mep->nargs++; - free(mep->curarg); - mep->curargalloc = mep->curargsize = 0; - mep->curarg = NULL; - - /* Each macro argument must be expanded to cope with stingize */ - if(last || mep->args[mep->nargs-1][0]) - { - yy_push_state(pp_macexp); - push_buffer(NULL, NULL, NULL, last ? 2 : 1); - yy_scan_string(mep->args[mep->nargs-1]); - /*mep->bufferstackidx = bufferstackidx; But not nested! */ - } -} - -static void macro_add_expansion(void) -{ - macexpstackentry_t *mep = top_macro(); - - assert(mep->ppp->expanding == 0); - - mep->ppargs[mep->nargs-1] = pp_xstrdup(mep->curarg ? mep->curarg : ""); - free(mep->curarg); - mep->curargalloc = mep->curargsize = 0; - mep->curarg = NULL; -} - - -/* - *------------------------------------------------------------------------- - * Output management - *------------------------------------------------------------------------- - */ -static void put_buffer(const char *s, int len) -{ - if(top_macro()) - add_text_to_macro(s, len); - else - wpp_write(s, len); -} - - -/* - *------------------------------------------------------------------------- - * Include management - *------------------------------------------------------------------------- - */ -void pp_do_include(char *fname, int type) -{ - char *newpath; - int n; - includelogicentry_t *iep; - void *fp; - - if(!fname) - return; - - for(iep = pp_includelogiclist; iep; iep = iep->next) - { - if(!strcmp(iep->filename, fname)) - { - /* - * We are done. The file was included before. - * If the define was deleted, then this entry would have - * been deleted too. - */ - free(fname); - return; - } - } - - n = strlen(fname); - - if(n <= 2) - { - ppy_error("Empty include filename"); - free(fname); - return; - } - - /* Undo the effect of the quotation */ - fname[n-1] = '\0'; - - if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL) - { - ppy_error("Unable to open include file %s", fname+1); - free(fname); - return; - } - - fname[n-1] = *fname; /* Redo the quotes */ - push_buffer(NULL, newpath, fname, 0); - pp_incl_state.seen_junk = 0; - pp_incl_state.state = 0; - pp_incl_state.ppp = NULL; - - pp_status.file = fp; - ppy__switch_to_buffer(ppy__create_buffer(NULL, YY_BUF_SIZE)); - - pp_writestring("# 1 \"%s\" 1%s\n", newpath, type ? "" : " 3"); -} - -/* - *------------------------------------------------------------------------- - * Push/pop preprocessor ignore state when processing conditionals - * which are false. - *------------------------------------------------------------------------- - */ -void pp_push_ignore_state(void) -{ - yy_push_state(pp_ignore); -} - -void pp_pop_ignore_state(void) -{ - yy_pop_state(); -} - diff --git a/dll/directx/wine/d3dcompiler_43/ppl.yy.h b/dll/directx/wine/d3dcompiler_43/ppl.yy.h deleted file mode 100644 index 2832331833f..00000000000 --- a/dll/directx/wine/d3dcompiler_43/ppl.yy.h +++ /dev/null @@ -1,730 +0,0 @@ -#ifndef ppy_HEADER_H -#define ppy_HEADER_H 1 -#define ppy_IN_HEADER 1 - -#line 5 "ppl.yy.h" - -#line 7 "ppl.yy.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define ppy__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer ppy__create_buffer -#endif - -#ifdef yy_delete_buffer -#define ppy__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer ppy__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define ppy__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer ppy__scan_buffer -#endif - -#ifdef yy_scan_string -#define ppy__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string ppy__scan_string -#endif - -#ifdef yy_scan_bytes -#define ppy__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes ppy__scan_bytes -#endif - -#ifdef yy_init_buffer -#define ppy__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer ppy__init_buffer -#endif - -#ifdef yy_flush_buffer -#define ppy__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer ppy__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define ppy__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state ppy__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define ppy__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer ppy__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define ppy_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state ppy_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define ppy_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state ppy_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define ppy_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack ppy_ensure_buffer_stack -#endif - -#ifdef yylex -#define ppy_lex_ALREADY_DEFINED -#else -#define yylex ppy_lex -#endif - -#ifdef yyrestart -#define ppy_restart_ALREADY_DEFINED -#else -#define yyrestart ppy_restart -#endif - -#ifdef yylex_init -#define ppy_lex_init_ALREADY_DEFINED -#else -#define yylex_init ppy_lex_init -#endif - -#ifdef yylex_init_extra -#define ppy_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra ppy_lex_init_extra -#endif - -#ifdef yylex_destroy -#define ppy_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy ppy_lex_destroy -#endif - -#ifdef yyget_debug -#define ppy_get_debug_ALREADY_DEFINED -#else -#define yyget_debug ppy_get_debug -#endif - -#ifdef yyset_debug -#define ppy_set_debug_ALREADY_DEFINED -#else -#define yyset_debug ppy_set_debug -#endif - -#ifdef yyget_extra -#define ppy_get_extra_ALREADY_DEFINED -#else -#define yyget_extra ppy_get_extra -#endif - -#ifdef yyset_extra -#define ppy_set_extra_ALREADY_DEFINED -#else -#define yyset_extra ppy_set_extra -#endif - -#ifdef yyget_in -#define ppy_get_in_ALREADY_DEFINED -#else -#define yyget_in ppy_get_in -#endif - -#ifdef yyset_in -#define ppy_set_in_ALREADY_DEFINED -#else -#define yyset_in ppy_set_in -#endif - -#ifdef yyget_out -#define ppy_get_out_ALREADY_DEFINED -#else -#define yyget_out ppy_get_out -#endif - -#ifdef yyset_out -#define ppy_set_out_ALREADY_DEFINED -#else -#define yyset_out ppy_set_out -#endif - -#ifdef yyget_leng -#define ppy_get_leng_ALREADY_DEFINED -#else -#define yyget_leng ppy_get_leng -#endif - -#ifdef yyget_text -#define ppy_get_text_ALREADY_DEFINED -#else -#define yyget_text ppy_get_text -#endif - -#ifdef yyget_lineno -#define ppy_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno ppy_get_lineno -#endif - -#ifdef yyset_lineno -#define ppy_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno ppy_set_lineno -#endif - -#ifdef yywrap -#define ppy_wrap_ALREADY_DEFINED -#else -#define yywrap ppy_wrap -#endif - -#ifdef yyalloc -#define ppy_alloc_ALREADY_DEFINED -#else -#define yyalloc ppy_alloc -#endif - -#ifdef yyrealloc -#define ppy_realloc_ALREADY_DEFINED -#else -#define yyrealloc ppy_realloc -#endif - -#ifdef yyfree -#define ppy_free_ALREADY_DEFINED -#else -#define yyfree ppy_free -#endif - -#ifdef yytext -#define ppy_text_ALREADY_DEFINED -#else -#define yytext ppy_text -#endif - -#ifdef yyleng -#define ppy_leng_ALREADY_DEFINED -#else -#define yyleng ppy_leng -#endif - -#ifdef yyin -#define ppy_in_ALREADY_DEFINED -#else -#define yyin ppy_in -#endif - -#ifdef yyout -#define ppy_out_ALREADY_DEFINED -#else -#define yyout ppy_out -#endif - -#ifdef yy_flex_debug -#define ppy__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug ppy__flex_debug -#endif - -#ifdef yylineno -#define ppy_lineno_ALREADY_DEFINED -#else -#define yylineno ppy_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#ifndef SIZE_MAX -#define SIZE_MAX (~(size_t)0) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -/* begin standard C++ headers. */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -/* Begin user sect3 */ - -extern int yylineno; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 -#define pp_pp 1 -#define pp_eol 2 -#define pp_inc 3 -#define pp_dqs 4 -#define pp_sqs 5 -#define pp_iqs 6 -#define pp_comment 7 -#define pp_def 8 -#define pp_define 9 -#define pp_macro 10 -#define pp_mbody 11 -#define pp_macign 12 -#define pp_macscan 13 -#define pp_macexp 14 -#define pp_if 15 -#define pp_ifd 16 -#define pp_ifignored 17 -#define pp_endif 18 -#define pp_line 19 -#define pp_defined 20 -#define pp_ignore 21 -#define RCINCL 22 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#ifndef ppy__create_buffer_ALREADY_DEFINED -#undef yy_create_buffer -#endif -#ifndef ppy__delete_buffer_ALREADY_DEFINED -#undef yy_delete_buffer -#endif -#ifndef ppy__scan_buffer_ALREADY_DEFINED -#undef yy_scan_buffer -#endif -#ifndef ppy__scan_string_ALREADY_DEFINED -#undef yy_scan_string -#endif -#ifndef ppy__scan_bytes_ALREADY_DEFINED -#undef yy_scan_bytes -#endif -#ifndef ppy__init_buffer_ALREADY_DEFINED -#undef yy_init_buffer -#endif -#ifndef ppy__flush_buffer_ALREADY_DEFINED -#undef yy_flush_buffer -#endif -#ifndef ppy__load_buffer_state_ALREADY_DEFINED -#undef yy_load_buffer_state -#endif -#ifndef ppy__switch_to_buffer_ALREADY_DEFINED -#undef yy_switch_to_buffer -#endif -#ifndef ppy_push_buffer_state_ALREADY_DEFINED -#undef yypush_buffer_state -#endif -#ifndef ppy_pop_buffer_state_ALREADY_DEFINED -#undef yypop_buffer_state -#endif -#ifndef ppy_ensure_buffer_stack_ALREADY_DEFINED -#undef yyensure_buffer_stack -#endif -#ifndef ppy_lex_ALREADY_DEFINED -#undef yylex -#endif -#ifndef ppy_restart_ALREADY_DEFINED -#undef yyrestart -#endif -#ifndef ppy_lex_init_ALREADY_DEFINED -#undef yylex_init -#endif -#ifndef ppy_lex_init_extra_ALREADY_DEFINED -#undef yylex_init_extra -#endif -#ifndef ppy_lex_destroy_ALREADY_DEFINED -#undef yylex_destroy -#endif -#ifndef ppy_get_debug_ALREADY_DEFINED -#undef yyget_debug -#endif -#ifndef ppy_set_debug_ALREADY_DEFINED -#undef yyset_debug -#endif -#ifndef ppy_get_extra_ALREADY_DEFINED -#undef yyget_extra -#endif -#ifndef ppy_set_extra_ALREADY_DEFINED -#undef yyset_extra -#endif -#ifndef ppy_get_in_ALREADY_DEFINED -#undef yyget_in -#endif -#ifndef ppy_set_in_ALREADY_DEFINED -#undef yyset_in -#endif -#ifndef ppy_get_out_ALREADY_DEFINED -#undef yyget_out -#endif -#ifndef ppy_set_out_ALREADY_DEFINED -#undef yyset_out -#endif -#ifndef ppy_get_leng_ALREADY_DEFINED -#undef yyget_leng -#endif -#ifndef ppy_get_text_ALREADY_DEFINED -#undef yyget_text -#endif -#ifndef ppy_get_lineno_ALREADY_DEFINED -#undef yyget_lineno -#endif -#ifndef ppy_set_lineno_ALREADY_DEFINED -#undef yyset_lineno -#endif -#ifndef ppy_get_column_ALREADY_DEFINED -#undef yyget_column -#endif -#ifndef ppy_set_column_ALREADY_DEFINED -#undef yyset_column -#endif -#ifndef ppy_wrap_ALREADY_DEFINED -#undef yywrap -#endif -#ifndef ppy_get_lval_ALREADY_DEFINED -#undef yyget_lval -#endif -#ifndef ppy_set_lval_ALREADY_DEFINED -#undef yyset_lval -#endif -#ifndef ppy_get_lloc_ALREADY_DEFINED -#undef yyget_lloc -#endif -#ifndef ppy_set_lloc_ALREADY_DEFINED -#undef yyset_lloc -#endif -#ifndef ppy_alloc_ALREADY_DEFINED -#undef yyalloc -#endif -#ifndef ppy_realloc_ALREADY_DEFINED -#undef yyrealloc -#endif -#ifndef ppy_free_ALREADY_DEFINED -#undef yyfree -#endif -#ifndef ppy_text_ALREADY_DEFINED -#undef yytext -#endif -#ifndef ppy_leng_ALREADY_DEFINED -#undef yyleng -#endif -#ifndef ppy_in_ALREADY_DEFINED -#undef yyin -#endif -#ifndef ppy_out_ALREADY_DEFINED -#undef yyout -#endif -#ifndef ppy__flex_debug_ALREADY_DEFINED -#undef yy_flex_debug -#endif -#ifndef ppy_lineno_ALREADY_DEFINED -#undef yylineno -#endif -#ifndef ppy_tables_fload_ALREADY_DEFINED -#undef yytables_fload -#endif -#ifndef ppy_tables_destroy_ALREADY_DEFINED -#undef yytables_destroy -#endif -#ifndef ppy_TABLES_NAME_ALREADY_DEFINED -#undef yyTABLES_NAME -#endif - -#line 768 "ppl.l" - - -#line 728 "ppl.yy.h" -#undef ppy_IN_HEADER -#endif /* ppy_HEADER_H */ diff --git a/dll/directx/wine/d3dcompiler_43/ppy.tab.c b/dll/directx/wine/d3dcompiler_43/ppy.tab.c deleted file mode 100644 index 89f2e45a602..00000000000 --- a/dll/directx/wine/d3dcompiler_43/ppy.tab.c +++ /dev/null @@ -1,2619 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse ppy_parse -#define yylex ppy_lex -#define yyerror ppy_error -#define yydebug ppy_debug -#define yynerrs ppy_nerrs - -#define yylval ppy_lval -#define yychar ppy_char - -/* First part of user prologue. */ -#line 22 "ppy.y" - -#include -#include -#include -#include -#include -#include -#include "wpp_private.h" - - -#define UNARY_OP(r, v, OP) \ - switch(v.type) \ - { \ - case cv_sint: r.val.si = OP v.val.si; break; \ - case cv_uint: r.val.ui = OP v.val.ui; break; \ - case cv_slong: r.val.sl = OP v.val.sl; break; \ - case cv_ulong: r.val.ul = OP v.val.ul; break; \ - case cv_sll: r.val.sll = OP v.val.sll; break; \ - case cv_ull: r.val.ull = OP v.val.ull; break; \ - } - -#define cv_signed(v) ((v.type & FLAG_SIGNED) != 0) - -#define BIN_OP_INT(r, v1, v2, OP) \ - r.type = v1.type; \ - if(cv_signed(v1) && cv_signed(v2)) \ - r.val.si = v1.val.si OP v2.val.si; \ - else if(cv_signed(v1) && !cv_signed(v2)) \ - r.val.si = v1.val.si OP (signed) v2.val.ui; \ - else if(!cv_signed(v1) && cv_signed(v2)) \ - r.val.si = (signed) v1.val.ui OP v2.val.si; \ - else \ - r.val.ui = v1.val.ui OP v2.val.ui; - -#define BIN_OP_LONG(r, v1, v2, OP) \ - r.type = v1.type; \ - if(cv_signed(v1) && cv_signed(v2)) \ - r.val.sl = v1.val.sl OP v2.val.sl; \ - else if(cv_signed(v1) && !cv_signed(v2)) \ - r.val.sl = v1.val.sl OP (signed long) v2.val.ul; \ - else if(!cv_signed(v1) && cv_signed(v2)) \ - r.val.sl = (signed long) v1.val.ul OP v2.val.sl; \ - else \ - r.val.ul = v1.val.ul OP v2.val.ul; - -#define BIN_OP_LONGLONG(r, v1, v2, OP) \ - r.type = v1.type; \ - if(cv_signed(v1) && cv_signed(v2)) \ - r.val.sll = v1.val.sll OP v2.val.sll; \ - else if(cv_signed(v1) && !cv_signed(v2)) \ - r.val.sll = v1.val.sll OP (__int64) v2.val.ull; \ - else if(!cv_signed(v1) && cv_signed(v2)) \ - r.val.sll = (__int64) v1.val.ull OP v2.val.sll; \ - else \ - r.val.ull = v1.val.ull OP v2.val.ull; - -#define BIN_OP(r, v1, v2, OP) \ - switch(v1.type & SIZE_MASK) \ - { \ - case SIZE_INT: BIN_OP_INT(r, v1, v2, OP); break; \ - case SIZE_LONG: BIN_OP_LONG(r, v1, v2, OP); break; \ - case SIZE_LONGLONG: BIN_OP_LONGLONG(r, v1, v2, OP); break; \ - default: pp_internal_error(__FILE__, __LINE__, "Invalid type indicator (0x%04x)", v1.type); \ - } - - -/* - * Prototypes - */ -static int boolean(cval_t *v); -static void promote_equal_size(cval_t *v1, cval_t *v2); -static void cast_to_sint(cval_t *v); -static void cast_to_uint(cval_t *v); -static void cast_to_slong(cval_t *v); -static void cast_to_ulong(cval_t *v); -static void cast_to_sll(cval_t *v); -static void cast_to_ull(cval_t *v); -static marg_t *new_marg(char *str, def_arg_t type); -static marg_t *add_new_marg(char *str, def_arg_t type); -static int marg_index(char *id); -static mtext_t *new_mtext(char *str, int idx, def_exp_t type); -static mtext_t *combine_mtext(mtext_t *tail, mtext_t *mtp); -static char *merge_text(char *s1, char *s2); - -/* - * Local variables - */ -static marg_t **macro_args; /* Macro parameters array while parsing */ -static int nmacro_args; - - -#line 170 "ppy.tab.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_PPY_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_PPY_TAB_H_INCLUDED -# define YY_PPY_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_PPY_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int ppy_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tRCINCLUDE = 258, - tIF = 259, - tIFDEF = 260, - tIFNDEF = 261, - tELSE = 262, - tELIF = 263, - tENDIF = 264, - tDEFINED = 265, - tNL = 266, - tINCLUDE = 267, - tLINE = 268, - tGCCLINE = 269, - tERROR = 270, - tWARNING = 271, - tPRAGMA = 272, - tPPIDENT = 273, - tUNDEF = 274, - tMACROEND = 275, - tCONCAT = 276, - tELIPSIS = 277, - tSTRINGIZE = 278, - tIDENT = 279, - tLITERAL = 280, - tMACRO = 281, - tDEFINE = 282, - tDQSTRING = 283, - tSQSTRING = 284, - tIQSTRING = 285, - tUINT = 286, - tSINT = 287, - tULONG = 288, - tSLONG = 289, - tULONGLONG = 290, - tSLONGLONG = 291, - tRCINCLUDEPATH = 292, - tLOGOR = 293, - tLOGAND = 294, - tEQ = 295, - tNE = 296, - tLTE = 297, - tGTE = 298, - tLSHIFT = 299, - tRSHIFT = 300 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 114 "ppy.y" - - int sint; - unsigned int uint; - long slong; - unsigned long ulong; - __int64 sll; - unsigned __int64 ull; - int *iptr; - char *cptr; - cval_t cval; - marg_t *marg; - mtext_t *mtext; - -#line 273 "ppy.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE ppy_lval; - -int ppy_parse (void); - -#endif /* !YY_PPY_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_PPY_TAB_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 303 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 62 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 13 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 84 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 153 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 300 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 58, 2, 2, 2, 2, 44, 2, - 60, 61, 55, 53, 59, 54, 2, 56, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 39, 2, - 47, 2, 49, 38, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 43, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 42, 2, 57, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 40, 41, 45, 46, 48, 50, 51, - 52 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 169, 169, 170, 174, 175, 176, 177, 178, 195, - 219, 245, 259, 260, 261, 264, 265, 266, 268, 270, - 272, 274, 275, 276, 277, 278, 279, 292, 298, 299, - 302, 303, 304, 305, 306, 307, 310, 313, 314, 317, - 318, 321, 322, 326, 327, 333, 334, 337, 338, 339, - 340, 341, 348, 357, 358, 359, 360, 361, 362, 363, - 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, - 384, 385, 386, 387, 388 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "tRCINCLUDE", "tIF", "tIFDEF", "tIFNDEF", - "tELSE", "tELIF", "tENDIF", "tDEFINED", "tNL", "tINCLUDE", "tLINE", - "tGCCLINE", "tERROR", "tWARNING", "tPRAGMA", "tPPIDENT", "tUNDEF", - "tMACROEND", "tCONCAT", "tELIPSIS", "tSTRINGIZE", "tIDENT", "tLITERAL", - "tMACRO", "tDEFINE", "tDQSTRING", "tSQSTRING", "tIQSTRING", "tUINT", - "tSINT", "tULONG", "tSLONG", "tULONGLONG", "tSLONGLONG", - "tRCINCLUDEPATH", "'?'", "':'", "tLOGOR", "tLOGAND", "'|'", "'^'", "'&'", - "tEQ", "tNE", "'<'", "tLTE", "'>'", "tGTE", "tLSHIFT", "tRSHIFT", "'+'", - "'-'", "'*'", "'/'", "'~'", "'!'", "','", "'('", "')'", "$accept", - "pp_file", "preprocessor", "opt_text", "text", "res_arg", "allmargs", - "emargs", "margs", "opt_mtexts", "mtexts", "mtext", "pp_expr", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 63, 58, - 293, 294, 124, 94, 38, 295, 296, 60, 297, 62, - 298, 299, 300, 43, 45, 42, 47, 126, 33, 44, - 40, 41 -}; -# endif - -#define YYPACT_NINF -27 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-27))) - -#define YYTABLE_NINF -1 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -27, 142, -27, -26, -3, -12, -2, 30, -3, 41, - 91, 21, 2, -19, -19, -19, -19, 32, -27, -19, - -27, -27, -27, -23, -27, -27, -27, -27, -27, -27, - -27, -3, -3, -3, -3, -3, 38, 66, 109, -27, - 85, -27, 113, 133, 115, -27, 124, -27, -27, -27, - 179, -9, 278, 280, 281, 282, 129, 283, -27, 271, - -10, -10, -27, -27, 57, -27, -3, -3, -3, -3, - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, - -3, -3, -3, -3, -27, -27, -27, -27, -27, 285, - 3, -27, -27, -27, -27, -27, -27, -27, -27, -27, - 277, -27, 239, -27, 238, -27, 132, 167, 182, 196, - 209, 221, 231, 231, 111, 111, 111, 111, 61, 61, - -10, -10, -27, -27, -27, -27, 4, 19, 266, -27, - -3, -27, 6, -27, 276, -27, -27, -27, -27, 290, - 19, -27, -27, -27, 151, -27, 7, -27, -27, -27, - -27, 291, -27 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 28, 28, 28, 28, 0, 36, 28, - 3, 27, 26, 0, 61, 54, 53, 56, 55, 58, - 57, 0, 0, 0, 0, 0, 0, 0, 0, 10, - 0, 11, 0, 0, 0, 21, 0, 30, 31, 32, - 0, 29, 0, 0, 0, 0, 37, 0, 59, 0, - 79, 80, 81, 82, 0, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 8, 9, 4, 5, 0, - 0, 22, 33, 34, 35, 23, 24, 25, 12, 42, - 0, 38, 39, 13, 0, 83, 0, 62, 63, 74, - 72, 73, 64, 65, 66, 68, 67, 69, 77, 78, - 70, 71, 75, 76, 15, 16, 0, 43, 0, 60, - 0, 17, 0, 50, 0, 52, 47, 48, 49, 0, - 44, 45, 40, 41, 84, 18, 0, 51, 14, 46, - 19, 0, 20 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -27, -27, -27, -11, -27, -27, -27, -27, -27, -27, - -27, 163, -8 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 20, 50, 51, 56, 100, 101, 102, 139, - 140, 141, 36 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 40, 58, 21, 52, 53, 54, 47, 23, 57, 48, - 49, 22, 37, 45, 125, 131, 92, 145, 150, 93, - 94, 24, 38, 60, 61, 62, 63, 64, 25, 26, - 27, 28, 29, 30, 46, 126, 132, 59, 146, 151, - 133, 39, 134, 135, 136, 82, 83, 137, 138, 65, - 31, 32, 41, 44, 33, 34, 55, 35, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 66, 84, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 66, 86, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 80, 81, 82, 83, 105, 42, - 85, 43, 144, 66, 87, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 2, 89, 88, 3, 4, 5, 6, 7, - 8, 9, 90, 99, 10, 11, 12, 13, 14, 15, - 16, 17, 78, 79, 80, 81, 82, 83, 18, 19, - 66, 130, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 66, - 91, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 142, 95, - 143, 96, 97, 98, 103, 104, 124, 127, 128, 129, - 147, 148, 152, 149 -}; - -static const yytype_uint8 yycheck[] = -{ - 8, 24, 28, 14, 15, 16, 25, 10, 19, 28, - 29, 37, 24, 11, 11, 11, 25, 11, 11, 28, - 29, 24, 24, 31, 32, 33, 34, 35, 31, 32, - 33, 34, 35, 36, 32, 32, 32, 60, 32, 32, - 21, 11, 23, 24, 25, 55, 56, 28, 29, 11, - 53, 54, 11, 32, 57, 58, 24, 60, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 38, 11, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 38, 11, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 53, 54, 55, 56, 61, 28, - 11, 30, 130, 38, 11, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 0, 28, 11, 3, 4, 5, 6, 7, - 8, 9, 28, 24, 12, 13, 14, 15, 16, 17, - 18, 19, 51, 52, 53, 54, 55, 56, 26, 27, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 38, - 11, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 22, 11, - 24, 11, 11, 11, 11, 24, 11, 20, 59, 61, - 24, 11, 11, 140 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 63, 0, 3, 4, 5, 6, 7, 8, 9, - 12, 13, 14, 15, 16, 17, 18, 19, 26, 27, - 64, 28, 37, 10, 24, 31, 32, 33, 34, 35, - 36, 53, 54, 57, 58, 60, 74, 24, 24, 11, - 74, 11, 28, 30, 32, 11, 32, 25, 28, 29, - 65, 66, 65, 65, 65, 24, 67, 65, 24, 60, - 74, 74, 74, 74, 74, 11, 38, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 11, 11, 11, 11, 11, 28, - 28, 11, 25, 28, 29, 11, 11, 11, 11, 24, - 68, 69, 70, 11, 24, 61, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 11, 11, 32, 20, 59, 61, - 39, 11, 32, 21, 23, 24, 25, 28, 29, 71, - 72, 73, 22, 24, 74, 11, 32, 24, 11, 73, - 11, 32, 11 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 62, 63, 63, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, - 66, 66, 66, 66, 66, 66, 67, 68, 68, 69, - 69, 70, 70, 71, 71, 72, 72, 73, 73, 73, - 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 3, 3, 3, 3, 3, 3, - 2, 2, 3, 3, 6, 4, 4, 5, 6, 7, - 8, 2, 3, 3, 3, 3, 2, 2, 0, 1, - 1, 1, 1, 2, 2, 2, 0, 0, 1, 1, - 3, 3, 1, 0, 1, 1, 2, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, - 4, 1, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, - 2, 2, 2, 3, 5 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 4: -#line 174 "ppy.y" - { pp_do_include((yyvsp[-1].cptr), 1); } -#line 1505 "ppy.tab.c" - break; - - case 5: -#line 175 "ppy.y" - { pp_do_include((yyvsp[-1].cptr), 0); } -#line 1511 "ppy.tab.c" - break; - - case 6: -#line 176 "ppy.y" - { pp_next_if_state(boolean(&(yyvsp[-1].cval))); } -#line 1517 "ppy.tab.c" - break; - - case 7: -#line 177 "ppy.y" - { pp_next_if_state(pplookup((yyvsp[-1].cptr)) != NULL); free((yyvsp[-1].cptr)); } -#line 1523 "ppy.tab.c" - break; - - case 8: -#line 178 "ppy.y" - { - int t = pplookup((yyvsp[-1].cptr)) == NULL; - if(pp_incl_state.state == 0 && t && !pp_incl_state.seen_junk) - { - pp_incl_state.state = 1; - pp_incl_state.ppp = (yyvsp[-1].cptr); - pp_incl_state.ifdepth = pp_get_if_depth(); - } - else if(pp_incl_state.state != 1) - { - pp_incl_state.state = -1; - free((yyvsp[-1].cptr)); - } - else - free((yyvsp[-1].cptr)); - pp_next_if_state(t); - } -#line 1545 "ppy.tab.c" - break; - - case 9: -#line 195 "ppy.y" - { - pp_if_state_t s = pp_pop_if(); - switch(s) - { - case if_true: - case if_elif: - pp_push_if(if_elif); - break; - case if_false: - pp_push_if(boolean(&(yyvsp[-1].cval)) ? if_true : if_false); - break; - case if_ignore: - pp_push_if(if_ignore); - break; - case if_elsetrue: - case if_elsefalse: - ppy_error("#elif cannot follow #else"); - break; - case if_error: - break; - default: - pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d) in #elif directive", s); - } - } -#line 1574 "ppy.tab.c" - break; - - case 10: -#line 219 "ppy.y" - { - pp_if_state_t s = pp_pop_if(); - switch(s) - { - case if_true: - pp_push_if(if_elsefalse); - break; - case if_elif: - pp_push_if(if_elif); - break; - case if_false: - pp_push_if(if_elsetrue); - break; - case if_ignore: - pp_push_if(if_ignore); - break; - case if_elsetrue: - case if_elsefalse: - ppy_error("#else clause already defined"); - break; - case if_error: - break; - default: - pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d) in #else directive", s); - } - } -#line 1605 "ppy.tab.c" - break; - - case 11: -#line 245 "ppy.y" - { - if(pp_pop_if() != if_error) - { - if(pp_incl_state.ifdepth == pp_get_if_depth() && pp_incl_state.state == 1) - { - pp_incl_state.state = 2; - pp_incl_state.seen_junk = 0; - } - else if(pp_incl_state.state != 1) - { - pp_incl_state.state = -1; - } - } - } -#line 1624 "ppy.tab.c" - break; - - case 12: -#line 259 "ppy.y" - { pp_del_define((yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1630 "ppy.tab.c" - break; - - case 13: -#line 260 "ppy.y" - { pp_add_define((yyvsp[-2].cptr), (yyvsp[-1].cptr)); free((yyvsp[-2].cptr)); free((yyvsp[-1].cptr)); } -#line 1636 "ppy.tab.c" - break; - - case 14: -#line 261 "ppy.y" - { - pp_add_macro((yyvsp[-5].cptr), macro_args, nmacro_args, (yyvsp[-1].mtext)); - } -#line 1644 "ppy.tab.c" - break; - - case 15: -#line 264 "ppy.y" - { if((yyvsp[-1].cptr)) pp_writestring("# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1650 "ppy.tab.c" - break; - - case 16: -#line 265 "ppy.y" - { if((yyvsp[-1].cptr)) pp_writestring("# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1656 "ppy.tab.c" - break; - - case 17: -#line 267 "ppy.y" - { if((yyvsp[-2].cptr)) pp_writestring("# %d %s %d\n", (yyvsp[-3].sint), (yyvsp[-2].cptr), (yyvsp[-1].sint)); free((yyvsp[-2].cptr)); } -#line 1662 "ppy.tab.c" - break; - - case 18: -#line 269 "ppy.y" - { 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)); } -#line 1668 "ppy.tab.c" - break; - - case 19: -#line 271 "ppy.y" - { 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)); } -#line 1674 "ppy.tab.c" - break; - - case 20: -#line 273 "ppy.y" - { 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)); } -#line 1680 "ppy.tab.c" - break; - - case 22: -#line 275 "ppy.y" - { ppy_error("#error directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1686 "ppy.tab.c" - break; - - case 23: -#line 276 "ppy.y" - { ppy_warning("#warning directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1692 "ppy.tab.c" - break; - - case 24: -#line 277 "ppy.y" - { pp_writestring("#pragma %s\n", (yyvsp[-1].cptr) ? (yyvsp[-1].cptr) : ""); free((yyvsp[-1].cptr)); } -#line 1698 "ppy.tab.c" - break; - - case 25: -#line 278 "ppy.y" - { if(pp_status.pedantic) ppy_warning("#ident ignored (arg: '%s')", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1704 "ppy.tab.c" - break; - - case 26: -#line 279 "ppy.y" - { - if((yyvsp[0].cptr)) - { - int nl=strlen((yyvsp[0].cptr)) +3; - char *fn=pp_xmalloc(nl); - if(fn) - { - sprintf(fn,"\"%s\"",(yyvsp[0].cptr)); - pp_do_include(fn,1); - } - free((yyvsp[0].cptr)); - } - } -#line 1722 "ppy.tab.c" - break; - - case 27: -#line 292 "ppy.y" - { - pp_do_include((yyvsp[0].cptr),1); - } -#line 1730 "ppy.tab.c" - break; - - case 28: -#line 298 "ppy.y" - { (yyval.cptr) = NULL; } -#line 1736 "ppy.tab.c" - break; - - case 29: -#line 299 "ppy.y" - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1742 "ppy.tab.c" - break; - - case 30: -#line 302 "ppy.y" - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1748 "ppy.tab.c" - break; - - case 31: -#line 303 "ppy.y" - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1754 "ppy.tab.c" - break; - - case 32: -#line 304 "ppy.y" - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1760 "ppy.tab.c" - break; - - case 33: -#line 305 "ppy.y" - { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1766 "ppy.tab.c" - break; - - case 34: -#line 306 "ppy.y" - { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1772 "ppy.tab.c" - break; - - case 35: -#line 307 "ppy.y" - { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1778 "ppy.tab.c" - break; - - case 36: -#line 310 "ppy.y" - { macro_args = NULL; nmacro_args = 0; } -#line 1784 "ppy.tab.c" - break; - - case 37: -#line 313 "ppy.y" - { (yyval.sint) = 0; macro_args = NULL; nmacro_args = 0; } -#line 1790 "ppy.tab.c" - break; - - case 38: -#line 314 "ppy.y" - { (yyval.sint) = nmacro_args; } -#line 1796 "ppy.tab.c" - break; - - case 39: -#line 317 "ppy.y" - { (yyval.marg) = (yyvsp[0].marg); } -#line 1802 "ppy.tab.c" - break; - - case 40: -#line 318 "ppy.y" - { (yyval.marg) = add_new_marg(NULL, arg_list); nmacro_args *= -1; } -#line 1808 "ppy.tab.c" - break; - - case 41: -#line 321 "ppy.y" - { (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); } -#line 1814 "ppy.tab.c" - break; - - case 42: -#line 322 "ppy.y" - { (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); } -#line 1820 "ppy.tab.c" - break; - - case 43: -#line 326 "ppy.y" - { (yyval.mtext) = NULL; } -#line 1826 "ppy.tab.c" - break; - - case 44: -#line 327 "ppy.y" - { - for((yyval.mtext) = (yyvsp[0].mtext); (yyval.mtext) && (yyval.mtext)->prev; (yyval.mtext) = (yyval.mtext)->prev) - ; - } -#line 1835 "ppy.tab.c" - break; - - case 45: -#line 333 "ppy.y" - { (yyval.mtext) = (yyvsp[0].mtext); } -#line 1841 "ppy.tab.c" - break; - - case 46: -#line 334 "ppy.y" - { (yyval.mtext) = combine_mtext((yyvsp[-1].mtext), (yyvsp[0].mtext)); } -#line 1847 "ppy.tab.c" - break; - - case 47: -#line 337 "ppy.y" - { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1853 "ppy.tab.c" - break; - - case 48: -#line 338 "ppy.y" - { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1859 "ppy.tab.c" - break; - - case 49: -#line 339 "ppy.y" - { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1865 "ppy.tab.c" - break; - - case 50: -#line 340 "ppy.y" - { (yyval.mtext) = new_mtext(NULL, 0, exp_concat); } -#line 1871 "ppy.tab.c" - break; - - case 51: -#line 341 "ppy.y" - { - int mat = marg_index((yyvsp[0].cptr)); - if(mat < 0) - ppy_error("Stringification identifier must be an argument parameter"); - else - (yyval.mtext) = new_mtext(NULL, mat, exp_stringize); - } -#line 1883 "ppy.tab.c" - break; - - case 52: -#line 348 "ppy.y" - { - int mat = marg_index((yyvsp[0].cptr)); - if(mat >= 0) - (yyval.mtext) = new_mtext(NULL, mat, exp_subst); - else if((yyvsp[0].cptr)) - (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); - } -#line 1895 "ppy.tab.c" - break; - - case 53: -#line 357 "ppy.y" - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = (yyvsp[0].sint); } -#line 1901 "ppy.tab.c" - break; - - case 54: -#line 358 "ppy.y" - { (yyval.cval).type = cv_uint; (yyval.cval).val.ui = (yyvsp[0].uint); } -#line 1907 "ppy.tab.c" - break; - - case 55: -#line 359 "ppy.y" - { (yyval.cval).type = cv_slong; (yyval.cval).val.sl = (yyvsp[0].slong); } -#line 1913 "ppy.tab.c" - break; - - case 56: -#line 360 "ppy.y" - { (yyval.cval).type = cv_ulong; (yyval.cval).val.ul = (yyvsp[0].ulong); } -#line 1919 "ppy.tab.c" - break; - - case 57: -#line 361 "ppy.y" - { (yyval.cval).type = cv_sll; (yyval.cval).val.sll = (yyvsp[0].sll); } -#line 1925 "ppy.tab.c" - break; - - case 58: -#line 362 "ppy.y" - { (yyval.cval).type = cv_ull; (yyval.cval).val.ull = (yyvsp[0].ull); } -#line 1931 "ppy.tab.c" - break; - - case 59: -#line 363 "ppy.y" - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[0].cptr)) != NULL; } -#line 1937 "ppy.tab.c" - break; - - case 60: -#line 364 "ppy.y" - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[-1].cptr)) != NULL; } -#line 1943 "ppy.tab.c" - break; - - case 61: -#line 365 "ppy.y" - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = 0; } -#line 1949 "ppy.tab.c" - break; - - case 62: -#line 366 "ppy.y" - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) || boolean(&(yyvsp[0].cval)); } -#line 1955 "ppy.tab.c" - break; - - case 63: -#line 367 "ppy.y" - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) && boolean(&(yyvsp[0].cval)); } -#line 1961 "ppy.tab.c" - break; - - case 64: -#line 368 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ==); } -#line 1967 "ppy.tab.c" - break; - - case 65: -#line 369 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), !=); } -#line 1973 "ppy.tab.c" - break; - - case 66: -#line 370 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <); } -#line 1979 "ppy.tab.c" - break; - - case 67: -#line 371 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >); } -#line 1985 "ppy.tab.c" - break; - - case 68: -#line 372 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <=); } -#line 1991 "ppy.tab.c" - break; - - case 69: -#line 373 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >=); } -#line 1997 "ppy.tab.c" - break; - - case 70: -#line 374 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), +); } -#line 2003 "ppy.tab.c" - break; - - case 71: -#line 375 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), -); } -#line 2009 "ppy.tab.c" - break; - - case 72: -#line 376 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ^); } -#line 2015 "ppy.tab.c" - break; - - case 73: -#line 377 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), &); } -#line 2021 "ppy.tab.c" - break; - - case 74: -#line 378 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), |); } -#line 2027 "ppy.tab.c" - break; - - case 75: -#line 379 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), *); } -#line 2033 "ppy.tab.c" - break; - - case 76: -#line 380 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), /); } -#line 2039 "ppy.tab.c" - break; - - case 77: -#line 381 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <<); } -#line 2045 "ppy.tab.c" - break; - - case 78: -#line 382 "ppy.y" - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >>); } -#line 2051 "ppy.tab.c" - break; - - case 79: -#line 383 "ppy.y" - { (yyval.cval) = (yyvsp[0].cval); } -#line 2057 "ppy.tab.c" - break; - - case 80: -#line 384 "ppy.y" - { UNARY_OP((yyval.cval), (yyvsp[0].cval), -); } -#line 2063 "ppy.tab.c" - break; - - case 81: -#line 385 "ppy.y" - { UNARY_OP((yyval.cval), (yyvsp[0].cval), ~); } -#line 2069 "ppy.tab.c" - break; - - case 82: -#line 386 "ppy.y" - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = !boolean(&(yyvsp[0].cval)); } -#line 2075 "ppy.tab.c" - break; - - case 83: -#line 387 "ppy.y" - { (yyval.cval) = (yyvsp[-1].cval); } -#line 2081 "ppy.tab.c" - break; - - case 84: -#line 388 "ppy.y" - { (yyval.cval) = boolean(&(yyvsp[-4].cval)) ? (yyvsp[-2].cval) : (yyvsp[0].cval); } -#line 2087 "ppy.tab.c" - break; - - -#line 2091 "ppy.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 391 "ppy.y" - - -/* - ************************************************************************** - * Support functions - ************************************************************************** - */ - -static void cast_to_sint(cval_t *v) -{ - switch(v->type) - { - case cv_sint: break; - case cv_uint: break; - case cv_slong: v->val.si = v->val.sl; break; - case cv_ulong: v->val.si = v->val.ul; break; - case cv_sll: v->val.si = v->val.sll; break; - case cv_ull: v->val.si = v->val.ull; break; - } - v->type = cv_sint; -} - -static void cast_to_uint(cval_t *v) -{ - switch(v->type) - { - case cv_sint: break; - case cv_uint: break; - case cv_slong: v->val.ui = v->val.sl; break; - case cv_ulong: v->val.ui = v->val.ul; break; - case cv_sll: v->val.ui = v->val.sll; break; - case cv_ull: v->val.ui = v->val.ull; break; - } - v->type = cv_uint; -} - -static void cast_to_slong(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.sl = v->val.si; break; - case cv_uint: v->val.sl = v->val.ui; break; - case cv_slong: break; - case cv_ulong: break; - case cv_sll: v->val.sl = v->val.sll; break; - case cv_ull: v->val.sl = v->val.ull; break; - } - v->type = cv_slong; -} - -static void cast_to_ulong(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.ul = v->val.si; break; - case cv_uint: v->val.ul = v->val.ui; break; - case cv_slong: break; - case cv_ulong: break; - case cv_sll: v->val.ul = v->val.sll; break; - case cv_ull: v->val.ul = v->val.ull; break; - } - v->type = cv_ulong; -} - -static void cast_to_sll(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.sll = v->val.si; break; - case cv_uint: v->val.sll = v->val.ui; break; - case cv_slong: v->val.sll = v->val.sl; break; - case cv_ulong: v->val.sll = v->val.ul; break; - case cv_sll: break; - case cv_ull: break; - } - v->type = cv_sll; -} - -static void cast_to_ull(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.ull = v->val.si; break; - case cv_uint: v->val.ull = v->val.ui; break; - case cv_slong: v->val.ull = v->val.sl; break; - case cv_ulong: v->val.ull = v->val.ul; break; - case cv_sll: break; - case cv_ull: break; - } - v->type = cv_ull; -} - - -static void promote_equal_size(cval_t *v1, cval_t *v2) -{ -#define cv_sizeof(v) ((int)(v->type & SIZE_MASK)) - int s1 = cv_sizeof(v1); - int s2 = cv_sizeof(v2); -#undef cv_sizeof - - if(s1 == s2) - return; - else if(s1 > s2) - { - switch(v1->type) - { - case cv_sint: cast_to_sint(v2); break; - case cv_uint: cast_to_uint(v2); break; - case cv_slong: cast_to_slong(v2); break; - case cv_ulong: cast_to_ulong(v2); break; - case cv_sll: cast_to_sll(v2); break; - case cv_ull: cast_to_ull(v2); break; - } - } - else - { - switch(v2->type) - { - case cv_sint: cast_to_sint(v1); break; - case cv_uint: cast_to_uint(v1); break; - case cv_slong: cast_to_slong(v1); break; - case cv_ulong: cast_to_ulong(v1); break; - case cv_sll: cast_to_sll(v1); break; - case cv_ull: cast_to_ull(v1); break; - } - } -} - - -static int boolean(cval_t *v) -{ - switch(v->type) - { - case cv_sint: return v->val.si != 0; - case cv_uint: return v->val.ui != 0; - case cv_slong: return v->val.sl != 0; - case cv_ulong: return v->val.ul != 0; - case cv_sll: return v->val.sll != 0; - case cv_ull: return v->val.ull != 0; - } - return 0; -} - -static marg_t *new_marg(char *str, def_arg_t type) -{ - marg_t *ma = pp_xmalloc(sizeof(marg_t)); - if(!ma) - return NULL; - ma->arg = str; - ma->type = type; - ma->nnl = 0; - return ma; -} - -static marg_t *add_new_marg(char *str, def_arg_t type) -{ - marg_t **new_macro_args; - marg_t *ma; - if(!str) - return NULL; - new_macro_args = pp_xrealloc(macro_args, (nmacro_args+1) * sizeof(macro_args[0])); - if(!new_macro_args) - return NULL; - macro_args = new_macro_args; - ma = new_marg(str, type); - if(!ma) - return NULL; - macro_args[nmacro_args] = ma; - nmacro_args++; - return ma; -} - -static int marg_index(char *id) -{ - int t; - if(!id) - return -1; - for(t = 0; t < nmacro_args; t++) - { - if(!strcmp(id, macro_args[t]->arg)) - break; - } - return t < nmacro_args ? t : -1; -} - -static mtext_t *new_mtext(char *str, int idx, def_exp_t type) -{ - mtext_t *mt = pp_xmalloc(sizeof(mtext_t)); - if(!mt) - return NULL; - if(str == NULL) - mt->subst.argidx = idx; - else - mt->subst.text = str; - mt->type = type; - mt->next = mt->prev = NULL; - return mt; -} - -static mtext_t *combine_mtext(mtext_t *tail, mtext_t *mtp) -{ - if(!tail) - return mtp; - - if(!mtp) - return tail; - - if(tail->type == exp_text && mtp->type == exp_text) - { - char *new_text; - new_text = pp_xrealloc(tail->subst.text, strlen(tail->subst.text)+strlen(mtp->subst.text)+1); - if(!new_text) - return mtp; - tail->subst.text = new_text; - strcat(tail->subst.text, mtp->subst.text); - free(mtp->subst.text); - free(mtp); - return tail; - } - - if(tail->type == exp_concat && mtp->type == exp_concat) - { - free(mtp); - return tail; - } - - if(tail->type == exp_concat && mtp->type == exp_text) - { - int len = strlen(mtp->subst.text); - while(len) - { -/* FIXME: should delete space from head of string */ - if(isspace(mtp->subst.text[len-1] & 0xff)) - mtp->subst.text[--len] = '\0'; - else - break; - } - - if(!len) - { - free(mtp->subst.text); - free(mtp); - return tail; - } - } - - if(tail->type == exp_text && mtp->type == exp_concat) - { - int len = strlen(tail->subst.text); - while(len) - { - if(isspace(tail->subst.text[len-1] & 0xff)) - tail->subst.text[--len] = '\0'; - else - break; - } - - if(!len) - { - mtp->prev = tail->prev; - mtp->next = tail->next; - if(tail->prev) - tail->prev->next = mtp; - free(tail->subst.text); - free(tail); - return mtp; - } - } - - tail->next = mtp; - mtp->prev = tail; - - return mtp; -} - -static char *merge_text(char *s1, char *s2) -{ - int l1; - int l2; - char *snew; - if(!s1) - return s2; - if(!s2) - return s1; - l1 = strlen(s1); - l2 = strlen(s2); - snew = pp_xrealloc(s1, l1+l2+1); - if(!snew) - { - free(s2); - return s1; - } - s1 = snew; - memcpy(s1+l1, s2, l2+1); - free(s2); - return s1; -} diff --git a/dll/directx/wine/d3dcompiler_43/ppy.tab.h b/dll/directx/wine/d3dcompiler_43/ppy.tab.h deleted file mode 100644 index c8f60ea7d38..00000000000 --- a/dll/directx/wine/d3dcompiler_43/ppy.tab.h +++ /dev/null @@ -1,129 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_PPY_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_PPY_TAB_H_INCLUDED -# define YY_PPY_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_PPY_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int ppy_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tRCINCLUDE = 258, - tIF = 259, - tIFDEF = 260, - tIFNDEF = 261, - tELSE = 262, - tELIF = 263, - tENDIF = 264, - tDEFINED = 265, - tNL = 266, - tINCLUDE = 267, - tLINE = 268, - tGCCLINE = 269, - tERROR = 270, - tWARNING = 271, - tPRAGMA = 272, - tPPIDENT = 273, - tUNDEF = 274, - tMACROEND = 275, - tCONCAT = 276, - tELIPSIS = 277, - tSTRINGIZE = 278, - tIDENT = 279, - tLITERAL = 280, - tMACRO = 281, - tDEFINE = 282, - tDQSTRING = 283, - tSQSTRING = 284, - tIQSTRING = 285, - tUINT = 286, - tSINT = 287, - tULONG = 288, - tSLONG = 289, - tULONGLONG = 290, - tSLONGLONG = 291, - tRCINCLUDEPATH = 292, - tLOGOR = 293, - tLOGAND = 294, - tEQ = 295, - tNE = 296, - tLTE = 297, - tGTE = 298, - tLSHIFT = 299, - tRSHIFT = 300 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 114 "ppy.y" - - int sint; - unsigned int uint; - long slong; - unsigned long ulong; - __int64 sll; - unsigned __int64 ull; - int *iptr; - char *cptr; - cval_t cval; - marg_t *marg; - mtext_t *mtext; - -#line 117 "ppy.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE ppy_lval; - -int ppy_parse (void); - -#endif /* !YY_PPY_E_REACTOSSYNC_GCC_DLL_DIRECTX_WINE_D3DCOMPILER_43_PPY_TAB_H_INCLUDED */ diff --git a/dll/win32/jscript/CMakeLists.txt b/dll/win32/jscript/CMakeLists.txt index 39f50011c05..6337587d67a 100644 --- a/dll/win32/jscript/CMakeLists.txt +++ b/dll/win32/jscript/CMakeLists.txt @@ -34,12 +34,12 @@ list(APPEND SOURCE string.c vbarray.c) -list(APPEND PCH_SKIP_SOURCE - cc_parser.tab.c - parser.tab.c) +BISON_TARGET(cc_parser cc_parser.y ${CMAKE_CURRENT_BINARY_DIR}/cc_parser.tab.c COMPILE_FLAGS "-p cc_parser_") +BISON_TARGET(parser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.tab.c COMPILE_FLAGS "-p parser_") -# cc_parser.tab.c/parser.tab.c have been generated with relative file paths... -set_source_files_properties(cc_parser.tab.c parser.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") +list(APPEND PCH_SKIP_SOURCE + ${BISON_cc_parser_OUTPUTS} + ${BISON_parser_OUTPUTS}) list(APPEND jscript_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/jscript.rgs diff --git a/dll/win32/jscript/cc_parser.tab.c b/dll/win32/jscript/cc_parser.tab.c deleted file mode 100644 index beafd15e5c2..00000000000 --- a/dll/win32/jscript/cc_parser.tab.c +++ /dev/null @@ -1,1846 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse cc_parser_parse -#define yylex cc_parser_lex -#define yyerror cc_parser_error -#define yydebug cc_parser_debug -#define yynerrs cc_parser_nerrs - - -/* First part of user prologue. */ -#line 19 "cc_parser.y" - - -#include "jscript.h" -#include "engine.h" -#include "parser.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(jscript); - - -#line 88 "cc_parser.tab.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED -# define YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int cc_parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tEQ = 258, - tEQEQ = 259, - tNEQ = 260, - tNEQEQ = 261, - tLSHIFT = 262, - tRSHIFT = 263, - tRRSHIFT = 264, - tOR = 265, - tAND = 266, - tLEQ = 267, - tGEQ = 268, - tCCValue = 269 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 36 "cc_parser.y" - - ccval_t ccval; - -#line 150 "cc_parser.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int cc_parser_parse (parser_ctx_t *ctx); - -#endif /* !YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED */ - -/* Second part of user prologue. */ -#line 47 "cc_parser.y" - - -static int cc_parser_error(parser_ctx_t *ctx, const char *str) -{ - if(SUCCEEDED(ctx->hres)) { - WARN("%s\n", str); - ctx->hres = JS_E_SYNTAX; - } - - return 0; -} - -static int cc_parser_lex(void *lval, parser_ctx_t *ctx) -{ - int r; - - r = try_parse_ccval(ctx, lval); - if(r) - return r > 0 ? tCCValue : -1; - - switch(*ctx->ptr) { - case '(': - case ')': - case '+': - case '-': - case '*': - case '/': - case '~': - case '%': - case '^': - return *ctx->ptr++; - case '=': - if(*++ctx->ptr == '=') { - if(*++ctx->ptr == '=') { - ctx->ptr++; - return tEQEQ; - } - return tEQ; - } - break; - case '!': - if(*++ctx->ptr == '=') { - if(*++ctx->ptr == '=') { - ctx->ptr++; - return tNEQEQ; - } - return tNEQ; - } - return '!'; - case '<': - switch(*++ctx->ptr) { - case '<': - ctx->ptr++; - return tLSHIFT; - case '=': - ctx->ptr++; - return tLEQ; - default: - return '<'; - } - case '>': - switch(*++ctx->ptr) { - case '>': - if(*++ctx->ptr == '>') { - ctx->ptr++; - return tRRSHIFT; - } - return tRSHIFT; - case '=': - ctx->ptr++; - return tGEQ; - default: - return '>'; - } - case '|': - if(*++ctx->ptr == '|') { - ctx->ptr++; - return tOR; - } - return '|'; - case '&': - if(*++ctx->ptr == '&') { - ctx->ptr++; - return tAND; - } - return '&'; - } - - WARN("Failed to interpret %s\n", debugstr_w(ctx->ptr)); - return -1; -} - - -#line 259 "cc_parser.tab.c" - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 24 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 57 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 29 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 13 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 39 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 69 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 269 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 17, 2, 2, 2, 28, 23, 2, - 15, 16, 26, 19, 2, 20, 2, 27, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 24, 2, 25, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 22, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 21, 2, 18, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint8 yyrline[] = -{ - 0, 146, 146, 149, 150, 151, 152, 153, 154, 157, - 158, 162, 163, 167, 168, 172, 173, 177, 178, 182, - 183, 185, 187, 189, 193, 194, 196, 198, 200, 204, - 205, 207, 209, 213, 214, 216, 220, 221, 223, 225 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "tEQ", "tEQEQ", "tNEQ", "tNEQEQ", - "tLSHIFT", "tRSHIFT", "tRRSHIFT", "tOR", "tAND", "tLEQ", "tGEQ", - "tCCValue", "'('", "')'", "'!'", "'~'", "'+'", "'-'", "'|'", "'^'", - "'&'", "'<'", "'>'", "'*'", "'/'", "'%'", "$accept", "CCExpr", - "CCUnaryExpression", "CCLogicalORExpression", "CCLogicalANDExpression", - "CCBitwiseORExpression", "CCBitwiseXORExpression", - "CCBitwiseANDExpression", "CCEqualityExpression", - "CCRelationalExpression", "CCShiftExpression", "CCAdditiveExpression", - "CCMultiplicativeExpression", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 40, 41, 33, 126, 43, - 45, 124, 94, 38, 60, 62, 42, 47, 37 -}; -# endif - -#define YYPACT_NINF -17 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-17))) - -#define YYTABLE_NINF -1 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int8 yypact[] = -{ - 3, -17, 3, 3, 3, 3, 3, 16, -17, -17, - -1, -17, -13, 32, -4, 21, -11, 30, 31, -16, - -17, -17, -17, -17, -17, 3, -17, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, -17, 32, 9, - 9, -13, 21, -11, -11, -11, -11, 30, 30, 30, - 30, 31, 31, 31, -16, -16, -17, -17, -17 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 3, 0, 0, 0, 0, 0, 0, 2, 36, - 0, 9, 11, 13, 15, 17, 19, 24, 29, 33, - 5, 6, 7, 8, 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 10, 14, 15, - 16, 12, 18, 20, 22, 21, 23, 26, 28, 25, - 27, 30, 31, 32, 34, 35, 37, 38, 39 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -17, -17, 0, -17, 18, 26, 29, 13, 27, -3, - -2, 8, 10 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 7, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 8, 35, 36, 20, 21, 22, 23, 29, 27, 25, - 44, 45, 46, 37, 38, 26, 24, 1, 2, 30, - 3, 4, 5, 6, 31, 32, 33, 34, 53, 54, - 55, 56, 30, 57, 58, 59, 60, 39, 40, 41, - 49, 50, 49, 47, 66, 67, 68, 61, 62, 63, - 42, 43, 64, 65, 28, 51, 48, 52 -}; - -static const yytype_uint8 yycheck[] = -{ - 0, 12, 13, 3, 4, 5, 6, 11, 21, 10, - 26, 27, 28, 24, 25, 16, 0, 14, 15, 23, - 17, 18, 19, 20, 3, 4, 5, 6, 31, 32, - 33, 34, 23, 35, 36, 37, 38, 7, 8, 9, - 27, 28, 29, 25, 44, 45, 46, 39, 40, 41, - 19, 20, 42, 43, 22, 29, 27, 30 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 14, 15, 17, 18, 19, 20, 30, 31, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 31, 31, 31, 31, 0, 10, 16, 21, 22, 11, - 23, 3, 4, 5, 6, 12, 13, 24, 25, 7, - 8, 9, 19, 20, 26, 27, 28, 33, 35, 36, - 36, 34, 37, 38, 38, 38, 38, 39, 39, 39, - 39, 40, 40, 40, 41, 41, 31, 31, 31 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 29, 30, 31, 31, 31, 31, 31, 31, 32, - 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, - 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, - 39, 39, 39, 40, 40, 40, 41, 41, 41, 41 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 3, 2, 2, 2, 2, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, - 3, 3, 3, 1, 3, 3, 1, 3, 3, 3 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (ctx, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, ctx); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (ctx); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep, ctx); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - , ctx); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, ctx); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_ctx_t *ctx) -{ - YYUSE (yyvaluep); - YYUSE (ctx); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (parser_ctx_t *ctx) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, ctx); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 146 "cc_parser.y" - { ctx->ccval = (yyvsp[0].ccval); YYACCEPT; } -#line 1381 "cc_parser.tab.c" - break; - - case 3: -#line 149 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1387 "cc_parser.tab.c" - break; - - case 4: -#line 150 "cc_parser.y" - { (yyval.ccval) = (yyvsp[-1].ccval); } -#line 1393 "cc_parser.tab.c" - break; - - case 5: -#line 151 "cc_parser.y" - { (yyval.ccval) = ccval_bool(!get_ccbool((yyvsp[0].ccval))); } -#line 1399 "cc_parser.tab.c" - break; - - case 6: -#line 152 "cc_parser.y" - { FIXME("'~' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1405 "cc_parser.tab.c" - break; - - case 7: -#line 153 "cc_parser.y" - { FIXME("'+' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1411 "cc_parser.tab.c" - break; - - case 8: -#line 154 "cc_parser.y" - { FIXME("'-' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1417 "cc_parser.tab.c" - break; - - case 9: -#line 157 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1423 "cc_parser.tab.c" - break; - - case 10: -#line 159 "cc_parser.y" - { FIXME("'||' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1429 "cc_parser.tab.c" - break; - - case 11: -#line 162 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1435 "cc_parser.tab.c" - break; - - case 12: -#line 164 "cc_parser.y" - { FIXME("'&&' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1441 "cc_parser.tab.c" - break; - - case 13: -#line 167 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1447 "cc_parser.tab.c" - break; - - case 14: -#line 169 "cc_parser.y" - { FIXME("'|' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1453 "cc_parser.tab.c" - break; - - case 15: -#line 172 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1459 "cc_parser.tab.c" - break; - - case 16: -#line 174 "cc_parser.y" - { FIXME("'^' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1465 "cc_parser.tab.c" - break; - - case 17: -#line 177 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1471 "cc_parser.tab.c" - break; - - case 18: -#line 179 "cc_parser.y" - { FIXME("'&' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1477 "cc_parser.tab.c" - break; - - case 19: -#line 182 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1483 "cc_parser.tab.c" - break; - - case 20: -#line 184 "cc_parser.y" - { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) == get_ccnum((yyvsp[0].ccval))); } -#line 1489 "cc_parser.tab.c" - break; - - case 21: -#line 186 "cc_parser.y" - { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) != get_ccnum((yyvsp[0].ccval))); } -#line 1495 "cc_parser.tab.c" - break; - - case 22: -#line 188 "cc_parser.y" - { FIXME("'===' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1501 "cc_parser.tab.c" - break; - - case 23: -#line 190 "cc_parser.y" - { FIXME("'!==' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1507 "cc_parser.tab.c" - break; - - case 24: -#line 193 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1513 "cc_parser.tab.c" - break; - - case 25: -#line 195 "cc_parser.y" - { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) < get_ccnum((yyvsp[0].ccval))); } -#line 1519 "cc_parser.tab.c" - break; - - case 26: -#line 197 "cc_parser.y" - { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) <= get_ccnum((yyvsp[0].ccval))); } -#line 1525 "cc_parser.tab.c" - break; - - case 27: -#line 199 "cc_parser.y" - { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) > get_ccnum((yyvsp[0].ccval))); } -#line 1531 "cc_parser.tab.c" - break; - - case 28: -#line 201 "cc_parser.y" - { (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) >= get_ccnum((yyvsp[0].ccval))); } -#line 1537 "cc_parser.tab.c" - break; - - case 29: -#line 204 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1543 "cc_parser.tab.c" - break; - - case 30: -#line 206 "cc_parser.y" - { FIXME("'<<' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1549 "cc_parser.tab.c" - break; - - case 31: -#line 208 "cc_parser.y" - { FIXME("'>>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1555 "cc_parser.tab.c" - break; - - case 32: -#line 210 "cc_parser.y" - { FIXME("'>>>' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1561 "cc_parser.tab.c" - break; - - case 33: -#line 213 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1567 "cc_parser.tab.c" - break; - - case 34: -#line 215 "cc_parser.y" - { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) + get_ccnum((yyvsp[0].ccval))); } -#line 1573 "cc_parser.tab.c" - break; - - case 35: -#line 217 "cc_parser.y" - { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) - get_ccnum((yyvsp[0].ccval))); } -#line 1579 "cc_parser.tab.c" - break; - - case 36: -#line 220 "cc_parser.y" - { (yyval.ccval) = (yyvsp[0].ccval); } -#line 1585 "cc_parser.tab.c" - break; - - case 37: -#line 222 "cc_parser.y" - { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) * get_ccnum((yyvsp[0].ccval))); } -#line 1591 "cc_parser.tab.c" - break; - - case 38: -#line 224 "cc_parser.y" - { (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) / get_ccnum((yyvsp[0].ccval))); } -#line 1597 "cc_parser.tab.c" - break; - - case 39: -#line 226 "cc_parser.y" - { FIXME("'%%' expression not implemented\n"); ctx->hres = E_NOTIMPL; YYABORT; } -#line 1603 "cc_parser.tab.c" - break; - - -#line 1607 "cc_parser.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (ctx, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (ctx, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, ctx); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, ctx); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (ctx, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, ctx); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, ctx); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 228 "cc_parser.y" - - -BOOL parse_cc_expr(parser_ctx_t *ctx) -{ - ctx->hres = S_OK; - cc_parser_parse(ctx); - return SUCCEEDED(ctx->hres); -} diff --git a/dll/win32/jscript/cc_parser.tab.h b/dll/win32/jscript/cc_parser.tab.h deleted file mode 100644 index d09ec5e3e0a..00000000000 --- a/dll/win32/jscript/cc_parser.tab.h +++ /dev/null @@ -1,87 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED -# define YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int cc_parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tEQ = 258, - tEQEQ = 259, - tNEQ = 260, - tNEQEQ = 261, - tLSHIFT = 262, - tRSHIFT = 263, - tRRSHIFT = 264, - tOR = 265, - tAND = 266, - tLEQ = 267, - tGEQ = 268, - tCCValue = 269 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 36 "cc_parser.y" - - ccval_t ccval; - -#line 76 "cc_parser.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int cc_parser_parse (parser_ctx_t *ctx); - -#endif /* !YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED */ diff --git a/dll/win32/jscript/parser.tab.c b/dll/win32/jscript/parser.tab.c deleted file mode 100644 index 246a38ce53c..00000000000 --- a/dll/win32/jscript/parser.tab.c +++ /dev/null @@ -1,4408 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse parser_parse -#define yylex parser_lex -#define yyerror parser_error -#define yydebug parser_debug -#define yynerrs parser_nerrs - - -/* First part of user prologue. */ -#line 19 "parser.y" - - -#include "jscript.h" -#include "engine.h" -#include "parser.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(jscript); - -static int parser_error(parser_ctx_t*,const char*); -static void set_error(parser_ctx_t*,UINT); -static BOOL explicit_error(parser_ctx_t*,void*,WCHAR); -static BOOL allow_auto_semicolon(parser_ctx_t*); -static void program_parsed(parser_ctx_t*,source_elements_t*); - -typedef struct _statement_list_t { - statement_t *head; - statement_t *tail; -} statement_list_t; - -static literal_t *new_string_literal(parser_ctx_t*,jsstr_t*); -static literal_t *new_null_literal(parser_ctx_t*); - -typedef struct _property_list_t { - property_definition_t *head; - property_definition_t *tail; -} property_list_t; - -static property_definition_t *new_property_definition(parser_ctx_t *ctx, property_definition_type_t, - literal_t *name, expression_t *value); -static property_list_t *new_property_list(parser_ctx_t*,property_definition_t*); -static property_list_t *property_list_add(parser_ctx_t*,property_list_t*,property_definition_t*); - -typedef struct _element_list_t { - array_element_t *head; - array_element_t *tail; -} element_list_t; - -static element_list_t *new_element_list(parser_ctx_t*,int,expression_t*); -static element_list_t *element_list_add(parser_ctx_t*,element_list_t*,int,expression_t*); - -typedef struct _argument_list_t { - argument_t *head; - argument_t *tail; -} argument_list_t; - -static argument_list_t *new_argument_list(parser_ctx_t*,expression_t*); -static argument_list_t *argument_list_add(parser_ctx_t*,argument_list_t*,expression_t*); - -typedef struct _case_list_t { - case_clausule_t *head; - case_clausule_t *tail; -} case_list_t; - -static catch_block_t *new_catch_block(parser_ctx_t*,const WCHAR*,statement_t*); -static case_clausule_t *new_case_clausule(parser_ctx_t*,expression_t*,statement_list_t*); -static case_list_t *new_case_list(parser_ctx_t*,case_clausule_t*); -static case_list_t *case_list_add(parser_ctx_t*,case_list_t*,case_clausule_t*); -static case_clausule_t *new_case_block(parser_ctx_t*,case_list_t*,case_clausule_t*,case_list_t*); - -typedef struct _variable_list_t { - variable_declaration_t *head; - variable_declaration_t *tail; -} variable_list_t; - -static variable_declaration_t *new_variable_declaration(parser_ctx_t*,const WCHAR*,expression_t*); -static variable_list_t *new_variable_list(parser_ctx_t*,variable_declaration_t*); -static variable_list_t *variable_list_add(parser_ctx_t*,variable_list_t*,variable_declaration_t*); - -static void *new_statement(parser_ctx_t*,statement_type_t,size_t); -static statement_t *new_block_statement(parser_ctx_t*,statement_list_t*); -static statement_t *new_var_statement(parser_ctx_t*,variable_list_t*); -static statement_t *new_expression_statement(parser_ctx_t*,expression_t*); -static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,statement_t*); -static statement_t *new_while_statement(parser_ctx_t*,BOOL,expression_t*,statement_t*); -static statement_t *new_for_statement(parser_ctx_t*,variable_list_t*,expression_t*,expression_t*, - expression_t*,statement_t*); -static statement_t *new_forin_statement(parser_ctx_t*,variable_declaration_t*,expression_t*,expression_t*,statement_t*); -static statement_t *new_continue_statement(parser_ctx_t*,const WCHAR*); -static statement_t *new_break_statement(parser_ctx_t*,const WCHAR*); -static statement_t *new_return_statement(parser_ctx_t*,expression_t*); -static statement_t *new_with_statement(parser_ctx_t*,expression_t*,statement_t*); -static statement_t *new_labelled_statement(parser_ctx_t*,const WCHAR*,statement_t*); -static statement_t *new_switch_statement(parser_ctx_t*,expression_t*,case_clausule_t*); -static statement_t *new_throw_statement(parser_ctx_t*,expression_t*); -static statement_t *new_try_statement(parser_ctx_t*,statement_t*,catch_block_t*,statement_t*); - -struct statement_list_t { - statement_t *head; - statement_t *tail; -}; - -static statement_list_t *new_statement_list(parser_ctx_t*,statement_t*); -static statement_list_t *statement_list_add(statement_list_t*,statement_t*); - -typedef struct _parameter_list_t { - parameter_t *head; - parameter_t *tail; -} parameter_list_t; - -static parameter_list_t *new_parameter_list(parser_ctx_t*,const WCHAR*); -static parameter_list_t *parameter_list_add(parser_ctx_t*,parameter_list_t*,const WCHAR*); - -static void *new_expression(parser_ctx_t *ctx,expression_type_t,size_t); -static expression_t *new_function_expression(parser_ctx_t*,const WCHAR*,parameter_list_t*, - source_elements_t*,const WCHAR*,const WCHAR*,DWORD); -static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expression_t*,expression_t*); -static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expression_t*); -static expression_t *new_conditional_expression(parser_ctx_t*,expression_t*,expression_t*,expression_t*); -static expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*); -static expression_t *new_new_expression(parser_ctx_t*,expression_t*,argument_list_t*); -static expression_t *new_call_expression(parser_ctx_t*,expression_t*,argument_list_t*); -static expression_t *new_identifier_expression(parser_ctx_t*,const WCHAR*); -static expression_t *new_literal_expression(parser_ctx_t*,literal_t*); -static expression_t *new_array_literal_expression(parser_ctx_t*,element_list_t*,int); -static expression_t *new_prop_and_value_expression(parser_ctx_t*,property_list_t*); - -static source_elements_t *new_source_elements(parser_ctx_t*); -static source_elements_t *source_elements_add_statement(source_elements_t*,statement_t*); - - -#line 199 "parser.tab.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED -# define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - kBREAK = 258, - kCASE = 259, - kCATCH = 260, - kCONTINUE = 261, - kDEFAULT = 262, - kDELETE = 263, - kDO = 264, - kELSE = 265, - kFUNCTION = 266, - kIF = 267, - kFINALLY = 268, - kFOR = 269, - kGET = 270, - kIN = 271, - kSET = 272, - kINSTANCEOF = 273, - kNEW = 274, - kNULL = 275, - kRETURN = 276, - kSWITCH = 277, - kTHIS = 278, - kTHROW = 279, - kTRUE = 280, - kFALSE = 281, - kTRY = 282, - kTYPEOF = 283, - kVAR = 284, - kVOID = 285, - kWHILE = 286, - kWITH = 287, - tANDAND = 288, - tOROR = 289, - tINC = 290, - tDEC = 291, - tHTMLCOMMENT = 292, - kDIVEQ = 293, - kDCOL = 294, - tIdentifier = 295, - tAssignOper = 296, - tEqOper = 297, - tShiftOper = 298, - tRelOper = 299, - tNumericLiteral = 300, - tBooleanLiteral = 301, - tStringLiteral = 302, - tEOF = 303, - LOWER_THAN_ELSE = 304 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 147 "parser.y" - - int ival; - const WCHAR *srcptr; - jsstr_t *str; - literal_t *literal; - struct _argument_list_t *argument_list; - case_clausule_t *case_clausule; - struct _case_list_t *case_list; - catch_block_t *catch_block; - struct _element_list_t *element_list; - expression_t *expr; - const WCHAR *identifier; - struct _parameter_list_t *parameter_list; - struct _property_list_t *property_list; - property_definition_t *property_definition; - source_elements_t *source_elements; - statement_t *statement; - struct _statement_list_t *statement_list; - struct _variable_list_t *variable_list; - variable_declaration_t *variable_declaration; - -#line 314 "parser.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int parser_parse (parser_ctx_t *ctx); - -#endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1393 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 72 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 99 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 254 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 454 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 304 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 66, 2, 2, 2, 64, 59, 2, - 70, 71, 62, 60, 52, 61, 69, 63, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 55, 54, - 2, 53, 2, 56, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 67, 2, 68, 58, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 51, 57, 40, 65, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 258, 258, 262, 263, 267, 268, 273, 275, 277, - 281, 285, 289, 290, 295, 296, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 318, 319, 324, 325, 329, 330, 334, 339, 340, - 345, 347, 352, 357, 362, 363, 367, 372, 373, 377, - 382, 386, 391, 393, 398, 400, 403, 405, 402, 409, - 411, 408, 414, 416, 421, 426, 431, 436, 441, 446, - 451, 453, 458, 459, 463, 464, 469, 474, 479, 484, - 485, 486, 491, 496, 500, 501, 504, 505, 509, 510, - 515, 516, 520, 522, 526, 527, 531, 532, 534, 539, - 541, 543, 548, 549, 554, 556, 561, 562, 567, 569, - 574, 575, 580, 582, 587, 588, 593, 595, 600, 601, - 606, 608, 613, 614, 619, 621, 626, 627, 632, 633, - 638, 639, 641, 643, 648, 649, 651, 656, 657, 662, - 664, 666, 671, 672, 674, 676, 681, 682, 684, 685, - 687, 688, 689, 690, 691, 692, 696, 698, 700, 706, - 707, 711, 712, 716, 717, 718, 720, 722, 727, 729, - 731, 733, 738, 739, 743, 744, 749, 750, 751, 752, - 753, 754, 758, 759, 760, 761, 766, 768, 773, 774, - 778, 779, 783, 784, 786, 797, 798, 803, 805, 807, - 811, 816, 817, 818, 822, 823, 827, 828, 839, 840, - 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, - 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, - 861, 862, 863, 864, 865, 866, 867, 868, 872, 873, - 874, 875, 876, 878, 883, 884, 885, 888, 889, 892, - 893, 896, 897, 900, 901 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "kBREAK", "kCASE", "kCATCH", "kCONTINUE", - "kDEFAULT", "kDELETE", "kDO", "kELSE", "kFUNCTION", "kIF", "kFINALLY", - "kFOR", "kGET", "kIN", "kSET", "kINSTANCEOF", "kNEW", "kNULL", "kRETURN", - "kSWITCH", "kTHIS", "kTHROW", "kTRUE", "kFALSE", "kTRY", "kTYPEOF", - "kVAR", "kVOID", "kWHILE", "kWITH", "tANDAND", "tOROR", "tINC", "tDEC", - "tHTMLCOMMENT", "kDIVEQ", "kDCOL", "'}'", "tIdentifier", "tAssignOper", - "tEqOper", "tShiftOper", "tRelOper", "tNumericLiteral", - "tBooleanLiteral", "tStringLiteral", "tEOF", "LOWER_THAN_ELSE", "'{'", - "','", "'='", "';'", "':'", "'?'", "'|'", "'^'", "'&'", "'+'", "'-'", - "'*'", "'/'", "'%'", "'~'", "'!'", "'['", "']'", "'.'", "'('", "')'", - "$accept", "Program", "HtmlComment", "SourceElements", - "FunctionExpression", "KFunction", "FunctionBody", "FormalParameterList", - "FormalParameterList_opt", "Statement", "StatementList", - "StatementList_opt", "Block", "VariableStatement", - "VariableDeclarationList", "VariableDeclarationListNoIn", - "VariableDeclaration", "VariableDeclarationNoIn", "Initialiser_opt", - "Initialiser", "InitialiserNoIn_opt", "InitialiserNoIn", - "EmptyStatement", "ExpressionStatement", "IfStatement", - "IterationStatement", "$@1", "$@2", "$@3", "$@4", "ContinueStatement", - "BreakStatement", "ReturnStatement", "WithStatement", - "LabelledStatement", "SwitchStatement", "CaseBlock", "CaseClausules_opt", - "CaseClausules", "CaseClausule", "DefaultClausule", "ThrowStatement", - "TryStatement", "Catch", "Finally", "Expression_opt", "Expression_err", - "Expression", "ExpressionNoIn_opt", "ExpressionNoIn", "AssignOper", - "AssignmentExpression", "AssignmentExpressionNoIn", - "ConditionalExpression", "ConditionalExpressionNoIn", - "LogicalORExpression", "LogicalORExpressionNoIn", "LogicalANDExpression", - "LogicalANDExpressionNoIn", "BitwiseORExpression", - "BitwiseORExpressionNoIn", "BitwiseXORExpression", - "BitwiseXORExpressionNoIn", "BitwiseANDExpression", - "BitwiseANDExpressionNoIn", "EqualityExpression", - "EqualityExpressionNoIn", "RelationalExpression", - "RelationalExpressionNoIn", "ShiftExpression", "AdditiveExpression", - "MultiplicativeExpression", "UnaryExpression", "PostfixExpression", - "LeftHandSideExpression", "NewExpression", "MemberExpression", - "CallExpression", "Arguments", "ArgumentList", "PrimaryExpression", - "ArrayLiteral", "ElementList", "Elision", "Elision_opt", "ObjectLiteral", - "PropertyNameAndValueList", "PropertyDefinition", "GetterSetterMethod", - "PropertyName", "Identifier_opt", "IdentifierName", - "ReservedAsIdentifier", "Literal", "BooleanLiteral", "semicolon_opt", - "left_bracket", "right_bracket", "semicolon", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 125, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 123, 44, 61, 59, 58, 63, 124, 94, 38, - 43, 45, 42, 47, 37, 126, 33, 91, 93, 46, - 40, 41 -}; -# endif - -#define YYPACT_NINF -361 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-361))) - -#define YYTABLE_NINF -238 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -361, 82, 649, -361, -15, -15, 1146, 844, -361, 60, - 60, 236, -361, 1146, 60, -361, 1146, -361, -361, 14, - 1146, 73, 1146, 60, 60, 1146, 1146, -361, -361, 72, - -361, -361, -361, 584, -361, 1146, 1146, -361, 1146, 1146, - 94, 1146, 88, 472, 36, -361, -361, -361, -361, -361, - -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, - 51, -361, -361, 86, 123, 124, 130, 145, 163, 22, - 183, -5, 182, -361, -361, 155, -361, 219, 224, -361, - -361, -361, -361, -361, -361, 31, 31, -361, 1214, -361, - -361, 230, 217, -361, -361, 434, 965, -361, 219, 31, - 205, 1146, 51, 714, 198, -361, 197, 59, -361, -361, - 434, 1146, -361, -361, 844, 9, -361, -361, 114, -361, - 1146, 844, -361, 212, 38, -361, 79, 1306, -361, 1306, - -361, 236, 221, 1025, 83, 223, 1146, 226, 246, 14, - 1146, 73, 1146, 95, 103, 517, 72, 249, 250, -361, - 779, 149, -361, 252, -361, -361, -361, -361, -361, -361, - -361, -361, 102, 107, 1146, 17, -361, 93, 244, -361, - 1146, -361, -361, 1146, 1146, 1146, 1146, 1146, 1146, 1146, - 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, -361, - -361, -361, -361, 1146, 1146, 1146, 1352, 904, -361, 1146, - 1352, -361, -361, -361, -361, -361, -361, -361, -361, -361, - -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, - -361, -361, -361, -361, -361, -361, -361, -361, -361, 60, - -361, 24, 205, 251, -361, 256, -361, -361, 111, 276, - 253, 255, 258, 272, 98, 183, 237, -361, -361, 16, - -361, -361, 60, 14, 305, -361, 1146, -361, -361, 73, - -361, 24, 16, -361, -361, -361, 60, 60, -361, -361, - -361, 1260, 1146, 267, -361, -361, -361, -361, -361, 279, - 244, -361, 269, 24, -361, 123, 270, 124, 130, 145, - 163, 22, 183, 183, 183, -5, 182, 182, -361, -361, - -361, -361, -361, 108, -361, -361, -361, 26, 116, -361, - 434, -361, -361, 844, 271, 274, 306, 48, 1146, 1146, - 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 434, 1146, - 1146, 277, 286, -361, -361, -361, -361, 844, 844, -361, - 244, -361, -361, -361, -361, 278, 1085, 60, 24, 288, - 280, 1146, -361, 1146, -361, -361, 24, 322, 1146, -361, - -361, 251, 48, 434, -361, -361, 1146, -361, 216, 276, - 282, 253, 255, 258, 272, 98, 183, 183, 24, -361, - -361, 329, -361, 24, -361, -361, 24, -361, -361, 244, - 283, -361, -361, -361, -361, 31, 844, -361, -361, 1146, - 24, -361, 1146, 844, 1146, 46, 329, -361, 14, 289, - 24, -361, 844, 301, -361, -361, -361, 844, 48, -361, - -361, 186, 287, -361, 329, -361, -361, -361, 292, 309, - -361, 48, -361, 1146, 844, 844, 310, 312, -361, -361, - 1146, 24, 844, -361, -361, -361, -361, 313, 24, 844, - -361, 844, -361, -361 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 5, 0, 4, 1, 204, 204, 0, 0, 10, 0, - 0, 0, 238, 84, 0, 176, 0, 244, 245, 0, - 0, 0, 0, 0, 0, 0, 0, 3, 243, 177, - 240, 246, 241, 0, 50, 0, 0, 242, 0, 0, - 190, 0, 0, 19, 0, 6, 16, 17, 18, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 0, 88, 96, 102, 106, 110, 114, 118, 122, 126, - 130, 137, 139, 142, 146, 156, 159, 161, 160, 163, - 179, 180, 178, 239, 205, 0, 0, 177, 0, 164, - 147, 156, 0, 250, 249, 0, 90, 162, 161, 0, - 85, 0, 0, 0, 0, 149, 44, 0, 38, 148, - 0, 0, 150, 151, 0, 204, 209, 210, 204, 212, - 213, 214, 215, 10, 0, 217, 0, 220, 222, 227, - 223, 224, 238, 84, 0, 176, 230, 244, 245, 232, - 233, 234, 235, 0, 0, 36, 177, 240, 241, 31, - 0, 0, 195, 0, 201, 207, 152, 153, 154, 155, - 188, 182, 0, 191, 0, 0, 2, 0, 14, 248, - 0, 247, 51, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, - 158, 95, 94, 0, 0, 0, 0, 0, 168, 0, - 0, 169, 65, 64, 208, 211, 213, 214, 219, 221, - 218, 224, 225, 226, 228, 229, 230, 231, 216, 232, - 233, 234, 235, 236, 237, 192, 206, 203, 202, 0, - 87, 0, 86, 0, 56, 91, 92, 99, 104, 108, - 112, 116, 120, 124, 128, 134, 156, 167, 66, 0, - 78, 36, 0, 0, 79, 80, 0, 42, 45, 0, - 37, 0, 0, 68, 220, 227, 0, 0, 35, 32, - 193, 0, 0, 190, 184, 189, 183, 186, 181, 0, - 14, 12, 15, 0, 89, 107, 0, 111, 115, 119, - 123, 127, 133, 132, 131, 138, 140, 141, 143, 144, - 145, 97, 98, 0, 166, 172, 174, 0, 0, 171, - 0, 252, 251, 0, 47, 59, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 83, 81, 46, 39, 0, 0, 198, - 14, 199, 194, 196, 197, 191, 0, 0, 0, 0, - 0, 0, 165, 0, 173, 170, 0, 53, 0, 43, - 48, 0, 0, 0, 254, 253, 84, 93, 156, 109, - 0, 113, 117, 121, 125, 129, 136, 135, 0, 100, - 101, 72, 69, 0, 55, 67, 0, 185, 187, 14, - 0, 13, 5, 103, 175, 0, 0, 49, 41, 84, - 0, 57, 0, 0, 0, 0, 73, 74, 0, 0, - 0, 5, 11, 0, 54, 52, 60, 0, 0, 105, - 62, 0, 0, 70, 72, 75, 82, 5, 0, 0, - 7, 0, 63, 84, 33, 33, 0, 0, 5, 8, - 84, 0, 34, 76, 77, 71, 200, 0, 0, 0, - 9, 0, 58, 61 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -361, -361, -361, 345, -2, -361, -357, -361, -261, 1, - -164, -70, -10, -361, -361, -361, 109, 8, -361, -361, - -361, -361, -361, -361, -361, -361, -361, -361, -361, -361, - -361, -361, -361, -361, -361, -361, -361, -54, -361, -35, - -361, -361, -361, -361, 118, -333, -68, -12, -361, -361, - 298, -146, -284, -361, -361, -361, -361, 201, 56, 202, - 55, 203, 58, 204, 61, 200, 62, 206, 57, -90, - 207, 112, 160, -361, 37, 4, 5, -361, 74, -361, - -361, -361, -361, 110, 115, -361, -361, 120, 122, 65, - 7, -22, -361, -361, -361, -72, -3, -239, -360 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 42, 412, 89, 44, 413, 282, 283, 149, - 150, 443, 46, 47, 107, 315, 108, 316, 257, 258, - 359, 360, 48, 49, 50, 51, 317, 418, 362, 431, - 52, 53, 54, 55, 56, 57, 382, 405, 406, 407, - 424, 58, 59, 254, 255, 99, 231, 60, 234, 235, - 330, 61, 236, 62, 237, 63, 238, 64, 239, 65, - 240, 66, 241, 67, 242, 68, 243, 69, 244, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 198, 307, - 79, 80, 162, 163, 164, 81, 151, 152, 339, 153, - 85, 154, 155, 82, 83, 172, 95, 313, 366 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 43, 100, 399, 45, 102, 43, 245, 96, 92, 104, - 331, 101, 86, 202, 203, 97, 98, 311, 277, 348, - 110, 111, 337, 338, 284, 311, 84, 248, 286, 165, - 250, 43, 169, 401, 367, 260, 370, 93, 180, 93, - 181, 168, 261, 91, 350, 379, 380, 301, 302, 364, - 84, 306, 169, 422, 429, 184, 185, 91, 433, 91, - 169, 93, 91, 91, -208, 103, 416, 182, 170, 170, - 437, 440, 91, 91, 397, 91, 91, 167, 353, 386, - 93, 447, 3, 232, 93, 171, 423, 312, 278, 249, - 292, 293, 294, -221, 93, 312, 93, 354, 232, 262, - 441, 43, 365, 170, 93, 171, 94, 448, 94, 390, - 335, 259, 43, 171, 106, 263, 326, 395, 419, 43, - 173, 100, 92, 96, 102, 86, 344, 114, 410, 104, - 94, 101, 279, 246, -218, 97, 98, 166, -228, 403, - 110, 111, 174, 327, 408, 319, 160, 409, 43, 94, - -236, 269, 201, 94, 273, 84, 175, 91, -237, 275, - 170, 417, 161, 94, 280, 94, 90, 320, 170, -211, - 274, 428, 247, 94, 304, 276, 352, 91, 309, 91, - 105, 176, 109, 303, 355, 112, 113, 308, 177, 270, - 189, 190, 266, 191, 267, 156, 157, 192, 158, 159, - 388, 271, 449, 252, 178, 393, 179, 394, 193, 451, - 91, 253, 91, 91, 91, 91, 91, 91, 91, 91, - 91, 91, 91, 91, 91, 91, 310, 183, 245, 245, - 245, 245, 245, 245, 245, 245, 376, 377, 170, 245, - 245, 434, 356, 333, 186, 187, 188, 8, 229, 332, - 256, 189, 190, 328, 191, 11, 12, 170, 192, 15, - 378, 17, 18, 340, 340, 189, 190, -219, 245, 329, - 442, 442, 189, 190, 28, 191, -225, 87, -229, 192, - 90, -231, 30, 31, 32, 281, 195, 88, 196, 197, - 329, 199, 314, 200, 197, 400, 296, 297, 232, 37, - 105, -216, 109, 40, -203, -202, 41, 272, 318, 321, - 322, 43, 245, 323, 357, 325, 232, 324, 253, 160, - 347, 349, 363, 414, 358, 351, 361, 383, 381, 391, - 275, 392, 396, 404, 411, 43, 43, 402, 384, 385, - 427, 430, 435, 438, 389, 2, 298, 299, 300, 439, - 445, 232, 446, 450, 100, 368, 91, 368, 91, 91, - 91, 91, 91, 91, 91, 444, 368, 368, 336, 398, - 436, 425, 334, 194, 285, 369, 371, 287, 290, 288, - 372, 289, 375, 345, 373, 291, 374, 100, 346, 341, - 295, 343, 421, 0, 43, 368, 0, 415, 426, 0, - 0, 43, 0, 0, 420, 0, 0, 0, 0, 0, - 43, 0, 0, 45, 0, 43, 0, 0, 432, 0, - 0, 100, 0, 0, 0, 0, 0, 0, 100, 0, - 0, 0, 43, 43, 0, 230, 0, 0, 0, 368, - 43, 0, 6, 269, 0, 8, 0, 43, 0, 43, - 452, 0, 453, 11, 12, 0, 0, 15, 0, 17, - 18, 0, 20, 0, 22, 0, 0, 0, 0, 25, - 26, 0, 28, -164, 0, 87, 0, 0, 0, 0, - 30, 31, 32, 0, 0, 88, 0, 0, -164, 0, - -164, 0, 0, 0, 35, 36, 0, 37, 0, 38, - 39, 40, 0, 0, 41, -164, -164, 0, 0, 0, - 0, 0, 0, 0, -164, -164, -164, -164, -192, 0, - 0, 0, 0, 0, -164, -164, 0, 0, -164, -164, - -164, -164, 0, -192, -164, -192, -164, 0, 0, 0, - 0, -164, 0, 0, 0, 0, 0, 0, 0, 0, - -192, -192, 0, 0, 0, 0, 0, 0, 0, -192, - -192, -192, -192, 0, 0, 0, 0, 0, 0, -192, - -192, 0, 0, -192, -192, -192, -192, 0, 0, -192, - 0, -192, 0, 0, 0, 0, -192, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 0, 0, 25, - 26, 0, 28, 0, 145, 146, 0, 0, 0, 0, - 147, 31, 148, 0, 0, 33, 0, 0, 34, 0, - 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, - 39, 40, 4, 0, 41, 5, 0, 6, 7, 0, - 8, 9, 0, 10, 0, 0, 0, 0, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 0, 0, 25, 26, 27, 28, 0, 0, - 29, 0, 0, 0, 0, 30, 31, 32, 0, 0, - 33, 0, 0, 34, 0, 0, 0, 0, 0, 35, - 36, 0, 37, 0, 38, 39, 40, 4, 0, 41, - 5, 0, 6, 7, 0, 8, 9, 0, 10, 0, - 0, 0, 0, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 0, 0, 25, - 26, 0, 28, 0, 251, 29, 0, 0, 0, 0, - 30, 31, 32, 0, 0, 33, 0, 0, 34, 0, - 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, - 39, 40, 4, 0, 41, 5, 0, 6, 7, 0, - 8, 9, 0, 10, 0, 0, 0, 0, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 0, 0, 25, 26, 0, 28, 0, 268, - 29, 0, 0, 0, 0, 30, 31, 32, 0, 0, - 33, 0, 0, 34, 0, 0, 0, 0, 0, 35, - 36, 0, 37, 0, 38, 39, 40, 4, 0, 41, - 5, 0, 6, 7, 0, 8, 9, 0, 10, 0, - 0, 0, 0, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 0, 0, 25, - 26, 0, 28, 0, 0, 29, 0, 0, 0, 0, - 30, 31, 32, 0, 0, 33, 0, 0, 34, 0, - 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, - 39, 40, 6, 0, 41, 8, 0, 0, 0, 0, - 0, 0, 0, 11, 12, 0, 0, 15, 0, 17, - 18, 0, 20, 0, 22, 0, 0, 0, 0, 25, - 26, 0, 28, 0, 0, 87, 0, 0, 0, 0, - 30, 31, 32, 0, 0, 88, 0, 0, 0, 0, - 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, - 39, 40, 0, 6, 41, 305, 8, 0, 0, 0, - 0, 0, 0, 0, 11, 12, 0, 0, 15, 0, - 17, 18, 0, 20, 233, 22, 0, 0, 0, 0, - 25, 26, 0, 28, 0, 0, 87, 0, 0, 0, - 0, 30, 31, 32, 0, 0, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, - 38, 39, 40, 6, 0, 41, 8, 0, 0, 0, - 0, 0, 0, 0, 11, 12, 0, 0, 15, 0, - 17, 18, 0, 20, 0, 22, 0, 0, 0, 0, - 25, 26, 0, 28, 0, 0, 87, 0, 0, 0, - 0, 30, 31, 32, 0, 0, 88, 0, 0, 0, - -226, 0, 0, 0, 0, 35, 36, 0, 37, 0, - 38, 39, 40, 6, 0, 41, 8, 0, 0, 0, - 0, 0, 0, 0, 11, 12, 0, 0, 15, 0, - 17, 18, 0, 20, 0, 22, 0, 0, 0, 0, - 25, 26, 0, 28, 0, 0, 87, 0, 0, 0, - 0, 30, 31, 32, 0, 0, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, - 38, 39, 40, 387, 6, 41, 0, 8, 0, 0, - 0, 0, 0, 0, 0, 11, 12, 0, 0, 15, - 0, 17, 18, 0, 20, 0, 22, 0, 0, 0, - 0, 25, 26, 0, 28, 0, 0, 87, 0, 0, - 0, 0, 30, 31, 32, 0, 0, 88, 0, 0, - 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, - 0, 38, 39, 40, 0, 0, 41, 204, 116, 117, - 205, 119, 206, 207, 122, 208, 209, 125, 210, 127, - 128, 129, 130, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 0, 0, 0, - 0, 0, 0, 0, 225, 226, 0, 0, 0, 0, - 227, 0, 228, 204, 116, 117, 205, 119, 206, 207, - 122, 208, 209, 125, 210, 127, 128, 129, 130, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 0, 0, 0, 0, 0, 0, 0, - 342, 226, 0, 0, 0, 0, 227, 0, 228, 204, - 116, 117, 205, 119, 206, 207, 122, 208, 209, 125, - 210, 264, 128, 265, 130, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 0, - 0, 0, 0, 0, 0, 0, 0, 226, 0, 0, - 0, 0, 227, 0, 228, 204, 116, 117, 205, 119, - 206, 207, 122, 208, 209, 125, 210, 264, 128, 265, - 130, 211, 212, 213, 214, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 0, 0, 0, 0, 0, - 0, 0, 0, 226 -}; - -static const yytype_int16 yycheck[] = -{ - 2, 13, 362, 2, 16, 7, 96, 10, 7, 19, - 249, 14, 5, 85, 86, 11, 11, 1, 164, 280, - 23, 24, 261, 262, 170, 1, 41, 99, 174, 41, - 102, 33, 1, 366, 318, 107, 320, 1, 16, 1, - 18, 44, 110, 6, 283, 329, 330, 193, 194, 1, - 41, 197, 1, 7, 411, 60, 61, 20, 418, 22, - 1, 1, 25, 26, 55, 51, 399, 45, 52, 52, - 427, 431, 35, 36, 358, 38, 39, 41, 52, 340, - 1, 438, 0, 95, 1, 54, 40, 71, 71, 101, - 180, 181, 182, 55, 1, 71, 1, 71, 110, 111, - 433, 103, 54, 52, 1, 54, 70, 440, 70, 348, - 256, 52, 114, 54, 41, 114, 18, 356, 402, 121, - 34, 133, 121, 126, 136, 118, 272, 55, 389, 139, - 70, 134, 39, 96, 55, 131, 131, 49, 55, 378, - 143, 144, 56, 45, 383, 34, 52, 386, 150, 70, - 55, 150, 78, 70, 52, 41, 33, 120, 55, 52, - 52, 400, 68, 70, 167, 70, 6, 56, 52, 55, - 68, 410, 98, 70, 196, 68, 68, 140, 200, 142, - 20, 57, 22, 195, 68, 25, 26, 199, 58, 40, - 35, 36, 127, 38, 129, 35, 36, 42, 38, 39, - 346, 52, 441, 5, 59, 351, 43, 353, 53, 448, - 173, 13, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 229, 44, 318, 319, - 320, 321, 322, 323, 324, 325, 326, 327, 52, 329, - 330, 55, 310, 253, 62, 63, 64, 11, 31, 252, - 53, 35, 36, 16, 38, 19, 20, 52, 42, 23, - 328, 25, 26, 266, 267, 35, 36, 55, 358, 53, - 434, 435, 35, 36, 38, 38, 55, 41, 55, 42, - 120, 55, 46, 47, 48, 41, 67, 51, 69, 70, - 53, 67, 41, 69, 70, 363, 184, 185, 310, 63, - 140, 55, 142, 67, 55, 55, 70, 55, 52, 33, - 57, 313, 402, 58, 313, 43, 328, 59, 13, 52, - 41, 52, 16, 395, 53, 55, 52, 41, 51, 41, - 52, 51, 10, 4, 51, 337, 338, 55, 337, 338, - 51, 40, 55, 51, 347, 0, 186, 187, 188, 40, - 40, 363, 40, 40, 366, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 435, 329, 330, 259, 361, - 424, 406, 254, 75, 173, 319, 321, 175, 178, 176, - 322, 177, 325, 273, 323, 179, 324, 399, 273, 267, - 183, 271, 404, -1, 396, 358, -1, 396, 408, -1, - -1, 403, -1, -1, 403, -1, -1, -1, -1, -1, - 412, -1, -1, 412, -1, 417, -1, -1, 417, -1, - -1, 433, -1, -1, -1, -1, -1, -1, 440, -1, - -1, -1, 434, 435, -1, 1, -1, -1, -1, 402, - 442, -1, 8, 442, -1, 11, -1, 449, -1, 451, - 449, -1, 451, 19, 20, -1, -1, 23, -1, 25, - 26, -1, 28, -1, 30, -1, -1, -1, -1, 35, - 36, -1, 38, 1, -1, 41, -1, -1, -1, -1, - 46, 47, 48, -1, -1, 51, -1, -1, 16, -1, - 18, -1, -1, -1, 60, 61, -1, 63, -1, 65, - 66, 67, -1, -1, 70, 33, 34, -1, -1, -1, - -1, -1, -1, -1, 42, 43, 44, 45, 1, -1, - -1, -1, -1, -1, 52, 53, -1, -1, 56, 57, - 58, 59, -1, 16, 62, 18, 64, -1, -1, -1, - -1, 69, -1, -1, -1, -1, -1, -1, -1, -1, - 33, 34, -1, -1, -1, -1, -1, -1, -1, 42, - 43, 44, 45, -1, -1, -1, -1, -1, -1, 52, - 53, -1, -1, 56, 57, 58, 59, -1, -1, 62, - -1, 64, -1, -1, -1, -1, 69, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, - 36, -1, 38, -1, 40, 41, -1, -1, -1, -1, - 46, 47, 48, -1, -1, 51, -1, -1, 54, -1, - -1, -1, -1, -1, 60, 61, -1, 63, -1, 65, - 66, 67, 3, -1, 70, 6, -1, 8, 9, -1, - 11, 12, -1, 14, -1, -1, -1, -1, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, -1, -1, 35, 36, 37, 38, -1, -1, - 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, - 51, -1, -1, 54, -1, -1, -1, -1, -1, 60, - 61, -1, 63, -1, 65, 66, 67, 3, -1, 70, - 6, -1, 8, 9, -1, 11, 12, -1, 14, -1, - -1, -1, -1, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, - 36, -1, 38, -1, 40, 41, -1, -1, -1, -1, - 46, 47, 48, -1, -1, 51, -1, -1, 54, -1, - -1, -1, -1, -1, 60, 61, -1, 63, -1, 65, - 66, 67, 3, -1, 70, 6, -1, 8, 9, -1, - 11, 12, -1, 14, -1, -1, -1, -1, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, -1, -1, 35, 36, -1, 38, -1, 40, - 41, -1, -1, -1, -1, 46, 47, 48, -1, -1, - 51, -1, -1, 54, -1, -1, -1, -1, -1, 60, - 61, -1, 63, -1, 65, 66, 67, 3, -1, 70, - 6, -1, 8, 9, -1, 11, 12, -1, 14, -1, - -1, -1, -1, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, 35, - 36, -1, 38, -1, -1, 41, -1, -1, -1, -1, - 46, 47, 48, -1, -1, 51, -1, -1, 54, -1, - -1, -1, -1, -1, 60, 61, -1, 63, -1, 65, - 66, 67, 8, -1, 70, 11, -1, -1, -1, -1, - -1, -1, -1, 19, 20, -1, -1, 23, -1, 25, - 26, -1, 28, -1, 30, -1, -1, -1, -1, 35, - 36, -1, 38, -1, -1, 41, -1, -1, -1, -1, - 46, 47, 48, -1, -1, 51, -1, -1, -1, -1, - -1, -1, -1, -1, 60, 61, -1, 63, -1, 65, - 66, 67, -1, 8, 70, 71, 11, -1, -1, -1, - -1, -1, -1, -1, 19, 20, -1, -1, 23, -1, - 25, 26, -1, 28, 29, 30, -1, -1, -1, -1, - 35, 36, -1, 38, -1, -1, 41, -1, -1, -1, - -1, 46, 47, 48, -1, -1, 51, -1, -1, -1, - -1, -1, -1, -1, -1, 60, 61, -1, 63, -1, - 65, 66, 67, 8, -1, 70, 11, -1, -1, -1, - -1, -1, -1, -1, 19, 20, -1, -1, 23, -1, - 25, 26, -1, 28, -1, 30, -1, -1, -1, -1, - 35, 36, -1, 38, -1, -1, 41, -1, -1, -1, - -1, 46, 47, 48, -1, -1, 51, -1, -1, -1, - 55, -1, -1, -1, -1, 60, 61, -1, 63, -1, - 65, 66, 67, 8, -1, 70, 11, -1, -1, -1, - -1, -1, -1, -1, 19, 20, -1, -1, 23, -1, - 25, 26, -1, 28, -1, 30, -1, -1, -1, -1, - 35, 36, -1, 38, -1, -1, 41, -1, -1, -1, - -1, 46, 47, 48, -1, -1, 51, -1, -1, -1, - -1, -1, -1, -1, -1, 60, 61, -1, 63, -1, - 65, 66, 67, 68, 8, 70, -1, 11, -1, -1, - -1, -1, -1, -1, -1, 19, 20, -1, -1, 23, - -1, 25, 26, -1, 28, -1, 30, -1, -1, -1, - -1, 35, 36, -1, 38, -1, -1, 41, -1, -1, - -1, -1, 46, 47, 48, -1, -1, 51, -1, -1, - -1, -1, -1, -1, -1, -1, 60, 61, -1, 63, - -1, 65, 66, 67, -1, -1, 70, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, - -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, - 46, -1, 48, 3, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, - 40, 41, -1, -1, -1, -1, 46, -1, 48, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, - -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, - -1, -1, 46, -1, 48, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, - -1, -1, -1, 41 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 73, 75, 0, 3, 6, 8, 9, 11, 12, - 14, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 35, 36, 37, 38, 41, - 46, 47, 48, 51, 54, 60, 61, 63, 65, 66, - 67, 70, 74, 76, 77, 81, 84, 85, 94, 95, - 96, 97, 102, 103, 104, 105, 106, 107, 113, 114, - 119, 123, 125, 127, 129, 131, 133, 135, 137, 139, - 141, 142, 143, 144, 145, 146, 147, 148, 149, 152, - 153, 157, 165, 166, 41, 162, 162, 41, 51, 76, - 144, 146, 81, 1, 70, 168, 168, 147, 148, 117, - 119, 168, 119, 51, 84, 144, 41, 86, 88, 144, - 168, 168, 144, 144, 55, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 40, 41, 46, 48, 81, - 82, 158, 159, 161, 163, 164, 144, 144, 144, 144, - 52, 68, 154, 155, 156, 119, 49, 41, 168, 1, - 52, 54, 167, 34, 56, 33, 57, 58, 59, 43, - 16, 18, 45, 44, 60, 61, 62, 63, 64, 35, - 36, 38, 42, 53, 122, 67, 69, 70, 150, 67, - 69, 150, 167, 167, 3, 6, 8, 9, 11, 12, - 14, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 40, 41, 46, 48, 31, - 1, 118, 119, 29, 120, 121, 124, 126, 128, 130, - 132, 134, 136, 138, 140, 141, 146, 150, 167, 119, - 167, 40, 5, 13, 115, 116, 53, 90, 91, 52, - 167, 118, 119, 81, 15, 17, 161, 161, 40, 81, - 40, 52, 55, 52, 68, 52, 68, 123, 71, 39, - 168, 41, 79, 80, 123, 129, 123, 131, 133, 135, - 137, 139, 141, 141, 141, 142, 143, 143, 144, 144, - 144, 123, 123, 119, 163, 71, 123, 151, 119, 163, - 168, 1, 71, 169, 41, 87, 89, 98, 52, 34, - 56, 33, 57, 58, 59, 43, 18, 45, 16, 53, - 122, 169, 168, 84, 116, 123, 88, 169, 169, 160, - 168, 160, 40, 159, 123, 155, 156, 41, 80, 52, - 169, 55, 68, 52, 71, 68, 118, 81, 53, 92, - 93, 52, 100, 16, 1, 54, 170, 124, 146, 130, - 124, 132, 134, 136, 138, 140, 141, 141, 118, 124, - 124, 51, 108, 41, 81, 81, 80, 68, 123, 168, - 169, 41, 51, 123, 123, 169, 10, 124, 89, 170, - 118, 117, 55, 169, 4, 109, 110, 111, 169, 169, - 80, 51, 75, 78, 167, 81, 117, 169, 99, 124, - 81, 119, 7, 40, 112, 111, 84, 51, 169, 78, - 40, 101, 81, 170, 55, 55, 109, 78, 51, 40, - 170, 117, 82, 83, 83, 40, 40, 78, 117, 169, - 40, 169, 81, 81 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 72, 73, 74, 74, 75, 75, 76, 76, 76, - 77, 78, 79, 79, 80, 80, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 82, 82, 83, 83, 84, 84, 85, 86, 86, - 87, 87, 88, 89, 90, 90, 91, 92, 92, 93, - 94, 95, 96, 96, 97, 97, 98, 99, 97, 100, - 101, 97, 97, 97, 102, 103, 104, 105, 106, 107, - 108, 108, 109, 109, 110, 110, 111, 112, 113, 114, - 114, 114, 115, 116, 117, 117, 118, 118, 119, 119, - 120, 120, 121, 121, 122, 122, 123, 123, 123, 124, - 124, 124, 125, 125, 126, 126, 127, 127, 128, 128, - 129, 129, 130, 130, 131, 131, 132, 132, 133, 133, - 134, 134, 135, 135, 136, 136, 137, 137, 138, 138, - 139, 139, 139, 139, 140, 140, 140, 141, 141, 142, - 142, 142, 143, 143, 143, 143, 144, 144, 144, 144, - 144, 144, 144, 144, 144, 144, 145, 145, 145, 146, - 146, 147, 147, 148, 148, 148, 148, 148, 149, 149, - 149, 149, 150, 150, 151, 151, 152, 152, 152, 152, - 152, 152, 153, 153, 153, 153, 154, 154, 155, 155, - 156, 156, 157, 157, 157, 158, 158, 159, 159, 159, - 160, 161, 161, 161, 162, 162, 163, 163, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, - 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, - 165, 165, 165, 165, 166, 166, 166, 167, 167, 168, - 168, 169, 169, 170, 170 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 3, 1, 0, 0, 2, 7, 8, 10, - 1, 1, 1, 3, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 0, 1, 3, 2, 3, 1, 3, - 1, 3, 2, 2, 0, 1, 2, 0, 1, 2, - 1, 2, 7, 5, 7, 5, 0, 0, 11, 0, - 0, 12, 7, 8, 3, 3, 3, 5, 3, 5, - 3, 5, 0, 1, 1, 2, 4, 3, 3, 3, - 3, 4, 5, 2, 0, 1, 1, 1, 1, 3, - 0, 1, 1, 3, 1, 1, 1, 3, 3, 1, - 3, 3, 1, 5, 1, 5, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 3, 3, 1, 3, 3, 1, 3, 1, - 3, 3, 1, 3, 3, 3, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, - 1, 1, 2, 1, 1, 4, 3, 3, 2, 2, - 4, 3, 2, 3, 1, 3, 1, 1, 1, 1, - 1, 3, 2, 3, 3, 5, 2, 4, 1, 2, - 0, 1, 2, 3, 4, 1, 3, 3, 3, 3, - 6, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (ctx, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, ctx); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (ctx); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep, ctx); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - , ctx); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, ctx); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_ctx_t *ctx) -{ - YYUSE (yyvaluep); - YYUSE (ctx); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (parser_ctx_t *ctx) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, ctx); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 259 "parser.y" - { program_parsed(ctx, (yyvsp[-2].source_elements)); } -#line 1957 "parser.tab.c" - break; - - case 3: -#line 262 "parser.y" - {} -#line 1963 "parser.tab.c" - break; - - case 4: -#line 263 "parser.y" - {} -#line 1969 "parser.tab.c" - break; - - case 5: -#line 267 "parser.y" - { (yyval.source_elements) = new_source_elements(ctx); } -#line 1975 "parser.tab.c" - break; - - case 6: -#line 269 "parser.y" - { (yyval.source_elements) = source_elements_add_statement((yyvsp[-1].source_elements), (yyvsp[0].statement)); } -#line 1981 "parser.tab.c" - break; - - case 7: -#line 274 "parser.y" - { (yyval.expr) = new_function_expression(ctx, NULL, (yyvsp[-4].parameter_list), (yyvsp[-1].source_elements), NULL, (yyvsp[-6].srcptr), (yyvsp[0].srcptr)-(yyvsp[-6].srcptr)+1); } -#line 1987 "parser.tab.c" - break; - - case 8: -#line 276 "parser.y" - { (yyval.expr) = new_function_expression(ctx, (yyvsp[-6].identifier), (yyvsp[-4].parameter_list), (yyvsp[-1].source_elements), NULL, (yyvsp[-7].srcptr), (yyvsp[0].srcptr)-(yyvsp[-7].srcptr)+1); } -#line 1993 "parser.tab.c" - break; - - case 9: -#line 278 "parser.y" - { (yyval.expr) = new_function_expression(ctx, (yyvsp[-6].identifier), (yyvsp[-4].parameter_list), (yyvsp[-1].source_elements), (yyvsp[-8].identifier), (yyvsp[-9].srcptr), (yyvsp[0].srcptr)-(yyvsp[-9].srcptr)+1); } -#line 1999 "parser.tab.c" - break; - - case 10: -#line 281 "parser.y" - { (yyval.srcptr) = ctx->ptr - 8; } -#line 2005 "parser.tab.c" - break; - - case 11: -#line 285 "parser.y" - { (yyval.source_elements) = (yyvsp[0].source_elements); } -#line 2011 "parser.tab.c" - break; - - case 12: -#line 289 "parser.y" - { (yyval.parameter_list) = new_parameter_list(ctx, (yyvsp[0].identifier)); } -#line 2017 "parser.tab.c" - break; - - case 13: -#line 291 "parser.y" - { (yyval.parameter_list) = parameter_list_add(ctx, (yyvsp[-2].parameter_list), (yyvsp[0].identifier)); } -#line 2023 "parser.tab.c" - break; - - case 14: -#line 295 "parser.y" - { (yyval.parameter_list) = NULL; } -#line 2029 "parser.tab.c" - break; - - case 15: -#line 296 "parser.y" - { (yyval.parameter_list) = (yyvsp[0].parameter_list); } -#line 2035 "parser.tab.c" - break; - - case 16: -#line 300 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2041 "parser.tab.c" - break; - - case 17: -#line 301 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2047 "parser.tab.c" - break; - - case 18: -#line 302 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2053 "parser.tab.c" - break; - - case 19: -#line 303 "parser.y" - { (yyval.statement) = new_expression_statement(ctx, (yyvsp[0].expr)); } -#line 2059 "parser.tab.c" - break; - - case 20: -#line 304 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2065 "parser.tab.c" - break; - - case 21: -#line 305 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2071 "parser.tab.c" - break; - - case 22: -#line 306 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2077 "parser.tab.c" - break; - - case 23: -#line 307 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2083 "parser.tab.c" - break; - - case 24: -#line 308 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2089 "parser.tab.c" - break; - - case 25: -#line 309 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2095 "parser.tab.c" - break; - - case 26: -#line 310 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2101 "parser.tab.c" - break; - - case 27: -#line 311 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2107 "parser.tab.c" - break; - - case 28: -#line 312 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2113 "parser.tab.c" - break; - - case 29: -#line 313 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2119 "parser.tab.c" - break; - - case 30: -#line 314 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2125 "parser.tab.c" - break; - - case 31: -#line 318 "parser.y" - { (yyval.statement_list) = new_statement_list(ctx, (yyvsp[0].statement)); } -#line 2131 "parser.tab.c" - break; - - case 32: -#line 320 "parser.y" - { (yyval.statement_list) = statement_list_add((yyvsp[-1].statement_list), (yyvsp[0].statement)); } -#line 2137 "parser.tab.c" - break; - - case 33: -#line 324 "parser.y" - { (yyval.statement_list) = NULL; } -#line 2143 "parser.tab.c" - break; - - case 34: -#line 325 "parser.y" - { (yyval.statement_list) = (yyvsp[0].statement_list); } -#line 2149 "parser.tab.c" - break; - - case 35: -#line 329 "parser.y" - { (yyval.statement) = new_block_statement(ctx, (yyvsp[-1].statement_list)); } -#line 2155 "parser.tab.c" - break; - - case 36: -#line 330 "parser.y" - { (yyval.statement) = new_block_statement(ctx, NULL); } -#line 2161 "parser.tab.c" - break; - - case 37: -#line 335 "parser.y" - { (yyval.statement) = new_var_statement(ctx, (yyvsp[-1].variable_list)); } -#line 2167 "parser.tab.c" - break; - - case 38: -#line 339 "parser.y" - { (yyval.variable_list) = new_variable_list(ctx, (yyvsp[0].variable_declaration)); } -#line 2173 "parser.tab.c" - break; - - case 39: -#line 341 "parser.y" - { (yyval.variable_list) = variable_list_add(ctx, (yyvsp[-2].variable_list), (yyvsp[0].variable_declaration)); } -#line 2179 "parser.tab.c" - break; - - case 40: -#line 346 "parser.y" - { (yyval.variable_list) = new_variable_list(ctx, (yyvsp[0].variable_declaration)); } -#line 2185 "parser.tab.c" - break; - - case 41: -#line 348 "parser.y" - { (yyval.variable_list) = variable_list_add(ctx, (yyvsp[-2].variable_list), (yyvsp[0].variable_declaration)); } -#line 2191 "parser.tab.c" - break; - - case 42: -#line 353 "parser.y" - { (yyval.variable_declaration) = new_variable_declaration(ctx, (yyvsp[-1].identifier), (yyvsp[0].expr)); } -#line 2197 "parser.tab.c" - break; - - case 43: -#line 358 "parser.y" - { (yyval.variable_declaration) = new_variable_declaration(ctx, (yyvsp[-1].identifier), (yyvsp[0].expr)); } -#line 2203 "parser.tab.c" - break; - - case 44: -#line 362 "parser.y" - { (yyval.expr) = NULL; } -#line 2209 "parser.tab.c" - break; - - case 45: -#line 363 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2215 "parser.tab.c" - break; - - case 46: -#line 368 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2221 "parser.tab.c" - break; - - case 47: -#line 372 "parser.y" - { (yyval.expr) = NULL; } -#line 2227 "parser.tab.c" - break; - - case 48: -#line 373 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2233 "parser.tab.c" - break; - - case 49: -#line 378 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2239 "parser.tab.c" - break; - - case 50: -#line 382 "parser.y" - { (yyval.statement) = new_statement(ctx, STAT_EMPTY, 0); } -#line 2245 "parser.tab.c" - break; - - case 51: -#line 387 "parser.y" - { (yyval.statement) = new_expression_statement(ctx, (yyvsp[-1].expr)); } -#line 2251 "parser.tab.c" - break; - - case 52: -#line 392 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-4].expr), (yyvsp[-2].statement), (yyvsp[0].statement)); } -#line 2257 "parser.tab.c" - break; - - case 53: -#line 394 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-2].expr), (yyvsp[0].statement), NULL); } -#line 2263 "parser.tab.c" - break; - - case 54: -#line 399 "parser.y" - { (yyval.statement) = new_while_statement(ctx, TRUE, (yyvsp[-2].expr), (yyvsp[-5].statement)); } -#line 2269 "parser.tab.c" - break; - - case 55: -#line 401 "parser.y" - { (yyval.statement) = new_while_statement(ctx, FALSE, (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2275 "parser.tab.c" - break; - - case 56: -#line 403 "parser.y" - { if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; } -#line 2281 "parser.tab.c" - break; - - case 57: -#line 405 "parser.y" - { if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; } -#line 2287 "parser.tab.c" - break; - - case 58: -#line 407 "parser.y" - { (yyval.statement) = new_for_statement(ctx, NULL, (yyvsp[-8].expr), (yyvsp[-5].expr), (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2293 "parser.tab.c" - break; - - case 59: -#line 409 "parser.y" - { if(!explicit_error(ctx, (yyvsp[0].variable_list), ';')) YYABORT; } -#line 2299 "parser.tab.c" - break; - - case 60: -#line 411 "parser.y" - { if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; } -#line 2305 "parser.tab.c" - break; - - case 61: -#line 413 "parser.y" - { (yyval.statement) = new_for_statement(ctx, (yyvsp[-8].variable_list), NULL, (yyvsp[-5].expr), (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2311 "parser.tab.c" - break; - - case 62: -#line 415 "parser.y" - { (yyval.statement) = new_forin_statement(ctx, NULL, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2317 "parser.tab.c" - break; - - case 63: -#line 417 "parser.y" - { (yyval.statement) = new_forin_statement(ctx, (yyvsp[-4].variable_declaration), NULL, (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2323 "parser.tab.c" - break; - - case 64: -#line 422 "parser.y" - { (yyval.statement) = new_continue_statement(ctx, (yyvsp[-1].identifier)); } -#line 2329 "parser.tab.c" - break; - - case 65: -#line 427 "parser.y" - { (yyval.statement) = new_break_statement(ctx, (yyvsp[-1].identifier)); } -#line 2335 "parser.tab.c" - break; - - case 66: -#line 432 "parser.y" - { (yyval.statement) = new_return_statement(ctx, (yyvsp[-1].expr)); } -#line 2341 "parser.tab.c" - break; - - case 67: -#line 437 "parser.y" - { (yyval.statement) = new_with_statement(ctx, (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2347 "parser.tab.c" - break; - - case 68: -#line 442 "parser.y" - { (yyval.statement) = new_labelled_statement(ctx, (yyvsp[-2].identifier), (yyvsp[0].statement)); } -#line 2353 "parser.tab.c" - break; - - case 69: -#line 447 "parser.y" - { (yyval.statement) = new_switch_statement(ctx, (yyvsp[-2].expr), (yyvsp[0].case_clausule)); } -#line 2359 "parser.tab.c" - break; - - case 70: -#line 452 "parser.y" - { (yyval.case_clausule) = new_case_block(ctx, (yyvsp[-1].case_list), NULL, NULL); } -#line 2365 "parser.tab.c" - break; - - case 71: -#line 454 "parser.y" - { (yyval.case_clausule) = new_case_block(ctx, (yyvsp[-3].case_list), (yyvsp[-2].case_clausule), (yyvsp[-1].case_list)); } -#line 2371 "parser.tab.c" - break; - - case 72: -#line 458 "parser.y" - { (yyval.case_list) = NULL; } -#line 2377 "parser.tab.c" - break; - - case 73: -#line 459 "parser.y" - { (yyval.case_list) = (yyvsp[0].case_list); } -#line 2383 "parser.tab.c" - break; - - case 74: -#line 463 "parser.y" - { (yyval.case_list) = new_case_list(ctx, (yyvsp[0].case_clausule)); } -#line 2389 "parser.tab.c" - break; - - case 75: -#line 465 "parser.y" - { (yyval.case_list) = case_list_add(ctx, (yyvsp[-1].case_list), (yyvsp[0].case_clausule)); } -#line 2395 "parser.tab.c" - break; - - case 76: -#line 470 "parser.y" - { (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[-2].expr), (yyvsp[0].statement_list)); } -#line 2401 "parser.tab.c" - break; - - case 77: -#line 475 "parser.y" - { (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[0].statement_list)); } -#line 2407 "parser.tab.c" - break; - - case 78: -#line 480 "parser.y" - { (yyval.statement) = new_throw_statement(ctx, (yyvsp[-1].expr)); } -#line 2413 "parser.tab.c" - break; - - case 79: -#line 484 "parser.y" - { (yyval.statement) = new_try_statement(ctx, (yyvsp[-1].statement), (yyvsp[0].catch_block), NULL); } -#line 2419 "parser.tab.c" - break; - - case 80: -#line 485 "parser.y" - { (yyval.statement) = new_try_statement(ctx, (yyvsp[-1].statement), NULL, (yyvsp[0].statement)); } -#line 2425 "parser.tab.c" - break; - - case 81: -#line 487 "parser.y" - { (yyval.statement) = new_try_statement(ctx, (yyvsp[-2].statement), (yyvsp[-1].catch_block), (yyvsp[0].statement)); } -#line 2431 "parser.tab.c" - break; - - case 82: -#line 492 "parser.y" - { (yyval.catch_block) = new_catch_block(ctx, (yyvsp[-2].identifier), (yyvsp[0].statement)); } -#line 2437 "parser.tab.c" - break; - - case 83: -#line 496 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2443 "parser.tab.c" - break; - - case 84: -#line 500 "parser.y" - { (yyval.expr) = NULL; } -#line 2449 "parser.tab.c" - break; - - case 85: -#line 501 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2455 "parser.tab.c" - break; - - case 86: -#line 504 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2461 "parser.tab.c" - break; - - case 87: -#line 505 "parser.y" - { set_error(ctx, JS_E_SYNTAX); YYABORT; } -#line 2467 "parser.tab.c" - break; - - case 88: -#line 509 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2473 "parser.tab.c" - break; - - case 89: -#line 511 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2479 "parser.tab.c" - break; - - case 90: -#line 515 "parser.y" - { (yyval.expr) = NULL; } -#line 2485 "parser.tab.c" - break; - - case 91: -#line 516 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2491 "parser.tab.c" - break; - - case 92: -#line 521 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2497 "parser.tab.c" - break; - - case 93: -#line 523 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2503 "parser.tab.c" - break; - - case 94: -#line 526 "parser.y" - { (yyval.ival) = (yyvsp[0].ival); } -#line 2509 "parser.tab.c" - break; - - case 95: -#line 527 "parser.y" - { (yyval.ival) = EXPR_ASSIGNDIV; } -#line 2515 "parser.tab.c" - break; - - case 96: -#line 531 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2521 "parser.tab.c" - break; - - case 97: -#line 533 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2527 "parser.tab.c" - break; - - case 98: -#line 535 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2533 "parser.tab.c" - break; - - case 99: -#line 540 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2539 "parser.tab.c" - break; - - case 100: -#line 542 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2545 "parser.tab.c" - break; - - case 101: -#line 544 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2551 "parser.tab.c" - break; - - case 102: -#line 548 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2557 "parser.tab.c" - break; - - case 103: -#line 550 "parser.y" - { (yyval.expr) = new_conditional_expression(ctx, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2563 "parser.tab.c" - break; - - case 104: -#line 555 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2569 "parser.tab.c" - break; - - case 105: -#line 557 "parser.y" - { (yyval.expr) = new_conditional_expression(ctx, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2575 "parser.tab.c" - break; - - case 106: -#line 561 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2581 "parser.tab.c" - break; - - case 107: -#line 563 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2587 "parser.tab.c" - break; - - case 108: -#line 568 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2593 "parser.tab.c" - break; - - case 109: -#line 570 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2599 "parser.tab.c" - break; - - case 110: -#line 574 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2605 "parser.tab.c" - break; - - case 111: -#line 576 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2611 "parser.tab.c" - break; - - case 112: -#line 581 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2617 "parser.tab.c" - break; - - case 113: -#line 583 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2623 "parser.tab.c" - break; - - case 114: -#line 587 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2629 "parser.tab.c" - break; - - case 115: -#line 589 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2635 "parser.tab.c" - break; - - case 116: -#line 594 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2641 "parser.tab.c" - break; - - case 117: -#line 596 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2647 "parser.tab.c" - break; - - case 118: -#line 600 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2653 "parser.tab.c" - break; - - case 119: -#line 602 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2659 "parser.tab.c" - break; - - case 120: -#line 607 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2665 "parser.tab.c" - break; - - case 121: -#line 609 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2671 "parser.tab.c" - break; - - case 122: -#line 613 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2677 "parser.tab.c" - break; - - case 123: -#line 615 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2683 "parser.tab.c" - break; - - case 124: -#line 620 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2689 "parser.tab.c" - break; - - case 125: -#line 622 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2695 "parser.tab.c" - break; - - case 126: -#line 626 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2701 "parser.tab.c" - break; - - case 127: -#line 628 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2707 "parser.tab.c" - break; - - case 128: -#line 632 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2713 "parser.tab.c" - break; - - case 129: -#line 634 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2719 "parser.tab.c" - break; - - case 130: -#line 638 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2725 "parser.tab.c" - break; - - case 131: -#line 640 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2731 "parser.tab.c" - break; - - case 132: -#line 642 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2737 "parser.tab.c" - break; - - case 133: -#line 644 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_IN, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2743 "parser.tab.c" - break; - - case 134: -#line 648 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2749 "parser.tab.c" - break; - - case 135: -#line 650 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2755 "parser.tab.c" - break; - - case 136: -#line 652 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2761 "parser.tab.c" - break; - - case 137: -#line 656 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2767 "parser.tab.c" - break; - - case 138: -#line 658 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2773 "parser.tab.c" - break; - - case 139: -#line 663 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2779 "parser.tab.c" - break; - - case 140: -#line 665 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2785 "parser.tab.c" - break; - - case 141: -#line 667 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2791 "parser.tab.c" - break; - - case 142: -#line 671 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2797 "parser.tab.c" - break; - - case 143: -#line 673 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2803 "parser.tab.c" - break; - - case 144: -#line 675 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2809 "parser.tab.c" - break; - - case 145: -#line 677 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2815 "parser.tab.c" - break; - - case 146: -#line 681 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2821 "parser.tab.c" - break; - - case 147: -#line 683 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_DELETE, (yyvsp[0].expr)); } -#line 2827 "parser.tab.c" - break; - - case 148: -#line 684 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_VOID, (yyvsp[0].expr)); } -#line 2833 "parser.tab.c" - break; - - case 149: -#line 686 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_TYPEOF, (yyvsp[0].expr)); } -#line 2839 "parser.tab.c" - break; - - case 150: -#line 687 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_PREINC, (yyvsp[0].expr)); } -#line 2845 "parser.tab.c" - break; - - case 151: -#line 688 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_PREDEC, (yyvsp[0].expr)); } -#line 2851 "parser.tab.c" - break; - - case 152: -#line 689 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_PLUS, (yyvsp[0].expr)); } -#line 2857 "parser.tab.c" - break; - - case 153: -#line 690 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_MINUS, (yyvsp[0].expr)); } -#line 2863 "parser.tab.c" - break; - - case 154: -#line 691 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_BITNEG, (yyvsp[0].expr)); } -#line 2869 "parser.tab.c" - break; - - case 155: -#line 692 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_LOGNEG, (yyvsp[0].expr)); } -#line 2875 "parser.tab.c" - break; - - case 156: -#line 697 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2881 "parser.tab.c" - break; - - case 157: -#line 699 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_POSTINC, (yyvsp[-1].expr)); } -#line 2887 "parser.tab.c" - break; - - case 158: -#line 701 "parser.y" - { (yyval.expr) = new_unary_expression(ctx, EXPR_POSTDEC, (yyvsp[-1].expr)); } -#line 2893 "parser.tab.c" - break; - - case 159: -#line 706 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2899 "parser.tab.c" - break; - - case 160: -#line 707 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2905 "parser.tab.c" - break; - - case 161: -#line 711 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2911 "parser.tab.c" - break; - - case 162: -#line 712 "parser.y" - { (yyval.expr) = new_new_expression(ctx, (yyvsp[0].expr), NULL); } -#line 2917 "parser.tab.c" - break; - - case 163: -#line 716 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2923 "parser.tab.c" - break; - - case 164: -#line 717 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 2929 "parser.tab.c" - break; - - case 165: -#line 719 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_ARRAY, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 2935 "parser.tab.c" - break; - - case 166: -#line 721 "parser.y" - { (yyval.expr) = new_member_expression(ctx, (yyvsp[-2].expr), (yyvsp[0].identifier)); } -#line 2941 "parser.tab.c" - break; - - case 167: -#line 723 "parser.y" - { (yyval.expr) = new_new_expression(ctx, (yyvsp[-1].expr), (yyvsp[0].argument_list)); } -#line 2947 "parser.tab.c" - break; - - case 168: -#line 728 "parser.y" - { (yyval.expr) = new_call_expression(ctx, (yyvsp[-1].expr), (yyvsp[0].argument_list)); } -#line 2953 "parser.tab.c" - break; - - case 169: -#line 730 "parser.y" - { (yyval.expr) = new_call_expression(ctx, (yyvsp[-1].expr), (yyvsp[0].argument_list)); } -#line 2959 "parser.tab.c" - break; - - case 170: -#line 732 "parser.y" - { (yyval.expr) = new_binary_expression(ctx, EXPR_ARRAY, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 2965 "parser.tab.c" - break; - - case 171: -#line 734 "parser.y" - { (yyval.expr) = new_member_expression(ctx, (yyvsp[-2].expr), (yyvsp[0].identifier)); } -#line 2971 "parser.tab.c" - break; - - case 172: -#line 738 "parser.y" - { (yyval.argument_list) = NULL; } -#line 2977 "parser.tab.c" - break; - - case 173: -#line 739 "parser.y" - { (yyval.argument_list) = (yyvsp[-1].argument_list); } -#line 2983 "parser.tab.c" - break; - - case 174: -#line 743 "parser.y" - { (yyval.argument_list) = new_argument_list(ctx, (yyvsp[0].expr)); } -#line 2989 "parser.tab.c" - break; - - case 175: -#line 745 "parser.y" - { (yyval.argument_list) = argument_list_add(ctx, (yyvsp[-2].argument_list), (yyvsp[0].expr)); } -#line 2995 "parser.tab.c" - break; - - case 176: -#line 749 "parser.y" - { (yyval.expr) = new_expression(ctx, EXPR_THIS, 0); } -#line 3001 "parser.tab.c" - break; - - case 177: -#line 750 "parser.y" - { (yyval.expr) = new_identifier_expression(ctx, (yyvsp[0].identifier)); } -#line 3007 "parser.tab.c" - break; - - case 178: -#line 751 "parser.y" - { (yyval.expr) = new_literal_expression(ctx, (yyvsp[0].literal)); } -#line 3013 "parser.tab.c" - break; - - case 179: -#line 752 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 3019 "parser.tab.c" - break; - - case 180: -#line 753 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 3025 "parser.tab.c" - break; - - case 181: -#line 754 "parser.y" - { (yyval.expr) = (yyvsp[-1].expr); } -#line 3031 "parser.tab.c" - break; - - case 182: -#line 758 "parser.y" - { (yyval.expr) = new_array_literal_expression(ctx, NULL, 0); } -#line 3037 "parser.tab.c" - break; - - case 183: -#line 759 "parser.y" - { (yyval.expr) = new_array_literal_expression(ctx, NULL, (yyvsp[-1].ival)+1); } -#line 3043 "parser.tab.c" - break; - - case 184: -#line 760 "parser.y" - { (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[-1].element_list), 0); } -#line 3049 "parser.tab.c" - break; - - case 185: -#line 762 "parser.y" - { (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[-3].element_list), (yyvsp[-1].ival)+1); } -#line 3055 "parser.tab.c" - break; - - case 186: -#line 767 "parser.y" - { (yyval.element_list) = new_element_list(ctx, (yyvsp[-1].ival), (yyvsp[0].expr)); } -#line 3061 "parser.tab.c" - break; - - case 187: -#line 769 "parser.y" - { (yyval.element_list) = element_list_add(ctx, (yyvsp[-3].element_list), (yyvsp[-1].ival), (yyvsp[0].expr)); } -#line 3067 "parser.tab.c" - break; - - case 188: -#line 773 "parser.y" - { (yyval.ival) = 1; } -#line 3073 "parser.tab.c" - break; - - case 189: -#line 774 "parser.y" - { (yyval.ival) = (yyvsp[-1].ival) + 1; } -#line 3079 "parser.tab.c" - break; - - case 190: -#line 778 "parser.y" - { (yyval.ival) = 0; } -#line 3085 "parser.tab.c" - break; - - case 191: -#line 779 "parser.y" - { (yyval.ival) = (yyvsp[0].ival); } -#line 3091 "parser.tab.c" - break; - - case 192: -#line 783 "parser.y" - { (yyval.expr) = new_prop_and_value_expression(ctx, NULL); } -#line 3097 "parser.tab.c" - break; - - case 193: -#line 785 "parser.y" - { (yyval.expr) = new_prop_and_value_expression(ctx, (yyvsp[-1].property_list)); } -#line 3103 "parser.tab.c" - break; - - case 194: -#line 787 "parser.y" - { - if(ctx->script->version < 2) { - WARN("Trailing comma in object literal is illegal in legacy mode.\n"); - YYABORT; - } - (yyval.expr) = new_prop_and_value_expression(ctx, (yyvsp[-2].property_list)); - } -#line 3115 "parser.tab.c" - break; - - case 195: -#line 797 "parser.y" - { (yyval.property_list) = new_property_list(ctx, (yyvsp[0].property_definition)); } -#line 3121 "parser.tab.c" - break; - - case 196: -#line 799 "parser.y" - { (yyval.property_list) = property_list_add(ctx, (yyvsp[-2].property_list), (yyvsp[0].property_definition)); } -#line 3127 "parser.tab.c" - break; - - case 197: -#line 804 "parser.y" - { (yyval.property_definition) = new_property_definition(ctx, PROPERTY_DEFINITION_VALUE, (yyvsp[-2].literal), (yyvsp[0].expr)); } -#line 3133 "parser.tab.c" - break; - - case 198: -#line 806 "parser.y" - { (yyval.property_definition) = new_property_definition(ctx, PROPERTY_DEFINITION_GETTER, (yyvsp[-1].literal), (yyvsp[0].expr)); } -#line 3139 "parser.tab.c" - break; - - case 199: -#line 808 "parser.y" - { (yyval.property_definition) = new_property_definition(ctx, PROPERTY_DEFINITION_SETTER, (yyvsp[-1].literal), (yyvsp[0].expr)); } -#line 3145 "parser.tab.c" - break; - - case 200: -#line 812 "parser.y" - { (yyval.expr) = new_function_expression(ctx, NULL, (yyvsp[-4].parameter_list), (yyvsp[-1].source_elements), NULL, (yyvsp[-5].srcptr), (yyvsp[0].srcptr)-(yyvsp[-5].srcptr)); } -#line 3151 "parser.tab.c" - break; - - case 201: -#line 816 "parser.y" - { (yyval.literal) = new_string_literal(ctx, compiler_alloc_string_len(ctx->compiler, (yyvsp[0].identifier), lstrlenW((yyvsp[0].identifier)))); } -#line 3157 "parser.tab.c" - break; - - case 202: -#line 817 "parser.y" - { (yyval.literal) = new_string_literal(ctx, (yyvsp[0].str)); } -#line 3163 "parser.tab.c" - break; - - case 203: -#line 818 "parser.y" - { (yyval.literal) = (yyvsp[0].literal); } -#line 3169 "parser.tab.c" - break; - - case 204: -#line 822 "parser.y" - { (yyval.identifier) = NULL; } -#line 3175 "parser.tab.c" - break; - - case 205: -#line 823 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3181 "parser.tab.c" - break; - - case 206: -#line 827 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3187 "parser.tab.c" - break; - - case 207: -#line 829 "parser.y" - { - if(ctx->script->version < SCRIPTLANGUAGEVERSION_ES5) { - WARN("%s keyword used as an identifier in legacy mode.\n", - debugstr_w((yyvsp[0].identifier))); - YYABORT; - } - (yyval.identifier) = (yyvsp[0].identifier); - } -#line 3200 "parser.tab.c" - break; - - case 208: -#line 839 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3206 "parser.tab.c" - break; - - case 209: -#line 840 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3212 "parser.tab.c" - break; - - case 210: -#line 841 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3218 "parser.tab.c" - break; - - case 211: -#line 842 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3224 "parser.tab.c" - break; - - case 212: -#line 843 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3230 "parser.tab.c" - break; - - case 213: -#line 844 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3236 "parser.tab.c" - break; - - case 214: -#line 845 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3242 "parser.tab.c" - break; - - case 215: -#line 846 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3248 "parser.tab.c" - break; - - case 216: -#line 847 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3254 "parser.tab.c" - break; - - case 217: -#line 848 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3260 "parser.tab.c" - break; - - case 218: -#line 849 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3266 "parser.tab.c" - break; - - case 219: -#line 850 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3272 "parser.tab.c" - break; - - case 220: -#line 851 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3278 "parser.tab.c" - break; - - case 221: -#line 852 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3284 "parser.tab.c" - break; - - case 222: -#line 853 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3290 "parser.tab.c" - break; - - case 223: -#line 854 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3296 "parser.tab.c" - break; - - case 224: -#line 855 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3302 "parser.tab.c" - break; - - case 225: -#line 856 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3308 "parser.tab.c" - break; - - case 226: -#line 857 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3314 "parser.tab.c" - break; - - case 227: -#line 858 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3320 "parser.tab.c" - break; - - case 228: -#line 859 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3326 "parser.tab.c" - break; - - case 229: -#line 860 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3332 "parser.tab.c" - break; - - case 230: -#line 861 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3338 "parser.tab.c" - break; - - case 231: -#line 862 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3344 "parser.tab.c" - break; - - case 232: -#line 863 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3350 "parser.tab.c" - break; - - case 233: -#line 864 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3356 "parser.tab.c" - break; - - case 234: -#line 865 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3362 "parser.tab.c" - break; - - case 235: -#line 866 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3368 "parser.tab.c" - break; - - case 236: -#line 867 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3374 "parser.tab.c" - break; - - case 237: -#line 868 "parser.y" - { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3380 "parser.tab.c" - break; - - case 238: -#line 872 "parser.y" - { (yyval.literal) = new_null_literal(ctx); } -#line 3386 "parser.tab.c" - break; - - case 239: -#line 873 "parser.y" - { (yyval.literal) = (yyvsp[0].literal); } -#line 3392 "parser.tab.c" - break; - - case 240: -#line 874 "parser.y" - { (yyval.literal) = (yyvsp[0].literal); } -#line 3398 "parser.tab.c" - break; - - case 241: -#line 875 "parser.y" - { (yyval.literal) = new_string_literal(ctx, (yyvsp[0].str)); } -#line 3404 "parser.tab.c" - break; - - case 242: -#line 876 "parser.y" - { (yyval.literal) = parse_regexp(ctx); - if(!(yyval.literal)) YYABORT; } -#line 3411 "parser.tab.c" - break; - - case 243: -#line 878 "parser.y" - { (yyval.literal) = parse_regexp(ctx); - if(!(yyval.literal)) YYABORT; } -#line 3418 "parser.tab.c" - break; - - case 244: -#line 883 "parser.y" - { (yyval.literal) = new_boolean_literal(ctx, VARIANT_TRUE); } -#line 3424 "parser.tab.c" - break; - - case 245: -#line 884 "parser.y" - { (yyval.literal) = new_boolean_literal(ctx, VARIANT_FALSE); } -#line 3430 "parser.tab.c" - break; - - case 246: -#line 885 "parser.y" - { (yyval.literal) = (yyvsp[0].literal); } -#line 3436 "parser.tab.c" - break; - - case 248: -#line 889 "parser.y" - { if(!allow_auto_semicolon(ctx)) {YYABORT;} } -#line 3442 "parser.tab.c" - break; - - case 249: -#line 892 "parser.y" - { (yyval.srcptr) = ctx->ptr; } -#line 3448 "parser.tab.c" - break; - - case 250: -#line 893 "parser.y" - { set_error(ctx, JS_E_MISSING_LBRACKET); YYABORT; } -#line 3454 "parser.tab.c" - break; - - case 252: -#line 897 "parser.y" - { set_error(ctx, JS_E_MISSING_RBRACKET); YYABORT; } -#line 3460 "parser.tab.c" - break; - - case 254: -#line 901 "parser.y" - { set_error(ctx, JS_E_MISSING_SEMICOLON); YYABORT; } -#line 3466 "parser.tab.c" - break; - - -#line 3470 "parser.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (ctx, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (ctx, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, ctx); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, ctx); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (ctx, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, ctx); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, ctx); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 903 "parser.y" - - -static BOOL allow_auto_semicolon(parser_ctx_t *ctx) -{ - return ctx->nl || ctx->ptr == ctx->end || *(ctx->ptr-1) == '}'; -} - -static void *new_statement(parser_ctx_t *ctx, statement_type_t type, size_t size) -{ - statement_t *stat; - - stat = parser_alloc(ctx, size ? size : sizeof(*stat)); - if(!stat) - return NULL; - - stat->type = type; - stat->next = NULL; - - return stat; -} - -static literal_t *new_string_literal(parser_ctx_t *ctx, jsstr_t *str) -{ - literal_t *ret = parser_alloc(ctx, sizeof(literal_t)); - - ret->type = LT_STRING; - ret->u.str = str; - - return ret; -} - -static literal_t *new_null_literal(parser_ctx_t *ctx) -{ - literal_t *ret = parser_alloc(ctx, sizeof(literal_t)); - - ret->type = LT_NULL; - - return ret; -} - -static property_definition_t *new_property_definition(parser_ctx_t *ctx, property_definition_type_t type, - literal_t *name, expression_t *value) -{ - property_definition_t *ret = parser_alloc(ctx, sizeof(property_definition_t)); - - ret->type = type; - ret->name = name; - ret->value = value; - ret->next = NULL; - - return ret; -} - -static property_list_t *new_property_list(parser_ctx_t *ctx, property_definition_t *prop) -{ - property_list_t *ret = parser_alloc_tmp(ctx, sizeof(property_list_t)); - ret->head = ret->tail = prop; - return ret; -} - -static property_list_t *property_list_add(parser_ctx_t *ctx, property_list_t *list, property_definition_t *prop) -{ - list->tail = list->tail->next = prop; - return list; -} - -static array_element_t *new_array_element(parser_ctx_t *ctx, int elision, expression_t *expr) -{ - array_element_t *ret = parser_alloc(ctx, sizeof(array_element_t)); - - ret->elision = elision; - ret->expr = expr; - ret->next = NULL; - - return ret; -} - -static element_list_t *new_element_list(parser_ctx_t *ctx, int elision, expression_t *expr) -{ - element_list_t *ret = parser_alloc_tmp(ctx, sizeof(element_list_t)); - - ret->head = ret->tail = new_array_element(ctx, elision, expr); - - return ret; -} - -static element_list_t *element_list_add(parser_ctx_t *ctx, element_list_t *list, int elision, expression_t *expr) -{ - list->tail = list->tail->next = new_array_element(ctx, elision, expr); - - return list; -} - -static argument_t *new_argument(parser_ctx_t *ctx, expression_t *expr) -{ - argument_t *ret = parser_alloc(ctx, sizeof(argument_t)); - - ret->expr = expr; - ret->next = NULL; - - return ret; -} - -static argument_list_t *new_argument_list(parser_ctx_t *ctx, expression_t *expr) -{ - argument_list_t *ret = parser_alloc_tmp(ctx, sizeof(argument_list_t)); - - ret->head = ret->tail = new_argument(ctx, expr); - - return ret; -} - -static argument_list_t *argument_list_add(parser_ctx_t *ctx, argument_list_t *list, expression_t *expr) -{ - list->tail = list->tail->next = new_argument(ctx, expr); - - return list; -} - -static catch_block_t *new_catch_block(parser_ctx_t *ctx, const WCHAR *identifier, statement_t *statement) -{ - catch_block_t *ret = parser_alloc(ctx, sizeof(catch_block_t)); - - ret->identifier = identifier; - ret->statement = statement; - - return ret; -} - -static case_clausule_t *new_case_clausule(parser_ctx_t *ctx, expression_t *expr, statement_list_t *stat_list) -{ - case_clausule_t *ret = parser_alloc(ctx, sizeof(case_clausule_t)); - - ret->expr = expr; - ret->stat = stat_list ? stat_list->head : NULL; - ret->next = NULL; - - return ret; -} - -static case_list_t *new_case_list(parser_ctx_t *ctx, case_clausule_t *case_clausule) -{ - case_list_t *ret = parser_alloc_tmp(ctx, sizeof(case_list_t)); - - ret->head = ret->tail = case_clausule; - - return ret; -} - -static case_list_t *case_list_add(parser_ctx_t *ctx, case_list_t *list, case_clausule_t *case_clausule) -{ - list->tail = list->tail->next = case_clausule; - - return list; -} - -static case_clausule_t *new_case_block(parser_ctx_t *ctx, case_list_t *case_list1, - case_clausule_t *default_clausule, case_list_t *case_list2) -{ - case_clausule_t *ret = NULL, *iter = NULL, *iter2; - statement_t *stat = NULL; - - if(case_list1) { - ret = case_list1->head; - iter = case_list1->tail; - } - - if(default_clausule) { - if(ret) - iter = iter->next = default_clausule; - else - ret = iter = default_clausule; - } - - if(case_list2) { - if(ret) - iter->next = case_list2->head; - else - ret = case_list2->head; - } - - if(!ret) - return NULL; - - for(iter = ret; iter; iter = iter->next) { - for(iter2 = iter; iter2 && !iter2->stat; iter2 = iter2->next); - if(!iter2) - break; - - while(iter != iter2) { - iter->stat = iter2->stat; - iter = iter->next; - } - - if(stat) { - while(stat->next) - stat = stat->next; - stat->next = iter->stat; - }else { - stat = iter->stat; - } - } - - return ret; -} - -static statement_t *new_block_statement(parser_ctx_t *ctx, statement_list_t *list) -{ - block_statement_t *ret; - - ret = new_statement(ctx, STAT_BLOCK, sizeof(*ret)); - if(!ret) - return NULL; - - ret->stat_list = list ? list->head : NULL; - - return &ret->stat; -} - -static variable_declaration_t *new_variable_declaration(parser_ctx_t *ctx, const WCHAR *identifier, expression_t *expr) -{ - variable_declaration_t *ret = parser_alloc(ctx, sizeof(variable_declaration_t)); - - ret->identifier = identifier; - ret->expr = expr; - ret->next = NULL; - ret->global_next = NULL; - - return ret; -} - -static variable_list_t *new_variable_list(parser_ctx_t *ctx, variable_declaration_t *decl) -{ - variable_list_t *ret = parser_alloc_tmp(ctx, sizeof(variable_list_t)); - - ret->head = ret->tail = decl; - - return ret; -} - -static variable_list_t *variable_list_add(parser_ctx_t *ctx, variable_list_t *list, variable_declaration_t *decl) -{ - list->tail = list->tail->next = decl; - - return list; -} - -static statement_t *new_var_statement(parser_ctx_t *ctx, variable_list_t *variable_list) -{ - var_statement_t *ret; - - ret = new_statement(ctx, STAT_VAR, sizeof(*ret)); - if(!ret) - return NULL; - - ret->variable_list = variable_list->head; - - return &ret->stat; -} - -static statement_t *new_expression_statement(parser_ctx_t *ctx, expression_t *expr) -{ - expression_statement_t *ret; - - ret = new_statement(ctx, STAT_EXPR, sizeof(*ret)); - if(!ret) - return NULL; - - ret->expr = expr; - - return &ret->stat; -} - -static statement_t *new_if_statement(parser_ctx_t *ctx, expression_t *expr, statement_t *if_stat, statement_t *else_stat) -{ - if_statement_t *ret; - - ret = new_statement(ctx, STAT_IF, sizeof(*ret)); - if(!ret) - return NULL; - - ret->expr = expr; - ret->if_stat = if_stat; - ret->else_stat = else_stat; - - return &ret->stat; -} - -static statement_t *new_while_statement(parser_ctx_t *ctx, BOOL dowhile, expression_t *expr, statement_t *stat) -{ - while_statement_t *ret; - - ret = new_statement(ctx, STAT_WHILE, sizeof(*ret)); - if(!ret) - return NULL; - - ret->do_while = dowhile; - ret->expr = expr; - ret->statement = stat; - - return &ret->stat; -} - -static statement_t *new_for_statement(parser_ctx_t *ctx, variable_list_t *variable_list, expression_t *begin_expr, - expression_t *expr, expression_t *end_expr, statement_t *statement) -{ - for_statement_t *ret; - - ret = new_statement(ctx, STAT_FOR, sizeof(*ret)); - if(!ret) - return NULL; - - ret->variable_list = variable_list ? variable_list->head : NULL; - ret->begin_expr = begin_expr; - ret->expr = expr; - ret->end_expr = end_expr; - ret->statement = statement; - - return &ret->stat; -} - -static statement_t *new_forin_statement(parser_ctx_t *ctx, variable_declaration_t *variable, expression_t *expr, - expression_t *in_expr, statement_t *statement) -{ - forin_statement_t *ret; - - ret = new_statement(ctx, STAT_FORIN, sizeof(*ret)); - if(!ret) - return NULL; - - ret->variable = variable; - ret->expr = expr; - ret->in_expr = in_expr; - ret->statement = statement; - - return &ret->stat; -} - -static statement_t *new_continue_statement(parser_ctx_t *ctx, const WCHAR *identifier) -{ - branch_statement_t *ret; - - ret = new_statement(ctx, STAT_CONTINUE, sizeof(*ret)); - if(!ret) - return NULL; - - ret->identifier = identifier; - - return &ret->stat; -} - -static statement_t *new_break_statement(parser_ctx_t *ctx, const WCHAR *identifier) -{ - branch_statement_t *ret; - - ret = new_statement(ctx, STAT_BREAK, sizeof(*ret)); - if(!ret) - return NULL; - - ret->identifier = identifier; - - return &ret->stat; -} - -static statement_t *new_return_statement(parser_ctx_t *ctx, expression_t *expr) -{ - expression_statement_t *ret; - - ret = new_statement(ctx, STAT_RETURN, sizeof(*ret)); - if(!ret) - return NULL; - - ret->expr = expr; - - return &ret->stat; -} - -static statement_t *new_with_statement(parser_ctx_t *ctx, expression_t *expr, statement_t *statement) -{ - with_statement_t *ret; - - ret = new_statement(ctx, STAT_WITH, sizeof(*ret)); - if(!ret) - return NULL; - - ret->expr = expr; - ret->statement = statement; - - return &ret->stat; -} - -static statement_t *new_labelled_statement(parser_ctx_t *ctx, const WCHAR *identifier, statement_t *statement) -{ - labelled_statement_t *ret; - - ret = new_statement(ctx, STAT_LABEL, sizeof(*ret)); - if(!ret) - return NULL; - - ret->identifier = identifier; - ret->statement = statement; - - return &ret->stat; -} - -static statement_t *new_switch_statement(parser_ctx_t *ctx, expression_t *expr, case_clausule_t *case_list) -{ - switch_statement_t *ret; - - ret = new_statement(ctx, STAT_SWITCH, sizeof(*ret)); - if(!ret) - return NULL; - - ret->expr = expr; - ret->case_list = case_list; - - return &ret->stat; -} - -static statement_t *new_throw_statement(parser_ctx_t *ctx, expression_t *expr) -{ - expression_statement_t *ret; - - ret = new_statement(ctx, STAT_THROW, sizeof(*ret)); - if(!ret) - return NULL; - - ret->expr = expr; - - return &ret->stat; -} - -static statement_t *new_try_statement(parser_ctx_t *ctx, statement_t *try_statement, - catch_block_t *catch_block, statement_t *finally_statement) -{ - try_statement_t *ret; - - ret = new_statement(ctx, STAT_TRY, sizeof(*ret)); - if(!ret) - return NULL; - - ret->try_statement = try_statement; - ret->catch_block = catch_block; - ret->finally_statement = finally_statement; - - return &ret->stat; -} - -static parameter_t *new_parameter(parser_ctx_t *ctx, const WCHAR *identifier) -{ - parameter_t *ret = parser_alloc(ctx, sizeof(parameter_t)); - - ret->identifier = identifier; - ret->next = NULL; - - return ret; -} - -static parameter_list_t *new_parameter_list(parser_ctx_t *ctx, const WCHAR *identifier) -{ - parameter_list_t *ret = parser_alloc_tmp(ctx, sizeof(parameter_list_t)); - - ret->head = ret->tail = new_parameter(ctx, identifier); - - return ret; -} - -static parameter_list_t *parameter_list_add(parser_ctx_t *ctx, parameter_list_t *list, const WCHAR *identifier) -{ - list->tail = list->tail->next = new_parameter(ctx, identifier); - - return list; -} - -static expression_t *new_function_expression(parser_ctx_t *ctx, const WCHAR *identifier, parameter_list_t *parameter_list, - source_elements_t *source_elements, const WCHAR *event_target, const WCHAR *src_str, DWORD src_len) -{ - function_expression_t *ret = new_expression(ctx, EXPR_FUNC, sizeof(*ret)); - - ret->identifier = identifier; - ret->parameter_list = parameter_list ? parameter_list->head : NULL; - ret->source_elements = source_elements; - ret->event_target = event_target; - ret->src_str = src_str; - ret->src_len = src_len; - ret->next = NULL; - - return &ret->expr; -} - -static void *new_expression(parser_ctx_t *ctx, expression_type_t type, size_t size) -{ - expression_t *ret = parser_alloc(ctx, size ? size : sizeof(*ret)); - - ret->type = type; - - return ret; -} - -static expression_t *new_binary_expression(parser_ctx_t *ctx, expression_type_t type, - expression_t *expression1, expression_t *expression2) -{ - binary_expression_t *ret = new_expression(ctx, type, sizeof(*ret)); - - ret->expression1 = expression1; - ret->expression2 = expression2; - - return &ret->expr; -} - -static expression_t *new_unary_expression(parser_ctx_t *ctx, expression_type_t type, expression_t *expression) -{ - unary_expression_t *ret = new_expression(ctx, type, sizeof(*ret)); - - ret->expression = expression; - - return &ret->expr; -} - -static expression_t *new_conditional_expression(parser_ctx_t *ctx, expression_t *expression, - expression_t *true_expression, expression_t *false_expression) -{ - conditional_expression_t *ret = new_expression(ctx, EXPR_COND, sizeof(*ret)); - - ret->expression = expression; - ret->true_expression = true_expression; - ret->false_expression = false_expression; - - return &ret->expr; -} - -static expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *expression, const WCHAR *identifier) -{ - member_expression_t *ret = new_expression(ctx, EXPR_MEMBER, sizeof(*ret)); - - ret->expression = expression; - ret->identifier = identifier; - - return &ret->expr; -} - -static expression_t *new_new_expression(parser_ctx_t *ctx, expression_t *expression, argument_list_t *argument_list) -{ - call_expression_t *ret = new_expression(ctx, EXPR_NEW, sizeof(*ret)); - - ret->expression = expression; - ret->argument_list = argument_list ? argument_list->head : NULL; - - return &ret->expr; -} - -static expression_t *new_call_expression(parser_ctx_t *ctx, expression_t *expression, argument_list_t *argument_list) -{ - call_expression_t *ret = new_expression(ctx, EXPR_CALL, sizeof(*ret)); - - ret->expression = expression; - ret->argument_list = argument_list ? argument_list->head : NULL; - - return &ret->expr; -} - -static int parser_error(parser_ctx_t *ctx, const char *str) -{ - return 0; -} - -static void set_error(parser_ctx_t *ctx, UINT error) -{ - ctx->hres = error; -} - -static BOOL explicit_error(parser_ctx_t *ctx, void *obj, WCHAR next) -{ - if(obj || *(ctx->ptr-1)==next) return TRUE; - - set_error(ctx, JS_E_SYNTAX); - return FALSE; -} - - -static expression_t *new_identifier_expression(parser_ctx_t *ctx, const WCHAR *identifier) -{ - identifier_expression_t *ret = new_expression(ctx, EXPR_IDENT, sizeof(*ret)); - - ret->identifier = identifier; - - return &ret->expr; -} - -static expression_t *new_array_literal_expression(parser_ctx_t *ctx, element_list_t *element_list, int length) -{ - array_literal_expression_t *ret = new_expression(ctx, EXPR_ARRAYLIT, sizeof(*ret)); - - ret->element_list = element_list ? element_list->head : NULL; - ret->length = length; - - return &ret->expr; -} - -static expression_t *new_prop_and_value_expression(parser_ctx_t *ctx, property_list_t *property_list) -{ - property_value_expression_t *ret = new_expression(ctx, EXPR_PROPVAL, sizeof(*ret)); - - ret->property_list = property_list ? property_list->head : NULL; - - return &ret->expr; -} - -static expression_t *new_literal_expression(parser_ctx_t *ctx, literal_t *literal) -{ - literal_expression_t *ret = new_expression(ctx, EXPR_LITERAL, sizeof(*ret)); - - ret->literal = literal; - - return &ret->expr; -} - -static source_elements_t *new_source_elements(parser_ctx_t *ctx) -{ - source_elements_t *ret = parser_alloc(ctx, sizeof(source_elements_t)); - - memset(ret, 0, sizeof(*ret)); - - return ret; -} - -static source_elements_t *source_elements_add_statement(source_elements_t *source_elements, statement_t *statement) -{ - if(source_elements->statement_tail) - source_elements->statement_tail = source_elements->statement_tail->next = statement; - else - source_elements->statement = source_elements->statement_tail = statement; - - return source_elements; -} - -static statement_list_t *new_statement_list(parser_ctx_t *ctx, statement_t *statement) -{ - statement_list_t *ret = parser_alloc_tmp(ctx, sizeof(statement_list_t)); - - ret->head = ret->tail = statement; - - return ret; -} - -static statement_list_t *statement_list_add(statement_list_t *list, statement_t *statement) -{ - list->tail = list->tail->next = statement; - - return list; -} - -static void program_parsed(parser_ctx_t *ctx, source_elements_t *source) -{ - ctx->source = source; - if(!ctx->lexer_error) - ctx->hres = S_OK; -} - -void parser_release(parser_ctx_t *ctx) -{ - script_release(ctx->script); - heap_pool_free(&ctx->heap); - heap_free(ctx); -} - -HRESULT script_parse(script_ctx_t *ctx, struct _compiler_ctx_t *compiler, const WCHAR *code, const WCHAR *delimiter, BOOL from_eval, - parser_ctx_t **ret) -{ - parser_ctx_t *parser_ctx; - heap_pool_t *mark; - HRESULT hres; - - const WCHAR html_tagW[] = {'<','/','s','c','r','i','p','t','>',0}; - - parser_ctx = heap_alloc_zero(sizeof(parser_ctx_t)); - if(!parser_ctx) - return E_OUTOFMEMORY; - - parser_ctx->hres = JS_E_SYNTAX; - parser_ctx->is_html = delimiter && !wcsicmp(delimiter, html_tagW); - - parser_ctx->begin = parser_ctx->ptr = code; - parser_ctx->end = parser_ctx->begin + lstrlenW(parser_ctx->begin); - - script_addref(ctx); - parser_ctx->script = ctx; - - mark = heap_pool_mark(&ctx->tmp_heap); - heap_pool_init(&parser_ctx->heap); - - parser_ctx->compiler = compiler; - parser_parse(parser_ctx); - parser_ctx->compiler = NULL; - - heap_pool_clear(mark); - hres = parser_ctx->hres; - if(FAILED(hres)) { - WARN("parser failed around %s\n", - debugstr_w(parser_ctx->begin+20 > parser_ctx->ptr ? parser_ctx->begin : parser_ctx->ptr-20)); - parser_release(parser_ctx); - return hres; - } - - *ret = parser_ctx; - return S_OK; -} diff --git a/dll/win32/jscript/parser.tab.h b/dll/win32/jscript/parser.tab.h deleted file mode 100644 index 7f06a4d34c3..00000000000 --- a/dll/win32/jscript/parser.tab.h +++ /dev/null @@ -1,140 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED -# define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - kBREAK = 258, - kCASE = 259, - kCATCH = 260, - kCONTINUE = 261, - kDEFAULT = 262, - kDELETE = 263, - kDO = 264, - kELSE = 265, - kFUNCTION = 266, - kIF = 267, - kFINALLY = 268, - kFOR = 269, - kGET = 270, - kIN = 271, - kSET = 272, - kINSTANCEOF = 273, - kNEW = 274, - kNULL = 275, - kRETURN = 276, - kSWITCH = 277, - kTHIS = 278, - kTHROW = 279, - kTRUE = 280, - kFALSE = 281, - kTRY = 282, - kTYPEOF = 283, - kVAR = 284, - kVOID = 285, - kWHILE = 286, - kWITH = 287, - tANDAND = 288, - tOROR = 289, - tINC = 290, - tDEC = 291, - tHTMLCOMMENT = 292, - kDIVEQ = 293, - kDCOL = 294, - tIdentifier = 295, - tAssignOper = 296, - tEqOper = 297, - tShiftOper = 298, - tRelOper = 299, - tNumericLiteral = 300, - tBooleanLiteral = 301, - tStringLiteral = 302, - tEOF = 303, - LOWER_THAN_ELSE = 304 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 147 "parser.y" - - int ival; - const WCHAR *srcptr; - jsstr_t *str; - literal_t *literal; - struct _argument_list_t *argument_list; - case_clausule_t *case_clausule; - struct _case_list_t *case_list; - catch_block_t *catch_block; - struct _element_list_t *element_list; - expression_t *expr; - const WCHAR *identifier; - struct _parameter_list_t *parameter_list; - struct _property_list_t *property_list; - property_definition_t *property_definition; - source_elements_t *source_elements; - statement_t *statement; - struct _statement_list_t *statement_list; - struct _variable_list_t *variable_list; - variable_declaration_t *variable_declaration; - -#line 129 "parser.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int parser_parse (parser_ctx_t *ctx); - -#endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED */ diff --git a/dll/win32/msi/CMakeLists.txt b/dll/win32/msi/CMakeLists.txt index 73600cf4c6b..87d2110eabb 100644 --- a/dll/win32/msi/CMakeLists.txt +++ b/dll/win32/msi/CMakeLists.txt @@ -48,9 +48,12 @@ list(APPEND SOURCE upgrade.c where.c) +BISON_TARGET(cond cond.y ${CMAKE_CURRENT_BINARY_DIR}/cond.tab.c COMPILE_FLAGS "-p cond_") +BISON_TARGET(sql sql.y ${CMAKE_CURRENT_BINARY_DIR}/sql.tab.c COMPILE_FLAGS "-p sql_") + list(APPEND PCH_SKIP_SOURCE - cond.tab.c - sql.tab.c + ${BISON_cond_OUTPUTS} + ${BISON_sql_OUTPUTS} ${CMAKE_CURRENT_BINARY_DIR}/msiserver_i.c ${CMAKE_CURRENT_BINARY_DIR}/msi_stubs.c) diff --git a/dll/win32/msi/cond.tab.c b/dll/win32/msi/cond.tab.c deleted file mode 100644 index 2ea550c96a8..00000000000 --- a/dll/win32/msi/cond.tab.c +++ /dev/null @@ -1,2552 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse cond_parse -#define yylex cond_lex -#define yyerror cond_error -#define yydebug cond_debug -#define yynerrs cond_nerrs - - -/* Copy the first part of user declarations. */ -#line 1 "cond.y" /* yacc.c:339 */ - - -/* - * Implementation of the Microsoft Installer (msi.dll) - * - * Copyright 2003 Mike McCormack for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#define COBJMACROS - -#include "config.h" - -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "msi.h" -#include "msiquery.h" -#include "objbase.h" -#include "oleauto.h" - -#include "msipriv.h" -#include "msiserver.h" -#include "wine/debug.h" -#include "wine/unicode.h" -#include "wine/list.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msi); - -typedef struct tag_yyinput -{ - MSIPACKAGE *package; - LPCWSTR str; - INT n; - MSICONDITION result; - struct list mem; -} COND_input; - -struct cond_str { - LPCWSTR data; - INT len; -}; - -struct value { - enum value_type { - VALUE_INTEGER, - VALUE_LITERAL, - VALUE_SYMBOL - } type; - union { - INT integer; - WCHAR *string; - } u; -}; - -static LPWSTR COND_GetString( COND_input *info, const struct cond_str *str ); -static LPWSTR COND_GetLiteral( COND_input *info, const struct cond_str *str ); -static int cond_lex( void *COND_lval, COND_input *info); -static int cond_error( COND_input *info, const char *str); - -static void *cond_alloc( COND_input *cond, unsigned int sz ); -static void *cond_track_mem( COND_input *cond, void *ptr, unsigned int sz ); -static void cond_free( void *ptr ); - -static INT compare_int( INT a, INT operator, INT b ); -static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ); - -static BOOL num_from_prop( LPCWSTR p, INT *val ) -{ - INT ret = 0, sign = 1; - - if (!p) - return FALSE; - if (*p == '-') - { - sign = -1; - p++; - } - if (!*p) - return FALSE; - while (*p) - { - if( *p < '0' || *p > '9' ) - return FALSE; - ret = ret*10 + (*p - '0'); - p++; - } - *val = ret*sign; - return TRUE; -} - -static void value_free( struct value val ) -{ - if (val.type != VALUE_INTEGER) - cond_free( val.u.string ); -} - - -#line 188 "cond.tab.c" /* yacc.c:339 */ - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - - -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int cond_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - COND_SPACE = 258, - COND_EOF = 259, - COND_OR = 260, - COND_AND = 261, - COND_NOT = 262, - COND_XOR = 263, - COND_IMP = 264, - COND_EQV = 265, - COND_LT = 266, - COND_GT = 267, - COND_EQ = 268, - COND_NE = 269, - COND_GE = 270, - COND_LE = 271, - COND_ILT = 272, - COND_IGT = 273, - COND_IEQ = 274, - COND_INE = 275, - COND_IGE = 276, - COND_ILE = 277, - COND_LPAR = 278, - COND_RPAR = 279, - COND_TILDA = 280, - COND_SS = 281, - COND_ISS = 282, - COND_ILHS = 283, - COND_IRHS = 284, - COND_LHS = 285, - COND_RHS = 286, - COND_PERCENT = 287, - COND_DOLLARS = 288, - COND_QUESTION = 289, - COND_AMPER = 290, - COND_EXCLAM = 291, - COND_IDENT = 292, - COND_NUMBER = 293, - COND_LITER = 294, - COND_ERROR = 295 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED - -union YYSTYPE -{ -#line 122 "cond.y" /* yacc.c:355 */ - - struct cond_str str; - struct value value; - LPWSTR identifier; - INT operator; - BOOL bool; - -#line 274 "cond.tab.c" /* yacc.c:355 */ -}; - -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int cond_parse (COND_input *info); - - - -/* Copy the second part of user declarations. */ - -#line 290 "cond.tab.c" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 24 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 67 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 41 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 8 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 41 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 56 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 295 - -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 149, 149, 155, 162, 166, 170, 174, 178, 185, - 189, 196, 200, 208, 243, 251, 252, 253, 254, 255, - 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 272, 286, 301, 309, 319, 336, 353, - 370, 390 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "COND_SPACE", "COND_EOF", "COND_OR", - "COND_AND", "COND_NOT", "COND_XOR", "COND_IMP", "COND_EQV", "COND_LT", - "COND_GT", "COND_EQ", "COND_NE", "COND_GE", "COND_LE", "COND_ILT", - "COND_IGT", "COND_IEQ", "COND_INE", "COND_IGE", "COND_ILE", "COND_LPAR", - "COND_RPAR", "COND_TILDA", "COND_SS", "COND_ISS", "COND_ILHS", - "COND_IRHS", "COND_LHS", "COND_RHS", "COND_PERCENT", "COND_DOLLARS", - "COND_QUESTION", "COND_AMPER", "COND_EXCLAM", "COND_IDENT", - "COND_NUMBER", "COND_LITER", "COND_ERROR", "$accept", "condition", - "expression", "boolean_term", "boolean_factor", "operator", "value", - "identifier", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295 -}; -# endif - -#define YYPACT_NINF -45 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-45))) - -#define YYTABLE_NINF -1 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int8 yypact[] = -{ - -7, -7, -7, -36, -36, -36, -36, -36, -45, -45, - -45, 2, 5, 3, -45, 23, -45, -45, -2, -45, - -45, -45, -45, -45, -45, -7, -7, -7, -7, -7, - -45, -45, -45, -45, -45, -45, -45, -45, -45, -45, - -45, -45, -45, -45, -45, -45, -45, -45, 24, -45, - 3, 3, 3, 3, -45, -45 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 3, 0, 0, 0, 0, 0, 0, 0, 41, 36, - 35, 0, 2, 4, 9, 12, 33, 11, 0, 34, - 37, 38, 39, 40, 1, 0, 0, 0, 0, 0, - 17, 18, 15, 16, 20, 19, 24, 25, 22, 23, - 27, 26, 21, 28, 31, 32, 29, 30, 0, 14, - 5, 7, 6, 8, 10, 13 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -45, -45, 9, 39, 4, -45, -44, 14 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 11, 12, 13, 14, 48, 15, 16 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 1, 8, 24, 25, 55, 17, 26, 27, 28, 29, - 25, 18, 0, 26, 27, 28, 2, 19, 20, 21, - 22, 23, 49, 0, 0, 3, 4, 5, 6, 7, - 8, 9, 10, 54, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 0, 0, 0, 42, - 43, 44, 45, 46, 47, 0, 3, 4, 5, 6, - 7, 8, 9, 10, 50, 51, 52, 53 -}; - -static const yytype_int8 yycheck[] = -{ - 7, 37, 0, 5, 48, 1, 8, 9, 10, 6, - 5, 2, -1, 8, 9, 10, 23, 3, 4, 5, - 6, 7, 24, -1, -1, 32, 33, 34, 35, 36, - 37, 38, 39, 29, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, -1, -1, -1, 26, - 27, 28, 29, 30, 31, -1, 32, 33, 34, 35, - 36, 37, 38, 39, 25, 26, 27, 28 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 7, 23, 32, 33, 34, 35, 36, 37, 38, - 39, 42, 43, 44, 45, 47, 48, 45, 43, 48, - 48, 48, 48, 48, 0, 5, 8, 9, 10, 6, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 26, 27, 28, 29, 30, 31, 46, 24, - 44, 44, 44, 44, 45, 47 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 41, 42, 42, 43, 43, 43, 43, 43, 44, - 44, 45, 45, 45, 45, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 47, 47, 47, 47, 47, 47, 47, - 47, 48 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 0, 1, 3, 3, 3, 3, 1, - 3, 2, 1, 3, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, - 2, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (info, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, info); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, COND_input *info) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (info); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, COND_input *info) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, info); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, COND_input *info) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , info); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, info); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, COND_input *info) -{ - YYUSE (yyvaluep); - YYUSE (info); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (COND_input *info) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, info); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 150 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - cond->result = (yyvsp[0].bool); - } -#line 1420 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 3: -#line 155 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - cond->result = MSICONDITION_NONE; - } -#line 1429 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 4: -#line 163 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = (yyvsp[0].bool); - } -#line 1437 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 5: -#line 167 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = (yyvsp[-2].bool) || (yyvsp[0].bool); - } -#line 1445 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 6: -#line 171 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = !(yyvsp[-2].bool) || (yyvsp[0].bool); - } -#line 1453 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 7: -#line 175 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = ( (yyvsp[-2].bool) || (yyvsp[0].bool) ) && !( (yyvsp[-2].bool) && (yyvsp[0].bool) ); - } -#line 1461 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 8: -#line 179 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = ( (yyvsp[-2].bool) && (yyvsp[0].bool) ) || ( !(yyvsp[-2].bool) && !(yyvsp[0].bool) ); - } -#line 1469 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 9: -#line 186 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = (yyvsp[0].bool); - } -#line 1477 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 10: -#line 190 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = (yyvsp[-2].bool) && (yyvsp[0].bool); - } -#line 1485 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 11: -#line 197 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = !(yyvsp[0].bool); - } -#line 1493 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 12: -#line 201 "cond.y" /* yacc.c:1651 */ - { - if ((yyvsp[0].value).type == VALUE_INTEGER) - (yyval.bool) = (yyvsp[0].value).u.integer ? 1 : 0; - else - (yyval.bool) = (yyvsp[0].value).u.string && (yyvsp[0].value).u.string[0]; - value_free( (yyvsp[0].value) ); - } -#line 1505 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 13: -#line 209 "cond.y" /* yacc.c:1651 */ - { - if ((yyvsp[-2].value).type == VALUE_INTEGER && (yyvsp[0].value).type == VALUE_INTEGER) - { - (yyval.bool) = compare_int((yyvsp[-2].value).u.integer, (yyvsp[-1].operator), (yyvsp[0].value).u.integer); - } - else if ((yyvsp[-2].value).type != VALUE_INTEGER && (yyvsp[0].value).type != VALUE_INTEGER) - { - (yyval.bool) = compare_string((yyvsp[-2].value).u.string, (yyvsp[-1].operator), (yyvsp[0].value).u.string, - (yyvsp[-2].value).type == VALUE_SYMBOL || (yyvsp[0].value).type == VALUE_SYMBOL); - } - else if ((yyvsp[-2].value).type == VALUE_LITERAL || (yyvsp[0].value).type == VALUE_LITERAL) - { - (yyval.bool) = ((yyvsp[-1].operator) == COND_NE || (yyvsp[-1].operator) == COND_INE ); - } - else if ((yyvsp[-2].value).type == VALUE_SYMBOL) /* symbol operator integer */ - { - int num; - if (num_from_prop( (yyvsp[-2].value).u.string, &num )) - (yyval.bool) = compare_int( num, (yyvsp[-1].operator), (yyvsp[0].value).u.integer ); - else - (yyval.bool) = ((yyvsp[-1].operator) == COND_NE || (yyvsp[-1].operator) == COND_INE ); - } - else /* integer operator symbol */ - { - int num; - if (num_from_prop( (yyvsp[0].value).u.string, &num )) - (yyval.bool) = compare_int( (yyvsp[-2].value).u.integer, (yyvsp[-1].operator), num ); - else - (yyval.bool) = ((yyvsp[-1].operator) == COND_NE || (yyvsp[-1].operator) == COND_INE ); - } - - value_free( (yyvsp[-2].value) ); - value_free( (yyvsp[0].value) ); - } -#line 1544 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 14: -#line 244 "cond.y" /* yacc.c:1651 */ - { - (yyval.bool) = (yyvsp[-1].bool); - } -#line 1552 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 15: -#line 251 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_EQ; } -#line 1558 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 16: -#line 252 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_NE; } -#line 1564 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 17: -#line 253 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_LT; } -#line 1570 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 18: -#line 254 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_GT; } -#line 1576 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 19: -#line 255 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_LE; } -#line 1582 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 20: -#line 256 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_GE; } -#line 1588 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 21: -#line 257 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_SS; } -#line 1594 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 22: -#line 258 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_IEQ; } -#line 1600 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 23: -#line 259 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_INE; } -#line 1606 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 24: -#line 260 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_ILT; } -#line 1612 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 25: -#line 261 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_IGT; } -#line 1618 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 26: -#line 262 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_ILE; } -#line 1624 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 27: -#line 263 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_IGE; } -#line 1630 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 28: -#line 264 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_ISS; } -#line 1636 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 29: -#line 265 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_LHS; } -#line 1642 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 30: -#line 266 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_RHS; } -#line 1648 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 31: -#line 267 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_ILHS; } -#line 1654 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 32: -#line 268 "cond.y" /* yacc.c:1651 */ - { (yyval.operator) = COND_IRHS; } -#line 1660 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 33: -#line 273 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - UINT len; - - (yyval.value).type = VALUE_SYMBOL; - (yyval.value).u.string = msi_dup_property( cond->package->db, (yyvsp[0].identifier) ); - if ((yyval.value).u.string) - { - len = (lstrlenW((yyval.value).u.string) + 1) * sizeof (WCHAR); - (yyval.value).u.string = cond_track_mem( cond, (yyval.value).u.string, len ); - } - cond_free( (yyvsp[0].identifier) ); - } -#line 1678 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 34: -#line 287 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - UINT len = GetEnvironmentVariableW( (yyvsp[0].identifier), NULL, 0 ); - (yyval.value).type = VALUE_SYMBOL; - (yyval.value).u.string = NULL; - if (len++) - { - (yyval.value).u.string = cond_alloc( cond, len*sizeof (WCHAR) ); - if( !(yyval.value).u.string ) - YYABORT; - GetEnvironmentVariableW( (yyvsp[0].identifier), (yyval.value).u.string, len ); - } - cond_free( (yyvsp[0].identifier) ); - } -#line 1697 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 35: -#line 302 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - (yyval.value).type = VALUE_LITERAL; - (yyval.value).u.string = COND_GetLiteral( cond, &(yyvsp[0].str) ); - if( !(yyval.value).u.string ) - YYABORT; - } -#line 1709 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 36: -#line 310 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - LPWSTR szNum = COND_GetString( cond, &(yyvsp[0].str) ); - if( !szNum ) - YYABORT; - (yyval.value).type = VALUE_INTEGER; - (yyval.value).u.integer = atoiW( szNum ); - cond_free( szNum ); - } -#line 1723 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 37: -#line 320 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - - if(MSI_GetComponentStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) - { - (yyval.value).type = VALUE_LITERAL; - (yyval.value).u.string = NULL; - } - else - { - (yyval.value).type = VALUE_INTEGER; - (yyval.value).u.integer = action; - } - cond_free( (yyvsp[0].identifier) ); - } -#line 1744 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 38: -#line 337 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - - if(MSI_GetComponentStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) - { - (yyval.value).type = VALUE_LITERAL; - (yyval.value).u.string = NULL; - } - else - { - (yyval.value).type = VALUE_INTEGER; - (yyval.value).u.integer = install; - } - cond_free( (yyvsp[0].identifier) ); - } -#line 1765 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 39: -#line 354 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - INSTALLSTATE install, action; - - if (MSI_GetFeatureStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) - { - (yyval.value).type = VALUE_LITERAL; - (yyval.value).u.string = NULL; - } - else - { - (yyval.value).type = VALUE_INTEGER; - (yyval.value).u.integer = action; - } - cond_free( (yyvsp[0].identifier) ); - } -#line 1786 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 40: -#line 371 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - INSTALLSTATE install = INSTALLSTATE_UNKNOWN, action = INSTALLSTATE_UNKNOWN; - - if(MSI_GetFeatureStateW(cond->package, (yyvsp[0].identifier), &install, &action ) != ERROR_SUCCESS) - { - (yyval.value).type = VALUE_LITERAL; - (yyval.value).u.string = NULL; - } - else - { - (yyval.value).type = VALUE_INTEGER; - (yyval.value).u.integer = install; - } - cond_free( (yyvsp[0].identifier) ); - } -#line 1807 "cond.tab.c" /* yacc.c:1651 */ - break; - - case 41: -#line 391 "cond.y" /* yacc.c:1651 */ - { - COND_input* cond = (COND_input*) info; - (yyval.identifier) = COND_GetString( cond, &(yyvsp[0].str) ); - if( !(yyval.identifier) ) - YYABORT; - } -#line 1818 "cond.tab.c" /* yacc.c:1651 */ - break; - - -#line 1822 "cond.tab.c" /* yacc.c:1651 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (info, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (info, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, info); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, info); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (info, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, info); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, info); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 399 "cond.y" /* yacc.c:1910 */ - - - -static int COND_IsAlpha( WCHAR x ) -{ - return( ( ( x >= 'A' ) && ( x <= 'Z' ) ) || - ( ( x >= 'a' ) && ( x <= 'z' ) ) || - ( ( x == '_' ) ) ); -} - -static int COND_IsNumber( WCHAR x ) -{ - return( (( x >= '0' ) && ( x <= '9' )) || (x =='-') || (x =='.') ); -} - -static WCHAR *strstriW( const WCHAR *str, const WCHAR *sub ) -{ - LPWSTR strlower, sublower, r; - strlower = CharLowerW( strdupW( str ) ); - sublower = CharLowerW( strdupW( sub ) ); - r = strstrW( strlower, sublower ); - if (r) - r = (LPWSTR)str + (r - strlower); - msi_free( strlower ); - msi_free( sublower ); - return r; -} - -static BOOL str_is_number( LPCWSTR str ) -{ - int i; - - if (!*str) - return FALSE; - - for (i = 0; i < lstrlenW( str ); i++) - if (!isdigitW(str[i])) - return FALSE; - - return TRUE; -} - -static INT compare_substring( LPCWSTR a, INT operator, LPCWSTR b ) -{ - int lhs, rhs; - - /* substring operators return 0 if LHS is missing */ - if (!a || !*a) - return 0; - - /* substring operators return 1 if RHS is missing */ - if (!b || !*b) - return 1; - - /* if both strings contain only numbers, use integer comparison */ - lhs = atoiW(a); - rhs = atoiW(b); - if (str_is_number(a) && str_is_number(b)) - return compare_int( lhs, operator, rhs ); - - switch (operator) - { - case COND_SS: - return strstrW( a, b ) != 0; - case COND_ISS: - return strstriW( a, b ) != 0; - case COND_LHS: - { - int l = strlenW( a ); - int r = strlenW( b ); - if (r > l) return 0; - return !strncmpW( a, b, r ); - } - case COND_RHS: - { - int l = strlenW( a ); - int r = strlenW( b ); - if (r > l) return 0; - return !strncmpW( a + (l - r), b, r ); - } - case COND_ILHS: - { - int l = strlenW( a ); - int r = strlenW( b ); - if (r > l) return 0; - return !strncmpiW( a, b, r ); - } - case COND_IRHS: - { - int l = strlenW( a ); - int r = strlenW( b ); - if (r > l) return 0; - return !strncmpiW( a + (l - r), b, r ); - } - default: - ERR("invalid substring operator\n"); - return 0; - } - return 0; -} - -static INT compare_string( LPCWSTR a, INT operator, LPCWSTR b, BOOL convert ) -{ - if (operator >= COND_SS && operator <= COND_RHS) - return compare_substring( a, operator, b ); - - /* null and empty string are equivalent */ - if (!a) a = szEmpty; - if (!b) b = szEmpty; - - if (convert && str_is_number(a) && str_is_number(b)) - return compare_int( atoiW(a), operator, atoiW(b) ); - - /* a or b may be NULL */ - switch (operator) - { - case COND_LT: - return strcmpW( a, b ) < 0; - case COND_GT: - return strcmpW( a, b ) > 0; - case COND_EQ: - return strcmpW( a, b ) == 0; - case COND_NE: - return strcmpW( a, b ) != 0; - case COND_GE: - return strcmpW( a, b ) >= 0; - case COND_LE: - return strcmpW( a, b ) <= 0; - case COND_ILT: - return strcmpiW( a, b ) < 0; - case COND_IGT: - return strcmpiW( a, b ) > 0; - case COND_IEQ: - return strcmpiW( a, b ) == 0; - case COND_INE: - return strcmpiW( a, b ) != 0; - case COND_IGE: - return strcmpiW( a, b ) >= 0; - case COND_ILE: - return strcmpiW( a, b ) <= 0; - default: - ERR("invalid string operator\n"); - return 0; - } - return 0; -} - - -static INT compare_int( INT a, INT operator, INT b ) -{ - switch (operator) - { - case COND_LT: - case COND_ILT: - return a < b; - case COND_GT: - case COND_IGT: - return a > b; - case COND_EQ: - case COND_IEQ: - return a == b; - case COND_NE: - case COND_INE: - return a != b; - case COND_GE: - case COND_IGE: - return a >= b; - case COND_LE: - case COND_ILE: - return a <= b; - case COND_SS: - case COND_ISS: - return ( a & b ) ? 1 : 0; - case COND_RHS: - return ( ( a & 0xffff ) == b ) ? 1 : 0; - case COND_LHS: - return ( ( (a>>16) & 0xffff ) == b ) ? 1 : 0; - default: - ERR("invalid integer operator\n"); - return 0; - } - return 0; -} - - -static int COND_IsIdent( WCHAR x ) -{ - return( COND_IsAlpha( x ) || COND_IsNumber( x ) || ( x == '_' ) - || ( x == '#' ) || (x == '.') ); -} - -static int COND_GetOperator( COND_input *cond ) -{ - static const struct { - const WCHAR str[4]; - int id; - } table[] = { - { {'~','<','=',0}, COND_ILE }, - { {'~','>','<',0}, COND_ISS }, - { {'~','>','>',0}, COND_IRHS }, - { {'~','<','>',0}, COND_INE }, - { {'~','>','=',0}, COND_IGE }, - { {'~','<','<',0}, COND_ILHS }, - { {'~','=',0}, COND_IEQ }, - { {'~','<',0}, COND_ILT }, - { {'~','>',0}, COND_IGT }, - { {'>','=',0}, COND_GE }, - { {'>','<',0}, COND_SS }, - { {'<','<',0}, COND_LHS }, - { {'<','>',0}, COND_NE }, - { {'<','=',0}, COND_LE }, - { {'>','>',0}, COND_RHS }, - { {'>',0}, COND_GT }, - { {'<',0}, COND_LT }, - { {0}, 0 } - }; - LPCWSTR p = &cond->str[cond->n]; - int i = 0, len; - - while ( 1 ) - { - len = lstrlenW( table[i].str ); - if ( !len || 0 == strncmpW( table[i].str, p, len ) ) - break; - i++; - } - cond->n += len; - return table[i].id; -} - -static int COND_GetOne( struct cond_str *str, COND_input *cond ) -{ - int rc, len = 1; - WCHAR ch; - - str->data = &cond->str[cond->n]; - - ch = str->data[0]; - - switch( ch ) - { - case 0: return 0; - case '(': rc = COND_LPAR; break; - case ')': rc = COND_RPAR; break; - case '&': rc = COND_AMPER; break; - case '!': rc = COND_EXCLAM; break; - case '$': rc = COND_DOLLARS; break; - case '?': rc = COND_QUESTION; break; - case '%': rc = COND_PERCENT; break; - case ' ': rc = COND_SPACE; break; - case '=': rc = COND_EQ; break; - - case '~': - case '<': - case '>': - rc = COND_GetOperator( cond ); - if (!rc) - rc = COND_ERROR; - return rc; - default: - rc = 0; - } - - if ( rc ) - { - cond->n += len; - return rc; - } - - if (ch == '"' ) - { - LPCWSTR p = strchrW( str->data + 1, '"' ); - if (!p) return COND_ERROR; - len = p - str->data + 1; - rc = COND_LITER; - } - else if( COND_IsAlpha( ch ) ) - { - static const WCHAR szNot[] = {'N','O','T',0}; - static const WCHAR szAnd[] = {'A','N','D',0}; - static const WCHAR szXor[] = {'X','O','R',0}; - static const WCHAR szEqv[] = {'E','Q','V',0}; - static const WCHAR szImp[] = {'I','M','P',0}; - static const WCHAR szOr[] = {'O','R',0}; - - while( COND_IsIdent( str->data[len] ) ) - len++; - rc = COND_IDENT; - - if ( len == 3 ) - { - if ( !strncmpiW( str->data, szNot, len ) ) - rc = COND_NOT; - else if( !strncmpiW( str->data, szAnd, len ) ) - rc = COND_AND; - else if( !strncmpiW( str->data, szXor, len ) ) - rc = COND_XOR; - else if( !strncmpiW( str->data, szEqv, len ) ) - rc = COND_EQV; - else if( !strncmpiW( str->data, szImp, len ) ) - rc = COND_IMP; - } - else if( (len == 2) && !strncmpiW( str->data, szOr, len ) ) - rc = COND_OR; - } - else if( COND_IsNumber( ch ) ) - { - while( COND_IsNumber( str->data[len] ) ) - len++; - rc = COND_NUMBER; - } - else - { - ERR("Got unknown character %c(%x)\n",ch,ch); - return COND_ERROR; - } - - cond->n += len; - str->len = len; - - return rc; -} - -static int cond_lex( void *COND_lval, COND_input *cond ) -{ - int rc; - struct cond_str *str = COND_lval; - - do { - rc = COND_GetOne( str, cond ); - } while (rc == COND_SPACE); - - return rc; -} - -static LPWSTR COND_GetString( COND_input *cond, const struct cond_str *str ) -{ - LPWSTR ret; - - ret = cond_alloc( cond, (str->len+1) * sizeof (WCHAR) ); - if( ret ) - { - memcpy( ret, str->data, str->len * sizeof(WCHAR)); - ret[str->len]=0; - } - TRACE("Got identifier %s\n",debugstr_w(ret)); - return ret; -} - -static LPWSTR COND_GetLiteral( COND_input *cond, const struct cond_str *str ) -{ - LPWSTR ret; - - ret = cond_alloc( cond, (str->len-1) * sizeof (WCHAR) ); - if( ret ) - { - memcpy( ret, str->data+1, (str->len-2) * sizeof(WCHAR) ); - ret[str->len - 2]=0; - } - TRACE("Got literal %s\n",debugstr_w(ret)); - return ret; -} - -static void *cond_alloc( COND_input *cond, unsigned int sz ) -{ - struct list *mem; - - mem = msi_alloc( sizeof (struct list) + sz ); - if( !mem ) - return NULL; - - list_add_head( &(cond->mem), mem ); - return mem + 1; -} - -static void *cond_track_mem( COND_input *cond, void *ptr, unsigned int sz ) -{ - void *new_ptr; - - if( !ptr ) - return ptr; - - new_ptr = cond_alloc( cond, sz ); - if( !new_ptr ) - { - msi_free( ptr ); - return NULL; - } - - memcpy( new_ptr, ptr, sz ); - msi_free( ptr ); - return new_ptr; -} - -static void cond_free( void *ptr ) -{ - struct list *mem = (struct list *)ptr - 1; - - if( ptr ) - { - list_remove( mem ); - msi_free( mem ); - } -} - -static int cond_error( COND_input *info, const char *str ) -{ - TRACE("%s\n", str ); - return 0; -} - -MSICONDITION MSI_EvaluateConditionW( MSIPACKAGE *package, LPCWSTR szCondition ) -{ - COND_input cond; - MSICONDITION r; - struct list *mem, *safety; - - TRACE("%s\n", debugstr_w( szCondition ) ); - - if (szCondition == NULL) return MSICONDITION_NONE; - - cond.package = package; - cond.str = szCondition; - cond.n = 0; - cond.result = MSICONDITION_ERROR; - - list_init( &cond.mem ); - - if ( !cond_parse( &cond ) ) - r = cond.result; - else - r = MSICONDITION_ERROR; - - LIST_FOR_EACH_SAFE( mem, safety, &cond.mem ) - { - /* The tracked memory lives directly after the list struct */ - void *ptr = mem + 1; - if ( r != MSICONDITION_ERROR ) - WARN( "condition parser failed to free up some memory: %p\n", ptr ); - cond_free( ptr ); - } - - TRACE("%i <- %s\n", r, debugstr_w(szCondition)); - return r; -} - -MSICONDITION WINAPI MsiEvaluateConditionW( MSIHANDLE hInstall, LPCWSTR szCondition ) -{ - MSIPACKAGE *package; - UINT ret; - - package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE); - if( !package ) - { - HRESULT hr; - BSTR condition; - IWineMsiRemotePackage *remote_package; - - remote_package = (IWineMsiRemotePackage *)msi_get_remote( hInstall ); - if (!remote_package) - return MSICONDITION_ERROR; - - condition = SysAllocString( szCondition ); - if (!condition) - { - IWineMsiRemotePackage_Release( remote_package ); - return ERROR_OUTOFMEMORY; - } - - hr = IWineMsiRemotePackage_EvaluateCondition( remote_package, condition ); - - SysFreeString( condition ); - IWineMsiRemotePackage_Release( remote_package ); - - if (FAILED(hr)) - { - if (HRESULT_FACILITY(hr) == FACILITY_WIN32) - return HRESULT_CODE(hr); - - return ERROR_FUNCTION_FAILED; - } - - return ERROR_SUCCESS; - } - - ret = MSI_EvaluateConditionW( package, szCondition ); - msiobj_release( &package->hdr ); - return ret; -} - -MSICONDITION WINAPI MsiEvaluateConditionA( MSIHANDLE hInstall, LPCSTR szCondition ) -{ - LPWSTR szwCond = NULL; - MSICONDITION r; - - szwCond = strdupAtoW( szCondition ); - if( szCondition && !szwCond ) - return MSICONDITION_ERROR; - - r = MsiEvaluateConditionW( hInstall, szwCond ); - msi_free( szwCond ); - return r; -} diff --git a/dll/win32/msi/sql.tab.c b/dll/win32/msi/sql.tab.c deleted file mode 100644 index 61263a58ef2..00000000000 --- a/dll/win32/msi/sql.tab.c +++ /dev/null @@ -1,2744 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse sql_parse -#define yylex sql_lex -#define yyerror sql_error -#define yydebug sql_debug -#define yynerrs sql_nerrs - - -/* Copy the first part of user declarations. */ -#line 1 "sql.y" /* yacc.c:339 */ - - -/* - * Implementation of the Microsoft Installer (msi.dll) - * - * Copyright 2002-2004 Mike McCormack for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - - -#include "config.h" - -#include -#include -#include - -#include "windef.h" -#include "winbase.h" -#include "query.h" -#include "wine/list.h" -#include "wine/debug.h" -#include "wine/unicode.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msi); - -static UINT SQL_getstring( void *info, const struct sql_str *strdata, LPWSTR *str ); -static INT SQL_getint( void *info ); -static int sql_lex( void *SQL_lval, SQL_input *info ); -static int sql_error( SQL_input *info, const char *str); - -static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table ); -static void *parser_alloc( void *info, unsigned int sz ); -static column_info *parser_alloc_column( void *info, LPCWSTR table, LPCWSTR column ); - -static BOOL SQL_MarkPrimaryKeys( column_info **cols, column_info *keys); - -static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r ); -static struct expr * EXPR_unary( void *info, struct expr *l, UINT op ); -static struct expr * EXPR_column( void *info, const column_info *column ); -static struct expr * EXPR_ival( void *info, int val ); -static struct expr * EXPR_sval( void *info, const struct sql_str *str ); -static struct expr * EXPR_wildcard( void *info ); - -#define PARSER_BUBBLE_UP_VIEW( sql, result, current_view ) \ - *sql->view = current_view; \ - result = current_view - - -#line 134 "sql.tab.c" /* yacc.c:339 */ - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "sql.tab.h". */ -#ifndef YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED -# define YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int sql_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - TK_ALTER = 258, - TK_AND = 259, - TK_BY = 260, - TK_CHAR = 261, - TK_COMMA = 262, - TK_CREATE = 263, - TK_DELETE = 264, - TK_DROP = 265, - TK_DISTINCT = 266, - TK_DOT = 267, - TK_EQ = 268, - TK_FREE = 269, - TK_FROM = 270, - TK_GE = 271, - TK_GT = 272, - TK_HOLD = 273, - TK_ADD = 274, - TK_ID = 275, - TK_ILLEGAL = 276, - TK_INSERT = 277, - TK_INT = 278, - TK_INTEGER = 279, - TK_INTO = 280, - TK_IS = 281, - TK_KEY = 282, - TK_LE = 283, - TK_LONG = 284, - TK_LONGCHAR = 285, - TK_LP = 286, - TK_LT = 287, - TK_LOCALIZABLE = 288, - TK_MINUS = 289, - TK_NE = 290, - TK_NOT = 291, - TK_NULL = 292, - TK_OBJECT = 293, - TK_OR = 294, - TK_ORDER = 295, - TK_PRIMARY = 296, - TK_RP = 297, - TK_SELECT = 298, - TK_SET = 299, - TK_SHORT = 300, - TK_SPACE = 301, - TK_STAR = 302, - TK_STRING = 303, - TK_TABLE = 304, - TK_TEMPORARY = 305, - TK_UPDATE = 306, - TK_VALUES = 307, - TK_WHERE = 308, - TK_WILDCARD = 309, - END_OF_FILE = 310, - ILLEGAL = 311, - SPACE = 312, - UNCLOSED_STRING = 313, - COMMENT = 314, - FUNCTION = 315, - COLUMN = 316, - TK_LIKE = 318, - TK_NEGATION = 319 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; -union YYSTYPE -{ -#line 68 "sql.y" /* yacc.c:355 */ - - struct sql_str str; - LPWSTR string; - column_info *column_list; - MSIVIEW *query; - struct expr *expr; - USHORT column_type; - int integer; - -#line 248 "sql.tab.c" /* yacc.c:355 */ -}; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int sql_parse (SQL_input *info); - -#endif /* !YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -#line 262 "sql.tab.c" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 36 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 156 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 65 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 37 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 87 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 154 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 319 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 117, 117, 125, 126, 127, 128, 129, 130, 131, - 135, 146, 160, 177, 193, 204, 218, 232, 243, 254, - 268, 272, 279, 294, 304, 314, 321, 330, 334, 338, - 345, 349, 356, 360, 364, 368, 372, 376, 380, 387, - 396, 400, 415, 435, 436, 440, 447, 448, 452, 459, - 471, 484, 488, 500, 515, 519, 528, 534, 540, 546, - 552, 558, 564, 570, 576, 582, 588, 597, 598, 602, - 609, 620, 621, 629, 637, 643, 649, 655, 664, 673, - 679, 688, 694, 700, 709, 716, 724, 732 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "TK_ALTER", "TK_AND", "TK_BY", "TK_CHAR", - "TK_COMMA", "TK_CREATE", "TK_DELETE", "TK_DROP", "TK_DISTINCT", "TK_DOT", - "TK_EQ", "TK_FREE", "TK_FROM", "TK_GE", "TK_GT", "TK_HOLD", "TK_ADD", - "TK_ID", "TK_ILLEGAL", "TK_INSERT", "TK_INT", "TK_INTEGER", "TK_INTO", - "TK_IS", "TK_KEY", "TK_LE", "TK_LONG", "TK_LONGCHAR", "TK_LP", "TK_LT", - "TK_LOCALIZABLE", "TK_MINUS", "TK_NE", "TK_NOT", "TK_NULL", "TK_OBJECT", - "TK_OR", "TK_ORDER", "TK_PRIMARY", "TK_RP", "TK_SELECT", "TK_SET", - "TK_SHORT", "TK_SPACE", "TK_STAR", "TK_STRING", "TK_TABLE", - "TK_TEMPORARY", "TK_UPDATE", "TK_VALUES", "TK_WHERE", "TK_WILDCARD", - "END_OF_FILE", "ILLEGAL", "SPACE", "UNCLOSED_STRING", "COMMENT", - "FUNCTION", "COLUMN", "AGG_FUNCTION.", "TK_LIKE", "TK_NEGATION", - "$accept", "query", "onequery", "oneinsert", "onecreate", "oneupdate", - "onedelete", "onealter", "alterop", "onedrop", "table_def", "column_def", - "column_and_type", "column_type", "data_type_l", "data_type", - "data_count", "oneselect", "selectfrom", "selcollist", "collist", "from", - "unorderdfrom", "tablelist", "expr", "val", "constlist", - "update_assign_list", "column_assignment", "const_val", "column_val", - "column", "selcolumn", "table", "id", "string", "number", YY_NULL -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319 -}; -# endif - -#define YYPACT_NINF -80 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-80))) - -#define YYTABLE_NINF -85 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 36, -44, -39, -1, -26, 9, 50, 37, 56, -80, - -80, -80, -80, -80, -80, -80, -80, 37, 37, 37, - -80, 25, 37, 37, -18, -80, -80, -80, -80, -1, - 78, 47, 76, -80, 57, -80, -80, 105, 72, 51, - 55, 100, -80, 81, -80, -80, -18, 37, 37, -80, - -80, 37, -80, 37, 62, 37, -12, -12, -80, -80, - 63, 102, 108, 101, 76, 97, 45, 83, 2, -80, - 62, 3, 94, -80, -80, 126, -80, -80, 127, 93, - 62, 37, 52, 37, -80, 106, -80, -80, -80, -80, - -80, -80, 31, 103, 118, 37, 111, 11, 62, 62, - 60, 60, 60, -11, 60, 60, 60, -12, 88, 3, - -80, -80, 117, -80, -80, -80, -80, -80, 117, -80, - -80, 107, -80, -80, -12, -80, -80, 138, -80, -80, - -80, -80, -80, 109, -80, -80, -80, -80, -80, 112, - -80, 110, -80, -80, -80, -80, 52, -80, 113, 140, - 95, 52, -80, -80 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, - 5, 4, 6, 7, 8, 9, 3, 0, 0, 0, - 16, 51, 0, 0, 0, 85, 45, 86, 40, 0, - 43, 0, 82, 83, 0, 84, 1, 0, 0, 52, - 54, 0, 22, 0, 41, 42, 0, 0, 0, 21, - 20, 0, 17, 0, 0, 0, 0, 0, 44, 81, - 15, 71, 0, 0, 80, 18, 0, 0, 0, 25, - 0, 53, 0, 78, 55, 54, 48, 50, 46, 0, - 0, 0, 0, 0, 19, 32, 36, 37, 34, 38, - 35, 26, 27, 30, 12, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 72, 87, 0, 76, 77, 73, 74, 79, 0, 28, - 29, 0, 13, 24, 0, 56, 57, 58, 59, 68, - 67, 63, 60, 0, 65, 62, 61, 64, 47, 0, - 75, 0, 39, 31, 23, 66, 0, 33, 0, 69, - 10, 0, 11, 70 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -80, -80, -80, -80, -80, -80, -80, -80, -80, -80, - -80, -80, -47, -80, -80, -80, -80, -80, 124, 104, - -53, 120, -80, 96, 19, 26, 5, 73, -80, -79, - -7, -29, -80, 14, -6, -80, -16 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 8, 9, 10, 11, 12, 13, 14, 52, 15, - 67, 68, 65, 91, 92, 93, 141, 16, 28, 29, - 77, 20, 21, 39, 71, 128, 148, 60, 61, 129, - 130, 73, 30, 63, 64, 33, 116 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 32, 35, 25, 115, 79, 17, 69, 98, 25, 95, - 18, 35, 35, 35, 19, 98, 35, 35, 32, 62, - 31, 34, 66, 22, 66, 133, 134, 78, 78, 26, - 27, 37, 38, 40, 23, 76, 42, 43, 31, 1, - 32, 59, 99, 96, 2, 3, 4, 72, 123, 35, - 99, 85, 62, 125, 138, -49, 36, 25, 5, 47, - 31, 24, 55, 72, 119, 41, 66, 149, 86, 75, - 25, 144, 149, 72, 87, 88, 111, 117, 78, 6, - 25, 120, 25, 89, 111, 46, 112, 7, -84, 97, - 90, 72, 72, 70, 112, 78, 140, 26, 27, 109, - 113, 48, 142, 53, 54, 56, 114, 100, 113, 81, - 101, 102, 57, 83, 114, 84, 80, 126, 127, 49, - 103, 82, 104, 50, 51, 94, 105, 131, 132, 106, - 135, 136, 137, 55, 107, 108, 122, 118, 124, 121, - 139, 111, 98, 146, 143, 152, 145, 151, 44, 45, - 58, 74, 147, 0, 110, 150, 153 -}; - -static const yytype_int16 yycheck[] = -{ - 6, 7, 20, 82, 57, 49, 53, 4, 20, 7, - 49, 17, 18, 19, 15, 4, 22, 23, 24, 48, - 6, 7, 51, 49, 53, 36, 37, 56, 57, 47, - 48, 17, 18, 19, 25, 47, 22, 23, 24, 3, - 46, 47, 39, 41, 8, 9, 10, 54, 95, 55, - 39, 6, 81, 42, 107, 0, 0, 20, 22, 12, - 46, 11, 7, 70, 33, 40, 95, 146, 23, 55, - 20, 124, 151, 80, 29, 30, 24, 83, 107, 43, - 20, 50, 20, 38, 24, 7, 34, 51, 12, 70, - 45, 98, 99, 31, 34, 124, 112, 47, 48, 80, - 48, 44, 118, 31, 53, 5, 54, 13, 48, 7, - 16, 17, 31, 12, 54, 18, 53, 98, 99, 14, - 26, 13, 28, 18, 19, 42, 32, 101, 102, 35, - 104, 105, 106, 7, 7, 42, 18, 31, 27, 36, - 52, 24, 4, 31, 37, 50, 37, 7, 24, 29, - 46, 55, 42, -1, 81, 42, 151 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 8, 9, 10, 22, 43, 51, 66, 67, - 68, 69, 70, 71, 72, 74, 82, 49, 49, 15, - 86, 87, 49, 25, 11, 20, 47, 48, 83, 84, - 97, 98, 99, 100, 98, 99, 0, 98, 98, 88, - 98, 40, 98, 98, 83, 86, 7, 12, 44, 14, - 18, 19, 73, 31, 53, 7, 5, 31, 84, 99, - 92, 93, 96, 98, 99, 77, 96, 75, 76, 77, - 31, 89, 95, 96, 88, 98, 47, 85, 96, 85, - 53, 7, 13, 12, 18, 6, 23, 29, 30, 38, - 45, 78, 79, 80, 42, 7, 41, 89, 4, 39, - 13, 16, 17, 26, 28, 32, 35, 7, 42, 89, - 92, 24, 34, 48, 54, 94, 101, 99, 31, 33, - 50, 36, 18, 77, 27, 42, 89, 89, 90, 94, - 95, 90, 90, 36, 37, 90, 90, 90, 85, 52, - 101, 81, 101, 37, 85, 37, 31, 42, 91, 94, - 42, 7, 50, 91 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 65, 66, 67, 67, 67, 67, 67, 67, 67, - 68, 68, 69, 69, 70, 70, 71, 72, 72, 72, - 73, 73, 74, 75, 76, 76, 77, 78, 78, 78, - 79, 79, 80, 80, 80, 80, 80, 80, 80, 81, - 82, 82, 83, 84, 84, 84, 85, 85, 85, 86, - 86, 86, 87, 87, 88, 88, 89, 89, 89, 89, - 89, 89, 89, 89, 89, 89, 89, 90, 90, 91, - 91, 92, 92, 93, 94, 94, 94, 94, 95, 96, - 96, 97, 97, 97, 98, 99, 100, 101 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 10, 11, 6, 7, 6, 4, 2, 4, 5, 6, - 1, 1, 3, 4, 3, 1, 2, 1, 2, 2, - 1, 3, 1, 4, 1, 1, 1, 1, 1, 1, - 2, 3, 2, 1, 3, 1, 1, 3, 1, 2, - 4, 1, 2, 4, 1, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 4, 1, 1, 1, - 3, 1, 3, 3, 1, 2, 1, 1, 1, 3, - 1, 3, 1, 1, 1, 1, 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (info, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, info); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, SQL_input *info) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (info); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, SQL_input *info) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, info); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, SQL_input *info) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , info); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, info); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, SQL_input *info) -{ - YYUSE (yyvaluep); - YYUSE (info); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (SQL_input *info) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, info); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 118 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - *sql->view = (yyvsp[0].query); - } -#line 1450 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 10: -#line 136 "sql.y" /* yacc.c:1646 */ - { - SQL_input *sql = (SQL_input*) info; - MSIVIEW *insert = NULL; - - INSERT_CreateView( sql->db, &insert, (yyvsp[-7].string), (yyvsp[-5].column_list), (yyvsp[-1].column_list), FALSE ); - if( !insert ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), insert ); - } -#line 1465 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 11: -#line 147 "sql.y" /* yacc.c:1646 */ - { - SQL_input *sql = (SQL_input*) info; - MSIVIEW *insert = NULL; - - INSERT_CreateView( sql->db, &insert, (yyvsp[-8].string), (yyvsp[-6].column_list), (yyvsp[-2].column_list), TRUE ); - if( !insert ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), insert ); - } -#line 1480 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 12: -#line 161 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW *create = NULL; - UINT r; - - if( !(yyvsp[-1].column_list) ) - YYABORT; - r = CREATE_CreateView( sql->db, &create, (yyvsp[-3].string), (yyvsp[-1].column_list), FALSE ); - if( !create ) - { - sql->r = r; - YYABORT; - } - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), create ); - } -#line 1501 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 13: -#line 178 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW *create = NULL; - - if( !(yyvsp[-2].column_list) ) - YYABORT; - CREATE_CreateView( sql->db, &create, (yyvsp[-4].string), (yyvsp[-2].column_list), TRUE ); - if( !create ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), create ); - } -#line 1518 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 14: -#line 194 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW *update = NULL; - - UPDATE_CreateView( sql->db, &update, (yyvsp[-4].string), (yyvsp[-2].column_list), (yyvsp[0].expr) ); - if( !update ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), update ); - } -#line 1533 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 15: -#line 205 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW *update = NULL; - - UPDATE_CreateView( sql->db, &update, (yyvsp[-2].string), (yyvsp[0].column_list), NULL ); - if( !update ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), update ); - } -#line 1548 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 16: -#line 219 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW *delete = NULL; - - DELETE_CreateView( sql->db, &delete, (yyvsp[0].query) ); - if( !delete ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), delete ); - } -#line 1563 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 17: -#line 233 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW *alter = NULL; - - ALTER_CreateView( sql->db, &alter, (yyvsp[-1].string), NULL, (yyvsp[0].integer) ); - if( !alter ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), alter ); - } -#line 1578 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 18: -#line 244 "sql.y" /* yacc.c:1646 */ - { - SQL_input *sql = (SQL_input *)info; - MSIVIEW *alter = NULL; - - ALTER_CreateView( sql->db, &alter, (yyvsp[-2].string), (yyvsp[0].column_list), 0 ); - if (!alter) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), alter ); - } -#line 1593 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 19: -#line 255 "sql.y" /* yacc.c:1646 */ - { - SQL_input *sql = (SQL_input *)info; - MSIVIEW *alter = NULL; - - ALTER_CreateView( sql->db, &alter, (yyvsp[-3].string), (yyvsp[-1].column_list), 1 ); - if (!alter) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), alter ); - } -#line 1608 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 20: -#line 269 "sql.y" /* yacc.c:1646 */ - { - (yyval.integer) = 1; - } -#line 1616 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 21: -#line 273 "sql.y" /* yacc.c:1646 */ - { - (yyval.integer) = -1; - } -#line 1624 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 22: -#line 280 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW* drop = NULL; - UINT r; - - r = DROP_CreateView( sql->db, &drop, (yyvsp[0].string) ); - if( r != ERROR_SUCCESS || !(yyval.query) ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), drop ); - } -#line 1640 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 23: -#line 295 "sql.y" /* yacc.c:1646 */ - { - if( SQL_MarkPrimaryKeys( &(yyvsp[-3].column_list), (yyvsp[0].column_list) ) ) - (yyval.column_list) = (yyvsp[-3].column_list); - else - (yyval.column_list) = NULL; - } -#line 1651 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 24: -#line 305 "sql.y" /* yacc.c:1646 */ - { - column_info *ci; - - for( ci = (yyvsp[-2].column_list); ci->next; ci = ci->next ) - ; - - ci->next = (yyvsp[0].column_list); - (yyval.column_list) = (yyvsp[-2].column_list); - } -#line 1665 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 25: -#line 315 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = (yyvsp[0].column_list); - } -#line 1673 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 26: -#line 322 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = (yyvsp[-1].column_list); - (yyval.column_list)->type = ((yyvsp[0].column_type) | MSITYPE_VALID); - (yyval.column_list)->temporary = (yyvsp[0].column_type) & MSITYPE_TEMPORARY ? TRUE : FALSE; - } -#line 1683 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 27: -#line 331 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = (yyvsp[0].column_type); - } -#line 1691 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 28: -#line 335 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_LOCALIZABLE; - } -#line 1699 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 29: -#line 339 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = (yyvsp[-1].column_type) | MSITYPE_TEMPORARY; - } -#line 1707 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 30: -#line 346 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) |= MSITYPE_NULLABLE; - } -#line 1715 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 31: -#line 350 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = (yyvsp[-2].column_type); - } -#line 1723 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 32: -#line 357 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = MSITYPE_STRING | 0x400; - } -#line 1731 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 33: -#line 361 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = MSITYPE_STRING | 0x400 | (yyvsp[-1].column_type); - } -#line 1739 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 34: -#line 365 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = MSITYPE_STRING | 0x400; - } -#line 1747 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 35: -#line 369 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = 2 | 0x400; - } -#line 1755 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 36: -#line 373 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = 2 | 0x400; - } -#line 1763 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 37: -#line 377 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = 4; - } -#line 1771 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 38: -#line 381 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_type) = MSITYPE_STRING | MSITYPE_VALID; - } -#line 1779 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 39: -#line 388 "sql.y" /* yacc.c:1646 */ - { - if( ( (yyvsp[0].integer) > 255 ) || ( (yyvsp[0].integer) < 0 ) ) - YYABORT; - (yyval.column_type) = (yyvsp[0].integer); - } -#line 1789 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 40: -#line 397 "sql.y" /* yacc.c:1646 */ - { - (yyval.query) = (yyvsp[0].query); - } -#line 1797 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 41: -#line 401 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW* distinct = NULL; - UINT r; - - r = DISTINCT_CreateView( sql->db, &distinct, (yyvsp[0].query) ); - if (r != ERROR_SUCCESS) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), distinct ); - } -#line 1813 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 42: -#line 416 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW* select = NULL; - UINT r; - - if( (yyvsp[-1].column_list) ) - { - r = SELECT_CreateView( sql->db, &select, (yyvsp[0].query), (yyvsp[-1].column_list) ); - if (r != ERROR_SUCCESS) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), select ); - } - else - (yyval.query) = (yyvsp[0].query); - } -#line 1834 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 44: -#line 437 "sql.y" /* yacc.c:1646 */ - { - (yyvsp[-2].column_list)->next = (yyvsp[0].column_list); - } -#line 1842 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 45: -#line 441 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = NULL; - } -#line 1850 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 47: -#line 449 "sql.y" /* yacc.c:1646 */ - { - (yyvsp[-2].column_list)->next = (yyvsp[0].column_list); - } -#line 1858 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 48: -#line 453 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = NULL; - } -#line 1866 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 49: -#line 460 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW* table = NULL; - UINT r; - - r = TABLE_CreateView( sql->db, (yyvsp[0].string), &table ); - if( r != ERROR_SUCCESS || !(yyval.query) ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), table ); - } -#line 1882 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 50: -#line 472 "sql.y" /* yacc.c:1646 */ - { - UINT r; - - if( (yyvsp[0].column_list) ) - { - r = (yyvsp[-3].query)->ops->sort( (yyvsp[-3].query), (yyvsp[0].column_list) ); - if ( r != ERROR_SUCCESS) - YYABORT; - } - - (yyval.query) = (yyvsp[-3].query); - } -#line 1899 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 52: -#line 489 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW* where = NULL; - UINT r; - - r = WHERE_CreateView( sql->db, &where, (yyvsp[0].string), NULL ); - if( r != ERROR_SUCCESS ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), where ); - } -#line 1915 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 53: -#line 501 "sql.y" /* yacc.c:1646 */ - { - SQL_input* sql = (SQL_input*) info; - MSIVIEW* where = NULL; - UINT r; - - r = WHERE_CreateView( sql->db, &where, (yyvsp[-2].string), (yyvsp[0].expr) ); - if( r != ERROR_SUCCESS ) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( sql, (yyval.query), where ); - } -#line 1931 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 54: -#line 516 "sql.y" /* yacc.c:1646 */ - { - (yyval.string) = (yyvsp[0].string); - } -#line 1939 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 55: -#line 520 "sql.y" /* yacc.c:1646 */ - { - (yyval.string) = parser_add_table( info, (yyvsp[0].string), (yyvsp[-2].string) ); - if (!(yyval.string)) - YYABORT; - } -#line 1949 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 56: -#line 529 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = (yyvsp[-1].expr); - if( !(yyval.expr) ) - YYABORT; - } -#line 1959 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 57: -#line 535 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_AND, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 1969 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 58: -#line 541 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_OR, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 1979 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 59: -#line 547 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 1989 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 60: -#line 553 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 1999 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 61: -#line 559 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2009 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 62: -#line 565 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2019 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 63: -#line 571 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2029 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 64: -#line 577 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_complex( info, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2039 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 65: -#line 583 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_unary( info, (yyvsp[-2].expr), OP_ISNULL ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2049 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 66: -#line 589 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_unary( info, (yyvsp[-3].expr), OP_NOTNULL ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2059 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 69: -#line 603 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = parser_alloc_column( info, NULL, NULL ); - if( !(yyval.column_list) ) - YYABORT; - (yyval.column_list)->val = (yyvsp[0].expr); - } -#line 2070 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 70: -#line 610 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = parser_alloc_column( info, NULL, NULL ); - if( !(yyval.column_list) ) - YYABORT; - (yyval.column_list)->val = (yyvsp[-2].expr); - (yyval.column_list)->next = (yyvsp[0].column_list); - } -#line 2082 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 72: -#line 622 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = (yyvsp[-2].column_list); - (yyval.column_list)->next = (yyvsp[0].column_list); - } -#line 2091 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 73: -#line 630 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = (yyvsp[-2].column_list); - (yyval.column_list)->val = (yyvsp[0].expr); - } -#line 2100 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 74: -#line 638 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_ival( info, (yyvsp[0].integer) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2110 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 75: -#line 644 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_ival( info, -(yyvsp[0].integer) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2120 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 76: -#line 650 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_sval( info, &(yyvsp[0].str) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2130 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 77: -#line 656 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_wildcard( info ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2140 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 78: -#line 665 "sql.y" /* yacc.c:1646 */ - { - (yyval.expr) = EXPR_column( info, (yyvsp[0].column_list) ); - if( !(yyval.expr) ) - YYABORT; - } -#line 2150 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 79: -#line 674 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = parser_alloc_column( info, (yyvsp[-2].string), (yyvsp[0].string) ); - if( !(yyval.column_list) ) - YYABORT; - } -#line 2160 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 80: -#line 680 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) ); - if( !(yyval.column_list) ) - YYABORT; - } -#line 2170 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 81: -#line 689 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = parser_alloc_column( info, (yyvsp[-2].string), (yyvsp[0].string) ); - if( !(yyval.column_list) ) - YYABORT; - } -#line 2180 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 82: -#line 695 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) ); - if( !(yyval.column_list) ) - YYABORT; - } -#line 2190 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 83: -#line 701 "sql.y" /* yacc.c:1646 */ - { - (yyval.column_list) = parser_alloc_column( info, NULL, (yyvsp[0].string) ); - if( !(yyval.column_list) ) - YYABORT; - } -#line 2200 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 84: -#line 710 "sql.y" /* yacc.c:1646 */ - { - (yyval.string) = (yyvsp[0].string); - } -#line 2208 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 85: -#line 717 "sql.y" /* yacc.c:1646 */ - { - if ( SQL_getstring( info, &(yyvsp[0].str), &(yyval.string) ) != ERROR_SUCCESS || !(yyval.string) ) - YYABORT; - } -#line 2217 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 86: -#line 725 "sql.y" /* yacc.c:1646 */ - { - if ( SQL_getstring( info, &(yyvsp[0].str), &(yyval.string) ) != ERROR_SUCCESS || !(yyval.string) ) - YYABORT; - } -#line 2226 "sql.tab.c" /* yacc.c:1646 */ - break; - - case 87: -#line 733 "sql.y" /* yacc.c:1646 */ - { - (yyval.integer) = SQL_getint( info ); - } -#line 2234 "sql.tab.c" /* yacc.c:1646 */ - break; - - -#line 2238 "sql.tab.c" /* yacc.c:1646 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (info, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (info, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, info); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, info); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (info, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, info); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, info); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 738 "sql.y" /* yacc.c:1906 */ - - -static LPWSTR parser_add_table( void *info, LPCWSTR list, LPCWSTR table ) -{ - static const WCHAR space[] = {' ',0}; - DWORD len = strlenW( list ) + strlenW( table ) + 2; - LPWSTR ret; - - ret = parser_alloc( info, len * sizeof(WCHAR) ); - if( ret ) - { - strcpyW( ret, list ); - strcatW( ret, space ); - strcatW( ret, table ); - } - return ret; -} - -static void *parser_alloc( void *info, unsigned int sz ) -{ - SQL_input* sql = (SQL_input*) info; - struct list *mem; - - mem = msi_alloc( sizeof (struct list) + sz ); - list_add_tail( sql->mem, mem ); - return &mem[1]; -} - -static column_info *parser_alloc_column( void *info, LPCWSTR table, LPCWSTR column ) -{ - column_info *col; - - col = parser_alloc( info, sizeof (*col) ); - if( col ) - { - col->table = table; - col->column = column; - col->val = NULL; - col->type = 0; - col->next = NULL; - } - - return col; -} - -static int sql_lex( void *SQL_lval, SQL_input *sql ) -{ - int token, skip; - struct sql_str * str = SQL_lval; - - do - { - sql->n += sql->len; - if( ! sql->command[sql->n] ) - return 0; /* end of input */ - - /* TRACE("string : %s\n", debugstr_w(&sql->command[sql->n])); */ - sql->len = sqliteGetToken( &sql->command[sql->n], &token, &skip ); - if( sql->len==0 ) - break; - str->data = &sql->command[sql->n]; - str->len = sql->len; - sql->n += skip; - } - while( token == TK_SPACE ); - - /* TRACE("token : %d (%s)\n", token, debugstr_wn(&sql->command[sql->n], sql->len)); */ - - return token; -} - -UINT SQL_getstring( void *info, const struct sql_str *strdata, LPWSTR *str ) -{ - LPCWSTR p = strdata->data; - UINT len = strdata->len; - - /* match quotes */ - if( ( (p[0]=='`') && (p[len-1]!='`') ) || - ( (p[0]=='\'') && (p[len-1]!='\'') ) ) - return ERROR_FUNCTION_FAILED; - - /* if there are quotes, remove them */ - if( ( (p[0]=='`') && (p[len-1]=='`') ) || - ( (p[0]=='\'') && (p[len-1]=='\'') ) ) - { - p++; - len -= 2; - } - *str = parser_alloc( info, (len + 1)*sizeof(WCHAR) ); - if( !*str ) - return ERROR_OUTOFMEMORY; - memcpy( *str, p, len*sizeof(WCHAR) ); - (*str)[len]=0; - - return ERROR_SUCCESS; -} - -INT SQL_getint( void *info ) -{ - SQL_input* sql = (SQL_input*) info; - LPCWSTR p = &sql->command[sql->n]; - INT i, r = 0; - - for( i=0; ilen; i++ ) - { - if( '0' > p[i] || '9' < p[i] ) - { - ERR("should only be numbers here!\n"); - break; - } - r = (p[i]-'0') + r*10; - } - - return r; -} - -static int sql_error( SQL_input *info, const char *str ) -{ - return 0; -} - -static struct expr * EXPR_wildcard( void *info ) -{ - struct expr *e = parser_alloc( info, sizeof *e ); - if( e ) - { - e->type = EXPR_WILDCARD; - } - return e; -} - -static struct expr * EXPR_complex( void *info, struct expr *l, UINT op, struct expr *r ) -{ - struct expr *e = parser_alloc( info, sizeof *e ); - if( e ) - { - e->type = EXPR_COMPLEX; - e->u.expr.left = l; - e->u.expr.op = op; - e->u.expr.right = r; - } - return e; -} - -static struct expr * EXPR_unary( void *info, struct expr *l, UINT op ) -{ - struct expr *e = parser_alloc( info, sizeof *e ); - if( e ) - { - e->type = EXPR_UNARY; - e->u.expr.left = l; - e->u.expr.op = op; - e->u.expr.right = NULL; - } - return e; -} - -static struct expr * EXPR_column( void *info, const column_info *column ) -{ - struct expr *e = parser_alloc( info, sizeof *e ); - if( e ) - { - e->type = EXPR_COLUMN; - e->u.column.unparsed.column = column->column; - e->u.column.unparsed.table = column->table; - } - return e; -} - -static struct expr * EXPR_ival( void *info, int val ) -{ - struct expr *e = parser_alloc( info, sizeof *e ); - if( e ) - { - e->type = EXPR_IVAL; - e->u.ival = val; - } - return e; -} - -static struct expr * EXPR_sval( void *info, const struct sql_str *str ) -{ - struct expr *e = parser_alloc( info, sizeof *e ); - if( e ) - { - e->type = EXPR_SVAL; - if( SQL_getstring( info, str, (LPWSTR *)&e->u.sval ) != ERROR_SUCCESS ) - return NULL; /* e will be freed by query destructor */ - } - return e; -} - -static void swap_columns( column_info **cols, column_info *A, int idx ) -{ - column_info *preA = NULL, *preB = NULL, *B, *ptr; - int i = 0; - - B = NULL; - ptr = *cols; - while( ptr ) - { - if( i++ == idx ) - B = ptr; - else if( !B ) - preB = ptr; - - if( ptr->next == A ) - preA = ptr; - - ptr = ptr->next; - } - - if( preB ) preB->next = A; - if( preA ) preA->next = B; - ptr = A->next; - A->next = B->next; - B->next = ptr; - if( idx == 0 ) - *cols = A; -} - -static BOOL SQL_MarkPrimaryKeys( column_info **cols, - column_info *keys ) -{ - column_info *k; - BOOL found = TRUE; - int count; - - for( k = keys, count = 0; k && found; k = k->next, count++ ) - { - column_info *c; - int idx; - - found = FALSE; - for( c = *cols, idx = 0; c && !found; c = c->next, idx++ ) - { - if( strcmpW( k->column, c->column ) ) - continue; - c->type |= MSITYPE_KEY; - found = TRUE; - if (idx != count) - swap_columns( cols, c, count ); - } - } - - return found; -} - -UINT MSI_ParseSQL( MSIDATABASE *db, LPCWSTR command, MSIVIEW **phview, - struct list *mem ) -{ - SQL_input sql; - int r; - - *phview = NULL; - - sql.db = db; - sql.command = command; - sql.n = 0; - sql.len = 0; - sql.r = ERROR_BAD_QUERY_SYNTAX; - sql.view = phview; - sql.mem = mem; - - r = sql_parse(&sql); - - TRACE("Parse returned %d\n", r); - if( r ) - { - if (*sql.view) - { - (*sql.view)->ops->delete(*sql.view); - *sql.view = NULL; - } - return sql.r; - } - - return ERROR_SUCCESS; -} diff --git a/dll/win32/msi/sql.tab.h b/dll/win32/msi/sql.tab.h deleted file mode 100644 index d9138c2550d..00000000000 --- a/dll/win32/msi/sql.tab.h +++ /dev/null @@ -1,137 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED -# define YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int sql_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - TK_ALTER = 258, - TK_AND = 259, - TK_BY = 260, - TK_CHAR = 261, - TK_COMMA = 262, - TK_CREATE = 263, - TK_DELETE = 264, - TK_DROP = 265, - TK_DISTINCT = 266, - TK_DOT = 267, - TK_EQ = 268, - TK_FREE = 269, - TK_FROM = 270, - TK_GE = 271, - TK_GT = 272, - TK_HOLD = 273, - TK_ADD = 274, - TK_ID = 275, - TK_ILLEGAL = 276, - TK_INSERT = 277, - TK_INT = 278, - TK_INTEGER = 279, - TK_INTO = 280, - TK_IS = 281, - TK_KEY = 282, - TK_LE = 283, - TK_LONG = 284, - TK_LONGCHAR = 285, - TK_LP = 286, - TK_LT = 287, - TK_LOCALIZABLE = 288, - TK_MINUS = 289, - TK_NE = 290, - TK_NOT = 291, - TK_NULL = 292, - TK_OBJECT = 293, - TK_OR = 294, - TK_ORDER = 295, - TK_PRIMARY = 296, - TK_RP = 297, - TK_SELECT = 298, - TK_SET = 299, - TK_SHORT = 300, - TK_SPACE = 301, - TK_STAR = 302, - TK_STRING = 303, - TK_TABLE = 304, - TK_TEMPORARY = 305, - TK_UPDATE = 306, - TK_VALUES = 307, - TK_WHERE = 308, - TK_WILDCARD = 309, - END_OF_FILE = 310, - ILLEGAL = 311, - SPACE = 312, - UNCLOSED_STRING = 313, - COMMENT = 314, - FUNCTION = 315, - COLUMN = 316, - TK_LIKE = 318, - TK_NEGATION = 319 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; -union YYSTYPE -{ -#line 68 "sql.y" /* yacc.c:1909 */ - - struct sql_str str; - LPWSTR string; - column_info *column_list; - MSIVIEW *query; - struct expr *expr; - USHORT column_type; - int integer; - -#line 128 "sql.tab.h" /* yacc.c:1909 */ -}; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int sql_parse (SQL_input *info); - -#endif /* !YY_SQL_E_REACTOSSYNC_GCC_DLL_WIN32_MSI_SQL_TAB_H_INCLUDED */ diff --git a/dll/win32/msxml3/CMakeLists.txt b/dll/win32/msxml3/CMakeLists.txt index 11fddb98a78..4d85db5d4ce 100644 --- a/dll/win32/msxml3/CMakeLists.txt +++ b/dll/win32/msxml3/CMakeLists.txt @@ -45,14 +45,15 @@ list(APPEND SOURCE xmlparser.c xmlview.c) +FLEX_TARGET(xslpattern_scanner xslpattern.l ${CMAKE_CURRENT_BINARY_DIR}/xslpattern.yy.c) +BISON_TARGET(xslpattern_parser xslpattern.y ${CMAKE_CURRENT_BINARY_DIR}/xslpattern.tab.c COMPILE_FLAGS "-p xslpattern_") +ADD_FLEX_BISON_DEPENDENCY(xslpattern_scanner xslpattern_parser) + list(APPEND PCH_SKIP_SOURCE factory.c uuid.c - xslpattern.tab.c - xslpattern.yy.c) - -# xslpattern.tab.c/xslpattern.yy.c have been generated with relative file paths... -set_source_files_properties(xslpattern.tab.c xslpattern.yy.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + ${FLEX_xslpattern_scanner_OUTPUTS} + ${BISON_xslpattern_parser_OUTPUTS}) list(APPEND msxml3_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/msxml3.manifest diff --git a/dll/win32/msxml3/xslpattern.tab.c b/dll/win32/msxml3/xslpattern.tab.c deleted file mode 100644 index 3fd70c2ddd2..00000000000 --- a/dll/win32/msxml3/xslpattern.tab.c +++ /dev/null @@ -1,2423 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse xslpattern_parse -#define yylex xslpattern_lex -#define yyerror xslpattern_error -#define yydebug xslpattern_debug -#define yynerrs xslpattern_nerrs - - -/* Copy the first part of user declarations. */ -#line 21 "xslpattern.y" /* yacc.c:339 */ - -#include "config.h" -#include "wine/port.h" - -#ifdef HAVE_LIBXML2 -#include "xslpattern.h" -#include -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msxml); - - -static const xmlChar NameTest_mod_pre[] = "*[name()='"; -static const xmlChar NameTest_mod_post[] = "']"; - -#define U(str) BAD_CAST str - -static inline BOOL is_literal(xmlChar const* tok) -{ - return (tok && tok[0] && tok[1] && - tok[0]== tok[xmlStrlen(tok)-1] && - (tok[0] == '\'' || tok[0] == '"')); -} - -static void xslpattern_error(parser_param* param, void const* scanner, char const* msg) -{ - FIXME("%s:\n" - " param {\n" - " yyscanner=%p\n" - " ctx=%p\n" - " in=\"%s\"\n" - " pos=%i\n" - " len=%i\n" - " out=\"%s\"\n" - " err=%i\n" - " }\n" - " scanner=%p\n", - msg, param->yyscanner, param->ctx, param->in, param->pos, - param->len, param->out, ++param->err, scanner); -} - - -#line 115 "xslpattern.tab.c" /* yacc.c:339 */ - -# ifndef YY_NULL -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULL nullptr -# else -# define YY_NULL 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* In a future release of Bison, this section will be replaced - by #include "xslpattern.tab.h". */ -#ifndef YY_XSLPATTERN_E_REACTOSSYNC_GCC_DLL_WIN32_MSXML3_XSLPATTERN_TAB_H_INCLUDED -# define YY_XSLPATTERN_E_REACTOSSYNC_GCC_DLL_WIN32_MSXML3_XSLPATTERN_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int xslpattern_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - TOK_Parent = 258, - TOK_Self = 259, - TOK_DblFSlash = 260, - TOK_FSlash = 261, - TOK_Axis = 262, - TOK_Colon = 263, - TOK_OpAnd = 264, - TOK_OpOr = 265, - TOK_OpNot = 266, - TOK_OpEq = 267, - TOK_OpIEq = 268, - TOK_OpNEq = 269, - TOK_OpINEq = 270, - TOK_OpLt = 271, - TOK_OpILt = 272, - TOK_OpGt = 273, - TOK_OpIGt = 274, - TOK_OpLEq = 275, - TOK_OpILEq = 276, - TOK_OpGEq = 277, - TOK_OpIGEq = 278, - TOK_OpAll = 279, - TOK_OpAny = 280, - TOK_NCName = 281, - TOK_Literal = 282, - TOK_Number = 283 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int xslpattern_parse (parser_param* p, void* scanner); - -#endif /* !YY_XSLPATTERN_E_REACTOSSYNC_GCC_DLL_WIN32_MSXML3_XSLPATTERN_TAB_H_INCLUDED */ - -/* Copy the second part of user declarations. */ - -#line 194 "xslpattern.tab.c" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if (! defined __GNUC__ || __GNUC__ < 2 \ - || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) -# define __attribute__(Spec) /* empty */ -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 58 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 176 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 38 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 39 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 104 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 157 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 283 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 35, 2, 2, 2, 2, 2, 2, - 33, 34, 30, 2, 36, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 29, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 31, 2, 32, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 37, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 86, 86, 96, 97, 99, 108, 119, 120, 122, - 129, 134, 136, 137, 145, 148, 157, 164, 171, 172, - 173, 175, 182, 189, 197, 198, 200, 205, 211, 230, - 238, 244, 246, 255, 261, 262, 263, 266, 274, 283, - 288, 297, 299, 300, 301, 302, 303, 304, 306, 314, - 322, 323, 326, 385, 416, 423, 425, 428, 429, 438, - 439, 447, 455, 457, 458, 467, 468, 470, 479, 480, - 482, 491, 492, 494, 502, 513, 521, 533, 534, 536, - 544, 555, 563, 574, 582, 593, 601, 615, 616, 618, - 626, 634, 642, 648, 655, 662, 669, 676, 683, 690, - 700, 710, 720, 730, 740 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "TOK_Parent", "TOK_Self", - "TOK_DblFSlash", "TOK_FSlash", "TOK_Axis", "TOK_Colon", "TOK_OpAnd", - "TOK_OpOr", "TOK_OpNot", "TOK_OpEq", "TOK_OpIEq", "TOK_OpNEq", - "TOK_OpINEq", "TOK_OpLt", "TOK_OpILt", "TOK_OpGt", "TOK_OpIGt", - "TOK_OpLEq", "TOK_OpILEq", "TOK_OpGEq", "TOK_OpIGEq", "TOK_OpAll", - "TOK_OpAny", "TOK_NCName", "TOK_Literal", "TOK_Number", "'@'", "'*'", - "'['", "']'", "'('", "')'", "'!'", "','", "'|'", "$accept", "XSLPattern", - "QName", "PrefixedName", "UnprefixedName", "LocationPath", - "AbsoluteLocationPath", "RelativeLocationPath", "Step", "AxisSpecifier", - "Attribute", "NodeTest", "NameTest", "Predicates", "Predicate", - "PredicateExpr", "AbbreviatedAbsoluteLocationPath", - "AbbreviatedRelativeLocationPath", "AbbreviatedStep", "Expr", "BoolExpr", - "PrimaryExpr", "FunctionCall", "Arguments", "Argument", "UnionExpr", - "PathExpr", "FilterExpr", "OrExpr", "BoolOrExpr", "AndExpr", - "BoolAndExpr", "EqualityExpr", "BoolEqualityExpr", "RelationalExpr", - "BoolRelationalExpr", "UnaryExpr", "BoolUnaryExpr", "AllExpr", YY_NULL -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 64, - 42, 91, 93, 40, 41, 33, 44, 124 -}; -# endif - -#define YYPACT_NINF -34 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-34))) - -#define YYTABLE_NINF -67 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 20, -34, -34, 25, 25, 20, 106, 20, 0, -34, - -34, -21, -34, 20, 10, -17, -34, -12, -34, -34, - 52, -34, -8, -34, 28, -34, -34, -34, -34, -34, - -34, -34, -10, 27, 35, 55, -34, 21, -34, 58, - -34, 136, -34, -34, -34, 52, 52, -34, 128, -34, - -34, -34, 26, 59, -34, -34, -34, 40, -34, 9, - 25, 25, 105, 28, 97, 28, -34, 106, 88, 25, - 25, -34, 20, 20, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, 20, 20, 106, 106, 106, 106, - 106, 106, 106, 106, 106, 106, 106, 106, 82, -34, - 90, -34, -34, -34, 83, 84, -34, -34, 28, 99, - 86, 87, 96, -34, 129, 55, 119, 130, 132, 133, - 134, -34, 27, -34, 52, 52, -34, 58, 136, 136, - 136, 136, -34, -34, -34, -34, -34, -34, -34, -34, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, - 27, 27, -34, -34, 20, -34, -34 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 39, 40, 0, 10, 0, 92, 0, 6, 50, - 51, 0, 26, 0, 0, 0, 3, 29, 59, 8, - 7, 12, 0, 19, 18, 24, 11, 14, 20, 2, - 63, 25, 87, 57, 62, 41, 66, 65, 69, 68, - 72, 71, 78, 77, 88, 37, 9, 89, 0, 91, - 90, 21, 0, 6, 23, 22, 4, 0, 1, 0, - 0, 0, 6, 17, 0, 16, 31, 0, 0, 0, - 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 28, 27, - 0, 48, 53, 56, 0, 55, 38, 13, 15, 6, - 51, 19, 0, 34, 25, 0, 47, 69, 72, 78, - 88, 30, 58, 49, 61, 60, 67, 70, 73, 74, - 75, 76, 79, 80, 81, 82, 83, 84, 85, 86, - 93, 99, 94, 100, 95, 101, 97, 103, 96, 102, - 98, 104, 5, 52, 0, 32, 54 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -34, -34, 126, -34, -5, -34, -34, -1, 44, -34, - 74, 138, -34, 104, -33, -34, -34, -34, -34, 4, - -34, -34, -4, 15, -34, -34, -6, -34, 107, 108, - 98, 109, 95, 110, 2, 111, 14, 112, -34 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 65, 66, 112, 26, 27, 28, 103, - 113, 30, 31, 104, 105, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 49 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 48, 71, 45, 46, 29, 53, 56, 51, 52, 54, - 58, 50, 1, 2, 3, 4, 59, 57, 62, 47, - 5, -4, 12, 1, 2, 3, 4, 67, 1, 2, - 73, 5, 121, 6, 7, 8, 9, 10, 11, 12, - 69, 70, 13, 102, 6, 7, 8, 9, 10, 11, - 12, 8, 98, 13, 11, 12, 99, 60, 61, 64, - 114, 122, 68, 56, 123, 72, 64, 100, 124, 125, - 74, 75, 76, 77, 101, 121, 128, 129, 130, 131, - 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, - 150, 151, 132, 133, 134, 135, 136, 137, 138, 139, - 1, 2, 3, 4, 106, 107, 51, 52, 5, 1, - 2, 3, 4, 52, 53, -5, 152, 153, -33, -35, - 154, 6, 7, 109, 9, 110, 11, 12, 155, -66, - 13, -36, 8, 9, 10, 11, 12, 55, 111, 13, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 78, 79, 80, 81, 82, 83, 84, 85, - 63, -42, -46, 68, -45, -44, -43, 108, 127, 156, - 126, 115, 116, 117, 118, 119, 120 -}; - -static const yytype_uint8 yycheck[] = -{ - 6, 34, 3, 4, 0, 26, 11, 7, 8, 30, - 0, 7, 3, 4, 5, 6, 33, 13, 26, 5, - 11, 33, 30, 3, 4, 5, 6, 37, 3, 4, - 9, 11, 65, 24, 25, 26, 27, 28, 29, 30, - 5, 6, 33, 34, 24, 25, 26, 27, 28, 29, - 30, 26, 26, 33, 29, 30, 30, 5, 6, 31, - 64, 67, 35, 68, 68, 10, 31, 8, 69, 70, - 12, 13, 14, 15, 34, 108, 74, 75, 76, 77, - 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 78, 79, 80, 81, 82, 83, 84, 85, - 3, 4, 5, 6, 60, 61, 7, 8, 11, 3, - 4, 5, 6, 8, 26, 33, 26, 34, 32, 32, - 36, 24, 25, 26, 27, 28, 29, 30, 32, 10, - 33, 32, 26, 27, 28, 29, 30, 11, 64, 33, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 16, 17, 18, 19, 20, 21, 22, 23, - 22, 32, 32, 35, 32, 32, 32, 63, 73, 154, - 72, 64, 64, 64, 64, 64, 64 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 4, 5, 6, 11, 24, 25, 26, 27, - 28, 29, 30, 33, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 54, 55, 56, 57, - 59, 60, 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 45, 45, 74, 64, 76, - 57, 7, 8, 26, 30, 40, 42, 57, 0, 33, - 5, 6, 26, 49, 31, 51, 52, 37, 35, 5, - 6, 52, 10, 9, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 26, 30, - 8, 34, 34, 57, 61, 62, 46, 46, 51, 26, - 28, 48, 53, 58, 60, 66, 67, 69, 71, 73, - 75, 52, 64, 60, 45, 45, 68, 70, 72, 72, - 72, 72, 74, 74, 74, 74, 74, 74, 74, 74, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 26, 34, 36, 32, 61 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 38, 39, 40, 40, 41, 42, 43, 43, 44, - 44, 44, 45, 45, 45, 46, 46, 46, 46, 46, - 46, 47, 48, 48, 49, 49, 50, 50, 50, 50, - 51, 51, 52, 53, 53, 53, 53, 54, 55, 56, - 56, 57, 58, 58, 58, 58, 58, 58, 59, 59, - 59, 59, 60, 60, 61, 61, 62, 63, 63, 64, - 64, 64, 64, 65, 65, 66, 66, 67, 68, 68, - 69, 70, 70, 71, 71, 71, 71, 72, 72, 73, - 73, 73, 73, 73, 73, 73, 73, 74, 74, 75, - 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, - 76, 76, 76, 76, 76 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 3, 1, 1, 1, 2, - 1, 1, 1, 3, 1, 3, 2, 2, 1, 1, - 1, 2, 2, 2, 1, 1, 1, 3, 3, 1, - 2, 1, 3, 1, 1, 1, 1, 2, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, - 1, 1, 4, 3, 3, 1, 1, 1, 3, 1, - 3, 3, 1, 1, 2, 1, 1, 3, 1, 1, - 3, 1, 1, 3, 3, 3, 3, 1, 1, 3, - 3, 3, 3, 3, 3, 3, 3, 1, 1, 2, - 2, 2, 1, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (p, scanner, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, p, scanner); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_param* p, void* scanner) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - YYUSE (p); - YYUSE (scanner); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parser_param* p, void* scanner) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep, p, scanner); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_param* p, void* scanner) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - , p, scanner); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, p, scanner); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULL; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_param* p, void* scanner) -{ - YYUSE (yyvaluep); - YYUSE (p); - YYUSE (scanner); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (parser_param* p, void* scanner) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, scanner); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 87 "xslpattern.y" /* yacc.c:1646 */ - { - p->out = (yyvsp[0]); - } -#line 1385 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 5: -#line 100 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got PrefixedName: \"%s:%s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(":")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1397 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 6: -#line 109 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got UnprefixedName: \"%s\"\n", (yyvsp[0])); - (yyval)=(yyvsp[0]); - } -#line 1406 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 9: -#line 123 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AbsoluteLocationPath: \"/%s\"\n", (yyvsp[0])); - (yyval)=xmlStrdup(U("/")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1417 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 10: -#line 130 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AbsoluteLocationPath: \"/\"\n"); - (yyval)=xmlStrdup(U("/")); - } -#line 1426 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 13: -#line 138 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelativeLocationPath: \"%s/%s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("/")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1438 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 15: -#line 149 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got Step: \"%s%s%s\"\n", (yyvsp[-2]), (yyvsp[-1]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1451 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 16: -#line 158 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got Step: \"%s%s\"\n", (yyvsp[-1]), (yyvsp[0])); - (yyval)=(yyvsp[-1]); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1462 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 17: -#line 165 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got Step: \"%s%s\"\n", (yyvsp[-1]), (yyvsp[0])); - (yyval)=(yyvsp[-1]); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1473 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 21: -#line 176 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AxisSpecifier: \"%s::\"\n", (yyvsp[-1])); - (yyval)=(yyvsp[-1]); - (yyval)=xmlStrcat((yyval),U("::")); - } -#line 1483 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 22: -#line 183 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got Attribute: \"@%s\"\n", (yyvsp[0])); - (yyval)=xmlStrdup(U("@")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1494 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 23: -#line 190 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got All attributes pattern: \"@*\"\n"); - (yyval)=xmlStrdup(U("@*")); - } -#line 1503 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 26: -#line 201 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got NameTest: \"*\"\n"); - (yyval)=xmlStrdup(U("*")); - } -#line 1512 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 27: -#line 206 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got NameTest: \"%s:*\"\n", (yyvsp[-2])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(":*")); - } -#line 1522 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 28: -#line 212 "xslpattern.y" /* yacc.c:1646 */ - { /* PrefixedName */ - xmlChar const* registeredNsURI = xmlXPathNsLookup(p->ctx, (yyvsp[-2])); - TRACE("Got PrefixedName: \"%s:%s\"\n", (yyvsp[-2]), (yyvsp[0])); - - if (registeredNsURI) - (yyval)=xmlStrdup(U("")); - else - (yyval)=xmlStrdup(NameTest_mod_pre); - - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(":")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - - if (!registeredNsURI) - (yyval)=xmlStrcat((yyval),NameTest_mod_post); - } -#line 1545 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 29: -#line 231 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(NameTest_mod_pre); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),NameTest_mod_post); - } -#line 1556 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 30: -#line 239 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-1]); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1566 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 32: -#line 247 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got Predicate: \"[%s]\"\n", (yyvsp[-1])); - (yyval)=xmlStrdup(U("[")); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),U("]")); - } -#line 1578 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 33: -#line 256 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(U("index()=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1588 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 37: -#line 267 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AbbreviatedAbsoluteLocationPath: \"//%s\"\n", (yyvsp[0])); - (yyval)=xmlStrdup(U("//")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1599 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 38: -#line 275 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AbbreviatedRelativeLocationPath: \"%s//%s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("//")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1611 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 39: -#line 284 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AbbreviatedStep: \"..\"\n"); - (yyval)=xmlStrdup(U("..")); - } -#line 1620 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 40: -#line 289 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AbbreviatedStep: \".\"\n"); - (yyval)=xmlStrdup(U(".")); - } -#line 1629 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 48: -#line 307 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got PrimaryExpr: \"(%s)\"\n", (yyvsp[-2])); - (yyval)=xmlStrdup(U("(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 1641 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 49: -#line 315 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got PrimaryExpr: \"%s!%s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("/")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1653 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 52: -#line 327 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got FunctionCall: \"%s(%s)\"\n", (yyvsp[-3]), (yyvsp[-1])); - if (xmlStrEqual((yyvsp[-3]),U("ancestor"))) - { - (yyval)=(yyvsp[-3]); - (yyval)=xmlStrcat((yyval),U("::")); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - } - else if (xmlStrEqual((yyvsp[-3]),U("attribute"))) - { - if (is_literal((yyvsp[-1]))) - { - (yyval)=xmlStrdup(U("@*[name()=")); - xmlFree((yyvsp[-3])); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),U("]")); - } - else - { - /* XML_XPATH_INVALID_TYPE */ - (yyval)=xmlStrdup(U("error(1211, 'Error: attribute(")); - xmlFree((yyvsp[-3])); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),U("): invalid argument')")); - } - } - else if (xmlStrEqual((yyvsp[-3]),U("element"))) - { - if (is_literal((yyvsp[-1]))) - { - (yyval)=xmlStrdup(U("node()[nodeType()=1][name()=")); - xmlFree((yyvsp[-3])); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),U("]")); - } - else - { - /* XML_XPATH_INVALID_TYPE */ - (yyval)=xmlStrdup(U("error(1211, 'Error: element(")); - xmlFree((yyvsp[-3])); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),U("): invalid argument')")); - } - } - else - { - (yyval)=(yyvsp[-3]); - (yyval)=xmlStrcat((yyval),U("(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-1])); - xmlFree((yyvsp[-1])); - (yyval)=xmlStrcat((yyval),U(")")); - } - } -#line 1716 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 53: -#line 386 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got FunctionCall: \"%s()\"\n", (yyvsp[-2])); - /* comment() & node() work the same in XPath */ - if (xmlStrEqual((yyvsp[-2]),U("attribute"))) - { - (yyval)=xmlStrdup(U("@*")); - xmlFree((yyvsp[-2])); - } - else if (xmlStrEqual((yyvsp[-2]),U("element"))) - { - (yyval)=xmlStrdup(U("node()[nodeType()=1]")); - xmlFree((yyvsp[-2])); - } - else if (xmlStrEqual((yyvsp[-2]),U("pi"))) - { - (yyval)=xmlStrdup(U("processing-instruction()")); - xmlFree((yyvsp[-2])); - } - else if (xmlStrEqual((yyvsp[-2]),U("textnode"))) - { - (yyval)=xmlStrdup(U("text()")); - xmlFree((yyvsp[-2])); - } - else - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("()")); - } - } -#line 1750 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 54: -#line 417 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1761 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 58: -#line 430 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got UnionExpr: \"%s|%s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("|")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1773 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 60: -#line 440 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got PathExpr: \"%s/%s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("/")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1785 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 61: -#line 448 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got PathExpr: \"%s//%s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("//")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1797 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 64: -#line 459 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got FilterExpr: \"%s%s\"\n", (yyvsp[-1]), (yyvsp[0])); - (yyval)=(yyvsp[-1]); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1808 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 67: -#line 471 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got OrExpr: \"%s $or$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(" or ")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1820 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 70: -#line 483 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got AndExpr: \"%s $and$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(" and ")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1832 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 73: -#line 495 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got EqualityExpr: \"%s $eq$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1844 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 74: -#line 503 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got EqualityExpr: \"%s $ieq$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=xmlStrdup(U("OP_IEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 1859 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 75: -#line 514 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got EqualityExpr: \"%s $ne$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("!=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1871 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 76: -#line 522 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got EqualityExpr: \"%s $ine$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=xmlStrdup(U("OP_INEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 1886 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 79: -#line 537 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $lt$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("<")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1898 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 80: -#line 545 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $ilt$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=xmlStrdup(U("OP_ILt(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 1913 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 81: -#line 556 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $gt$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(">")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1925 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 82: -#line 564 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $igt$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=xmlStrdup(U("OP_IGt(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 1940 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 83: -#line 575 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $le$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("<=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1952 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 84: -#line 583 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $ile$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=xmlStrdup(U("OP_ILEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 1967 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 85: -#line 594 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $ge$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(">=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 1979 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 86: -#line 602 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got RelationalExpr: \"%s $ige$ %s\"\n", (yyvsp[-2]), (yyvsp[0])); - (yyval)=xmlStrdup(U("OP_IGEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 1994 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 89: -#line 619 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got UnaryExpr: \"$not$ %s\"\n", (yyvsp[0])); - (yyval)=xmlStrdup(U(" not(")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2006 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 90: -#line 627 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got UnaryExpr: \"$any$ %s\"\n", (yyvsp[0])); - (yyval)=xmlStrdup(U("boolean(")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2018 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 91: -#line 635 "xslpattern.y" /* yacc.c:1646 */ - { - TRACE("Got UnaryExpr: \"$all$ %s\"\n", (yyvsp[0])); - (yyval)=xmlStrdup(U("not(")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2030 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 92: -#line 643 "xslpattern.y" /* yacc.c:1646 */ - { - FIXME("Unrecognized $all$ expression - ignoring\n"); - (yyval)=xmlStrdup(U("")); - } -#line 2039 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 93: -#line 649 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("!=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 2050 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 94: -#line 656 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 2061 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 95: -#line 663 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(">=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 2072 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 96: -#line 670 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U(">")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 2083 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 97: -#line 677 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("<=")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 2094 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 98: -#line 684 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=(yyvsp[-2]); - (yyval)=xmlStrcat((yyval),U("<")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - } -#line 2105 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 99: -#line 691 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(U("OP_INEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2119 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 100: -#line 701 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(U("OP_IEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2133 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 101: -#line 711 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(U("OP_IGEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2147 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 102: -#line 721 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(U("OP_IGt(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2161 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 103: -#line 731 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(U("OP_ILEq(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2175 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - case 104: -#line 741 "xslpattern.y" /* yacc.c:1646 */ - { - (yyval)=xmlStrdup(U("OP_ILt(")); - (yyval)=xmlStrcat((yyval),(yyvsp[-2])); - xmlFree((yyvsp[-2])); - (yyval)=xmlStrcat((yyval),U(",")); - (yyval)=xmlStrcat((yyval),(yyvsp[0])); - xmlFree((yyvsp[0])); - (yyval)=xmlStrcat((yyval),U(")")); - } -#line 2189 "xslpattern.tab.c" /* yacc.c:1646 */ - break; - - -#line 2193 "xslpattern.tab.c" /* yacc.c:1646 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (p, scanner, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (p, scanner, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, p, scanner); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, p, scanner); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (p, scanner, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, p, scanner); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, p, scanner); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 752 "xslpattern.y" /* yacc.c:1906 */ - - -#endif /* HAVE_LIBXML2 */ diff --git a/dll/win32/msxml3/xslpattern.tab.h b/dll/win32/msxml3/xslpattern.tab.h deleted file mode 100644 index df8761af4e8..00000000000 --- a/dll/win32/msxml3/xslpattern.tab.h +++ /dev/null @@ -1,88 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_XSLPATTERN_E_REACTOSSYNC_GCC_DLL_WIN32_MSXML3_XSLPATTERN_TAB_H_INCLUDED -# define YY_XSLPATTERN_E_REACTOSSYNC_GCC_DLL_WIN32_MSXML3_XSLPATTERN_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int xslpattern_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - TOK_Parent = 258, - TOK_Self = 259, - TOK_DblFSlash = 260, - TOK_FSlash = 261, - TOK_Axis = 262, - TOK_Colon = 263, - TOK_OpAnd = 264, - TOK_OpOr = 265, - TOK_OpNot = 266, - TOK_OpEq = 267, - TOK_OpIEq = 268, - TOK_OpNEq = 269, - TOK_OpINEq = 270, - TOK_OpLt = 271, - TOK_OpILt = 272, - TOK_OpGt = 273, - TOK_OpIGt = 274, - TOK_OpLEq = 275, - TOK_OpILEq = 276, - TOK_OpGEq = 277, - TOK_OpIGEq = 278, - TOK_OpAll = 279, - TOK_OpAny = 280, - TOK_NCName = 281, - TOK_Literal = 282, - TOK_Number = 283 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef int YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int xslpattern_parse (parser_param* p, void* scanner); - -#endif /* !YY_XSLPATTERN_E_REACTOSSYNC_GCC_DLL_WIN32_MSXML3_XSLPATTERN_TAB_H_INCLUDED */ diff --git a/dll/win32/msxml3/xslpattern.yy.c b/dll/win32/msxml3/xslpattern.yy.c deleted file mode 100644 index c29fd3e3dc6..00000000000 --- a/dll/win32/msxml3/xslpattern.yy.c +++ /dev/null @@ -1,2240 +0,0 @@ -#line 2 "xslpattern.yy.c" - -#line 4 "xslpattern.yy.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN yyg->yy_start = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START ((yyg->yy_start - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE xslpattern_restart(yyin ,yyscanner ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = yyg->yy_hold_char; \ - YY_RESTORE_YY_MORE_OFFSET \ - yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via xslpattern_restart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \ - ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] - -void xslpattern_restart (FILE *input_file ,yyscan_t yyscanner ); -void xslpattern__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE xslpattern__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void xslpattern__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void xslpattern__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void xslpattern_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void xslpattern_pop_buffer_state (yyscan_t yyscanner ); - -static void xslpattern_ensure_buffer_stack (yyscan_t yyscanner ); -static void xslpattern__load_buffer_state (yyscan_t yyscanner ); -static void xslpattern__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); - -#define YY_FLUSH_BUFFER xslpattern__flush_buffer(YY_CURRENT_BUFFER ,yyscanner) - -YY_BUFFER_STATE xslpattern__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE xslpattern__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE xslpattern__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); - -void *xslpattern_alloc (yy_size_t ,yyscan_t yyscanner ); -void *xslpattern_realloc (void *,yy_size_t ,yyscan_t yyscanner ); -void xslpattern_free (void * ,yyscan_t yyscanner ); - -#define yy_new_buffer xslpattern__create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - xslpattern_ensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - xslpattern__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - xslpattern_ensure_buffer_stack (yyscanner); \ - YY_CURRENT_BUFFER_LVALUE = \ - xslpattern__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define xslpattern_wrap(yyscanner) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -typedef int yy_state_type; - -#define yytext_ptr yytext_r - -static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); -static int yy_get_next_buffer (yyscan_t yyscanner ); -static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - yyg->yytext_ptr = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - yyg->yy_hold_char = *yy_cp; \ - *yy_cp = '\0'; \ - yyg->yy_c_buf_p = yy_cp; - -#define YY_NUM_RULES 38 -#define YY_END_OF_BUFFER 39 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[96] = - { 0, - 0, 0, 39, 37, 1, 1, 34, 37, 37, 37, - 37, 9, 10, 15, 14, 6, 4, 36, 8, 23, - 19, 25, 13, 35, 11, 12, 35, 35, 33, 1, - 21, 0, 2, 0, 0, 0, 0, 0, 0, 0, - 16, 0, 5, 36, 3, 36, 36, 7, 27, 29, - 35, 35, 35, 35, 17, 17, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 36, 16, 0, 0, 0, 19, 25, 0, 0, 0, - 0, 0, 0, 23, 0, 31, 32, 20, 30, 26, - 28, 24, 22, 18, 0 - - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 1, 6, 1, 7, 8, 9, - 10, 11, 1, 12, 13, 14, 15, 16, 16, 16, - 16, 16, 16, 16, 16, 16, 16, 17, 1, 18, - 19, 20, 1, 21, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, - 23, 1, 24, 1, 25, 1, 26, 22, 22, 27, - - 28, 22, 29, 22, 30, 22, 22, 31, 22, 32, - 33, 22, 34, 35, 22, 36, 22, 22, 22, 22, - 37, 22, 1, 38, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 13, 1, 1, 1, 1, 1, 1, 1, - 1, 39, 39, 39, 39, 39, 39, 39, 39, 39, - - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 1, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 1, 39, 39, 39, - 39, 39, 39, 39, 39 - } ; - -static yyconst flex_int32_t yy_meta[40] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 2, 1, 2, 1, 1, 1, 1, - 1, 2, 1, 1, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 1, 2 - } ; - -static yyconst flex_int16_t yy_base[99] = - { 0, - 0, 0, 137, 138, 38, 40, 117, 130, 18, 127, - 125, 138, 138, 138, 138, 38, 117, 39, 114, 111, - 138, 110, 138, 43, 138, 138, 47, 30, 90, 64, - 138, 122, 138, 38, 92, 45, 46, 48, 52, 90, - 138, 116, 138, 107, 138, 106, 72, 138, 138, 138, - 89, 88, 87, 55, 86, 138, 86, 56, 110, 109, - 108, 79, 61, 62, 84, 105, 104, 103, 72, 101, - 90, 73, 98, 97, 90, 138, 138, 89, 88, 86, - 85, 65, 58, 138, 52, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 98, 100, 43 - - } ; - -static yyconst flex_int16_t yy_def[99] = - { 0, - 95, 1, 95, 95, 95, 95, 95, 96, 95, 95, - 97, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 98, 95, 95, 98, 27, 95, 95, - 95, 96, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 97, 95, 95, 95, 95, 95, 95, 95, 95, - 27, 27, 27, 27, 27, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 27, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 0, 95, 95, 95 - - } ; - -static yyconst flex_int16_t yy_nxt[178] = - { 0, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 15, 4, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 24, 27, 24, 24, 24, 24, - 24, 24, 28, 24, 24, 24, 24, 29, 24, 30, - 30, 30, 30, 34, 52, 35, 36, 37, 38, 39, - 40, 43, 46, 44, 47, 51, 51, 94, 51, 51, - 51, 52, 51, 93, 55, 30, 30, 53, 57, 58, - 92, 53, 60, 62, 63, 66, 64, 65, 54, 68, - 61, 72, 74, 67, 69, 46, 52, 47, 79, 81, - 91, 90, 75, 89, 88, 87, 80, 82, 32, 32, - - 42, 42, 41, 86, 52, 71, 56, 85, 31, 84, - 49, 83, 78, 77, 50, 76, 73, 52, 52, 52, - 52, 71, 44, 33, 70, 59, 33, 56, 50, 49, - 48, 45, 33, 41, 33, 31, 95, 3, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95 - } ; - -static yyconst flex_int16_t yy_chk[178] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, - 5, 6, 6, 9, 98, 9, 9, 9, 9, 9, - 9, 16, 18, 16, 18, 24, 24, 85, 24, 27, - 27, 28, 27, 83, 28, 30, 30, 24, 34, 34, - 82, 27, 36, 37, 37, 38, 37, 37, 27, 39, - 36, 54, 58, 38, 39, 47, 54, 47, 63, 64, - 81, 80, 58, 79, 78, 75, 63, 64, 96, 96, - - 97, 97, 74, 73, 72, 71, 70, 69, 68, 67, - 66, 65, 62, 61, 60, 59, 57, 55, 53, 52, - 51, 46, 44, 42, 40, 35, 32, 29, 22, 20, - 19, 17, 11, 10, 8, 7, 3, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, - 95, 95, 95, 95, 95, 95, 95 - } ; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -#line 1 "xslpattern.l" -/* - * XSLPattern lexer - * - * Copyright 2010 Adam Martinson for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ -#line 22 "xslpattern.l" -#include "config.h" -#include "wine/port.h" - -#ifdef HAVE_LIBXML2 - -#include "xslpattern.h" -#include "xslpattern.tab.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(msxml); - -#define SCAN xslpattern_get_extra(yyscanner) - -#define YY_INPUT(tok_buf, tok_len, max) \ - do { \ - if (SCAN->pos <= SCAN->len) \ - { \ - tok_len = SCAN->len - SCAN->pos; \ - if (tok_len > max) tok_len = max; \ - memcpy(tok_buf, SCAN->in + SCAN->pos, tok_len); \ - SCAN->pos += tok_len; \ - } \ - else \ - { \ - tok_len = YY_NULL; \ - } \ - } while (0); - -#define TOK(tok) TRACE("token: %s : %s\n", #tok, yytext); return tok -#define OP(tok) *yylval=NULL; TOK(tok) -#define SYM(tok) *yylval=NULL; TOK(tok) -#define STR(tok) *yylval=xmlStrdup(BAD_CAST yytext); TOK(tok) - - -#define YY_NO_INPUT 1 -/* From the w3c XML standard - * */ -/* [2.3] Common Syntactic Constructs */ -/* From the w3c XML Namespace standard - * */ -/* [3] Declaring Namespaces*/ -/* Mostly verbatim from the w3c XPath standard. - * */ -/* [3.4] Booleans -* ||, &&, $foo$ are XSLPattern only */ -/* [3.7] Lexical Structure */ -#line 568 "xslpattern.yy.c" - -#define INITIAL 0 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Holds the entire state of the reentrant scanner. */ -struct yyguts_t - { - - /* User-defined. Not touched by flex. */ - YY_EXTRA_TYPE yyextra_r; - - /* The rest are the same as the globals declared in the non-reentrant scanner. */ - FILE *yyin_r, *yyout_r; - size_t yy_buffer_stack_top; /**< index of top of stack. */ - size_t yy_buffer_stack_max; /**< capacity of stack. */ - YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ - char yy_hold_char; - yy_size_t yy_n_chars; - yy_size_t yyleng_r; - char *yy_c_buf_p; - int yy_init; - int yy_start; - int yy_did_buffer_switch_on_eof; - int yy_start_stack_ptr; - int yy_start_stack_depth; - int *yy_start_stack; - yy_state_type yy_last_accepting_state; - char* yy_last_accepting_cpos; - - int yylineno_r; - int yy_flex_debug_r; - - char *yytext_r; - int yy_more_flag; - int yy_more_len; - - YYSTYPE * yylval_r; - - }; /* end struct yyguts_t */ - -static int yy_init_globals (yyscan_t yyscanner ); - - /* This must go here because YYSTYPE and YYLTYPE are included - * from bison output in section 1.*/ - # define yylval yyg->yylval_r - -int xslpattern_lex_init (yyscan_t* scanner); - -int xslpattern_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int xslpattern_lex_destroy (yyscan_t yyscanner ); - -int xslpattern_get_debug (yyscan_t yyscanner ); - -void xslpattern_set_debug (int debug_flag ,yyscan_t yyscanner ); - -YY_EXTRA_TYPE xslpattern_get_extra (yyscan_t yyscanner ); - -void xslpattern_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); - -FILE *xslpattern_get_in (yyscan_t yyscanner ); - -void xslpattern_set_in (FILE * in_str ,yyscan_t yyscanner ); - -FILE *xslpattern_get_out (yyscan_t yyscanner ); - -void xslpattern_set_out (FILE * out_str ,yyscan_t yyscanner ); - -yy_size_t xslpattern_get_leng (yyscan_t yyscanner ); - -char *xslpattern_get_text (yyscan_t yyscanner ); - -int xslpattern_get_lineno (yyscan_t yyscanner ); - -void xslpattern_set_lineno (int line_number ,yyscan_t yyscanner ); - -int xslpattern_get_column (yyscan_t yyscanner ); - -void xslpattern_set_column (int column_no ,yyscan_t yyscanner ); - -YYSTYPE * xslpattern_get_lval (yyscan_t yyscanner ); - -void xslpattern_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int xslpattern_wrap (yyscan_t yyscanner ); -#else -extern int xslpattern_wrap (yyscan_t yyscanner ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (yyscan_t yyscanner ); -#else -static int input (yyscan_t yyscanner ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int xslpattern_lex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); - -#define YY_DECL int xslpattern_lex \ - (YYSTYPE * yylval_param , yyscan_t yyscanner) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - -#line 113 "xslpattern.l" - - -#line 806 "xslpattern.yy.c" - - yylval = yylval_param; - - if ( !yyg->yy_init ) - { - yyg->yy_init = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yyg->yy_start ) - yyg->yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - xslpattern_ensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - xslpattern__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - xslpattern__load_buffer_state(yyscanner ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = yyg->yy_c_buf_p; - - /* Support of yytext. */ - *yy_cp = yyg->yy_hold_char; - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = yyg->yy_start; -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 96 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_current_state != 95 ); - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yyg->yy_hold_char; - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -YY_RULE_SETUP -#line 115 "xslpattern.l" -{ /* ignored */ } - YY_BREAK -case 2: -/* rule 2 can match eol */ -YY_RULE_SETUP -#line 116 "xslpattern.l" -{ STR(TOK_Literal); } - YY_BREAK -case 3: -YY_RULE_SETUP -#line 117 "xslpattern.l" -{ SYM(TOK_DblFSlash); } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 118 "xslpattern.l" -{ SYM(TOK_FSlash); } - YY_BREAK -case 5: -YY_RULE_SETUP -#line 119 "xslpattern.l" -{ SYM(TOK_Parent); } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 120 "xslpattern.l" -{ SYM(TOK_Self); } - YY_BREAK -case 7: -YY_RULE_SETUP -#line 121 "xslpattern.l" -{ SYM(TOK_Axis); } - YY_BREAK -case 8: -YY_RULE_SETUP -#line 122 "xslpattern.l" -{ SYM(TOK_Colon); } - YY_BREAK -case 9: -YY_RULE_SETUP -#line 123 "xslpattern.l" -{ SYM('('); } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 124 "xslpattern.l" -{ SYM(')'); } - YY_BREAK -case 11: -YY_RULE_SETUP -#line 125 "xslpattern.l" -{ SYM('['); } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 126 "xslpattern.l" -{ SYM(']'); } - YY_BREAK -case 13: -YY_RULE_SETUP -#line 127 "xslpattern.l" -{ SYM('@'); } - YY_BREAK -case 14: -YY_RULE_SETUP -#line 128 "xslpattern.l" -{ SYM(','); } - YY_BREAK -case 15: -YY_RULE_SETUP -#line 129 "xslpattern.l" -{ SYM('*'); } - YY_BREAK -case 16: -YY_RULE_SETUP -#line 130 "xslpattern.l" -{ OP(TOK_OpAnd); } - YY_BREAK -case 17: -YY_RULE_SETUP -#line 131 "xslpattern.l" -{ OP(TOK_OpOr); } - YY_BREAK -case 18: -YY_RULE_SETUP -#line 132 "xslpattern.l" -{ OP(TOK_OpNot); } - YY_BREAK -case 19: -YY_RULE_SETUP -#line 133 "xslpattern.l" -{ OP(TOK_OpEq); } - YY_BREAK -case 20: -YY_RULE_SETUP -#line 134 "xslpattern.l" -{ OP(TOK_OpIEq); } - YY_BREAK -case 21: -YY_RULE_SETUP -#line 135 "xslpattern.l" -{ OP(TOK_OpNEq); } - YY_BREAK -case 22: -YY_RULE_SETUP -#line 136 "xslpattern.l" -{ OP(TOK_OpINEq); } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 137 "xslpattern.l" -{ OP(TOK_OpLt); } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 138 "xslpattern.l" -{ OP(TOK_OpILt); } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 139 "xslpattern.l" -{ OP(TOK_OpGt); } - YY_BREAK -case 26: -YY_RULE_SETUP -#line 140 "xslpattern.l" -{ OP(TOK_OpIGt); } - YY_BREAK -case 27: -YY_RULE_SETUP -#line 141 "xslpattern.l" -{ OP(TOK_OpLEq); } - YY_BREAK -case 28: -YY_RULE_SETUP -#line 142 "xslpattern.l" -{ OP(TOK_OpILEq); } - YY_BREAK -case 29: -YY_RULE_SETUP -#line 143 "xslpattern.l" -{ OP(TOK_OpGEq); } - YY_BREAK -case 30: -YY_RULE_SETUP -#line 144 "xslpattern.l" -{ OP(TOK_OpIGEq); } - YY_BREAK -case 31: -YY_RULE_SETUP -#line 145 "xslpattern.l" -{ OP(TOK_OpAll); } - YY_BREAK -case 32: -YY_RULE_SETUP -#line 146 "xslpattern.l" -{ OP(TOK_OpAny); } - YY_BREAK -case 33: -YY_RULE_SETUP -#line 147 "xslpattern.l" -{ SYM('|'); } - YY_BREAK -case 34: -YY_RULE_SETUP -#line 148 "xslpattern.l" -{ SYM('!'); } - YY_BREAK -case 35: -YY_RULE_SETUP -#line 149 "xslpattern.l" -{ STR(TOK_NCName); } - YY_BREAK -case 36: -YY_RULE_SETUP -#line 150 "xslpattern.l" -{ STR(TOK_Number); } - YY_BREAK -case 37: -YY_RULE_SETUP -#line 151 "xslpattern.l" -{ FIXME("Unexpected character '%s'.\n",yytext); } - YY_BREAK -case 38: -YY_RULE_SETUP -#line 153 "xslpattern.l" -ECHO; - YY_BREAK -#line 1079 "xslpattern.yy.c" -case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yyg->yy_hold_char; - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * xslpattern_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner); - - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++yyg->yy_c_buf_p; - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = yyg->yy_last_accepting_cpos; - yy_current_state = yyg->yy_last_accepting_state; - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_END_OF_FILE: - { - yyg->yy_did_buffer_switch_on_eof = 0; - - if ( xslpattern_wrap(yyscanner ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = - yyg->yytext_ptr + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - yyg->yy_c_buf_p = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; - - yy_current_state = yy_get_previous_state( yyscanner ); - - yy_cp = yyg->yy_c_buf_p; - yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of xslpattern_lex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; - int ret_val; - - if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0; - - else - { - yy_size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) (yyg->yy_c_buf_p - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - yy_size_t new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - xslpattern_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - if ( yyg->yy_n_chars == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - xslpattern_restart(yyin ,yyscanner); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) xslpattern_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - yyg->yy_n_chars += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; - - yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (yyscan_t yyscanner) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - yy_current_state = yyg->yy_start; - - for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 96 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) -{ - register int yy_is_jam; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - yyg->yy_last_accepting_state = yy_current_state; - yyg->yy_last_accepting_cpos = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 96 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 95); - - (void)yyg; - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (yyscan_t yyscanner) -#else - static int input (yyscan_t yyscanner) -#endif - -{ - int c; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - *yyg->yy_c_buf_p = yyg->yy_hold_char; - - if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) - /* This was really a NUL. */ - *yyg->yy_c_buf_p = '\0'; - - else - { /* need more input */ - yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; - ++yyg->yy_c_buf_p; - - switch ( yy_get_next_buffer( yyscanner ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - xslpattern_restart(yyin ,yyscanner); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( xslpattern_wrap(yyscanner ) ) - return EOF; - - if ( ! yyg->yy_did_buffer_switch_on_eof ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(yyscanner); -#else - return input(yyscanner); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - yyg->yy_c_buf_p = yyg->yytext_ptr + offset; - break; - } - } - } - - c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ - *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ - yyg->yy_hold_char = *++yyg->yy_c_buf_p; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * @param yyscanner The scanner object. - * @note This function does not reset the start condition to @c INITIAL . - */ - void xslpattern_restart (FILE * input_file , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! YY_CURRENT_BUFFER ){ - xslpattern_ensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - xslpattern__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - xslpattern__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); - xslpattern__load_buffer_state(yyscanner ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * @param yyscanner The scanner object. - */ - void xslpattern__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* TODO. We should be able to replace this entire function body - * with - * xslpattern_pop_buffer_state(); - * xslpattern_push_buffer_state(new_buffer); - */ - xslpattern_ensure_buffer_stack (yyscanner); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - xslpattern__load_buffer_state(yyscanner ); - - /* We don't actually know whether we did this switch during - * EOF (xslpattern_wrap()) processing, but the only time this flag - * is looked at is after xslpattern_wrap() is called, so it's safe - * to go ahead and always set it. - */ - yyg->yy_did_buffer_switch_on_eof = 1; -} - -static void xslpattern__load_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - yyg->yy_hold_char = *yyg->yy_c_buf_p; -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * @param yyscanner The scanner object. - * @return the allocated buffer state. - */ - YY_BUFFER_STATE xslpattern__create_buffer (FILE * file, int size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) xslpattern_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xslpattern__create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) xslpattern_alloc(b->yy_buf_size + 2 ,yyscanner ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in xslpattern__create_buffer()" ); - - b->yy_is_our_buffer = 1; - - xslpattern__init_buffer(b,file ,yyscanner); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with xslpattern__create_buffer() - * @param yyscanner The scanner object. - */ - void xslpattern__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - xslpattern_free((void *) b->yy_ch_buf ,yyscanner ); - - xslpattern_free((void *) b ,yyscanner ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a xslpattern_restart() or at EOF. - */ - static void xslpattern__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner) - -{ - int oerrno = errno; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - xslpattern__flush_buffer(b ,yyscanner); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then xslpattern__init_buffer was _probably_ - * called from xslpattern_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * @param yyscanner The scanner object. - */ - void xslpattern__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - xslpattern__load_buffer_state(yyscanner ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * @param yyscanner The scanner object. - */ -void xslpattern_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (new_buffer == NULL) - return; - - xslpattern_ensure_buffer_stack(yyscanner); - - /* This block is copied from xslpattern__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *yyg->yy_c_buf_p = yyg->yy_hold_char; - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - yyg->yy_buffer_stack_top++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from xslpattern__switch_to_buffer. */ - xslpattern__load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * @param yyscanner The scanner object. - */ -void xslpattern_pop_buffer_state (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - if (!YY_CURRENT_BUFFER) - return; - - xslpattern__delete_buffer(YY_CURRENT_BUFFER ,yyscanner); - YY_CURRENT_BUFFER_LVALUE = NULL; - if (yyg->yy_buffer_stack_top > 0) - --yyg->yy_buffer_stack_top; - - if (YY_CURRENT_BUFFER) { - xslpattern__load_buffer_state(yyscanner ); - yyg->yy_did_buffer_switch_on_eof = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void xslpattern_ensure_buffer_stack (yyscan_t yyscanner) -{ - yy_size_t num_to_alloc; - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (!yyg->yy_buffer_stack) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - yyg->yy_buffer_stack = (struct yy_buffer_state**)xslpattern_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in xslpattern_ensure_buffer_stack()" ); - - memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - yyg->yy_buffer_stack_max = num_to_alloc; - yyg->yy_buffer_stack_top = 0; - return; - } - - if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = yyg->yy_buffer_stack_max + grow_size; - yyg->yy_buffer_stack = (struct yy_buffer_state**)xslpattern_realloc - (yyg->yy_buffer_stack, - num_to_alloc * sizeof(struct yy_buffer_state*) - , yyscanner); - if ( ! yyg->yy_buffer_stack ) - YY_FATAL_ERROR( "out of dynamic memory in xslpattern_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); - yyg->yy_buffer_stack_max = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE xslpattern__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) xslpattern_alloc(sizeof( struct yy_buffer_state ) ,yyscanner ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in xslpattern__scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - xslpattern__switch_to_buffer(b ,yyscanner ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to xslpattern_lex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * xslpattern__scan_bytes() instead. - */ -YY_BUFFER_STATE xslpattern__scan_string (yyconst char * yystr , yyscan_t yyscanner) -{ - - return xslpattern__scan_bytes(yystr,strlen(yystr) ,yyscanner); -} - -/** Setup the input buffer state to scan the given bytes. The next call to xslpattern_lex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * @param yyscanner The scanner object. - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE xslpattern__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - yy_size_t i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) xslpattern_alloc(n ,yyscanner ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in xslpattern__scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = xslpattern__scan_buffer(buf,n ,yyscanner); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in xslpattern__scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = yyg->yy_hold_char; \ - yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ - yyg->yy_hold_char = *yyg->yy_c_buf_p; \ - *yyg->yy_c_buf_p = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the user-defined data for this scanner. - * @param yyscanner The scanner object. - */ -YY_EXTRA_TYPE xslpattern_get_extra (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyextra; -} - -/** Get the current line number. - * @param yyscanner The scanner object. - */ -int xslpattern_get_lineno (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yylineno; -} - -/** Get the current column number. - * @param yyscanner The scanner object. - */ -int xslpattern_get_column (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - if (! YY_CURRENT_BUFFER) - return 0; - - return yycolumn; -} - -/** Get the input stream. - * @param yyscanner The scanner object. - */ -FILE *xslpattern_get_in (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyin; -} - -/** Get the output stream. - * @param yyscanner The scanner object. - */ -FILE *xslpattern_get_out (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyout; -} - -/** Get the length of the current token. - * @param yyscanner The scanner object. - */ -yy_size_t xslpattern_get_leng (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yyleng; -} - -/** Get the current token. - * @param yyscanner The scanner object. - */ - -char *xslpattern_get_text (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yytext; -} - -/** Set the user-defined data. This data is never touched by the scanner. - * @param user_defined The data to be associated with this scanner. - * @param yyscanner The scanner object. - */ -void xslpattern_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyextra = user_defined ; -} - -/** Set the current line number. - * @param line_number - * @param yyscanner The scanner object. - */ -void xslpattern_set_lineno (int line_number , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* lineno is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "xslpattern_set_lineno called with no buffer" ); - - yylineno = line_number; -} - -/** Set the current column. - * @param line_number - * @param yyscanner The scanner object. - */ -void xslpattern_set_column (int column_no , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* column is only valid if an input buffer exists. */ - if (! YY_CURRENT_BUFFER ) - YY_FATAL_ERROR( "xslpattern_set_column called with no buffer" ); - - yycolumn = column_no; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * @param yyscanner The scanner object. - * @see xslpattern__switch_to_buffer - */ -void xslpattern_set_in (FILE * in_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; -} - -void xslpattern_set_out (FILE * out_str , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; -} - -int xslpattern_get_debug (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yy_flex_debug; -} - -void xslpattern_set_debug (int bdebug , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; -} - -/* Accessor methods for yylval and yylloc */ - -YYSTYPE * xslpattern_get_lval (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - return yylval; -} - -void xslpattern_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yylval = yylval_param; -} - -/* User-visible API */ - -/* xslpattern_lex_init is special because it creates the scanner itself, so it is - * the ONLY reentrant function that doesn't take the scanner as the last argument. - * That's why we explicitly handle the declaration, instead of using our macros. - */ - -int xslpattern_lex_init(yyscan_t* ptr_yy_globals) - -{ - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) xslpattern_alloc ( sizeof( struct yyguts_t ), NULL ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - return yy_init_globals ( *ptr_yy_globals ); -} - -/* xslpattern_lex_init_extra has the same functionality as xslpattern_lex_init, but follows the - * convention of taking the scanner as the last argument. Note however, that - * this is a *pointer* to a scanner, as it will be allocated by this call (and - * is the reason, too, why this function also must handle its own declaration). - * The user defined value in the first argument will be available to xslpattern_alloc in - * the yyextra field. - */ - -int xslpattern_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) - -{ - struct yyguts_t dummy_yyguts; - - xslpattern_set_extra (yy_user_defined, &dummy_yyguts); - - if (ptr_yy_globals == NULL){ - errno = EINVAL; - return 1; - } - - *ptr_yy_globals = (yyscan_t) xslpattern_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); - - if (*ptr_yy_globals == NULL){ - errno = ENOMEM; - return 1; - } - - /* By setting to 0xAA, we expose bugs in - yy_init_globals. Leave at 0x00 for releases. */ - memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); - - xslpattern_set_extra (yy_user_defined, *ptr_yy_globals); - - return yy_init_globals ( *ptr_yy_globals ); -} - -static int yy_init_globals (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from xslpattern_lex_destroy(), so don't allocate here. - */ - - yyg->yy_buffer_stack = 0; - yyg->yy_buffer_stack_top = 0; - yyg->yy_buffer_stack_max = 0; - yyg->yy_c_buf_p = (char *) 0; - yyg->yy_init = 0; - yyg->yy_start = 0; - - yyg->yy_start_stack_ptr = 0; - yyg->yy_start_stack_depth = 0; - yyg->yy_start_stack = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * xslpattern_lex_init() - */ - return 0; -} - -/* xslpattern_lex_destroy is for both reentrant and non-reentrant scanners. */ -int xslpattern_lex_destroy (yyscan_t yyscanner) -{ - struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - xslpattern__delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); - YY_CURRENT_BUFFER_LVALUE = NULL; - xslpattern_pop_buffer_state(yyscanner); - } - - /* Destroy the stack itself. */ - xslpattern_free(yyg->yy_buffer_stack ,yyscanner); - yyg->yy_buffer_stack = NULL; - - /* Destroy the start condition stack. */ - xslpattern_free(yyg->yy_start_stack ,yyscanner ); - yyg->yy_start_stack = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * xslpattern_lex() is called, initialization will occur. */ - yy_init_globals( yyscanner); - - /* Destroy the main struct (reentrant only). */ - xslpattern_free ( yyscanner , yyscanner ); - yyscanner = NULL; - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *xslpattern_alloc (yy_size_t size , yyscan_t yyscanner) -{ - return (void *) malloc( size ); -} - -void *xslpattern_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void xslpattern_free (void * ptr , yyscan_t yyscanner) -{ - free( (char *) ptr ); /* see xslpattern_realloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 152 "xslpattern.l" - - - -xmlChar* XSLPattern_to_XPath(xmlXPathContextPtr, xmlChar const*) DECLSPEC_HIDDEN; -xmlChar* XSLPattern_to_XPath(xmlXPathContextPtr ctxt, xmlChar const* xslpat_str) -{ - parser_param p; - TRACE("(%s)\n", debugstr_a((char const*)xslpat_str)); - memset(&p, 0, sizeof(parser_param)); - p.ctx = ctxt; - p.in = xslpat_str; - p.len = xmlStrlen(xslpat_str); - - xslpattern_lex_init(&p.yyscanner); - xslpattern_set_extra(&p, p.yyscanner); - - xslpattern_parse(&p, p.yyscanner); - - TRACE("=> %s\n", debugstr_a((char const*)p.out)); - xslpattern_lex_destroy(p.yyscanner); - - if (p.err) - { - xmlFree(p.out); - return xmlStrdup(xslpat_str); - } - else - { - return p.out; - } - -} - -#endif /* HAVE_LIBXML2 */ - diff --git a/dll/win32/msxml3/xslpattern.yy.h b/dll/win32/msxml3/xslpattern.yy.h deleted file mode 100644 index 86887f97105..00000000000 --- a/dll/win32/msxml3/xslpattern.yy.h +++ /dev/null @@ -1,346 +0,0 @@ -#ifndef xslpattern_HEADER_H -#define xslpattern_HEADER_H 1 -#define xslpattern_IN_HEADER 1 - -#line 6 "xslpattern.yy.h" - -#line 8 "xslpattern.yy.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 37 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* An opaque pointer. */ -#ifndef YY_TYPEDEF_YY_SCANNER_T -#define YY_TYPEDEF_YY_SCANNER_T -typedef void* yyscan_t; -#endif - -/* For convenience, these vars (plus the bison vars far below) - are macros in the reentrant scanner. */ -#define yyin yyg->yyin_r -#define yyout yyg->yyout_r -#define yyextra yyg->yyextra_r -#define yyleng yyg->yyleng_r -#define yytext yyg->yytext_r -#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) -#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) -#define yy_flex_debug yyg->yy_flex_debug_r - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#define YY_BUF_SIZE 16384 -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - yy_size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void xslpattern_restart (FILE *input_file ,yyscan_t yyscanner ); -void xslpattern__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -YY_BUFFER_STATE xslpattern__create_buffer (FILE *file,int size ,yyscan_t yyscanner ); -void xslpattern__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void xslpattern__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); -void xslpattern_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); -void xslpattern_pop_buffer_state (yyscan_t yyscanner ); - -YY_BUFFER_STATE xslpattern__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); -YY_BUFFER_STATE xslpattern__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE xslpattern__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); - -void *xslpattern_alloc (yy_size_t ,yyscan_t yyscanner ); -void *xslpattern_realloc (void *,yy_size_t ,yyscan_t yyscanner ); -void xslpattern_free (void * ,yyscan_t yyscanner ); - -/* Begin user sect3 */ - -#define xslpattern_wrap(yyscanner) 1 -#define YY_SKIP_YYWRAP - -#define yytext_ptr yytext_r - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -int xslpattern_lex_init (yyscan_t* scanner); - -int xslpattern_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int xslpattern_lex_destroy (yyscan_t yyscanner ); - -int xslpattern_get_debug (yyscan_t yyscanner ); - -void xslpattern_set_debug (int debug_flag ,yyscan_t yyscanner ); - -YY_EXTRA_TYPE xslpattern_get_extra (yyscan_t yyscanner ); - -void xslpattern_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); - -FILE *xslpattern_get_in (yyscan_t yyscanner ); - -void xslpattern_set_in (FILE * in_str ,yyscan_t yyscanner ); - -FILE *xslpattern_get_out (yyscan_t yyscanner ); - -void xslpattern_set_out (FILE * out_str ,yyscan_t yyscanner ); - -yy_size_t xslpattern_get_leng (yyscan_t yyscanner ); - -char *xslpattern_get_text (yyscan_t yyscanner ); - -int xslpattern_get_lineno (yyscan_t yyscanner ); - -void xslpattern_set_lineno (int line_number ,yyscan_t yyscanner ); - -int xslpattern_get_column (yyscan_t yyscanner ); - -void xslpattern_set_column (int column_no ,yyscan_t yyscanner ); - -YYSTYPE * xslpattern_get_lval (yyscan_t yyscanner ); - -void xslpattern_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int xslpattern_wrap (yyscan_t yyscanner ); -#else -extern int xslpattern_wrap (yyscan_t yyscanner ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#define YY_READ_BUF_SIZE 8192 -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int xslpattern_lex \ - (YYSTYPE * yylval_param ,yyscan_t yyscanner); - -#define YY_DECL int xslpattern_lex \ - (YYSTYPE * yylval_param , yyscan_t yyscanner) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#line 152 "xslpattern.l" - - -#line 345 "xslpattern.yy.h" -#undef xslpattern_IN_HEADER -#endif /* xslpattern_HEADER_H */ diff --git a/dll/win32/vbscript/CMakeLists.txt b/dll/win32/vbscript/CMakeLists.txt index 82b70c2a030..0f6819625ae 100644 --- a/dll/win32/vbscript/CMakeLists.txt +++ b/dll/win32/vbscript/CMakeLists.txt @@ -15,11 +15,7 @@ list(APPEND SOURCE vbscript.c vbscript_main.c) -list(APPEND PCH_SKIP_SOURCE - parser.tab.c) - -# parser.tab.c has been generated with relative file paths... -set_source_files_properties(parser.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") +BISON_TARGET(parser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.tab.c COMPILE_FLAGS "-p parser_") list(APPEND vbscript_rc_deps ${CMAKE_CURRENT_SOURCE_DIR}/vbscript_classes.rgs @@ -36,7 +32,7 @@ add_typelib(vbsglobal.idl vbsregexp10.idl vbsregexp55.idl) add_library(vbscript MODULE ${SOURCE} - ${PCH_SKIP_SOURCE} + ${BISON_parser_OUTPUTS} vbscript.rc ${CMAKE_CURRENT_BINARY_DIR}/vbscript.def) diff --git a/dll/win32/vbscript/parser.tab.c b/dll/win32/vbscript/parser.tab.c deleted file mode 100644 index cc702c598a9..00000000000 --- a/dll/win32/vbscript/parser.tab.c +++ /dev/null @@ -1,3961 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse parser_parse -#define yylex parser_lex -#define yyerror parser_error -#define yydebug parser_debug -#define yynerrs parser_nerrs - - -/* First part of user prologue. */ -#line 19 "parser.y" - - -#include "vbscript.h" -#include "parse.h" - -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(vbscript); - -static int parser_error(parser_ctx_t *,const char*); - -static void parse_complete(parser_ctx_t*,BOOL); -static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr); - -static void source_add_statement(parser_ctx_t*,statement_t*); -static void source_add_class(parser_ctx_t*,class_decl_t*); - -static void *new_expression(parser_ctx_t*,expression_type_t,size_t); -static expression_t *new_bool_expression(parser_ctx_t*,VARIANT_BOOL); -static expression_t *new_string_expression(parser_ctx_t*,const WCHAR*); -static expression_t *new_long_expression(parser_ctx_t*,expression_type_t,LONG); -static expression_t *new_double_expression(parser_ctx_t*,double); -static expression_t *new_unary_expression(parser_ctx_t*,expression_type_t,expression_t*); -static expression_t *new_binary_expression(parser_ctx_t*,expression_type_t,expression_t*,expression_t*); -static expression_t *new_new_expression(parser_ctx_t*,const WCHAR*); - -static member_expression_t *new_member_expression(parser_ctx_t*,expression_t*,const WCHAR*); - -static void *new_statement(parser_ctx_t*,statement_type_t,size_t); -static statement_t *new_call_statement(parser_ctx_t*,BOOL,member_expression_t*); -static statement_t *new_assign_statement(parser_ctx_t*,member_expression_t*,expression_t*); -static statement_t *new_set_statement(parser_ctx_t*,member_expression_t*,expression_t*); -static statement_t *new_dim_statement(parser_ctx_t*,dim_decl_t*); -static statement_t *new_while_statement(parser_ctx_t*,statement_type_t,expression_t*,statement_t*); -static statement_t *new_forto_statement(parser_ctx_t*,const WCHAR*,expression_t*,expression_t*,expression_t*,statement_t*); -static statement_t *new_foreach_statement(parser_ctx_t*,const WCHAR*,expression_t*,statement_t*); -static statement_t *new_if_statement(parser_ctx_t*,expression_t*,statement_t*,elseif_decl_t*,statement_t*); -static statement_t *new_function_statement(parser_ctx_t*,function_decl_t*); -static statement_t *new_onerror_statement(parser_ctx_t*,BOOL); -static statement_t *new_const_statement(parser_ctx_t*,const_decl_t*); -static statement_t *new_select_statement(parser_ctx_t*,expression_t*,case_clausule_t*); - -static dim_decl_t *new_dim_decl(parser_ctx_t*,const WCHAR*,BOOL,dim_list_t*); -static dim_list_t *new_dim(parser_ctx_t*,unsigned,dim_list_t*); -static elseif_decl_t *new_elseif_decl(parser_ctx_t*,expression_t*,statement_t*); -static function_decl_t *new_function_decl(parser_ctx_t*,const WCHAR*,function_type_t,unsigned,arg_decl_t*,statement_t*); -static arg_decl_t *new_argument_decl(parser_ctx_t*,const WCHAR*,BOOL); -static const_decl_t *new_const_decl(parser_ctx_t*,const WCHAR*,expression_t*); -static case_clausule_t *new_case_clausule(parser_ctx_t*,expression_t*,statement_t*,case_clausule_t*); - -static class_decl_t *new_class_decl(parser_ctx_t*); -static class_decl_t *add_class_function(parser_ctx_t*,class_decl_t*,function_decl_t*); -static class_decl_t *add_dim_prop(parser_ctx_t*,class_decl_t*,dim_decl_t*,unsigned); - -static statement_t *link_statements(statement_t*,statement_t*); - -#define STORAGE_IS_PRIVATE 1 -#define STORAGE_IS_DEFAULT 2 - -#define CHECK_ERROR if(((parser_ctx_t*)ctx)->hres != S_OK) YYABORT - - -#line 139 "parser.tab.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED -# define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tEXPRESSION = 258, - tEOF = 259, - tNL = 260, - tEMPTYBRACKETS = 261, - tLTEQ = 262, - tGTEQ = 263, - tNEQ = 264, - tSTOP = 265, - tME = 266, - tREM = 267, - tTRUE = 268, - tFALSE = 269, - tNOT = 270, - tAND = 271, - tOR = 272, - tXOR = 273, - tEQV = 274, - tIMP = 275, - tIS = 276, - tMOD = 277, - tCALL = 278, - tDIM = 279, - tSUB = 280, - tFUNCTION = 281, - tGET = 282, - tLET = 283, - tCONST = 284, - tIF = 285, - tELSE = 286, - tELSEIF = 287, - tEND = 288, - tTHEN = 289, - tEXIT = 290, - tWHILE = 291, - tWEND = 292, - tDO = 293, - tLOOP = 294, - tUNTIL = 295, - tFOR = 296, - tTO = 297, - tEACH = 298, - tIN = 299, - tSELECT = 300, - tCASE = 301, - tBYREF = 302, - tBYVAL = 303, - tOPTION = 304, - tNOTHING = 305, - tEMPTY = 306, - tNULL = 307, - tCLASS = 308, - tSET = 309, - tNEW = 310, - tPUBLIC = 311, - tPRIVATE = 312, - tNEXT = 313, - tON = 314, - tRESUME = 315, - tGOTO = 316, - tIdentifier = 317, - tString = 318, - tDEFAULT = 319, - tERROR = 320, - tEXPLICIT = 321, - tPROPERTY = 322, - tSTEP = 323, - tInt = 324, - tDouble = 325 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 87 "parser.y" - - const WCHAR *string; - statement_t *statement; - expression_t *expression; - member_expression_t *member; - elseif_decl_t *elseif; - dim_decl_t *dim_decl; - dim_list_t *dim_list; - function_decl_t *func_decl; - arg_decl_t *arg_decl; - class_decl_t *class_decl; - const_decl_t *const_decl; - case_clausule_t *case_clausule; - unsigned uint; - LONG integer; - BOOL boolean; - double dbl; - -#line 272 "parser.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int parser_parse (parser_ctx_t *ctx); - -#endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 48 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1153 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 87 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 63 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 232 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 405 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 325 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 81, 2, - 76, 77, 84, 82, 75, 78, 74, 85, 73, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 71, 2, - 80, 72, 79, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 83, 2, 86, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 148, 148, 149, 152, 153, 156, 157, 158, 161, - 162, 165, 166, 167, 170, 171, 174, 175, 178, 181, - 182, 183, 184, 185, 188, 189, 190, 192, 193, 194, - 196, 199, 202, 203, 204, 205, 206, 207, 208, 209, - 211, 212, 213, 214, 215, 217, 219, 223, 224, 227, - 228, 231, 232, 233, 236, 237, 240, 241, 244, 247, - 248, 251, 252, 255, 256, 259, 261, 262, 266, 267, - 270, 271, 274, 275, 278, 282, 283, 286, 287, 288, - 292, 293, 296, 297, 300, 301, 302, 305, 306, 309, - 310, 313, 314, 317, 318, 321, 322, 325, 326, 329, - 330, 333, 334, 337, 338, 339, 340, 341, 342, 343, - 344, 347, 348, 351, 352, 353, 356, 357, 360, 361, - 365, 366, 368, 372, 373, 376, 377, 378, 379, 380, - 383, 384, 387, 388, 389, 390, 391, 392, 393, 396, - 397, 398, 401, 402, 405, 406, 409, 412, 413, 414, - 416, 418, 420, 421, 422, 423, 426, 428, 430, 434, - 436, 440, 441, 444, 445, 446, 449, 450, 453, 454, - 457, 458, 459, 463, 464, 465, 466, 467, 468, 472, - 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, - 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 525, - 526, 527, 528 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "tEXPRESSION", "tEOF", "tNL", - "tEMPTYBRACKETS", "tLTEQ", "tGTEQ", "tNEQ", "tSTOP", "tME", "tREM", - "tTRUE", "tFALSE", "tNOT", "tAND", "tOR", "tXOR", "tEQV", "tIMP", "tIS", - "tMOD", "tCALL", "tDIM", "tSUB", "tFUNCTION", "tGET", "tLET", "tCONST", - "tIF", "tELSE", "tELSEIF", "tEND", "tTHEN", "tEXIT", "tWHILE", "tWEND", - "tDO", "tLOOP", "tUNTIL", "tFOR", "tTO", "tEACH", "tIN", "tSELECT", - "tCASE", "tBYREF", "tBYVAL", "tOPTION", "tNOTHING", "tEMPTY", "tNULL", - "tCLASS", "tSET", "tNEW", "tPUBLIC", "tPRIVATE", "tNEXT", "tON", - "tRESUME", "tGOTO", "tIdentifier", "tString", "tDEFAULT", "tERROR", - "tEXPLICIT", "tPROPERTY", "tSTEP", "tInt", "tDouble", "':'", "'='", - "'0'", "'.'", "','", "'('", "')'", "'-'", "'>'", "'<'", "'&'", "'+'", - "'\\\\'", "'*'", "'/'", "'^'", "$accept", "Program", - "OptionExplicit_opt", "SourceElements", "ExpressionNl_opt", - "BodyStatements", "StatementsNl_opt", "StatementsNl", "StatementNl", - "Statement", "SimpleStatement", "MemberExpression", "DimDeclList", - "DimDecl", "DimList", "ConstDeclList", "ConstDecl", "ConstExpression", - "DoType", "Step_opt", "IfStatement", "EndIf_opt", "ElseIfs_opt", - "ElseIfs", "ElseIf", "Else_opt", "CaseClausules", "Arguments_opt", - "ArgumentList_opt", "ArgumentList", "EmptyBrackets_opt", - "ExpressionList", "Expression", "EqvExpression", "XorExpression", - "OrExpression", "AndExpression", "NotExpression", "EqualityExpression", - "ConcatExpression", "AdditiveExpression", "ModExpression", - "IntdivExpression", "MultiplicativeExpression", "ExpExpression", - "UnaryExpression", "CallExpression", "LiteralExpression", - "NumericLiteralExpression", "IntegerValue", "PrimaryExpression", - "ClassDeclaration", "ClassBody", "PropertyDecl", "FunctionDecl", - "Storage_opt", "Storage", "ArgumentsDecl_opt", "ArgumentDeclList", - "ArgumentDecl", "Identifier", "DotIdentifier", "StSep", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 58, 61, 48, 46, 44, 40, 41, 45, 62, - 60, 38, 43, 92, 42, 47, 94 -}; -# endif - -#define YYPACT_NINF -294 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-294))) - -#define YYTABLE_NINF -162 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - 34, 617, -19, 50, -294, -294, -294, -294, 617, -294, - -294, -294, 166, -294, -294, -294, -294, -294, -294, -294, - -294, -294, -294, 617, 660, 660, 30, 2, 16, 43, - 96, 51, 111, -294, 37, 53, -17, 110, 100, 41, - 65, -294, 119, -294, -294, -294, -294, 15, -294, 466, - -294, -294, 19, -294, -294, -294, -294, 545, -294, -294, - -294, 617, 617, 617, 617, 617, 660, 660, 660, 660, - 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, - 660, 1085, 15, 15, -294, -294, -294, 368, 166, 166, - 617, 117, 617, 20, 107, 163, 166, 368, 126, -294, - 149, 721, -294, 212, 152, 391, -294, 119, -294, -294, - 131, -294, -294, 545, 147, -8, 43, 96, 51, 111, - -294, 53, 53, 53, 53, 53, 53, 53, -17, 110, - 110, 100, 41, 65, 65, -294, -294, -294, -294, -294, - -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, - -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, - -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, - -294, -294, -294, -294, -294, -294, -294, -294, -294, -294, - -294, -294, -294, -294, -294, -294, -294, -294, -294, 2, - -294, 154, 11, -294, 160, 164, 18, -294, -294, -294, - -294, -294, 9, -294, -294, 617, 771, 166, 169, 617, - 15, 2, -294, 144, -294, -294, 721, 545, 172, -294, - -294, -32, 166, 166, -294, -294, 545, 171, 166, -294, - 68, 166, 116, 516, 821, 9, 199, -294, 721, 202, - 617, 9, 82, 175, 190, 176, -294, 4, 617, 13, - 13, -294, -294, -294, -294, 173, 177, -294, -16, -294, - -294, 721, 66, 216, 771, 142, -294, 617, 104, 211, - 166, 227, 15, 15, 85, 201, 617, -294, -294, 241, - 97, -294, 15, 15, -294, 68, -294, 234, 1021, 237, - -294, -294, 230, 617, 9, 617, 588, 238, 15, 221, - 82, 82, -5, 15, 241, 166, 166, 200, 203, 270, - 871, 871, -294, 617, 249, -294, 234, 248, -294, -294, - 241, 921, 7, 15, 15, 10, 239, 82, 15, -294, - -294, 224, 225, 226, 82, 270, 270, -294, 97, -294, - 250, 871, 212, 256, 113, 285, 258, -294, -294, 243, - 617, 15, 1021, 721, 617, -294, -294, -294, 13, 228, - 229, -294, -294, -294, -294, 267, -294, 271, 305, 971, - 283, -294, 241, 921, -294, 211, -294, 15, 97, 97, - -294, -294, 721, -294, -294, 257, -294, 871, 240, 242, - -294, -294, 281, 15, 15, 251, 871, 871, -294, 287, - 288, 255, 261, -294, -294 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 4, 9, 0, 0, 6, 145, 132, 133, 0, 138, - 136, 137, 0, 173, 134, 174, 175, 176, 177, 178, - 140, 141, 139, 0, 0, 0, 0, 87, 0, 91, - 93, 95, 97, 99, 101, 103, 111, 113, 116, 118, - 120, 123, 126, 125, 135, 130, 47, 0, 1, 161, - 102, 127, 0, 128, 129, 3, 88, 0, 131, 80, - 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 229, 230, 5, 2, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 164, 165, - 0, 19, 7, 0, 21, 87, 28, 0, 8, 33, - 0, 162, 144, 0, 0, 84, 92, 94, 96, 98, - 100, 109, 108, 105, 110, 104, 106, 107, 112, 115, - 114, 117, 119, 121, 122, 124, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, - 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 179, 48, 231, 232, 87, - 27, 49, 51, 43, 56, 0, 0, 38, 36, 34, - 35, 37, 0, 61, 62, 0, 161, 0, 0, 0, - 0, 87, 163, 0, 20, 18, 23, 0, 131, 24, - 83, 82, 0, 0, 86, 81, 0, 25, 0, 53, - 0, 0, 0, 161, 161, 0, 0, 15, 16, 0, - 0, 0, 161, 131, 0, 0, 22, 0, 0, 87, - 87, 85, 50, 143, 142, 0, 54, 57, 0, 58, - 59, 14, 68, 0, 161, 32, 17, 0, 0, 77, - 0, 0, 154, 148, 0, 162, 0, 41, 42, 26, - 0, 166, 0, 0, 52, 0, 60, 70, 161, 0, - 66, 29, 0, 0, 0, 0, 0, 0, 152, 0, - 161, 161, 0, 150, 39, 0, 0, 0, 168, 87, - 161, 161, 55, 0, 75, 71, 72, 68, 69, 30, - 31, 161, 63, 0, 0, 89, 0, 161, 0, 155, - 149, 0, 0, 0, 161, 87, 87, 167, 0, 170, - 0, 161, 12, 0, 0, 0, 0, 73, 67, 0, - 0, 0, 161, 14, 0, 46, 153, 146, 87, 0, - 0, 151, 171, 172, 169, 0, 13, 0, 0, 161, - 0, 45, 64, 161, 78, 77, 90, 0, 0, 0, - 159, 160, 14, 76, 65, 0, 79, 161, 0, 0, - 74, 44, 0, 0, 0, 0, 161, 161, 156, 0, - 0, 0, 0, 157, 158 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -294, -294, -294, -294, -294, -293, -233, -231, -38, -85, - -294, -46, 101, 54, 40, 99, -294, -294, 69, -294, - -294, 23, -294, 22, -294, -294, -40, -99, -294, -103, - -96, -11, 3, 276, 282, 284, 290, 27, -294, 130, - 272, 102, 279, 269, 128, 39, 21, 120, 90, -294, - -294, -294, -268, -294, -229, -227, -199, -245, 25, -157, - -12, -294, 98 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 3, 4, 49, 26, 340, 236, 237, 238, 103, - 104, 27, 190, 191, 255, 193, 194, 259, 205, 351, - 106, 290, 314, 315, 316, 346, 297, 58, 219, 114, - 59, 324, 115, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 256, - 45, 108, 271, 272, 109, 110, 111, 282, 307, 308, - 46, 186, 84 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 51, 263, 220, 105, 28, 283, 218, 266, 56, 221, - 224, 102, 61, 273, 82, 274, 214, 229, 343, 56, - 82, 60, 331, 332, 61, 82, 52, 61, 287, 61, - 61, 292, 329, 330, 55, 50, 61, 1, 61, 61, - -80, 189, -80, 275, 66, 67, 68, 47, 366, 333, - 48, 211, 233, 20, 21, 105, 203, 22, 69, 356, - 204, 74, 62, 53, 54, 75, 361, 226, 64, 185, - 107, 273, 273, 274, 274, 350, 192, 195, 57, 226, - 83, 112, 208, 2, 210, 354, 83, 230, 349, 280, - 227, 83, 120, 196, 392, 202, 112, 288, 273, 289, - 274, 275, 275, 399, 400, 273, 270, 274, 107, 70, - 222, 223, 243, 377, 63, -147, 71, 72, 107, 135, - 375, 374, 107, 251, 61, 78, 79, 65, 275, 6, - 7, 246, 76, 61, 73, 275, 383, 253, 98, 99, - 385, 254, 197, 198, 305, 306, 295, 368, 262, 390, - 207, 80, 302, 281, 281, 199, 222, 223, 200, 13, - 105, 15, 16, 17, 18, 19, 9, 10, 11, 13, - 105, 15, 16, 17, 18, 19, 129, 130, 203, 14, - 187, 188, 204, 77, 201, 20, 21, 105, 105, 22, - 212, 206, 105, 81, 258, 239, 121, 122, 123, 124, - 125, 126, 127, 317, 244, 245, 133, 134, 235, 209, - 249, 250, 241, 339, 213, 105, 192, 215, 105, 195, - 247, 388, 389, 216, 225, 342, 342, 107, 13, 228, - 15, 16, 17, 18, 19, 231, 232, 107, 265, 362, - 363, 240, 105, 268, 248, -131, 267, 276, 277, 278, - 284, 279, 285, 291, 107, 107, 342, 296, 192, 107, - 299, 61, 281, 303, 105, 105, 313, 318, 309, 319, - 294, 326, 341, 341, 328, 105, 56, 337, 338, 304, - 345, 289, 107, 365, 355, 107, 358, 359, 360, 367, - 369, 370, 380, 335, 336, 105, 320, 381, 322, 325, - 234, 371, 342, 341, 378, 379, 105, 105, 242, 107, - 382, 342, 342, 384, 395, 391, 344, 393, 398, 394, - 401, 402, 403, 105, 298, 312, 309, 105, 404, 252, - 257, 107, 107, 264, 293, 386, 105, 116, 347, 269, - 348, 105, 107, 376, 117, 128, 132, 118, 286, 341, - 105, 105, 260, 372, 119, 131, 0, 325, 341, 341, - 0, 0, 107, 364, 0, 0, 309, 309, 0, 0, - 300, 301, 0, 107, 107, 0, 0, 0, 0, 5, - 310, 311, 0, 0, 0, 0, 0, 0, 0, 0, - 107, 0, 321, 0, 107, 0, 327, 56, 0, 0, - 0, 334, 5, 107, 6, 7, 8, 0, 107, 0, - 0, 0, 0, 0, 0, 0, 0, 107, 107, 0, - 0, 352, 353, 0, 0, 0, 357, 0, 0, 0, - 13, 0, 15, 16, 17, 18, 19, 0, 0, 0, - 0, 9, 10, 11, 23, 0, 12, 0, 0, 373, - 0, 0, 0, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 0, 0, 22, 0, 113, 217, 0, 24, - 85, 0, 0, 25, 0, 387, 86, 5, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, - 88, 396, 397, 0, 0, 89, 90, 0, 0, 0, - 0, 91, 92, 0, 93, 0, 0, 94, 0, 0, - 0, 95, 0, 0, 0, 0, 0, 0, 0, 96, - 97, 261, 98, 99, 0, 100, 86, 5, 13, 0, - 15, 16, 17, 18, 19, 0, 0, 101, 0, 87, - 88, 0, 23, 0, 0, 89, 90, 0, 0, 0, - 0, 91, 92, 0, 93, 0, 5, 94, 6, 7, - 8, 95, 0, 0, 0, 0, 0, 0, 0, 0, - 97, 0, 98, 99, 0, 100, 0, 0, 13, 0, - 15, 16, 17, 18, 19, 0, 0, 101, 0, 0, - 0, 0, 23, 0, 0, 9, 10, 11, 0, 5, - 12, 6, 7, 8, 0, 0, 0, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 0, 0, 22, 323, - 113, 23, 0, 24, 0, 0, 0, 25, 5, 0, - 6, 7, 8, 0, 0, 0, 0, 0, 9, 10, - 11, 0, 0, 12, 0, 0, 0, 0, 0, 0, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 0, - 0, 22, 0, 0, 23, 0, 24, 9, 10, 11, - 25, 5, 12, 6, 7, 0, 0, 0, 0, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 0, 0, - 22, 0, 0, 23, 0, 24, 0, 0, 0, 25, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 9, 10, 11, 0, 0, 12, 0, 0, 0, 0, - 0, 0, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 86, 5, 22, 0, 0, 23, 0, 24, 0, - 0, 0, 25, 0, 87, 88, -161, -161, 0, 0, - 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, - 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, - 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, - 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, - 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, - -14, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, - 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, - 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, - 89, 90, 0, 0, 0, 0, 91, 92, -14, 93, - 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, - 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, - 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, - 89, 90, 0, 0, -11, 0, 91, 92, 0, 93, - 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, - 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, - 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, - 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, - 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 98, 99, -14, - 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, - 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, - 89, 90, 0, 0, -14, 0, 91, 92, 0, 93, - 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, - 100, 86, 5, 13, 0, 15, 16, 17, 18, 19, - 0, 0, 101, 0, 87, 88, 0, 23, 0, 0, - 89, 90, 0, 0, 0, 0, 91, 92, 0, 93, - 0, 0, 94, 0, 0, 0, 95, 0, 0, 0, - 0, 0, 0, 0, 0, 97, 0, 98, 99, 0, - 100, 0, 0, 13, 0, 15, 16, 17, 18, 19, - 0, 0, 101, 0, 0, 0, 0, 23, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, - 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, - 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 183, 184, 13, 0, 15, - 16, 17, 18, 19 -}; - -static const yytype_int16 yycheck[] = -{ - 12, 234, 105, 49, 1, 250, 105, 238, 6, 105, - 113, 49, 20, 242, 5, 242, 101, 6, 311, 6, - 5, 5, 27, 28, 20, 5, 23, 20, 261, 20, - 20, 264, 300, 301, 4, 8, 20, 3, 20, 20, - 72, 87, 74, 242, 7, 8, 9, 66, 341, 54, - 0, 97, 34, 69, 70, 101, 36, 73, 21, 327, - 40, 78, 19, 24, 25, 82, 334, 75, 17, 81, - 49, 300, 301, 300, 301, 68, 88, 89, 76, 75, - 71, 77, 94, 49, 96, 75, 71, 76, 321, 76, - 189, 71, 65, 90, 387, 92, 77, 31, 327, 33, - 327, 300, 301, 396, 397, 334, 24, 334, 87, 72, - 25, 26, 211, 358, 18, 33, 79, 80, 97, 80, - 353, 352, 101, 226, 20, 84, 85, 16, 327, 13, - 14, 216, 22, 20, 81, 334, 369, 69, 56, 57, - 373, 73, 25, 26, 47, 48, 42, 34, 233, 382, - 43, 86, 67, 249, 250, 38, 25, 26, 41, 62, - 206, 64, 65, 66, 67, 68, 50, 51, 52, 62, - 216, 64, 65, 66, 67, 68, 74, 75, 36, 63, - 82, 83, 40, 83, 67, 69, 70, 233, 234, 73, - 64, 93, 238, 74, 78, 207, 66, 67, 68, 69, - 70, 71, 72, 288, 60, 61, 78, 79, 205, 46, - 222, 223, 209, 309, 65, 261, 228, 5, 264, 231, - 217, 378, 379, 71, 77, 310, 311, 206, 62, 75, - 64, 65, 66, 67, 68, 75, 72, 216, 39, 335, - 336, 72, 288, 240, 72, 74, 44, 72, 58, 73, - 77, 248, 75, 37, 233, 234, 341, 46, 270, 238, - 33, 20, 358, 62, 310, 311, 32, 30, 280, 39, - 267, 33, 310, 311, 53, 321, 6, 77, 75, 276, - 31, 33, 261, 33, 45, 264, 62, 62, 62, 33, - 5, 33, 25, 305, 306, 341, 293, 26, 295, 296, - 202, 58, 387, 341, 76, 76, 352, 353, 210, 288, - 5, 396, 397, 30, 33, 58, 313, 77, 67, 77, - 33, 33, 67, 369, 270, 285, 338, 373, 67, 228, - 231, 310, 311, 235, 265, 375, 382, 61, 316, 241, - 317, 387, 321, 354, 62, 73, 77, 63, 258, 387, - 396, 397, 232, 350, 64, 76, -1, 354, 396, 397, - -1, -1, 341, 338, -1, -1, 378, 379, -1, -1, - 272, 273, -1, 352, 353, -1, -1, -1, -1, 11, - 282, 283, -1, -1, -1, -1, -1, -1, -1, -1, - 369, -1, 294, -1, 373, -1, 298, 6, -1, -1, - -1, 303, 11, 382, 13, 14, 15, -1, 387, -1, - -1, -1, -1, -1, -1, -1, -1, 396, 397, -1, - -1, 323, 324, -1, -1, -1, 328, -1, -1, -1, - 62, -1, 64, 65, 66, 67, 68, -1, -1, -1, - -1, 50, 51, 52, 76, -1, 55, -1, -1, 351, - -1, -1, -1, 62, 63, 64, 65, 66, 67, 68, - 69, 70, -1, -1, 73, -1, 75, 76, -1, 78, - 4, -1, -1, 82, -1, 377, 10, 11, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 23, - 24, 393, 394, -1, -1, 29, 30, -1, -1, -1, - -1, 35, 36, -1, 38, -1, -1, 41, -1, -1, - -1, 45, -1, -1, -1, -1, -1, -1, -1, 53, - 54, 5, 56, 57, -1, 59, 10, 11, 62, -1, - 64, 65, 66, 67, 68, -1, -1, 71, -1, 23, - 24, -1, 76, -1, -1, 29, 30, -1, -1, -1, - -1, 35, 36, -1, 38, -1, 11, 41, 13, 14, - 15, 45, -1, -1, -1, -1, -1, -1, -1, -1, - 54, -1, 56, 57, -1, 59, -1, -1, 62, -1, - 64, 65, 66, 67, 68, -1, -1, 71, -1, -1, - -1, -1, 76, -1, -1, 50, 51, 52, -1, 11, - 55, 13, 14, 15, -1, -1, -1, 62, 63, 64, - 65, 66, 67, 68, 69, 70, -1, -1, 73, 31, - 75, 76, -1, 78, -1, -1, -1, 82, 11, -1, - 13, 14, 15, -1, -1, -1, -1, -1, 50, 51, - 52, -1, -1, 55, -1, -1, -1, -1, -1, -1, - 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, - -1, 73, -1, -1, 76, -1, 78, 50, 51, 52, - 82, 11, 55, 13, 14, -1, -1, -1, -1, 62, - 63, 64, 65, 66, 67, 68, 69, 70, -1, -1, - 73, -1, -1, 76, -1, 78, -1, -1, -1, 82, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 50, 51, 52, -1, -1, 55, -1, -1, -1, -1, - -1, -1, 62, 63, 64, 65, 66, 67, 68, 69, - 70, 10, 11, 73, -1, -1, 76, -1, 78, -1, - -1, -1, 82, -1, 23, 24, 25, 26, -1, -1, - 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, - -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, - 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, - -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, - 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, - 39, -1, 41, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, - 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, - -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, - 29, 30, -1, -1, -1, -1, 35, 36, 37, 38, - -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, - 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, - -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, - 29, 30, -1, -1, 33, -1, 35, 36, -1, 38, - -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, - 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, - -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, - 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, - -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, 56, 57, 58, - 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, - -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, - 29, 30, -1, -1, 33, -1, 35, 36, -1, 38, - -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, - 59, 10, 11, 62, -1, 64, 65, 66, 67, 68, - -1, -1, 71, -1, 23, 24, -1, 76, -1, -1, - 29, 30, -1, -1, -1, -1, 35, 36, -1, 38, - -1, -1, 41, -1, -1, -1, 45, -1, -1, -1, - -1, -1, -1, -1, -1, 54, -1, 56, 57, -1, - 59, -1, -1, 62, -1, 64, 65, 66, 67, 68, - -1, -1, 71, -1, -1, -1, -1, 76, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, -1, 64, - 65, 66, 67, 68 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 49, 88, 89, 11, 13, 14, 15, 50, - 51, 52, 55, 62, 63, 64, 65, 66, 67, 68, - 69, 70, 73, 76, 78, 82, 91, 98, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 137, 147, 66, 0, 90, - 124, 147, 119, 132, 132, 4, 6, 76, 114, 117, - 5, 20, 19, 18, 17, 16, 7, 8, 9, 21, - 72, 79, 80, 81, 78, 82, 22, 83, 84, 85, - 86, 74, 5, 71, 149, 4, 10, 23, 24, 29, - 30, 35, 36, 38, 41, 45, 53, 54, 56, 57, - 59, 71, 95, 96, 97, 98, 107, 133, 138, 141, - 142, 143, 77, 75, 116, 119, 120, 121, 122, 123, - 124, 126, 126, 126, 126, 126, 126, 126, 127, 128, - 128, 129, 130, 131, 131, 132, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 147, 148, 149, 149, 98, - 99, 100, 147, 102, 103, 147, 119, 25, 26, 38, - 41, 67, 119, 36, 40, 105, 149, 43, 147, 46, - 147, 98, 64, 65, 96, 5, 71, 76, 114, 115, - 116, 117, 25, 26, 116, 77, 75, 114, 75, 6, - 76, 75, 72, 34, 149, 119, 93, 94, 95, 147, - 72, 119, 149, 114, 60, 61, 96, 119, 72, 147, - 147, 116, 99, 69, 73, 101, 136, 102, 78, 104, - 134, 5, 96, 93, 149, 39, 94, 44, 119, 149, - 24, 139, 140, 141, 142, 143, 72, 58, 73, 119, - 76, 117, 144, 144, 77, 75, 135, 93, 31, 33, - 108, 37, 93, 105, 119, 42, 46, 113, 100, 33, - 149, 149, 67, 62, 119, 47, 48, 145, 146, 147, - 149, 149, 101, 32, 109, 110, 111, 96, 30, 39, - 119, 149, 119, 31, 118, 119, 33, 149, 53, 139, - 139, 27, 28, 54, 149, 147, 147, 77, 75, 117, - 92, 95, 96, 92, 119, 31, 112, 110, 108, 93, - 68, 106, 149, 149, 75, 45, 139, 149, 62, 62, - 62, 139, 117, 117, 145, 33, 92, 33, 34, 5, - 33, 58, 119, 149, 94, 93, 118, 144, 76, 76, - 25, 26, 5, 93, 30, 93, 113, 149, 146, 146, - 93, 58, 92, 77, 77, 33, 149, 149, 67, 92, - 92, 33, 33, 67, 67 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 87, 88, 88, 89, 89, 90, 90, 90, 91, - 91, 92, 92, 92, 93, 93, 94, 94, 95, 96, - 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, - 97, 97, 97, 97, 97, 97, 97, 98, 98, 99, - 99, 100, 100, 100, 101, 101, 102, 102, 103, 104, - 104, 105, 105, 106, 106, 107, 107, 107, 108, 108, - 109, 109, 110, 110, 111, 112, 112, 113, 113, 113, - 114, 114, 115, 115, 116, 116, 116, 117, 117, 118, - 118, 119, 119, 120, 120, 121, 121, 122, 122, 123, - 123, 124, 124, 125, 125, 125, 125, 125, 125, 125, - 125, 126, 126, 127, 127, 127, 128, 128, 129, 129, - 130, 130, 130, 131, 131, 132, 132, 132, 132, 132, - 133, 133, 134, 134, 134, 134, 134, 134, 134, 135, - 135, 135, 136, 136, 137, 137, 138, 139, 139, 139, - 139, 139, 139, 139, 139, 139, 140, 140, 140, 141, - 141, 142, 142, 143, 143, 143, 144, 144, 145, 145, - 146, 146, 146, 147, 147, 147, 147, 147, 147, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, - 149, 149, 149 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 3, 3, 0, 3, 0, 2, 2, 0, - 2, 0, 1, 2, 0, 1, 1, 2, 2, 1, - 2, 1, 3, 2, 2, 3, 4, 2, 1, 5, - 6, 6, 4, 1, 2, 2, 2, 2, 2, 5, - 1, 4, 4, 2, 10, 8, 7, 1, 3, 1, - 3, 1, 4, 2, 1, 3, 1, 3, 3, 1, - 2, 1, 1, 0, 2, 9, 5, 7, 0, 2, - 0, 1, 1, 2, 5, 0, 3, 0, 4, 5, - 1, 3, 1, 1, 1, 3, 2, 0, 1, 1, - 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, - 3, 1, 2, 1, 3, 3, 3, 3, 3, 3, - 3, 1, 3, 1, 3, 3, 1, 3, 1, 3, - 1, 3, 3, 1, 3, 1, 1, 2, 2, 2, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 1, 7, 0, 1, 3, - 2, 4, 2, 4, 1, 3, 9, 11, 11, 8, - 8, 0, 1, 2, 1, 1, 1, 3, 1, 3, - 2, 3, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 2 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (ctx, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, ctx); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (ctx); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, parser_ctx_t *ctx) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep, ctx); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, parser_ctx_t *ctx) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - , ctx); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, ctx); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parser_ctx_t *ctx) -{ - YYUSE (yyvaluep); - YYUSE (ctx); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (parser_ctx_t *ctx) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, ctx); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 148 "parser.y" - { parse_complete(ctx, (yyvsp[-2].boolean)); } -#line 1830 "parser.tab.c" - break; - - case 3: -#line 149 "parser.y" - { handle_isexpression_script(ctx, (yyvsp[-1].expression)); } -#line 1836 "parser.tab.c" - break; - - case 4: -#line 152 "parser.y" - { (yyval.boolean) = FALSE; } -#line 1842 "parser.tab.c" - break; - - case 5: -#line 153 "parser.y" - { (yyval.boolean) = TRUE; } -#line 1848 "parser.tab.c" - break; - - case 7: -#line 157 "parser.y" - { source_add_statement(ctx, (yyvsp[0].statement)); } -#line 1854 "parser.tab.c" - break; - - case 8: -#line 158 "parser.y" - { source_add_class(ctx, (yyvsp[0].class_decl)); } -#line 1860 "parser.tab.c" - break; - - case 9: -#line 161 "parser.y" - { (yyval.expression) = NULL; } -#line 1866 "parser.tab.c" - break; - - case 10: -#line 162 "parser.y" - { (yyval.expression) = (yyvsp[-1].expression); } -#line 1872 "parser.tab.c" - break; - - case 11: -#line 165 "parser.y" - { (yyval.statement) = NULL; } -#line 1878 "parser.tab.c" - break; - - case 12: -#line 166 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 1884 "parser.tab.c" - break; - - case 13: -#line 167 "parser.y" - { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } -#line 1890 "parser.tab.c" - break; - - case 14: -#line 170 "parser.y" - { (yyval.statement) = NULL; } -#line 1896 "parser.tab.c" - break; - - case 15: -#line 171 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 1902 "parser.tab.c" - break; - - case 16: -#line 174 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 1908 "parser.tab.c" - break; - - case 17: -#line 175 "parser.y" - { (yyval.statement) = link_statements((yyvsp[-1].statement), (yyvsp[0].statement)); } -#line 1914 "parser.tab.c" - break; - - case 18: -#line 178 "parser.y" - { (yyval.statement) = (yyvsp[-1].statement); } -#line 1920 "parser.tab.c" - break; - - case 19: -#line 181 "parser.y" - { (yyval.statement) = NULL; } -#line 1926 "parser.tab.c" - break; - - case 20: -#line 182 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 1932 "parser.tab.c" - break; - - case 21: -#line 183 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 1938 "parser.tab.c" - break; - - case 22: -#line 184 "parser.y" - { (yyvsp[-2].statement)->next = (yyvsp[0].statement); (yyval.statement) = (yyvsp[-2].statement); } -#line 1944 "parser.tab.c" - break; - - case 23: -#line 185 "parser.y" - { (yyval.statement) = (yyvsp[-1].statement); } -#line 1950 "parser.tab.c" - break; - - case 24: -#line 188 "parser.y" - { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, FALSE, (yyvsp[-1].member)); CHECK_ERROR; } -#line 1956 "parser.tab.c" - break; - - case 25: -#line 189 "parser.y" - { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.statement) = new_call_statement(ctx, TRUE, (yyvsp[-1].member)); CHECK_ERROR; } -#line 1962 "parser.tab.c" - break; - - case 26: -#line 191 "parser.y" - { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_assign_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } -#line 1968 "parser.tab.c" - break; - - case 27: -#line 192 "parser.y" - { (yyval.statement) = new_dim_statement(ctx, (yyvsp[0].dim_decl)); CHECK_ERROR; } -#line 1974 "parser.tab.c" - break; - - case 28: -#line 193 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 1980 "parser.tab.c" - break; - - case 29: -#line 195 "parser.y" - { (yyval.statement) = new_while_statement(ctx, STAT_WHILE, (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } -#line 1986 "parser.tab.c" - break; - - case 30: -#line 197 "parser.y" - { (yyval.statement) = new_while_statement(ctx, (yyvsp[-4].boolean) ? STAT_WHILELOOP : STAT_UNTIL, (yyvsp[-3].expression), (yyvsp[-1].statement)); - CHECK_ERROR; } -#line 1993 "parser.tab.c" - break; - - case 31: -#line 200 "parser.y" - { (yyval.statement) = new_while_statement(ctx, (yyvsp[-1].boolean) ? STAT_DOWHILE : STAT_DOUNTIL, (yyvsp[0].expression), (yyvsp[-3].statement)); - CHECK_ERROR; } -#line 2000 "parser.tab.c" - break; - - case 32: -#line 202 "parser.y" - { (yyval.statement) = new_while_statement(ctx, STAT_DOWHILE, NULL, (yyvsp[-1].statement)); CHECK_ERROR; } -#line 2006 "parser.tab.c" - break; - - case 33: -#line 203 "parser.y" - { (yyval.statement) = new_function_statement(ctx, (yyvsp[0].func_decl)); CHECK_ERROR; } -#line 2012 "parser.tab.c" - break; - - case 34: -#line 204 "parser.y" - { (yyval.statement) = new_statement(ctx, STAT_EXITDO, 0); CHECK_ERROR; } -#line 2018 "parser.tab.c" - break; - - case 35: -#line 205 "parser.y" - { (yyval.statement) = new_statement(ctx, STAT_EXITFOR, 0); CHECK_ERROR; } -#line 2024 "parser.tab.c" - break; - - case 36: -#line 206 "parser.y" - { (yyval.statement) = new_statement(ctx, STAT_EXITFUNC, 0); CHECK_ERROR; } -#line 2030 "parser.tab.c" - break; - - case 37: -#line 207 "parser.y" - { (yyval.statement) = new_statement(ctx, STAT_EXITPROP, 0); CHECK_ERROR; } -#line 2036 "parser.tab.c" - break; - - case 38: -#line 208 "parser.y" - { (yyval.statement) = new_statement(ctx, STAT_EXITSUB, 0); CHECK_ERROR; } -#line 2042 "parser.tab.c" - break; - - case 39: -#line 210 "parser.y" - { (yyvsp[-3].member)->args = (yyvsp[-2].expression); (yyval.statement) = new_set_statement(ctx, (yyvsp[-3].member), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2048 "parser.tab.c" - break; - - case 40: -#line 211 "parser.y" - { (yyval.statement) = new_statement(ctx, STAT_STOP, 0); CHECK_ERROR; } -#line 2054 "parser.tab.c" - break; - - case 41: -#line 212 "parser.y" - { (yyval.statement) = new_onerror_statement(ctx, TRUE); CHECK_ERROR; } -#line 2060 "parser.tab.c" - break; - - case 42: -#line 213 "parser.y" - { (yyval.statement) = new_onerror_statement(ctx, FALSE); CHECK_ERROR; } -#line 2066 "parser.tab.c" - break; - - case 43: -#line 214 "parser.y" - { (yyval.statement) = new_const_statement(ctx, (yyvsp[0].const_decl)); CHECK_ERROR; } -#line 2072 "parser.tab.c" - break; - - case 44: -#line 216 "parser.y" - { (yyval.statement) = new_forto_statement(ctx, (yyvsp[-8].string), (yyvsp[-6].expression), (yyvsp[-4].expression), (yyvsp[-3].expression), (yyvsp[-1].statement)); CHECK_ERROR; } -#line 2078 "parser.tab.c" - break; - - case 45: -#line 218 "parser.y" - { (yyval.statement) = new_foreach_statement(ctx, (yyvsp[-5].string), (yyvsp[-3].expression), (yyvsp[-1].statement)); } -#line 2084 "parser.tab.c" - break; - - case 46: -#line 220 "parser.y" - { (yyval.statement) = new_select_statement(ctx, (yyvsp[-4].expression), (yyvsp[-2].case_clausule)); } -#line 2090 "parser.tab.c" - break; - - case 47: -#line 223 "parser.y" - { (yyval.member) = new_member_expression(ctx, NULL, (yyvsp[0].string)); CHECK_ERROR; } -#line 2096 "parser.tab.c" - break; - - case 48: -#line 224 "parser.y" - { (yyval.member) = new_member_expression(ctx, (yyvsp[-2].expression), (yyvsp[0].string)); CHECK_ERROR; } -#line 2102 "parser.tab.c" - break; - - case 49: -#line 227 "parser.y" - { (yyval.dim_decl) = (yyvsp[0].dim_decl); } -#line 2108 "parser.tab.c" - break; - - case 50: -#line 228 "parser.y" - { (yyvsp[-2].dim_decl)->next = (yyvsp[0].dim_decl); (yyval.dim_decl) = (yyvsp[-2].dim_decl); } -#line 2114 "parser.tab.c" - break; - - case 51: -#line 231 "parser.y" - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; } -#line 2120 "parser.tab.c" - break; - - case 52: -#line 232 "parser.y" - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-3].string), TRUE, (yyvsp[-1].dim_list)); CHECK_ERROR; } -#line 2126 "parser.tab.c" - break; - - case 53: -#line 233 "parser.y" - { (yyval.dim_decl) = new_dim_decl(ctx, (yyvsp[-1].string), TRUE, NULL); CHECK_ERROR; } -#line 2132 "parser.tab.c" - break; - - case 54: -#line 236 "parser.y" - { (yyval.dim_list) = new_dim(ctx, (yyvsp[0].uint), NULL); } -#line 2138 "parser.tab.c" - break; - - case 55: -#line 237 "parser.y" - { (yyval.dim_list) = new_dim(ctx, (yyvsp[-2].uint), (yyvsp[0].dim_list)); } -#line 2144 "parser.tab.c" - break; - - case 56: -#line 240 "parser.y" - { (yyval.const_decl) = (yyvsp[0].const_decl); } -#line 2150 "parser.tab.c" - break; - - case 57: -#line 241 "parser.y" - { (yyvsp[-2].const_decl)->next = (yyvsp[0].const_decl); (yyval.const_decl) = (yyvsp[-2].const_decl); } -#line 2156 "parser.tab.c" - break; - - case 58: -#line 244 "parser.y" - { (yyval.const_decl) = new_const_decl(ctx, (yyvsp[-2].string), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2162 "parser.tab.c" - break; - - case 59: -#line 247 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2168 "parser.tab.c" - break; - - case 60: -#line 248 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } -#line 2174 "parser.tab.c" - break; - - case 61: -#line 251 "parser.y" - { (yyval.boolean) = TRUE; } -#line 2180 "parser.tab.c" - break; - - case 62: -#line 252 "parser.y" - { (yyval.boolean) = FALSE; } -#line 2186 "parser.tab.c" - break; - - case 63: -#line 255 "parser.y" - { (yyval.expression) = NULL;} -#line 2192 "parser.tab.c" - break; - - case 64: -#line 256 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2198 "parser.tab.c" - break; - - case 65: -#line 260 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-7].expression), (yyvsp[-4].statement), (yyvsp[-3].elseif), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2204 "parser.tab.c" - break; - - case 66: -#line 261 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-3].expression), (yyvsp[-1].statement), NULL, NULL); CHECK_ERROR; } -#line 2210 "parser.tab.c" - break; - - case 67: -#line 263 "parser.y" - { (yyval.statement) = new_if_statement(ctx, (yyvsp[-5].expression), (yyvsp[-3].statement), NULL, (yyvsp[-1].statement)); CHECK_ERROR; } -#line 2216 "parser.tab.c" - break; - - case 70: -#line 270 "parser.y" - { (yyval.elseif) = NULL; } -#line 2222 "parser.tab.c" - break; - - case 71: -#line 271 "parser.y" - { (yyval.elseif) = (yyvsp[0].elseif); } -#line 2228 "parser.tab.c" - break; - - case 72: -#line 274 "parser.y" - { (yyval.elseif) = (yyvsp[0].elseif); } -#line 2234 "parser.tab.c" - break; - - case 73: -#line 275 "parser.y" - { (yyvsp[-1].elseif)->next = (yyvsp[0].elseif); (yyval.elseif) = (yyvsp[-1].elseif); } -#line 2240 "parser.tab.c" - break; - - case 74: -#line 279 "parser.y" - { (yyval.elseif) = new_elseif_decl(ctx, (yyvsp[-3].expression), (yyvsp[0].statement)); } -#line 2246 "parser.tab.c" - break; - - case 75: -#line 282 "parser.y" - { (yyval.statement) = NULL; } -#line 2252 "parser.tab.c" - break; - - case 76: -#line 283 "parser.y" - { (yyval.statement) = (yyvsp[0].statement); } -#line 2258 "parser.tab.c" - break; - - case 77: -#line 286 "parser.y" - { (yyval.case_clausule) = NULL; } -#line 2264 "parser.tab.c" - break; - - case 78: -#line 287 "parser.y" - { (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[0].statement), NULL); } -#line 2270 "parser.tab.c" - break; - - case 79: -#line 289 "parser.y" - { (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[-3].expression), (yyvsp[-1].statement), (yyvsp[0].case_clausule)); } -#line 2276 "parser.tab.c" - break; - - case 80: -#line 292 "parser.y" - { (yyval.expression) = NULL; } -#line 2282 "parser.tab.c" - break; - - case 81: -#line 293 "parser.y" - { (yyval.expression) = (yyvsp[-1].expression); } -#line 2288 "parser.tab.c" - break; - - case 82: -#line 296 "parser.y" - { (yyval.expression) = NULL; } -#line 2294 "parser.tab.c" - break; - - case 83: -#line 297 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2300 "parser.tab.c" - break; - - case 84: -#line 300 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2306 "parser.tab.c" - break; - - case 85: -#line 301 "parser.y" - { (yyvsp[-2].expression)->next = (yyvsp[0].expression); (yyval.expression) = (yyvsp[-2].expression); } -#line 2312 "parser.tab.c" - break; - - case 86: -#line 302 "parser.y" - { (yyval.expression) = new_expression(ctx, EXPR_NOARG, 0); CHECK_ERROR; (yyval.expression)->next = (yyvsp[0].expression); } -#line 2318 "parser.tab.c" - break; - - case 89: -#line 309 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2324 "parser.tab.c" - break; - - case 90: -#line 310 "parser.y" - { (yyvsp[-2].expression)->next = (yyvsp[0].expression); (yyval.expression) = (yyvsp[-2].expression); } -#line 2330 "parser.tab.c" - break; - - case 91: -#line 313 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2336 "parser.tab.c" - break; - - case 92: -#line 314 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_IMP, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2342 "parser.tab.c" - break; - - case 93: -#line 317 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2348 "parser.tab.c" - break; - - case 94: -#line 318 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_EQV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2354 "parser.tab.c" - break; - - case 95: -#line 321 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2360 "parser.tab.c" - break; - - case 96: -#line 322 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_XOR, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2366 "parser.tab.c" - break; - - case 97: -#line 325 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2372 "parser.tab.c" - break; - - case 98: -#line 326 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2378 "parser.tab.c" - break; - - case 99: -#line 329 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2384 "parser.tab.c" - break; - - case 100: -#line 330 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2390 "parser.tab.c" - break; - - case 101: -#line 333 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2396 "parser.tab.c" - break; - - case 102: -#line 334 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_NOT, (yyvsp[0].expression)); CHECK_ERROR; } -#line 2402 "parser.tab.c" - break; - - case 103: -#line 337 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2408 "parser.tab.c" - break; - - case 104: -#line 338 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_EQUAL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2414 "parser.tab.c" - break; - - case 105: -#line 339 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_NEQUAL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2420 "parser.tab.c" - break; - - case 106: -#line 340 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_GT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2426 "parser.tab.c" - break; - - case 107: -#line 341 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_LT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2432 "parser.tab.c" - break; - - case 108: -#line 342 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_GTEQ, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2438 "parser.tab.c" - break; - - case 109: -#line 343 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_LTEQ, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2444 "parser.tab.c" - break; - - case 110: -#line 344 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_IS, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2450 "parser.tab.c" - break; - - case 111: -#line 347 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2456 "parser.tab.c" - break; - - case 112: -#line 348 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_CONCAT, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2462 "parser.tab.c" - break; - - case 113: -#line 351 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2468 "parser.tab.c" - break; - - case 114: -#line 352 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2474 "parser.tab.c" - break; - - case 115: -#line 353 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2480 "parser.tab.c" - break; - - case 116: -#line 356 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2486 "parser.tab.c" - break; - - case 117: -#line 357 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2492 "parser.tab.c" - break; - - case 118: -#line 360 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2498 "parser.tab.c" - break; - - case 119: -#line 362 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_IDIV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2504 "parser.tab.c" - break; - - case 120: -#line 365 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2510 "parser.tab.c" - break; - - case 121: -#line 367 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2516 "parser.tab.c" - break; - - case 122: -#line 369 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2522 "parser.tab.c" - break; - - case 123: -#line 372 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2528 "parser.tab.c" - break; - - case 124: -#line 373 "parser.y" - { (yyval.expression) = new_binary_expression(ctx, EXPR_EXP, (yyvsp[-2].expression), (yyvsp[0].expression)); CHECK_ERROR; } -#line 2534 "parser.tab.c" - break; - - case 125: -#line 376 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2540 "parser.tab.c" - break; - - case 126: -#line 377 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2546 "parser.tab.c" - break; - - case 127: -#line 378 "parser.y" - { (yyval.expression) = new_new_expression(ctx, (yyvsp[0].string)); CHECK_ERROR; } -#line 2552 "parser.tab.c" - break; - - case 128: -#line 379 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_NEG, (yyvsp[0].expression)); CHECK_ERROR; } -#line 2558 "parser.tab.c" - break; - - case 129: -#line 380 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2564 "parser.tab.c" - break; - - case 130: -#line 383 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2570 "parser.tab.c" - break; - - case 131: -#line 384 "parser.y" - { (yyvsp[-1].member)->args = (yyvsp[0].expression); (yyval.expression) = &(yyvsp[-1].member)->expr; } -#line 2576 "parser.tab.c" - break; - - case 132: -#line 387 "parser.y" - { (yyval.expression) = new_bool_expression(ctx, VARIANT_TRUE); CHECK_ERROR; } -#line 2582 "parser.tab.c" - break; - - case 133: -#line 388 "parser.y" - { (yyval.expression) = new_bool_expression(ctx, VARIANT_FALSE); CHECK_ERROR; } -#line 2588 "parser.tab.c" - break; - - case 134: -#line 389 "parser.y" - { (yyval.expression) = new_string_expression(ctx, (yyvsp[0].string)); CHECK_ERROR; } -#line 2594 "parser.tab.c" - break; - - case 135: -#line 390 "parser.y" - { (yyval.expression) = (yyvsp[0].expression); } -#line 2600 "parser.tab.c" - break; - - case 136: -#line 391 "parser.y" - { (yyval.expression) = new_expression(ctx, EXPR_EMPTY, 0); CHECK_ERROR; } -#line 2606 "parser.tab.c" - break; - - case 137: -#line 392 "parser.y" - { (yyval.expression) = new_expression(ctx, EXPR_NULL, 0); CHECK_ERROR; } -#line 2612 "parser.tab.c" - break; - - case 138: -#line 393 "parser.y" - { (yyval.expression) = new_expression(ctx, EXPR_NOTHING, 0); CHECK_ERROR; } -#line 2618 "parser.tab.c" - break; - - case 139: -#line 396 "parser.y" - { (yyval.expression) = new_long_expression(ctx, EXPR_INT, 0); CHECK_ERROR; } -#line 2624 "parser.tab.c" - break; - - case 140: -#line 397 "parser.y" - { (yyval.expression) = new_long_expression(ctx, EXPR_INT, (yyvsp[0].integer)); CHECK_ERROR; } -#line 2630 "parser.tab.c" - break; - - case 141: -#line 398 "parser.y" - { (yyval.expression) = new_double_expression(ctx, (yyvsp[0].dbl)); CHECK_ERROR; } -#line 2636 "parser.tab.c" - break; - - case 142: -#line 401 "parser.y" - { (yyval.uint) = 0; } -#line 2642 "parser.tab.c" - break; - - case 143: -#line 402 "parser.y" - { (yyval.uint) = (yyvsp[0].integer); } -#line 2648 "parser.tab.c" - break; - - case 144: -#line 405 "parser.y" - { (yyval.expression) = new_unary_expression(ctx, EXPR_BRACKETS, (yyvsp[-1].expression)); } -#line 2654 "parser.tab.c" - break; - - case 145: -#line 406 "parser.y" - { (yyval.expression) = new_expression(ctx, EXPR_ME, 0); CHECK_ERROR; } -#line 2660 "parser.tab.c" - break; - - case 146: -#line 409 "parser.y" - { (yyvsp[-3].class_decl)->name = (yyvsp[-5].string); (yyval.class_decl) = (yyvsp[-3].class_decl); } -#line 2666 "parser.tab.c" - break; - - case 147: -#line 412 "parser.y" - { (yyval.class_decl) = new_class_decl(ctx); } -#line 2672 "parser.tab.c" - break; - - case 148: -#line 413 "parser.y" - { (yyval.class_decl) = add_class_function(ctx, new_class_decl(ctx), (yyvsp[0].func_decl)); CHECK_ERROR; } -#line 2678 "parser.tab.c" - break; - - case 149: -#line 414 "parser.y" - { (yyval.class_decl) = add_class_function(ctx, (yyvsp[0].class_decl), (yyvsp[-2].func_decl)); CHECK_ERROR; } -#line 2684 "parser.tab.c" - break; - - case 150: -#line 416 "parser.y" - { dim_decl_t *dim_decl = new_dim_decl(ctx, (yyvsp[0].string), FALSE, NULL); CHECK_ERROR; - (yyval.class_decl) = add_dim_prop(ctx, new_class_decl(ctx), dim_decl, (yyvsp[-1].uint)); CHECK_ERROR; } -#line 2691 "parser.tab.c" - break; - - case 151: -#line 418 "parser.y" - { dim_decl_t *dim_decl = new_dim_decl(ctx, (yyvsp[-2].string), FALSE, NULL); CHECK_ERROR; - (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[0].class_decl), dim_decl, (yyvsp[-3].uint)); CHECK_ERROR; } -#line 2698 "parser.tab.c" - break; - - case 152: -#line 420 "parser.y" - { (yyval.class_decl) = add_dim_prop(ctx, new_class_decl(ctx), (yyvsp[0].dim_decl), 0); CHECK_ERROR; } -#line 2704 "parser.tab.c" - break; - - case 153: -#line 421 "parser.y" - { (yyval.class_decl) = add_dim_prop(ctx, (yyvsp[0].class_decl), (yyvsp[-2].dim_decl), 0); CHECK_ERROR; } -#line 2710 "parser.tab.c" - break; - - case 154: -#line 422 "parser.y" - { (yyval.class_decl) = add_class_function(ctx, new_class_decl(ctx), (yyvsp[0].func_decl)); CHECK_ERROR; } -#line 2716 "parser.tab.c" - break; - - case 155: -#line 423 "parser.y" - { (yyval.class_decl) = add_class_function(ctx, (yyvsp[0].class_decl), (yyvsp[-2].func_decl)); CHECK_ERROR; } -#line 2722 "parser.tab.c" - break; - - case 156: -#line 427 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_PROPGET, (yyvsp[-8].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2728 "parser.tab.c" - break; - - case 157: -#line 429 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-7].string), FUNC_PROPLET, (yyvsp[-10].uint), (yyvsp[-5].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2734 "parser.tab.c" - break; - - case 158: -#line 431 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-7].string), FUNC_PROPSET, (yyvsp[-10].uint), (yyvsp[-5].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2740 "parser.tab.c" - break; - - case 159: -#line 435 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_SUB, (yyvsp[-7].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2746 "parser.tab.c" - break; - - case 160: -#line 437 "parser.y" - { (yyval.func_decl) = new_function_decl(ctx, (yyvsp[-5].string), FUNC_FUNCTION, (yyvsp[-7].uint), (yyvsp[-4].arg_decl), (yyvsp[-2].statement)); CHECK_ERROR; } -#line 2752 "parser.tab.c" - break; - - case 161: -#line 440 "parser.y" - { (yyval.uint) = 0; } -#line 2758 "parser.tab.c" - break; - - case 162: -#line 441 "parser.y" - { (yyval.uint) = (yyvsp[0].uint); } -#line 2764 "parser.tab.c" - break; - - case 163: -#line 444 "parser.y" - { (yyval.uint) = STORAGE_IS_DEFAULT; } -#line 2770 "parser.tab.c" - break; - - case 164: -#line 445 "parser.y" - { (yyval.uint) = 0; } -#line 2776 "parser.tab.c" - break; - - case 165: -#line 446 "parser.y" - { (yyval.uint) = STORAGE_IS_PRIVATE; } -#line 2782 "parser.tab.c" - break; - - case 166: -#line 449 "parser.y" - { (yyval.arg_decl) = NULL; } -#line 2788 "parser.tab.c" - break; - - case 167: -#line 450 "parser.y" - { (yyval.arg_decl) = (yyvsp[-1].arg_decl); } -#line 2794 "parser.tab.c" - break; - - case 168: -#line 453 "parser.y" - { (yyval.arg_decl) = (yyvsp[0].arg_decl); } -#line 2800 "parser.tab.c" - break; - - case 169: -#line 454 "parser.y" - { (yyvsp[-2].arg_decl)->next = (yyvsp[0].arg_decl); (yyval.arg_decl) = (yyvsp[-2].arg_decl); } -#line 2806 "parser.tab.c" - break; - - case 170: -#line 457 "parser.y" - { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), TRUE); } -#line 2812 "parser.tab.c" - break; - - case 171: -#line 458 "parser.y" - { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), TRUE); } -#line 2818 "parser.tab.c" - break; - - case 172: -#line 459 "parser.y" - { (yyval.arg_decl) = new_argument_decl(ctx, (yyvsp[-1].string), FALSE); } -#line 2824 "parser.tab.c" - break; - - case 173: -#line 463 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2830 "parser.tab.c" - break; - - case 174: -#line 464 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2836 "parser.tab.c" - break; - - case 175: -#line 465 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2842 "parser.tab.c" - break; - - case 176: -#line 466 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2848 "parser.tab.c" - break; - - case 177: -#line 467 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2854 "parser.tab.c" - break; - - case 178: -#line 468 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2860 "parser.tab.c" - break; - - case 179: -#line 472 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2866 "parser.tab.c" - break; - - case 180: -#line 473 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2872 "parser.tab.c" - break; - - case 181: -#line 474 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2878 "parser.tab.c" - break; - - case 182: -#line 475 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2884 "parser.tab.c" - break; - - case 183: -#line 476 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2890 "parser.tab.c" - break; - - case 184: -#line 477 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2896 "parser.tab.c" - break; - - case 185: -#line 478 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2902 "parser.tab.c" - break; - - case 186: -#line 479 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2908 "parser.tab.c" - break; - - case 187: -#line 480 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2914 "parser.tab.c" - break; - - case 188: -#line 481 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2920 "parser.tab.c" - break; - - case 189: -#line 482 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2926 "parser.tab.c" - break; - - case 190: -#line 483 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2932 "parser.tab.c" - break; - - case 191: -#line 484 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2938 "parser.tab.c" - break; - - case 192: -#line 485 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2944 "parser.tab.c" - break; - - case 193: -#line 486 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2950 "parser.tab.c" - break; - - case 194: -#line 487 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2956 "parser.tab.c" - break; - - case 195: -#line 488 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2962 "parser.tab.c" - break; - - case 196: -#line 489 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2968 "parser.tab.c" - break; - - case 197: -#line 490 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2974 "parser.tab.c" - break; - - case 198: -#line 491 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2980 "parser.tab.c" - break; - - case 199: -#line 492 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2986 "parser.tab.c" - break; - - case 200: -#line 493 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2992 "parser.tab.c" - break; - - case 201: -#line 494 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 2998 "parser.tab.c" - break; - - case 202: -#line 495 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3004 "parser.tab.c" - break; - - case 203: -#line 496 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3010 "parser.tab.c" - break; - - case 204: -#line 497 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3016 "parser.tab.c" - break; - - case 205: -#line 498 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3022 "parser.tab.c" - break; - - case 206: -#line 499 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3028 "parser.tab.c" - break; - - case 207: -#line 500 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3034 "parser.tab.c" - break; - - case 208: -#line 501 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3040 "parser.tab.c" - break; - - case 209: -#line 502 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3046 "parser.tab.c" - break; - - case 210: -#line 503 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3052 "parser.tab.c" - break; - - case 211: -#line 504 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3058 "parser.tab.c" - break; - - case 212: -#line 505 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3064 "parser.tab.c" - break; - - case 213: -#line 506 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3070 "parser.tab.c" - break; - - case 214: -#line 507 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3076 "parser.tab.c" - break; - - case 215: -#line 508 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3082 "parser.tab.c" - break; - - case 216: -#line 509 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3088 "parser.tab.c" - break; - - case 217: -#line 510 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3094 "parser.tab.c" - break; - - case 218: -#line 511 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3100 "parser.tab.c" - break; - - case 219: -#line 512 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3106 "parser.tab.c" - break; - - case 220: -#line 513 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3112 "parser.tab.c" - break; - - case 221: -#line 514 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3118 "parser.tab.c" - break; - - case 222: -#line 515 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3124 "parser.tab.c" - break; - - case 223: -#line 516 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3130 "parser.tab.c" - break; - - case 224: -#line 517 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3136 "parser.tab.c" - break; - - case 225: -#line 518 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3142 "parser.tab.c" - break; - - case 226: -#line 519 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3148 "parser.tab.c" - break; - - case 227: -#line 520 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3154 "parser.tab.c" - break; - - case 228: -#line 521 "parser.y" - { (yyval.string) = (yyvsp[0].string); } -#line 3160 "parser.tab.c" - break; - - -#line 3164 "parser.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (ctx, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (ctx, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, ctx); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, ctx); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (ctx, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, ctx); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, ctx); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 530 "parser.y" - - -static int parser_error(parser_ctx_t *ctx, const char *str) -{ - return 0; -} - -static void source_add_statement(parser_ctx_t *ctx, statement_t *stat) -{ - if(!stat) - return; - - if(ctx->stats) { - ctx->stats_tail->next = stat; - ctx->stats_tail = stat; - }else { - ctx->stats = ctx->stats_tail = stat; - } -} - -static void source_add_class(parser_ctx_t *ctx, class_decl_t *class_decl) -{ - class_decl->next = ctx->class_decls; - ctx->class_decls = class_decl; -} - -static void parse_complete(parser_ctx_t *ctx, BOOL option_explicit) -{ - ctx->parse_complete = TRUE; - ctx->option_explicit = option_explicit; -} - -static void handle_isexpression_script(parser_ctx_t *ctx, expression_t *expr) -{ - retval_statement_t *stat; - - ctx->parse_complete = TRUE; - if(!expr) - return; - - stat = new_statement(ctx, STAT_RETVAL, sizeof(*stat)); - if(!stat) - return; - - stat->expr = expr; - ctx->stats = &stat->stat; -} - -static void *new_expression(parser_ctx_t *ctx, expression_type_t type, size_t size) -{ - expression_t *expr; - - expr = parser_alloc(ctx, size ? size : sizeof(*expr)); - if(expr) { - expr->type = type; - expr->next = NULL; - } - - return expr; -} - -static expression_t *new_bool_expression(parser_ctx_t *ctx, VARIANT_BOOL value) -{ - bool_expression_t *expr; - - expr = new_expression(ctx, EXPR_BOOL, sizeof(*expr)); - if(!expr) - return NULL; - - expr->value = value; - return &expr->expr; -} - -static expression_t *new_string_expression(parser_ctx_t *ctx, const WCHAR *value) -{ - string_expression_t *expr; - - expr = new_expression(ctx, EXPR_STRING, sizeof(*expr)); - if(!expr) - return NULL; - - expr->value = value; - return &expr->expr; -} - -static expression_t *new_long_expression(parser_ctx_t *ctx, expression_type_t type, LONG value) -{ - int_expression_t *expr; - - expr = new_expression(ctx, type, sizeof(*expr)); - if(!expr) - return NULL; - - expr->value = value; - return &expr->expr; -} - -static expression_t *new_double_expression(parser_ctx_t *ctx, double value) -{ - double_expression_t *expr; - - expr = new_expression(ctx, EXPR_DOUBLE, sizeof(*expr)); - if(!expr) - return NULL; - - expr->value = value; - return &expr->expr; -} - -static expression_t *new_unary_expression(parser_ctx_t *ctx, expression_type_t type, expression_t *subexpr) -{ - unary_expression_t *expr; - - expr = new_expression(ctx, type, sizeof(*expr)); - if(!expr) - return NULL; - - expr->subexpr = subexpr; - return &expr->expr; -} - -static expression_t *new_binary_expression(parser_ctx_t *ctx, expression_type_t type, expression_t *left, expression_t *right) -{ - binary_expression_t *expr; - - expr = new_expression(ctx, type, sizeof(*expr)); - if(!expr) - return NULL; - - expr->left = left; - expr->right = right; - return &expr->expr; -} - -static member_expression_t *new_member_expression(parser_ctx_t *ctx, expression_t *obj_expr, const WCHAR *identifier) -{ - member_expression_t *expr; - - expr = new_expression(ctx, EXPR_MEMBER, sizeof(*expr)); - if(!expr) - return NULL; - - expr->obj_expr = obj_expr; - expr->identifier = identifier; - expr->args = NULL; - return expr; -} - -static expression_t *new_new_expression(parser_ctx_t *ctx, const WCHAR *identifier) -{ - string_expression_t *expr; - - expr = new_expression(ctx, EXPR_NEW, sizeof(*expr)); - if(!expr) - return NULL; - - expr->value = identifier; - return &expr->expr; -} - -static void *new_statement(parser_ctx_t *ctx, statement_type_t type, size_t size) -{ - statement_t *stat; - - stat = parser_alloc(ctx, size ? size : sizeof(*stat)); - if(stat) { - stat->type = type; - stat->next = NULL; - } - - return stat; -} - -static statement_t *new_call_statement(parser_ctx_t *ctx, BOOL is_strict, member_expression_t *expr) -{ - call_statement_t *stat; - - stat = new_statement(ctx, STAT_CALL, sizeof(*stat)); - if(!stat) - return NULL; - - stat->expr = expr; - stat->is_strict = is_strict; - return &stat->stat; -} - -static statement_t *new_assign_statement(parser_ctx_t *ctx, member_expression_t *left, expression_t *right) -{ - assign_statement_t *stat; - - stat = new_statement(ctx, STAT_ASSIGN, sizeof(*stat)); - if(!stat) - return NULL; - - stat->member_expr = left; - stat->value_expr = right; - return &stat->stat; -} - -static statement_t *new_set_statement(parser_ctx_t *ctx, member_expression_t *left, expression_t *right) -{ - assign_statement_t *stat; - - stat = new_statement(ctx, STAT_SET, sizeof(*stat)); - if(!stat) - return NULL; - - stat->member_expr = left; - stat->value_expr = right; - return &stat->stat; -} - -static dim_decl_t *new_dim_decl(parser_ctx_t *ctx, const WCHAR *name, BOOL is_array, dim_list_t *dims) -{ - dim_decl_t *decl; - - decl = parser_alloc(ctx, sizeof(*decl)); - if(!decl) - return NULL; - - decl->name = name; - decl->is_array = is_array; - decl->dims = dims; - decl->next = NULL; - return decl; -} - -static dim_list_t *new_dim(parser_ctx_t *ctx, unsigned val, dim_list_t *next) -{ - dim_list_t *ret; - - ret = parser_alloc(ctx, sizeof(*ret)); - if(!ret) - return NULL; - - ret->val = val; - ret->next = next; - return ret; -} - -static statement_t *new_dim_statement(parser_ctx_t *ctx, dim_decl_t *decls) -{ - dim_statement_t *stat; - - stat = new_statement(ctx, STAT_DIM, sizeof(*stat)); - if(!stat) - return NULL; - - stat->dim_decls = decls; - return &stat->stat; -} - -static elseif_decl_t *new_elseif_decl(parser_ctx_t *ctx, expression_t *expr, statement_t *stat) -{ - elseif_decl_t *decl; - - decl = parser_alloc(ctx, sizeof(*decl)); - if(!decl) - return NULL; - - decl->expr = expr; - decl->stat = stat; - decl->next = NULL; - return decl; -} - -static statement_t *new_while_statement(parser_ctx_t *ctx, statement_type_t type, expression_t *expr, statement_t *body) -{ - while_statement_t *stat; - - stat = new_statement(ctx, type, sizeof(*stat)); - if(!stat) - return NULL; - - stat->expr = expr; - stat->body = body; - return &stat->stat; -} - -static statement_t *new_forto_statement(parser_ctx_t *ctx, const WCHAR *identifier, expression_t *from_expr, - expression_t *to_expr, expression_t *step_expr, statement_t *body) -{ - forto_statement_t *stat; - - stat = new_statement(ctx, STAT_FORTO, sizeof(*stat)); - if(!stat) - return NULL; - - stat->identifier = identifier; - stat->from_expr = from_expr; - stat->to_expr = to_expr; - stat->step_expr = step_expr; - stat->body = body; - return &stat->stat; -} - -static statement_t *new_foreach_statement(parser_ctx_t *ctx, const WCHAR *identifier, expression_t *group_expr, - statement_t *body) -{ - foreach_statement_t *stat; - - stat = new_statement(ctx, STAT_FOREACH, sizeof(*stat)); - if(!stat) - return NULL; - - stat->identifier = identifier; - stat->group_expr = group_expr; - stat->body = body; - return &stat->stat; -} - -static statement_t *new_if_statement(parser_ctx_t *ctx, expression_t *expr, statement_t *if_stat, elseif_decl_t *elseif_decl, - statement_t *else_stat) -{ - if_statement_t *stat; - - stat = new_statement(ctx, STAT_IF, sizeof(*stat)); - if(!stat) - return NULL; - - stat->expr = expr; - stat->if_stat = if_stat; - stat->elseifs = elseif_decl; - stat->else_stat = else_stat; - return &stat->stat; -} - -static statement_t *new_select_statement(parser_ctx_t *ctx, expression_t *expr, case_clausule_t *case_clausules) -{ - select_statement_t *stat; - - stat = new_statement(ctx, STAT_SELECT, sizeof(*stat)); - if(!stat) - return NULL; - - stat->expr = expr; - stat->case_clausules = case_clausules; - return &stat->stat; -} - -static case_clausule_t *new_case_clausule(parser_ctx_t *ctx, expression_t *expr, statement_t *stat, case_clausule_t *next) -{ - case_clausule_t *ret; - - ret = parser_alloc(ctx, sizeof(*ret)); - if(!ret) - return NULL; - - ret->expr = expr; - ret->stat = stat; - ret->next = next; - return ret; -} - -static statement_t *new_onerror_statement(parser_ctx_t *ctx, BOOL resume_next) -{ - onerror_statement_t *stat; - - stat = new_statement(ctx, STAT_ONERROR, sizeof(*stat)); - if(!stat) - return NULL; - - stat->resume_next = resume_next; - return &stat->stat; -} - -static arg_decl_t *new_argument_decl(parser_ctx_t *ctx, const WCHAR *name, BOOL by_ref) -{ - arg_decl_t *arg_decl; - - arg_decl = parser_alloc(ctx, sizeof(*arg_decl)); - if(!arg_decl) - return NULL; - - arg_decl->name = name; - arg_decl->by_ref = by_ref; - arg_decl->next = NULL; - return arg_decl; -} - -static function_decl_t *new_function_decl(parser_ctx_t *ctx, const WCHAR *name, function_type_t type, - unsigned storage_flags, arg_decl_t *arg_decl, statement_t *body) -{ - function_decl_t *decl; - - if(storage_flags & STORAGE_IS_DEFAULT) { - if(type == FUNC_PROPGET) { - type = FUNC_DEFGET; - }else { - FIXME("Invalid default property\n"); - ctx->hres = E_FAIL; - return NULL; - } - } - - decl = parser_alloc(ctx, sizeof(*decl)); - if(!decl) - return NULL; - - decl->name = name; - decl->type = type; - decl->is_public = !(storage_flags & STORAGE_IS_PRIVATE); - decl->args = arg_decl; - decl->body = body; - decl->next = NULL; - decl->next_prop_func = NULL; - return decl; -} - -static statement_t *new_function_statement(parser_ctx_t *ctx, function_decl_t *decl) -{ - function_statement_t *stat; - - stat = new_statement(ctx, STAT_FUNC, sizeof(*stat)); - if(!stat) - return NULL; - - stat->func_decl = decl; - return &stat->stat; -} - -static class_decl_t *new_class_decl(parser_ctx_t *ctx) -{ - class_decl_t *class_decl; - - class_decl = parser_alloc(ctx, sizeof(*class_decl)); - if(!class_decl) - return NULL; - - class_decl->funcs = NULL; - class_decl->props = NULL; - class_decl->next = NULL; - return class_decl; -} - -static class_decl_t *add_class_function(parser_ctx_t *ctx, class_decl_t *class_decl, function_decl_t *decl) -{ - function_decl_t *iter; - - for(iter = class_decl->funcs; iter; iter = iter->next) { - if(!wcsicmp(iter->name, decl->name)) { - if(decl->type == FUNC_SUB || decl->type == FUNC_FUNCTION) { - FIXME("Redefinition of %s::%s\n", debugstr_w(class_decl->name), debugstr_w(decl->name)); - ctx->hres = E_FAIL; - return NULL; - } - - while(1) { - if(iter->type == decl->type) { - FIXME("Redefinition of %s::%s\n", debugstr_w(class_decl->name), debugstr_w(decl->name)); - ctx->hres = E_FAIL; - return NULL; - } - if(!iter->next_prop_func) - break; - iter = iter->next_prop_func; - } - - iter->next_prop_func = decl; - return class_decl; - } - } - - decl->next = class_decl->funcs; - class_decl->funcs = decl; - return class_decl; -} - -static class_decl_t *add_dim_prop(parser_ctx_t *ctx, class_decl_t *class_decl, dim_decl_t *dim_decl, unsigned storage_flags) -{ - if(storage_flags & STORAGE_IS_DEFAULT) { - FIXME("variant prop van't be default value\n"); - ctx->hres = E_FAIL; - return NULL; - } - - dim_decl->is_public = !(storage_flags & STORAGE_IS_PRIVATE); - dim_decl->next = class_decl->props; - class_decl->props = dim_decl; - return class_decl; -} - -static const_decl_t *new_const_decl(parser_ctx_t *ctx, const WCHAR *name, expression_t *expr) -{ - const_decl_t *decl; - - decl = parser_alloc(ctx, sizeof(*decl)); - if(!decl) - return NULL; - - decl->name = name; - decl->value_expr = expr; - decl->next = NULL; - return decl; -} - -static statement_t *new_const_statement(parser_ctx_t *ctx, const_decl_t *decls) -{ - const_statement_t *stat; - - stat = new_statement(ctx, STAT_CONST, sizeof(*stat)); - if(!stat) - return NULL; - - stat->decls = decls; - return &stat->stat; -} - -static statement_t *link_statements(statement_t *head, statement_t *tail) -{ - statement_t *iter; - - for(iter = head; iter->next; iter = iter->next); - iter->next = tail; - - return head; -} - -void *parser_alloc(parser_ctx_t *ctx, size_t size) -{ - void *ret; - - ret = heap_pool_alloc(&ctx->heap, size); - if(!ret) - ctx->hres = E_OUTOFMEMORY; - return ret; -} - -HRESULT parse_script(parser_ctx_t *ctx, const WCHAR *code, const WCHAR *delimiter, DWORD flags) -{ - static const WCHAR html_delimiterW[] = {'<','/','s','c','r','i','p','t','>',0}; - - ctx->code = ctx->ptr = code; - ctx->end = ctx->code + lstrlenW(ctx->code); - - heap_pool_init(&ctx->heap); - - ctx->parse_complete = FALSE; - ctx->hres = S_OK; - - ctx->last_token = tNL; - ctx->last_nl = 0; - ctx->stats = ctx->stats_tail = NULL; - ctx->class_decls = NULL; - ctx->option_explicit = FALSE; - ctx->is_html = delimiter && !wcsicmp(delimiter, html_delimiterW); - - if(flags & SCRIPTTEXT_ISEXPRESSION) - ctx->last_token = tEXPRESSION; - - parser_parse(ctx); - - if(FAILED(ctx->hres)) - return ctx->hres; - if(!ctx->parse_complete) { - FIXME("parser failed around %s\n", debugstr_w(ctx->code+20 > ctx->ptr ? ctx->code : ctx->ptr-20)); - return E_FAIL; - } - - return S_OK; -} - -void parser_release(parser_ctx_t *ctx) -{ - heap_pool_free(&ctx->heap); -} diff --git a/dll/win32/vbscript/parser.tab.h b/dll/win32/vbscript/parser.tab.h deleted file mode 100644 index 615800d019a..00000000000 --- a/dll/win32/vbscript/parser.tab.h +++ /dev/null @@ -1,158 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED -# define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tEXPRESSION = 258, - tEOF = 259, - tNL = 260, - tEMPTYBRACKETS = 261, - tLTEQ = 262, - tGTEQ = 263, - tNEQ = 264, - tSTOP = 265, - tME = 266, - tREM = 267, - tTRUE = 268, - tFALSE = 269, - tNOT = 270, - tAND = 271, - tOR = 272, - tXOR = 273, - tEQV = 274, - tIMP = 275, - tIS = 276, - tMOD = 277, - tCALL = 278, - tDIM = 279, - tSUB = 280, - tFUNCTION = 281, - tGET = 282, - tLET = 283, - tCONST = 284, - tIF = 285, - tELSE = 286, - tELSEIF = 287, - tEND = 288, - tTHEN = 289, - tEXIT = 290, - tWHILE = 291, - tWEND = 292, - tDO = 293, - tLOOP = 294, - tUNTIL = 295, - tFOR = 296, - tTO = 297, - tEACH = 298, - tIN = 299, - tSELECT = 300, - tCASE = 301, - tBYREF = 302, - tBYVAL = 303, - tOPTION = 304, - tNOTHING = 305, - tEMPTY = 306, - tNULL = 307, - tCLASS = 308, - tSET = 309, - tNEW = 310, - tPUBLIC = 311, - tPRIVATE = 312, - tNEXT = 313, - tON = 314, - tRESUME = 315, - tGOTO = 316, - tIdentifier = 317, - tString = 318, - tDEFAULT = 319, - tERROR = 320, - tEXPLICIT = 321, - tPROPERTY = 322, - tSTEP = 323, - tInt = 324, - tDouble = 325 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 87 "parser.y" - - const WCHAR *string; - statement_t *statement; - expression_t *expression; - member_expression_t *member; - elseif_decl_t *elseif; - dim_decl_t *dim_decl; - dim_list_t *dim_list; - function_decl_t *func_decl; - arg_decl_t *arg_decl; - class_decl_t *class_decl; - const_decl_t *const_decl; - case_clausule_t *case_clausule; - unsigned uint; - LONG integer; - BOOL boolean; - double dbl; - -#line 147 "parser.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int parser_parse (parser_ctx_t *ctx); - -#endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_VBSCRIPT_PARSER_TAB_H_INCLUDED */ diff --git a/dll/win32/wbemprox/CMakeLists.txt b/dll/win32/wbemprox/CMakeLists.txt index de69823069f..aff723c5bf2 100644 --- a/dll/win32/wbemprox/CMakeLists.txt +++ b/dll/win32/wbemprox/CMakeLists.txt @@ -20,12 +20,11 @@ list(APPEND SOURCE table.c wbemlocator.c) +BISON_TARGET(wql wql.y ${CMAKE_CURRENT_BINARY_DIR}/wql.tab.c COMPILE_FLAGS "-p wql_") + list(APPEND PCH_SKIP_SOURCE guid.c - wql.tab.c) - -# wql.tab.c has been generated with relative file paths... -set_source_files_properties(wql.tab.c PROPERTIES COMPILE_FLAGS "-UREACTOS_SOURCE_DIR -DREACTOS_SOURCE_DIR=\"\\\".\\\"\"") + ${BISON_wql_OUTPUTS}) add_library(wbemprox MODULE ${SOURCE} diff --git a/dll/win32/wbemprox/wql.tab.c b/dll/win32/wbemprox/wql.tab.c deleted file mode 100644 index 62249558393..00000000000 --- a/dll/win32/wbemprox/wql.tab.c +++ /dev/null @@ -1,2476 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse wql_parse -#define yylex wql_lex -#define yyerror wql_error -#define yydebug wql_debug -#define yynerrs wql_nerrs - - -/* First part of user prologue. */ -#line 1 "wql.y" - - -/* - * Copyright 2012 Hans Leidekker for CodeWeavers - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include - -#include "windef.h" -#include "winbase.h" -#include "wbemcli.h" -#include "wbemprox_private.h" - -#include "wine/list.h" -#include "wine/debug.h" - -WINE_DEFAULT_DEBUG_CHANNEL(wbemprox); - -struct parser -{ - const WCHAR *cmd; - UINT idx; - UINT len; - HRESULT error; - struct view **view; - struct list *mem; -}; - -struct string -{ - const WCHAR *data; - int len; -}; - -static void *alloc_mem( struct parser *parser, UINT size ) -{ - struct list *mem = heap_alloc( sizeof(struct list) + size ); - list_add_tail( parser->mem, mem ); - return &mem[1]; -} - -static struct property *alloc_property( struct parser *parser, const WCHAR *class, const WCHAR *name ) -{ - struct property *prop = alloc_mem( parser, sizeof(*prop) ); - if (prop) - { - prop->name = name; - prop->class = class; - prop->next = NULL; - } - return prop; -} - -static struct keyword *alloc_keyword( struct parser *parser, const WCHAR *name, const WCHAR *value ) -{ - struct keyword *keyword = alloc_mem( parser, sizeof(*keyword) ); - if (keyword) - { - keyword->name = name; - keyword->value = value; - keyword->next = NULL; - } - return keyword; -} - -static WCHAR *get_string( struct parser *parser, const struct string *str ) -{ - const WCHAR *p = str->data; - int len = str->len; - WCHAR *ret; - - if ((p[0] == '\"' && p[len - 1] != '\"') || - (p[0] == '\'' && p[len - 1] != '\'')) return NULL; - if ((p[0] == '\"' && p[len - 1] == '\"') || - (p[0] == '\'' && p[len - 1] == '\'')) - { - p++; - len -= 2; - } - if (!(ret = alloc_mem( parser, (len + 1) * sizeof(WCHAR) ))) return NULL; - memcpy( ret, p, len * sizeof(WCHAR) ); - ret[len] = 0; - return ret; -} - -static WCHAR *get_path( struct parser *parser, const struct string *str ) -{ - const WCHAR *p = str->data; - int len = str->len; - WCHAR *ret; - - if (p[0] == '{' && p[len - 1] == '}') - { - p++; - len -= 2; - } - - if (!(ret = alloc_mem( parser, (len + 1) * sizeof(WCHAR) ))) return NULL; - memcpy( ret, p, len * sizeof(WCHAR) ); - ret[len] = 0; - return ret; -} - -static int get_int( struct parser *parser ) -{ - const WCHAR *p = &parser->cmd[parser->idx]; - int i, ret = 0; - - for (i = 0; i < parser->len; i++) - { - if (p[i] < '0' || p[i] > '9') - { - ERR("should only be numbers here!\n"); - break; - } - ret = (p[i] - '0') + ret * 10; - } - return ret; -} - -static struct expr *expr_complex( struct parser *parser, struct expr *l, UINT op, struct expr *r ) -{ - struct expr *e = alloc_mem( parser, sizeof(*e) ); - if (e) - { - e->type = EXPR_COMPLEX; - e->u.expr.left = l; - e->u.expr.op = op; - e->u.expr.right = r; - } - return e; -} - -static struct expr *expr_unary( struct parser *parser, struct expr *l, UINT op ) -{ - struct expr *e = alloc_mem( parser, sizeof(*e) ); - if (e) - { - e->type = EXPR_UNARY; - e->u.expr.left = l; - e->u.expr.op = op; - e->u.expr.right = NULL; - } - return e; -} - -static struct expr *expr_ival( struct parser *parser, int val ) -{ - struct expr *e = alloc_mem( parser, sizeof *e ); - if (e) - { - e->type = EXPR_IVAL; - e->u.ival = val; - } - return e; -} - -static struct expr *expr_sval( struct parser *parser, const struct string *str ) -{ - struct expr *e = alloc_mem( parser, sizeof *e ); - if (e) - { - e->type = EXPR_SVAL; - e->u.sval = get_string( parser, str ); - if (!e->u.sval) - return NULL; /* e will be freed by query destructor */ - } - return e; -} - -static struct expr *expr_bval( struct parser *parser, int val ) -{ - struct expr *e = alloc_mem( parser, sizeof *e ); - if (e) - { - e->type = EXPR_BVAL; - e->u.ival = val; - } - return e; -} - -static struct expr *expr_propval( struct parser *parser, const struct property *prop ) -{ - struct expr *e = alloc_mem( parser, sizeof *e ); - if (e) - { - e->type = EXPR_PROPVAL; - e->u.propval = prop; - } - return e; -} - -static int wql_error( struct parser *parser, const char *str ); -static int wql_lex( void *val, struct parser *parser ); - -#define PARSER_BUBBLE_UP_VIEW( parser, result, current_view ) \ - *parser->view = current_view; \ - result = current_view - - -#line 291 "wql.tab.c" - -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED -# define YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int wql_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - TK_SELECT = 258, - TK_FROM = 259, - TK_STAR = 260, - TK_COMMA = 261, - TK_DOT = 262, - TK_IS = 263, - TK_LP = 264, - TK_RP = 265, - TK_NULL = 266, - TK_FALSE = 267, - TK_TRUE = 268, - TK_INTEGER = 269, - TK_WHERE = 270, - TK_SPACE = 271, - TK_MINUS = 272, - TK_ILLEGAL = 273, - TK_BY = 274, - TK_ASSOCIATORS = 275, - TK_OF = 276, - TK_STRING = 277, - TK_ID = 278, - TK_PATH = 279, - TK_OR = 280, - TK_AND = 281, - TK_NOT = 282, - TK_EQ = 283, - TK_NE = 284, - TK_LT = 285, - TK_GT = 286, - TK_LE = 287, - TK_GE = 288, - TK_LIKE = 289 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 222 "wql.y" - - struct string str; - WCHAR *string; - struct property *proplist; - struct keyword *keywordlist; - struct view *view; - struct expr *expr; - int integer; - -#line 379 "wql.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int wql_parse (struct parser *ctx); - -#endif /* !YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 13 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 91 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 35 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 15 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 49 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 87 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 289 - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 248, 248, 250, 254, 263, 269, 278, 279, 286, - 298, 313, 325, 337, 352, 353, 357, 364, 370, 379, - 388, 395, 401, 407, 413, 419, 425, 431, 437, 443, - 449, 455, 461, 467, 473, 479, 485, 491, 497, 503, - 509, 515, 521, 527, 536, 545, 554, 560, 566, 572 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "TK_SELECT", "TK_FROM", "TK_STAR", - "TK_COMMA", "TK_DOT", "TK_IS", "TK_LP", "TK_RP", "TK_NULL", "TK_FALSE", - "TK_TRUE", "TK_INTEGER", "TK_WHERE", "TK_SPACE", "TK_MINUS", - "TK_ILLEGAL", "TK_BY", "TK_ASSOCIATORS", "TK_OF", "TK_STRING", "TK_ID", - "TK_PATH", "TK_OR", "TK_AND", "TK_NOT", "TK_EQ", "TK_NE", "TK_LT", - "TK_GT", "TK_LE", "TK_GE", "TK_LIKE", "$accept", "query", "path", - "keyword", "keywordlist", "associatorsof", "select", "proplist", "prop", - "id", "number", "expr", "string_val", "prop_val", "const_val", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289 -}; -# endif - -#define YYPACT_NINF -25 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-25))) - -#define YYTABLE_NINF -1 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int8 yypact[] = -{ - 0, 8, -13, 15, -25, -25, 10, -25, -25, 38, - 37, 42, 26, -25, -25, 10, 9, 10, -25, 57, - 58, -25, -25, 10, 25, 10, -25, 23, 25, -24, - -25, -25, -25, -25, 25, -25, -25, -19, -7, 51, - -25, 10, 20, 10, 10, -25, 25, 25, -9, 49, - 53, 56, 56, 56, 56, 52, 10, 10, 10, 10, - 10, 10, -25, -25, -25, -25, -25, -25, -25, 65, - -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, - -25, -25, -25, -25, -25, -25, -25 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 0, 0, 0, 3, 2, 0, 16, 19, 0, - 14, 18, 0, 1, 11, 0, 0, 0, 4, 9, - 12, 15, 17, 0, 0, 7, 10, 5, 0, 0, - 49, 48, 20, 47, 0, 45, 46, 13, 0, 0, - 8, 0, 0, 0, 0, 24, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 6, 21, 41, 43, 23, 22, 38, 0, - 40, 25, 42, 30, 27, 26, 28, 29, 44, 37, - 31, 36, 33, 32, 34, 35, 39 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int8 yypgoto[] = -{ - -25, -25, -25, -25, 66, -25, -25, 61, 43, -6, - -25, -18, -25, -3, 36 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int8 yydefgoto[] = -{ - -1, 3, 19, 25, 26, 4, 5, 9, 35, 11, - 36, 37, 79, 38, 39 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 14, 48, 68, 1, 43, 44, 46, 47, 12, 20, - 42, 22, 6, 7, 7, 13, 45, 27, 69, 27, - 2, 49, 50, 51, 52, 53, 54, 55, 66, 67, - 63, 8, 8, 8, 28, 62, 29, 30, 31, 32, - 64, 65, 15, 16, 10, 46, 47, 33, 8, 17, - 18, 41, 34, 80, 81, 82, 83, 84, 85, 10, - 70, 30, 31, 32, 72, 30, 31, 32, 30, 31, - 32, 33, 23, 24, 78, 33, 86, 21, 33, 56, - 57, 58, 59, 60, 61, 71, 73, 74, 75, 76, - 77, 40 -}; - -static const yytype_uint8 yycheck[] = -{ - 6, 8, 11, 3, 28, 29, 25, 26, 21, 15, - 28, 17, 4, 5, 5, 0, 34, 23, 27, 25, - 20, 28, 29, 30, 31, 32, 33, 34, 46, 47, - 10, 23, 23, 23, 9, 41, 11, 12, 13, 14, - 43, 44, 4, 6, 1, 25, 26, 22, 23, 7, - 24, 28, 27, 56, 57, 58, 59, 60, 61, 16, - 11, 12, 13, 14, 11, 12, 13, 14, 12, 13, - 14, 22, 15, 15, 22, 22, 11, 16, 22, 28, - 29, 30, 31, 32, 33, 49, 50, 51, 52, 53, - 54, 25 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 20, 36, 40, 41, 4, 5, 23, 42, - 43, 44, 21, 0, 44, 4, 6, 7, 24, 37, - 44, 42, 44, 15, 15, 38, 39, 44, 9, 11, - 12, 13, 14, 22, 27, 43, 45, 46, 48, 49, - 39, 28, 46, 28, 29, 46, 25, 26, 8, 28, - 29, 30, 31, 32, 33, 34, 28, 29, 30, 31, - 32, 33, 44, 10, 48, 48, 46, 46, 11, 27, - 11, 49, 11, 49, 49, 49, 49, 49, 22, 47, - 48, 48, 48, 48, 48, 48, 11 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 35, 36, 36, 37, 38, 38, 39, 39, 40, - 40, 41, 41, 41, 42, 42, 42, 43, 43, 44, - 45, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 47, 48, 49, 49, 49, 49 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 3, 1, 2, 3, - 5, 3, 4, 6, 1, 3, 1, 3, 1, 1, - 1, 3, 3, 3, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, - 3, 3, 3, 3, 1, 1, 1, 1, 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (ctx, YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value, ctx); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct parser *ctx) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - YYUSE (ctx); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, struct parser *ctx) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep, ctx); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, struct parser *ctx) -{ - unsigned long yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - , ctx); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule, ctx); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, struct parser *ctx) -{ - YYUSE (yyvaluep); - YYUSE (ctx); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (struct parser *ctx) -{ -/* The lookahead symbol. */ -int yychar; - - -/* The semantic value of the lookahead symbol. */ -/* Default value used for initialization, for pacifying older GCCs - or non-GCC compilers. */ -YY_INITIAL_VALUE (static YYSTYPE yyval_default;) -YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); - - /* Number of syntax errors so far. */ - int yynerrs; - - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yynewstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - *yyssp = (yytype_int16) yystate; - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (&yylval, ctx); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 4: -#line 255 "wql.y" - { - (yyval.string) = get_path( ctx, &(yyvsp[0].str) ); - if (!(yyval.string)) - YYABORT; - } -#line 1537 "wql.tab.c" - break; - - case 5: -#line 264 "wql.y" - { - (yyval.keywordlist) = alloc_keyword( ctx, (yyvsp[0].string), NULL ); - if (!(yyval.keywordlist)) - YYABORT; - } -#line 1547 "wql.tab.c" - break; - - case 6: -#line 270 "wql.y" - { - (yyval.keywordlist) = alloc_keyword( ctx, (yyvsp[-2].string), (yyvsp[0].string) ); - if (!(yyval.keywordlist)) - YYABORT; - } -#line 1557 "wql.tab.c" - break; - - case 8: -#line 280 "wql.y" - { - (yyvsp[-1].keywordlist)->next = (yyvsp[0].keywordlist); - } -#line 1565 "wql.tab.c" - break; - - case 9: -#line 287 "wql.y" - { - HRESULT hr; - struct parser *parser = ctx; - struct view *view; - - hr = create_view( VIEW_TYPE_ASSOCIATORS, (yyvsp[0].string), NULL, NULL, NULL, NULL, &view ); - if (hr != S_OK) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view ); - } -#line 1581 "wql.tab.c" - break; - - case 10: -#line 299 "wql.y" - { - HRESULT hr; - struct parser *parser = ctx; - struct view *view; - - hr = create_view( VIEW_TYPE_ASSOCIATORS, (yyvsp[-2].string), (yyvsp[0].keywordlist), NULL, NULL, NULL, &view ); - if (hr != S_OK) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view ); - } -#line 1597 "wql.tab.c" - break; - - case 11: -#line 314 "wql.y" - { - HRESULT hr; - struct parser *parser = ctx; - struct view *view; - - hr = create_view( VIEW_TYPE_SELECT, NULL, NULL, (yyvsp[0].string), NULL, NULL, &view ); - if (hr != S_OK) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view ); - } -#line 1613 "wql.tab.c" - break; - - case 12: -#line 326 "wql.y" - { - HRESULT hr; - struct parser *parser = ctx; - struct view *view; - - hr = create_view( VIEW_TYPE_SELECT, NULL, NULL, (yyvsp[0].string), (yyvsp[-2].proplist), NULL, &view ); - if (hr != S_OK) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view ); - } -#line 1629 "wql.tab.c" - break; - - case 13: -#line 338 "wql.y" - { - HRESULT hr; - struct parser *parser = ctx; - struct view *view; - - hr = create_view( VIEW_TYPE_SELECT, NULL, NULL, (yyvsp[-2].string), (yyvsp[-4].proplist), (yyvsp[0].expr), &view ); - if (hr != S_OK) - YYABORT; - - PARSER_BUBBLE_UP_VIEW( parser, (yyval.view), view ); - } -#line 1645 "wql.tab.c" - break; - - case 15: -#line 354 "wql.y" - { - (yyvsp[-2].proplist)->next = (yyvsp[0].proplist); - } -#line 1653 "wql.tab.c" - break; - - case 16: -#line 358 "wql.y" - { - (yyval.proplist) = NULL; - } -#line 1661 "wql.tab.c" - break; - - case 17: -#line 365 "wql.y" - { - (yyval.proplist) = alloc_property( ctx, (yyvsp[-2].string), (yyvsp[0].string) ); - if (!(yyval.proplist)) - YYABORT; - } -#line 1671 "wql.tab.c" - break; - - case 18: -#line 371 "wql.y" - { - (yyval.proplist) = alloc_property( ctx, NULL, (yyvsp[0].string) ); - if (!(yyval.proplist)) - YYABORT; - } -#line 1681 "wql.tab.c" - break; - - case 19: -#line 380 "wql.y" - { - (yyval.string) = get_string( ctx, &(yyvsp[0].str) ); - if (!(yyval.string)) - YYABORT; - } -#line 1691 "wql.tab.c" - break; - - case 20: -#line 389 "wql.y" - { - (yyval.integer) = get_int( ctx ); - } -#line 1699 "wql.tab.c" - break; - - case 21: -#line 396 "wql.y" - { - (yyval.expr) = (yyvsp[-1].expr); - if (!(yyval.expr)) - YYABORT; - } -#line 1709 "wql.tab.c" - break; - - case 22: -#line 402 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_AND, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1719 "wql.tab.c" - break; - - case 23: -#line 408 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_OR, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1729 "wql.tab.c" - break; - - case 24: -#line 414 "wql.y" - { - (yyval.expr) = expr_unary( ctx, (yyvsp[0].expr), OP_NOT ); - if (!(yyval.expr)) - YYABORT; - } -#line 1739 "wql.tab.c" - break; - - case 25: -#line 420 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1749 "wql.tab.c" - break; - - case 26: -#line 426 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1759 "wql.tab.c" - break; - - case 27: -#line 432 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1769 "wql.tab.c" - break; - - case 28: -#line 438 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1779 "wql.tab.c" - break; - - case 29: -#line 444 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1789 "wql.tab.c" - break; - - case 30: -#line 450 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1799 "wql.tab.c" - break; - - case 31: -#line 456 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_EQ, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1809 "wql.tab.c" - break; - - case 32: -#line 462 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GT, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1819 "wql.tab.c" - break; - - case 33: -#line 468 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LT, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1829 "wql.tab.c" - break; - - case 34: -#line 474 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LE, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1839 "wql.tab.c" - break; - - case 35: -#line 480 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_GE, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1849 "wql.tab.c" - break; - - case 36: -#line 486 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_NE, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1859 "wql.tab.c" - break; - - case 37: -#line 492 "wql.y" - { - (yyval.expr) = expr_complex( ctx, (yyvsp[-2].expr), OP_LIKE, (yyvsp[0].expr) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1869 "wql.tab.c" - break; - - case 38: -#line 498 "wql.y" - { - (yyval.expr) = expr_unary( ctx, (yyvsp[-2].expr), OP_ISNULL ); - if (!(yyval.expr)) - YYABORT; - } -#line 1879 "wql.tab.c" - break; - - case 39: -#line 504 "wql.y" - { - (yyval.expr) = expr_unary( ctx, (yyvsp[-3].expr), OP_NOTNULL ); - if (!(yyval.expr)) - YYABORT; - } -#line 1889 "wql.tab.c" - break; - - case 40: -#line 510 "wql.y" - { - (yyval.expr) = expr_unary( ctx, (yyvsp[-2].expr), OP_ISNULL ); - if (!(yyval.expr)) - YYABORT; - } -#line 1899 "wql.tab.c" - break; - - case 41: -#line 516 "wql.y" - { - (yyval.expr) = expr_unary( ctx, (yyvsp[0].expr), OP_ISNULL ); - if (!(yyval.expr)) - YYABORT; - } -#line 1909 "wql.tab.c" - break; - - case 42: -#line 522 "wql.y" - { - (yyval.expr) = expr_unary( ctx, (yyvsp[-2].expr), OP_NOTNULL ); - if (!(yyval.expr)) - YYABORT; - } -#line 1919 "wql.tab.c" - break; - - case 43: -#line 528 "wql.y" - { - (yyval.expr) = expr_unary( ctx, (yyvsp[0].expr), OP_NOTNULL ); - if (!(yyval.expr)) - YYABORT; - } -#line 1929 "wql.tab.c" - break; - - case 44: -#line 537 "wql.y" - { - (yyval.expr) = expr_sval( ctx, &(yyvsp[0].str) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1939 "wql.tab.c" - break; - - case 45: -#line 546 "wql.y" - { - (yyval.expr) = expr_propval( ctx, (yyvsp[0].proplist) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1949 "wql.tab.c" - break; - - case 46: -#line 555 "wql.y" - { - (yyval.expr) = expr_ival( ctx, (yyvsp[0].integer) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1959 "wql.tab.c" - break; - - case 47: -#line 561 "wql.y" - { - (yyval.expr) = expr_sval( ctx, &(yyvsp[0].str) ); - if (!(yyval.expr)) - YYABORT; - } -#line 1969 "wql.tab.c" - break; - - case 48: -#line 567 "wql.y" - { - (yyval.expr) = expr_bval( ctx, -1 ); - if (!(yyval.expr)) - YYABORT; - } -#line 1979 "wql.tab.c" - break; - - case 49: -#line 573 "wql.y" - { - (yyval.expr) = expr_bval( ctx, 0 ); - if (!(yyval.expr)) - YYABORT; - } -#line 1989 "wql.tab.c" - break; - - -#line 1993 "wql.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (ctx, YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (ctx, yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval, ctx); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp, ctx); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (ctx, YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval, ctx); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp, ctx); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 580 "wql.y" - - -HRESULT parse_query( const WCHAR *str, struct view **view, struct list *mem ) -{ - struct parser parser; - int ret; - - *view = NULL; - - parser.cmd = str; - parser.idx = 0; - parser.len = 0; - parser.error = WBEM_E_INVALID_QUERY; - parser.view = view; - parser.mem = mem; - - ret = wql_parse( &parser ); - TRACE("wql_parse returned %d\n", ret); - if (ret) - { - if (*parser.view) - { - destroy_view( *parser.view ); - *parser.view = NULL; - } - return parser.error; - } - return S_OK; -} - -static const char id_char[] = -{ - 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -}; - -struct wql_keyword -{ - const WCHAR *name; - unsigned int len; - int type; -}; - -#define MIN_TOKEN_LEN 2 -#define MAX_TOKEN_LEN 11 - -static const WCHAR andW[] = {'A','N','D'}; -static const WCHAR associatorsW[] = {'A','S','S','O','C','I','A','T','O','R','S'}; -static const WCHAR byW[] = {'B','Y'}; -static const WCHAR falseW[] = {'F','A','L','S','E'}; -static const WCHAR fromW[] = {'F','R','O','M'}; -static const WCHAR isW[] = {'I','S'}; -static const WCHAR likeW[] = {'L','I','K','E'}; -static const WCHAR notW[] = {'N','O','T'}; -static const WCHAR nullW[] = {'N','U','L','L'}; -static const WCHAR ofW[] = {'O','F'}; -static const WCHAR orW[] = {'O','R'}; -static const WCHAR selectW[] = {'S','E','L','E','C','T'}; -static const WCHAR trueW[] = {'T','R','U','E'}; -static const WCHAR whereW[] = {'W','H','E','R','E'}; - -static const struct wql_keyword keyword_table[] = -{ - { andW, ARRAY_SIZE(andW), TK_AND }, - { associatorsW, ARRAY_SIZE(associatorsW), TK_ASSOCIATORS }, - { byW, ARRAY_SIZE(byW), TK_BY }, - { falseW, ARRAY_SIZE(falseW), TK_FALSE }, - { fromW, ARRAY_SIZE(fromW), TK_FROM }, - { isW, ARRAY_SIZE(isW), TK_IS }, - { likeW, ARRAY_SIZE(likeW), TK_LIKE }, - { notW, ARRAY_SIZE(notW), TK_NOT }, - { nullW, ARRAY_SIZE(nullW), TK_NULL }, - { ofW, ARRAY_SIZE(ofW), TK_OF }, - { orW, ARRAY_SIZE(orW), TK_OR }, - { selectW, ARRAY_SIZE(selectW), TK_SELECT }, - { trueW, ARRAY_SIZE(trueW), TK_TRUE }, - { whereW, ARRAY_SIZE(whereW), TK_WHERE } -}; - -static int __cdecl cmp_keyword( const void *arg1, const void *arg2 ) -{ - const struct wql_keyword *key1 = arg1, *key2 = arg2; - int len = min( key1->len, key2->len ); - int ret; - - if ((ret = _wcsnicmp( key1->name, key2->name, len ))) return ret; - if (key1->len < key2->len) return -1; - else if (key1->len > key2->len) return 1; - return 0; -} - -static int keyword_type( const WCHAR *str, unsigned int len ) -{ - struct wql_keyword key, *ret; - - if (len < MIN_TOKEN_LEN || len > MAX_TOKEN_LEN) return TK_ID; - - key.name = str; - key.len = len; - key.type = 0; - ret = bsearch( &key, keyword_table, ARRAY_SIZE(keyword_table), sizeof(struct wql_keyword), cmp_keyword ); - if (ret) return ret->type; - return TK_ID; -} - -static int get_token( const WCHAR *s, int *token ) -{ - int i; - - switch (*s) - { - case ' ': - case '\t': - case '\r': - case '\n': - for (i = 1; iswspace( s[i] ); i++) {} - *token = TK_SPACE; - return i; - case '-': - if (!s[1]) return -1; - *token = TK_MINUS; - return 1; - case '(': - *token = TK_LP; - return 1; - case ')': - *token = TK_RP; - return 1; - case '{': - for (i = 1; s[i] && s[i] != '}'; i++) {} - if (s[i] != '}') - { - *token = TK_ILLEGAL; - return i; - } - *token = TK_PATH; - return i + 1; - case '*': - *token = TK_STAR; - return 1; - case '=': - *token = TK_EQ; - return 1; - case '<': - if (s[1] == '=' ) - { - *token = TK_LE; - return 2; - } - else if (s[1] == '>') - { - *token = TK_NE; - return 2; - } - else - { - *token = TK_LT; - return 1; - } - case '>': - if (s[1] == '=') - { - *token = TK_GE; - return 2; - } - else - { - *token = TK_GT; - return 1; - } - case '!': - if (s[1] != '=') - { - *token = TK_ILLEGAL; - return 2; - } - else - { - *token = TK_NE; - return 2; - } - case ',': - *token = TK_COMMA; - return 1; - case '\"': - case '\'': - for (i = 1; s[i]; i++) - { - if (s[i] == s[0]) break; - } - if (s[i]) i++; - *token = TK_STRING; - return i; - case '.': - if (!iswdigit( s[1] )) - { - *token = TK_DOT; - return 1; - } - /* fall through */ - case '0': case '1': case '2': case '3': case '4': - case '5': case '6': case '7': case '8': case '9': - *token = TK_INTEGER; - for (i = 1; iswdigit( s[i] ); i++) {} - return i; - default: - if (!id_char[*s]) break; - - for (i = 1; id_char[s[i]]; i++) {} - *token = keyword_type( s, i ); - return i; - } - *token = TK_ILLEGAL; - return 1; -} - -static int wql_lex( void *p, struct parser *parser ) -{ - struct string *str = p; - int token = -1; - do - { - parser->idx += parser->len; - if (!parser->cmd[parser->idx]) return 0; - parser->len = get_token( &parser->cmd[parser->idx], &token ); - if (!parser->len) break; - - str->data = &parser->cmd[parser->idx]; - str->len = parser->len; - } while (token == TK_SPACE); - return token; -} - -static int wql_error( struct parser *parser, const char *str ) -{ - ERR("%s\n", str); - return 0; -} diff --git a/dll/win32/wbemprox/wql.tab.h b/dll/win32/wbemprox/wql.tab.h deleted file mode 100644 index 06309653d46..00000000000 --- a/dll/win32/wbemprox/wql.tab.h +++ /dev/null @@ -1,113 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.4.1. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED -# define YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int wql_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - TK_SELECT = 258, - TK_FROM = 259, - TK_STAR = 260, - TK_COMMA = 261, - TK_DOT = 262, - TK_IS = 263, - TK_LP = 264, - TK_RP = 265, - TK_NULL = 266, - TK_FALSE = 267, - TK_TRUE = 268, - TK_INTEGER = 269, - TK_WHERE = 270, - TK_SPACE = 271, - TK_MINUS = 272, - TK_ILLEGAL = 273, - TK_BY = 274, - TK_ASSOCIATORS = 275, - TK_OF = 276, - TK_STRING = 277, - TK_ID = 278, - TK_PATH = 279, - TK_OR = 280, - TK_AND = 281, - TK_NOT = 282, - TK_EQ = 283, - TK_NE = 284, - TK_LT = 285, - TK_GT = 286, - TK_LE = 287, - TK_GE = 288, - TK_LIKE = 289 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 222 "wql.y" - - struct string str; - WCHAR *string; - struct property *proplist; - struct keyword *keywordlist; - struct view *view; - struct expr *expr; - int integer; - -#line 102 "wql.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - - -int wql_parse (struct parser *ctx); - -#endif /* !YY_WQL_E_REACTOSSYNC_GCC_DLL_WIN32_WBEMPROX_WQL_TAB_H_INCLUDED */ diff --git a/sdk/cmake/bison-flex.cmake b/sdk/cmake/bison-flex.cmake deleted file mode 100644 index d03d4a8b3fd..00000000000 --- a/sdk/cmake/bison-flex.cmake +++ /dev/null @@ -1,27 +0,0 @@ - -# Simply use : -# add_bison_files(foo.y) -# and -# add_flex_files(foo.l) -# then add ${CMAKE_CURRENT_BINARY_DIR}/foo.tab.c -# and ${CMAKE_CURRENT_BINARY_DIR}/foo.yy.c to the source list - -function(add_bison_files) - foreach(_file ${ARGN}) - get_filename_component(_name ${_file} NAME_WE) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}.tab.c ${CMAKE_CURRENT_BINARY_DIR}/${_name}.tab.h - COMMAND bison -p ${_name}_ -o ${CMAKE_CURRENT_BINARY_DIR}/${_name}.tab.c --defines=${CMAKE_CURRENT_BINARY_DIR}/${_name}.tab.h ${CMAKE_CURRENT_SOURCE_DIR}/${_file} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_file}) - endforeach() -endfunction() - -function(add_flex_files) - foreach(_file ${ARGN}) - get_filename_component(_name ${_file} NAME_WE) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_name}.yy.c ${CMAKE_CURRENT_BINARY_DIR}/${_name}.yy.h - COMMAND flex -o ${CMAKE_CURRENT_BINARY_DIR}/${_name}.yy.c --header-file=${CMAKE_CURRENT_BINARY_DIR}/${_name}.yy.h ${CMAKE_CURRENT_SOURCE_DIR}/${_file} - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_file}) - endforeach() -endfunction() diff --git a/sdk/tools/widl/CMakeLists.txt b/sdk/tools/widl/CMakeLists.txt index 22fa0846602..4fbfb48749b 100644 --- a/sdk/tools/widl/CMakeLists.txt +++ b/sdk/tools/widl/CMakeLists.txt @@ -10,6 +10,10 @@ if(MSVC) endif() endif() +FLEX_TARGET(p_scanner parser.l ${CMAKE_CURRENT_BINARY_DIR}/parser.yy.c) +BISON_TARGET(p_parser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.tab.c COMPILE_FLAGS "-p parser_") +ADD_FLEX_BISON_DEPENDENCY(p_scanner p_parser) + list(APPEND SOURCE client.c expr.c @@ -25,8 +29,8 @@ list(APPEND SOURCE widl.c write_msft.c write_sltg.c - parser.yy.c - parser.tab.c + ${FLEX_p_scanner_OUTPUTS} + ${BISON_p_parser_OUTPUTS} ../port/getopt.c ../port/getopt1.c ../port/mkstemps.c) diff --git a/sdk/tools/widl/parser.tab.c b/sdk/tools/widl/parser.tab.c deleted file mode 100644 index 79369804346..00000000000 --- a/sdk/tools/widl/parser.tab.c +++ /dev/null @@ -1,7408 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.5.4. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.5.4" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse parser_parse -#define yylex parser_lex -#define yyerror parser_error -#define yydebug parser_debug -#define yynerrs parser_nerrs -#define yylval parser_lval -#define yychar parser_char - -/* First part of user prologue. */ -#line 1 "parser.y" - -/* - * IDL Compiler - * - * Copyright 2002 Ove Kaaven - * Copyright 2006-2008 Robert Shearman - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include "widl.h" -#include "utils.h" -#include "parser.h" -#include "header.h" -#include "typelib.h" -#include "typegen.h" -#include "expr.h" -#include "typetree.h" - -static unsigned char pointer_default = FC_UP; - -typedef struct list typelist_t; -struct typenode { - type_t *type; - struct list entry; -}; - -struct _import_t -{ - char *name; - int import_performed; -}; - -typedef struct _decl_spec_t -{ - type_t *type; - attr_list_t *attrs; - enum storage_class stgclass; -} decl_spec_t; - -typelist_t incomplete_types = LIST_INIT(incomplete_types); - -static void fix_incomplete(void); -static void fix_incomplete_types(type_t *complete_type); - -static str_list_t *append_str(str_list_t *list, char *str); -static attr_list_t *append_attr(attr_list_t *list, attr_t *attr); -static attr_list_t *append_attr_list(attr_list_t *new_list, attr_list_t *old_list); -static decl_spec_t *make_decl_spec(type_t *type, decl_spec_t *left, decl_spec_t *right, attr_t *attr, enum storage_class stgclass); -static attr_t *make_attr(enum attr_type type); -static attr_t *make_attrv(enum attr_type type, unsigned int val); -static attr_t *make_attrp(enum attr_type type, void *val); -static expr_list_t *append_expr(expr_list_t *list, expr_t *expr); -static type_t *append_array(type_t *chain, expr_t *expr); -static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const declarator_t *decl, int top); -static var_list_t *set_var_types(attr_list_t *attrs, decl_spec_t *decl_spec, declarator_list_t *decls); -static ifref_list_t *append_ifref(ifref_list_t *list, ifref_t *iface); -static ifref_t *make_ifref(type_t *iface); -static var_list_t *append_var_list(var_list_t *list, var_list_t *vars); -static declarator_list_t *append_declarator(declarator_list_t *list, declarator_t *p); -static declarator_t *make_declarator(var_t *var); -static type_t *make_safearray(type_t *type); -static typelib_t *make_library(const char *name, const attr_list_t *attrs); -static type_t *append_chain_type(type_t *chain, type_t *type); -static warning_list_t *append_warning(warning_list_t *, int); - -static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs); -static type_t *find_type_or_error(const char *name, int t); -static type_t *find_type_or_error2(char *name, int t); - -static var_t *reg_const(var_t *var); - -static void push_namespace(const char *name); -static void pop_namespace(const char *name); - -static char *gen_name(void); -static void check_arg_attrs(const var_t *arg); -static void check_statements(const statement_list_t *stmts, int is_inside_library); -static void check_all_user_types(const statement_list_t *stmts); -static attr_list_t *check_iface_attrs(const char *name, attr_list_t *attrs); -static attr_list_t *check_function_attrs(const char *name, attr_list_t *attrs); -static attr_list_t *check_typedef_attrs(attr_list_t *attrs); -static attr_list_t *check_enum_attrs(attr_list_t *attrs); -static attr_list_t *check_struct_attrs(attr_list_t *attrs); -static attr_list_t *check_union_attrs(attr_list_t *attrs); -static attr_list_t *check_field_attrs(const char *name, attr_list_t *attrs); -static attr_list_t *check_library_attrs(const char *name, attr_list_t *attrs); -static attr_list_t *check_dispiface_attrs(const char *name, attr_list_t *attrs); -static attr_list_t *check_module_attrs(const char *name, attr_list_t *attrs); -static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs); -const char *get_attr_display_name(enum attr_type type); -static void add_explicit_handle_if_necessary(const type_t *iface, var_t *func); -static void check_def(const type_t *t); - -static void check_async_uuid(type_t *iface); - -static statement_t *make_statement(enum statement_type type); -static statement_t *make_statement_type_decl(type_t *type); -static statement_t *make_statement_reference(type_t *type); -static statement_t *make_statement_declaration(var_t *var); -static statement_t *make_statement_library(typelib_t *typelib); -static statement_t *make_statement_pragma(const char *str); -static statement_t *make_statement_cppquote(const char *str); -static statement_t *make_statement_importlib(const char *str); -static statement_t *make_statement_module(type_t *type); -static statement_t *make_statement_typedef(var_list_t *names); -static statement_t *make_statement_import(const char *str); -static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt); -static statement_list_t *append_statements(statement_list_t *, statement_list_t *); -static attr_list_t *append_attribs(attr_list_t *, attr_list_t *); - -static struct namespace global_namespace = { - NULL, NULL, LIST_INIT(global_namespace.entry), LIST_INIT(global_namespace.children) -}; - -static struct namespace *current_namespace = &global_namespace; - -#ifndef __REACTOS__ -static typelib_t *current_typelib; -#endif - - -#line 221 "parser.tab.c" - -# ifndef YY_CAST -# ifdef __cplusplus -# define YY_CAST(Type, Val) static_cast (Val) -# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) -# else -# define YY_CAST(Type, Val) ((Type) (Val)) -# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) -# endif -# endif -# ifndef YY_NULLPTR -# if defined __cplusplus -# if 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# else -# define YY_NULLPTR ((void*)0) -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 1 -#endif - -/* Use api.header.include to #include this header - instead of duplicating it here. */ -#ifndef YY_PARSER_PARSER_TAB_H_INCLUDED -# define YY_PARSER_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - aIDENTIFIER = 258, - aPRAGMA = 259, - aKNOWNTYPE = 260, - aNUM = 261, - aHEXNUM = 262, - aDOUBLE = 263, - aSTRING = 264, - aWSTRING = 265, - aSQSTRING = 266, - aUUID = 267, - aEOF = 268, - aACF = 269, - SHL = 270, - SHR = 271, - MEMBERPTR = 272, - EQUALITY = 273, - INEQUALITY = 274, - GREATEREQUAL = 275, - LESSEQUAL = 276, - LOGICALOR = 277, - LOGICALAND = 278, - ELLIPSIS = 279, - tAGGREGATABLE = 280, - tALLNODES = 281, - tALLOCATE = 282, - tANNOTATION = 283, - tAPPOBJECT = 284, - tASYNC = 285, - tASYNCUUID = 286, - tAUTOHANDLE = 287, - tBINDABLE = 288, - tBOOLEAN = 289, - tBROADCAST = 290, - tBYTE = 291, - tBYTECOUNT = 292, - tCALLAS = 293, - tCALLBACK = 294, - tCASE = 295, - tCDECL = 296, - tCHAR = 297, - tCOCLASS = 298, - tCODE = 299, - tCOMMSTATUS = 300, - tCONST = 301, - tCONTEXTHANDLE = 302, - tCONTEXTHANDLENOSERIALIZE = 303, - tCONTEXTHANDLESERIALIZE = 304, - tCONTROL = 305, - tCPPQUOTE = 306, - tDECODE = 307, - tDEFAULT = 308, - tDEFAULTBIND = 309, - tDEFAULTCOLLELEM = 310, - tDEFAULTVALUE = 311, - tDEFAULTVTABLE = 312, - tDISABLECONSISTENCYCHECK = 313, - tDISPLAYBIND = 314, - tDISPINTERFACE = 315, - tDLLNAME = 316, - tDONTFREE = 317, - tDOUBLE = 318, - tDUAL = 319, - tENABLEALLOCATE = 320, - tENCODE = 321, - tENDPOINT = 322, - tENTRY = 323, - tENUM = 324, - tERRORSTATUST = 325, - tEXPLICITHANDLE = 326, - tEXTERN = 327, - tFALSE = 328, - tFASTCALL = 329, - tFAULTSTATUS = 330, - tFLOAT = 331, - tFORCEALLOCATE = 332, - tHANDLE = 333, - tHANDLET = 334, - tHELPCONTEXT = 335, - tHELPFILE = 336, - tHELPSTRING = 337, - tHELPSTRINGCONTEXT = 338, - tHELPSTRINGDLL = 339, - tHIDDEN = 340, - tHYPER = 341, - tID = 342, - tIDEMPOTENT = 343, - tIGNORE = 344, - tIIDIS = 345, - tIMMEDIATEBIND = 346, - tIMPLICITHANDLE = 347, - tIMPORT = 348, - tIMPORTLIB = 349, - tIN = 350, - tIN_LINE = 351, - tINLINE = 352, - tINPUTSYNC = 353, - tINT = 354, - tINT32 = 355, - tINT3264 = 356, - tINT64 = 357, - tINTERFACE = 358, - tLCID = 359, - tLENGTHIS = 360, - tLIBRARY = 361, - tLICENSED = 362, - tLOCAL = 363, - tLONG = 364, - tMAYBE = 365, - tMESSAGE = 366, - tMETHODS = 367, - tMODULE = 368, - tNAMESPACE = 369, - tNOCODE = 370, - tNONBROWSABLE = 371, - tNONCREATABLE = 372, - tNONEXTENSIBLE = 373, - tNOTIFY = 374, - tNOTIFYFLAG = 375, - tNULL = 376, - tOBJECT = 377, - tODL = 378, - tOLEAUTOMATION = 379, - tOPTIMIZE = 380, - tOPTIONAL = 381, - tOUT = 382, - tPARTIALIGNORE = 383, - tPASCAL = 384, - tPOINTERDEFAULT = 385, - tPRAGMA_WARNING = 386, - tPROGID = 387, - tPROPERTIES = 388, - tPROPGET = 389, - tPROPPUT = 390, - tPROPPUTREF = 391, - tPROXY = 392, - tPTR = 393, - tPUBLIC = 394, - tRANGE = 395, - tREADONLY = 396, - tREF = 397, - tREGISTER = 398, - tREPRESENTAS = 399, - tREQUESTEDIT = 400, - tRESTRICTED = 401, - tRETVAL = 402, - tSAFEARRAY = 403, - tSHORT = 404, - tSIGNED = 405, - tSINGLENODE = 406, - tSIZEIS = 407, - tSIZEOF = 408, - tSMALL = 409, - tSOURCE = 410, - tSTATIC = 411, - tSTDCALL = 412, - tSTRICTCONTEXTHANDLE = 413, - tSTRING = 414, - tSTRUCT = 415, - tSWITCH = 416, - tSWITCHIS = 417, - tSWITCHTYPE = 418, - tTHREADING = 419, - tTRANSMITAS = 420, - tTRUE = 421, - tTYPEDEF = 422, - tUIDEFAULT = 423, - tUNION = 424, - tUNIQUE = 425, - tUNSIGNED = 426, - tUSESGETLASTERROR = 427, - tUSERMARSHAL = 428, - tUUID = 429, - tV1ENUM = 430, - tVARARG = 431, - tVERSION = 432, - tVIPROGID = 433, - tVOID = 434, - tWCHAR = 435, - tWIREMARSHAL = 436, - tAPARTMENT = 437, - tNEUTRAL = 438, - tSINGLE = 439, - tFREE = 440, - tBOTH = 441, - CAST = 442, - PPTR = 443, - POS = 444, - NEG = 445, - ADDRESSOF = 446 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 144 "parser.y" - - attr_t *attr; - attr_list_t *attr_list; - str_list_t *str_list; - expr_t *expr; - expr_list_t *expr_list; - type_t *type; - var_t *var; - var_list_t *var_list; - declarator_t *declarator; - declarator_list_t *declarator_list; - statement_t *statement; - statement_list_t *stmt_list; - warning_t *warning; - warning_list_t *warning_list; - ifref_t *ifref; - ifref_list_t *ifref_list; - char *str; - UUID *uuid; - unsigned int num; - double dbl; - interface_info_t ifinfo; - typelib_t *typelib; - struct _import_t *import; - struct _decl_spec_t *declspec; - enum storage_class stgclass; - -#line 493 "parser.tab.c" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE parser_lval; - -int parser_parse (void); - -#endif /* !YY_PARSER_PARSER_TAB_H_INCLUDED */ - - - -#ifdef short -# undef short -#endif - -/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure - and (if available) are included - so that the code can choose integer types of a good width. */ - -#ifndef __PTRDIFF_MAX__ -# include /* INFRINGES ON USER NAME SPACE */ -# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_STDINT_H -# endif -#endif - -/* Narrow types that promote to a signed type and that can represent a - signed or unsigned integer of at least N bits. In tables they can - save space and decrease cache pressure. Promoting to a signed type - helps avoid bugs in integer arithmetic. */ - -#ifdef __INT_LEAST8_MAX__ -typedef __INT_LEAST8_TYPE__ yytype_int8; -#elif defined YY_STDINT_H -typedef int_least8_t yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef __INT_LEAST16_MAX__ -typedef __INT_LEAST16_TYPE__ yytype_int16; -#elif defined YY_STDINT_H -typedef int_least16_t yytype_int16; -#else -typedef short yytype_int16; -#endif - -#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST8_TYPE__ yytype_uint8; -#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST8_MAX <= INT_MAX) -typedef uint_least8_t yytype_uint8; -#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX -typedef unsigned char yytype_uint8; -#else -typedef short yytype_uint8; -#endif - -#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ -typedef __UINT_LEAST16_TYPE__ yytype_uint16; -#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ - && UINT_LEAST16_MAX <= INT_MAX) -typedef uint_least16_t yytype_uint16; -#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX -typedef unsigned short yytype_uint16; -#else -typedef int yytype_uint16; -#endif - -#ifndef YYPTRDIFF_T -# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ -# define YYPTRDIFF_T __PTRDIFF_TYPE__ -# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ -# elif defined PTRDIFF_MAX -# ifndef ptrdiff_t -# include /* INFRINGES ON USER NAME SPACE */ -# endif -# define YYPTRDIFF_T ptrdiff_t -# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX -# else -# define YYPTRDIFF_T long -# define YYPTRDIFF_MAXIMUM LONG_MAX -# endif -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned -# endif -#endif - -#define YYSIZE_MAXIMUM \ - YY_CAST (YYPTRDIFF_T, \ - (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ - ? YYPTRDIFF_MAXIMUM \ - : YY_CAST (YYSIZE_T, -1))) - -#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) - -/* Stored state numbers (used for stacks). */ -typedef yytype_int16 yy_state_t; - -/* State numbers in computations. */ -typedef int yy_state_fast_t; - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) -# else -# define YY_ATTRIBUTE_PURE -# endif -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) -# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) -# else -# define YY_ATTRIBUTE_UNUSED -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - -#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ -# define YY_IGNORE_USELESS_CAST_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") -# define YY_IGNORE_USELESS_CAST_END \ - _Pragma ("GCC diagnostic pop") -#endif -#ifndef YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_BEGIN -# define YY_IGNORE_USELESS_CAST_END -#endif - - -#define YY_ASSERT(E) ((void) (0 && (E))) - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yy_state_t yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYPTRDIFF_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / YYSIZEOF (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYPTRDIFF_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 3 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 3170 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 216 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 115 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 417 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 729 - -#define YYUNDEFTOK 2 -#define YYMAXUTOK 446 - - -/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, with out-of-bounds checking. */ -#define YYTRANSLATE(YYX) \ - (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 200, 2, 2, 2, 199, 192, 2, - 213, 214, 197, 196, 187, 195, 207, 198, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 189, 212, - 193, 215, 194, 188, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 208, 2, 209, 191, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 210, 190, 211, 201, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 202, 203, 204, 205, 206 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_int16 yyrline[] = -{ - 0, 328, 328, 345, 345, 347, 348, 348, 350, 351, - 352, 355, 358, 359, 360, 363, 364, 365, 365, 367, - 368, 369, 372, 373, 374, 375, 378, 379, 382, 383, - 387, 388, 389, 390, 391, 392, 393, 396, 407, 408, - 412, 413, 414, 415, 416, 417, 418, 419, 420, 423, - 425, 433, 439, 447, 448, 450, 458, 469, 470, 473, - 474, 477, 478, 482, 487, 494, 498, 499, 502, 503, - 507, 510, 511, 512, 515, 516, 519, 520, 521, 522, - 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, - 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, - 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, - 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, - 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, - 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, - 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, - 593, 594, 598, 599, 600, 601, 602, 603, 604, 605, - 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, - 616, 617, 618, 619, 620, 621, 625, 626, 631, 632, - 633, 634, 637, 638, 641, 645, 651, 652, 653, 656, - 660, 672, 676, 681, 684, 685, 688, 689, 692, 693, - 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, - 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, - 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, - 724, 725, 726, 727, 728, 729, 731, 733, 734, 737, - 738, 741, 747, 753, 754, 757, 762, 769, 770, 773, - 774, 778, 779, 782, 786, 792, 800, 804, 809, 810, - 813, 814, 815, 818, 820, 823, 824, 825, 826, 827, - 828, 829, 830, 831, 832, 833, 836, 837, 840, 841, - 842, 843, 844, 845, 846, 847, 848, 851, 852, 860, - 866, 870, 873, 874, 878, 881, 882, 885, 894, 895, - 898, 899, 902, 908, 914, 915, 918, 919, 922, 932, - 942, 948, 952, 953, 956, 957, 960, 965, 972, 973, - 974, 978, 982, 985, 986, 989, 990, 994, 995, 999, - 1000, 1001, 1005, 1007, 1009, 1013, 1014, 1015, 1016, 1024, - 1026, 1028, 1033, 1035, 1040, 1041, 1046, 1047, 1048, 1049, - 1054, 1063, 1065, 1066, 1071, 1073, 1077, 1078, 1085, 1086, - 1087, 1088, 1089, 1094, 1102, 1103, 1106, 1107, 1110, 1117, - 1118, 1123, 1124, 1128, 1129, 1130, 1131, 1132, 1136, 1137, - 1138, 1141, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 1151, - 1152, 1153, 1156, 1163, 1165, 1171, 1172, 1173, 1177, 1178, - 1182, 1183, 1187, 1194, 1203, 1204, 1208, 1209, 1213, 1215, - 1216, 1217, 1221, 1222, 1227, 1228, 1229, 1230 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 1 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "aIDENTIFIER", "aPRAGMA", "aKNOWNTYPE", - "aNUM", "aHEXNUM", "aDOUBLE", "aSTRING", "aWSTRING", "aSQSTRING", - "aUUID", "aEOF", "aACF", "SHL", "SHR", "MEMBERPTR", "EQUALITY", - "INEQUALITY", "GREATEREQUAL", "LESSEQUAL", "LOGICALOR", "LOGICALAND", - "ELLIPSIS", "tAGGREGATABLE", "tALLNODES", "tALLOCATE", "tANNOTATION", - "tAPPOBJECT", "tASYNC", "tASYNCUUID", "tAUTOHANDLE", "tBINDABLE", - "tBOOLEAN", "tBROADCAST", "tBYTE", "tBYTECOUNT", "tCALLAS", "tCALLBACK", - "tCASE", "tCDECL", "tCHAR", "tCOCLASS", "tCODE", "tCOMMSTATUS", "tCONST", - "tCONTEXTHANDLE", "tCONTEXTHANDLENOSERIALIZE", "tCONTEXTHANDLESERIALIZE", - "tCONTROL", "tCPPQUOTE", "tDECODE", "tDEFAULT", "tDEFAULTBIND", - "tDEFAULTCOLLELEM", "tDEFAULTVALUE", "tDEFAULTVTABLE", - "tDISABLECONSISTENCYCHECK", "tDISPLAYBIND", "tDISPINTERFACE", "tDLLNAME", - "tDONTFREE", "tDOUBLE", "tDUAL", "tENABLEALLOCATE", "tENCODE", - "tENDPOINT", "tENTRY", "tENUM", "tERRORSTATUST", "tEXPLICITHANDLE", - "tEXTERN", "tFALSE", "tFASTCALL", "tFAULTSTATUS", "tFLOAT", - "tFORCEALLOCATE", "tHANDLE", "tHANDLET", "tHELPCONTEXT", "tHELPFILE", - "tHELPSTRING", "tHELPSTRINGCONTEXT", "tHELPSTRINGDLL", "tHIDDEN", - "tHYPER", "tID", "tIDEMPOTENT", "tIGNORE", "tIIDIS", "tIMMEDIATEBIND", - "tIMPLICITHANDLE", "tIMPORT", "tIMPORTLIB", "tIN", "tIN_LINE", "tINLINE", - "tINPUTSYNC", "tINT", "tINT32", "tINT3264", "tINT64", "tINTERFACE", - "tLCID", "tLENGTHIS", "tLIBRARY", "tLICENSED", "tLOCAL", "tLONG", - "tMAYBE", "tMESSAGE", "tMETHODS", "tMODULE", "tNAMESPACE", "tNOCODE", - "tNONBROWSABLE", "tNONCREATABLE", "tNONEXTENSIBLE", "tNOTIFY", - "tNOTIFYFLAG", "tNULL", "tOBJECT", "tODL", "tOLEAUTOMATION", "tOPTIMIZE", - "tOPTIONAL", "tOUT", "tPARTIALIGNORE", "tPASCAL", "tPOINTERDEFAULT", - "tPRAGMA_WARNING", "tPROGID", "tPROPERTIES", "tPROPGET", "tPROPPUT", - "tPROPPUTREF", "tPROXY", "tPTR", "tPUBLIC", "tRANGE", "tREADONLY", - "tREF", "tREGISTER", "tREPRESENTAS", "tREQUESTEDIT", "tRESTRICTED", - "tRETVAL", "tSAFEARRAY", "tSHORT", "tSIGNED", "tSINGLENODE", "tSIZEIS", - "tSIZEOF", "tSMALL", "tSOURCE", "tSTATIC", "tSTDCALL", - "tSTRICTCONTEXTHANDLE", "tSTRING", "tSTRUCT", "tSWITCH", "tSWITCHIS", - "tSWITCHTYPE", "tTHREADING", "tTRANSMITAS", "tTRUE", "tTYPEDEF", - "tUIDEFAULT", "tUNION", "tUNIQUE", "tUNSIGNED", "tUSESGETLASTERROR", - "tUSERMARSHAL", "tUUID", "tV1ENUM", "tVARARG", "tVERSION", "tVIPROGID", - "tVOID", "tWCHAR", "tWIREMARSHAL", "tAPARTMENT", "tNEUTRAL", "tSINGLE", - "tFREE", "tBOTH", "','", "'?'", "':'", "'|'", "'^'", "'&'", "'<'", "'>'", - "'-'", "'+'", "'*'", "'/'", "'%'", "'!'", "'~'", "CAST", "PPTR", "POS", - "NEG", "ADDRESSOF", "'.'", "'['", "']'", "'{'", "'}'", "';'", "'('", - "')'", "'='", "$accept", "input", "m_acf", "gbl_statements", "$@1", - "imp_statements", "$@2", "int_statements", "semicolon_opt", "statement", - "pragma_warning", "warnings", "typedecl", "cppquote", "import_start", - "import", "importlib", "libraryhdr", "library_start", "librarydef", - "m_args", "arg_list", "args", "arg", "array", "m_attributes", - "attributes", "attrib_list", "str_list", "attribute", "uuid_string", - "callconv", "cases", "case", "enums", "enum_list", "enum", "enumdef", - "m_exprs", "m_expr", "expr", "expr_list_int_const", "expr_int_const", - "expr_const", "fields", "field", "ne_union_field", "ne_union_fields", - "union_field", "s_field", "funcdef", "declaration", "m_ident", "t_ident", - "ident", "base_type", "m_int", "int_std", "coclass", "coclasshdr", - "coclassdef", "namespacedef", "coclass_ints", "coclass_int", - "dispinterface", "dispinterfacehdr", "dispint_props", "dispint_meths", - "dispinterfacedef", "inherit", "interface", "interfacehdr", - "interfacedef", "interfacedec", "module", "modulehdr", "moduledef", - "storage_cls_spec", "function_specifier", "type_qualifier", - "m_type_qual_list", "decl_spec", "m_decl_spec_no_type", - "decl_spec_no_type", "declarator", "direct_declarator", - "abstract_declarator", "abstract_declarator_no_direct", - "m_abstract_declarator", "abstract_direct_declarator", "any_declarator", - "any_declarator_no_direct", "m_any_declarator", "any_direct_declarator", - "declarator_list", "m_bitfield", "struct_declarator", - "struct_declarator_list", "init_declarator", "threading_type", - "pointer_type", "structdef", "type", "typedef", "uniondef", "version", - "acf_statements", "acf_int_statements", "acf_int_statement", - "acf_interface", "acf_attributes", "acf_attribute_list", "acf_attribute", - "allocate_option_list", "allocate_option", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_int16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, - 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, - 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, - 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, - 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, - 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 44, 63, 58, - 124, 94, 38, 60, 62, 45, 43, 42, 47, 37, - 33, 126, 442, 443, 444, 445, 446, 46, 91, 93, - 123, 125, 59, 40, 41, 61 -}; -# endif - -#define YYPACT_NINF (-564) - -#define yypact_value_is_default(Yyn) \ - ((Yyn) == YYPACT_NINF) - -#define YYTABLE_NINF (-405) - -#define yytable_value_is_error(Yyn) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -564, 108, 1696, -564, -564, -564, -66, -564, -564, -564, - 176, -564, -101, 195, -564, 243, -564, -564, -564, -564, - 38, 148, -564, -564, -564, -564, -564, 269, 38, 165, - -35, -564, -14, 38, 15, -564, -564, 291, 321, 15, - -564, -564, 2989, -564, -564, -564, 47, -564, -564, -564, - -564, -564, 51, 2671, 53, 57, -564, -564, 64, 24, - -564, 81, 80, 85, 87, 91, 117, -564, -564, 123, - -564, -16, -16, -16, 48, 2836, 125, -16, 130, 136, - 96, -564, -66, 152, -564, -564, 346, -564, -564, 119, - -564, 139, -564, -564, 149, -564, -564, -564, -564, 368, - 2836, -564, -564, 122, 168, -92, -117, -564, -564, 169, - -564, -564, 173, -564, -564, -564, 174, 186, -564, -564, - -564, -564, -564, -564, -564, -564, -564, -564, 187, -564, - -564, -564, 188, -564, -564, -564, 189, 190, -564, -564, - -564, -564, 191, 192, 194, 203, 206, -564, 207, -564, - -564, 208, -564, 213, -564, -564, 214, 216, -564, -564, - -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, - -564, 217, -564, -564, -564, 218, 220, -564, -564, -564, - -564, -564, -564, 223, -564, -564, 224, -564, -564, -564, - 225, -564, -564, -564, 226, 228, 230, 231, -564, -564, - -564, 236, 257, -564, -564, 259, 260, 262, -62, -564, - -564, -564, 1836, 878, 200, 335, 340, 349, 359, 364, - 267, 268, -564, -564, -564, -564, 48, 270, 271, -564, - -564, -564, -564, -564, -30, -564, -564, -564, 369, 274, - -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, - -564, -564, 48, 48, -564, 272, -58, -564, -564, -564, - -16, -564, -564, -564, 275, -564, -564, -564, -12, -564, - -564, 423, 278, 376, -564, 296, 279, -564, 276, -564, - 485, 43, 376, 731, 731, 487, 489, 731, 731, 490, - 491, 731, 492, 731, 731, 2224, 731, 731, 494, -80, - 495, 731, 2836, 731, 731, 2836, 98, 2836, 2836, 43, - 202, 496, 2836, 2989, 298, -564, 295, -564, -564, -564, - 299, -564, 302, -564, -564, -564, 87, 2760, -564, 303, - -564, -564, -564, -564, 303, -97, -564, -564, -112, -564, - 325, -72, 305, 308, -564, -564, 1239, 45, 306, -564, - 731, 624, 2224, -564, -564, 66, 96, -564, 311, -564, - 312, 337, -564, 307, 520, -564, -111, 200, 59, 313, - -564, -564, 314, 316, -564, -564, -564, -564, -564, -564, - -564, -564, -564, 318, -564, 731, 731, 731, 731, 731, - 731, 605, 2473, -93, -564, 2473, 320, 322, -564, -42, - 328, 330, 331, 332, 333, 334, 336, 374, 338, 2760, - 65, 339, -41, -564, 2473, 341, 342, 344, 345, 347, - -38, 2230, 360, -564, -564, -564, -564, -564, 361, 362, - 363, 365, 352, -564, 366, 370, 372, -564, 2989, 526, - -564, -564, -564, 48, 87, 27, -564, 1120, -564, 371, - 2760, 351, 1575, 343, 456, 1358, 87, -564, 2760, -564, - -564, -564, -564, 709, -564, 2390, 373, 391, -564, -564, - -564, -564, -564, -564, -34, -564, -564, 384, -564, 376, - 731, -564, 21, -564, 2760, -564, 377, -564, 378, -564, - 380, -564, -564, -564, 2760, 32, 32, 32, 32, 32, - 32, 2319, 227, 731, 731, 590, 731, 731, 731, 731, - 731, 731, 731, 731, 731, 731, 731, 731, 731, 731, - 731, 731, 731, 592, 731, 731, -564, -564, -564, 587, - -564, -564, -564, -564, -564, -564, -564, -564, -564, -564, - 65, -564, 1957, -564, 65, -564, -564, -564, 8, -564, - 731, -564, -564, -564, -564, 731, -564, -564, -564, -564, - -564, -564, -564, -564, 591, -564, -564, -564, -564, 385, - -564, -564, 411, -564, -564, -564, -564, 48, 171, -564, - -564, 2760, 388, -564, -564, -564, 87, -564, -564, -564, - -564, 2135, 66, -564, 393, 394, 384, -564, -564, -564, - -564, 65, 390, 376, -564, -564, 227, -564, -564, 2046, - -564, 227, -564, 392, 28, 90, 90, -564, 672, 672, - 215, 215, 2345, 2504, 2452, 1277, 1396, 1337, 215, 215, - 30, 30, 32, 32, 32, -564, 2430, -564, -564, -564, - 36, -564, 395, 65, 403, -564, 2224, -564, -564, 404, - -564, 87, 999, 48, -564, -564, 1477, -564, -564, -564, - -564, 599, -564, -564, 430, -564, -103, -564, 410, -564, - 407, 289, -564, 408, 65, 409, -564, 731, 2224, -564, - 731, -564, -564, 36, -564, -564, -564, 414, -564, -564, - -564, -564, 87, 412, 731, -564, 65, -564, -564, -564, - -564, 36, -564, -564, -564, 32, 415, 2473, -564, -564, - -564, -564, -564, -564, -7, -564, -564, 731, 436, -564, - -564, 447, -147, -147, -564, -564, 425, -564, -564 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_int16 yydefact[] = -{ - 5, 0, 3, 1, 35, 383, 398, 273, 265, 284, - 0, 322, 0, 0, 272, 260, 274, 318, 271, 275, - 276, 0, 321, 278, 285, 286, 283, 0, 276, 0, - 0, 320, 0, 276, 0, 280, 319, 260, 260, 270, - 382, 266, 76, 2, 14, 36, 0, 30, 15, 33, - 15, 13, 0, 69, 385, 0, 384, 267, 0, 0, - 11, 0, 0, 0, 28, 0, 304, 9, 8, 0, - 12, 327, 327, 327, 0, 0, 387, 327, 0, 389, - 0, 4, 398, 0, 287, 288, 0, 295, 296, 386, - 262, 0, 277, 282, 0, 306, 307, 281, 291, 0, - 0, 279, 268, 388, 0, 390, 0, 269, 77, 0, - 79, 80, 0, 81, 82, 83, 0, 0, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, 0, 97, - 98, 99, 0, 101, 102, 103, 0, 0, 106, 107, - 108, 109, 0, 0, 0, 0, 0, 115, 0, 117, - 118, 0, 120, 0, 122, 123, 126, 0, 127, 128, - 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, - 139, 0, 141, 142, 143, 0, 0, 146, 147, 148, - 149, 380, 150, 0, 152, 378, 0, 154, 155, 156, - 0, 158, 159, 160, 0, 0, 0, 0, 165, 379, - 166, 0, 0, 170, 171, 0, 0, 0, 0, 71, - 175, 31, 68, 68, 68, 260, 0, 0, 260, 260, - 0, 385, 289, 297, 308, 316, 0, 387, 389, 32, - 10, 292, 6, 313, 0, 29, 311, 312, 0, 0, - 26, 331, 328, 330, 329, 263, 264, 178, 179, 180, - 181, 323, 0, 0, 335, 371, 334, 257, 385, 387, - 327, 389, 325, 34, 0, 410, 409, 411, 0, 406, - 399, 0, 0, 186, 50, 0, 0, 243, 0, 249, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 196, 0, 0, - 0, 0, 0, 196, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 76, 70, 51, 0, 23, 24, 25, - 0, 21, 0, 19, 16, 22, 28, 0, 69, 386, - 53, 54, 314, 315, 388, 390, 55, 256, 68, 5, - 0, 68, 0, 0, 305, 26, 68, 0, 0, 333, - 0, 0, 57, 337, 326, 0, 0, 405, 0, 49, - 0, 188, 189, 192, 0, 391, 68, 68, 68, 0, - 177, 176, 0, 0, 207, 198, 199, 200, 204, 205, - 206, 201, 202, 0, 203, 0, 0, 0, 0, 0, - 0, 0, 241, 0, 239, 242, 0, 0, 74, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 356, 0, 0, 194, 197, 0, 0, 0, 0, 0, - 0, 0, 0, 373, 374, 375, 376, 377, 0, 0, - 0, 0, 395, 397, 0, 0, 0, 72, 76, 0, - 20, 17, 56, 0, 28, 0, 293, 68, 298, 0, - 0, 0, 0, 0, 0, 68, 28, 27, 69, 324, - 332, 336, 372, 0, 67, 0, 0, 61, 58, 59, - 416, 414, 417, 415, 0, 412, 407, 400, 193, 187, - 0, 38, 0, 381, 0, 244, 0, 393, 69, 250, - 0, 78, 169, 84, 0, 231, 230, 229, 232, 227, - 228, 0, 344, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 85, 96, 100, 0, - 104, 105, 110, 111, 112, 113, 114, 116, 119, 121, - 356, 323, 57, 361, 356, 358, 357, 64, 353, 125, - 196, 124, 140, 144, 145, 0, 153, 157, 161, 162, - 164, 163, 167, 168, 0, 172, 173, 174, 73, 0, - 15, 364, 392, 290, 294, 7, 300, 0, 387, 299, - 302, 0, 0, 255, 303, 26, 28, 317, 66, 65, - 338, 0, 0, 408, 404, 0, 400, 190, 191, 39, - 37, 0, 389, 258, 248, 247, 344, 238, 323, 57, - 348, 344, 345, 0, 341, 220, 221, 233, 214, 215, - 218, 219, 209, 210, 0, 211, 212, 213, 217, 216, - 223, 222, 225, 226, 224, 234, 0, 240, 75, 63, - 356, 323, 0, 356, 0, 352, 57, 360, 195, 0, - 396, 28, 68, 0, 253, 301, 68, 309, 62, 60, - 413, 0, 403, 401, 366, 369, 0, 246, 0, 259, - 0, 344, 323, 0, 356, 0, 340, 0, 57, 347, - 0, 237, 351, 356, 362, 355, 359, 0, 151, 52, - 18, 365, 28, 0, 0, 368, 0, 245, 182, 236, - 339, 356, 349, 343, 346, 235, 0, 208, 354, 363, - 310, 402, 367, 370, 0, 342, 350, 0, 0, 394, - 183, 0, 68, 68, 252, 185, 0, 184, 251 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -564, -564, -564, 301, -564, -45, -564, -331, -315, 0, - -564, -564, -564, -564, -564, 184, -564, -564, -564, 11, - -483, -564, -564, -263, -246, -207, -2, -564, -564, -284, - 353, -68, -564, -564, -564, -564, 163, 13, 355, 93, - -199, -564, -265, -279, -564, -564, -564, -564, -78, -197, - -564, 196, -564, 5, -70, -564, 110, 162, 10, -564, - 17, 19, -564, -564, 593, -564, -564, -564, -564, -564, - -28, -564, 20, 16, -564, -564, 22, -564, -564, -313, - -506, -52, 6, 3, -236, -564, -564, -564, -539, -564, - -563, -564, -164, -564, -564, -564, -47, -564, 426, -564, - 356, 1, -55, -564, 7, -564, 578, 68, -564, -564, - 67, -564, 310, -564, 75 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 43, 2, 339, 212, 570, 346, 236, 317, - 45, 482, 46, 47, 48, 49, 318, 220, 50, 319, - 466, 467, 468, 469, 543, 52, 328, 208, 399, 209, - 372, 544, 714, 720, 360, 361, 362, 258, 412, 413, - 392, 393, 394, 396, 366, 485, 489, 368, 725, 726, - 582, 55, 668, 91, 545, 56, 93, 57, 320, 59, - 321, 322, 338, 446, 62, 63, 341, 452, 64, 239, - 65, 66, 323, 324, 225, 69, 325, 71, 72, 73, - 347, 74, 241, 75, 255, 256, 612, 675, 613, 614, - 546, 644, 547, 548, 572, 695, 665, 666, 257, 428, - 210, 259, 77, 78, 261, 434, 81, 595, 596, 82, - 83, 268, 269, 474, 475 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_int16 yytable[] = -{ - 53, 226, 44, 76, 254, 213, 253, 327, 400, 79, - 353, 442, 58, 51, 455, 54, 348, 349, 68, 60, - 260, 61, 67, 401, 70, 224, 404, 599, 406, 437, - 11, 411, 408, 717, 459, 640, 418, -404, 664, 245, - 449, 246, 104, 106, 278, 276, 718, 505, 245, 505, - 246, 245, 370, 246, 227, 371, 17, 9, 181, 642, - 228, 42, 185, 222, -261, 724, 221, 670, 245, -261, - 246, 462, 676, 27, 242, 242, 242, 247, 243, 244, - 242, 22, 11, 262, 696, 395, 247, 13, 395, 247, - 199, 11, 470, 279, 525, 407, 42, 42, 414, 444, - 483, 20, 671, 340, 414, 421, 247, 505, 3, 697, - 248, 460, 86, -261, 23, 24, 25, 26, -261, 248, - -45, 526, 248, 264, 28, 313, 673, 31, 471, 573, - 27, 445, 700, 664, 450, 683, 42, 92, 97, 248, - 36, 587, 80, 101, 451, 529, 550, 314, 265, 550, - 351, 395, 465, 592, 568, 352, 254, 94, 253, 484, - 450, 450, 266, 687, 33, 249, 701, 267, 98, 35, - 486, 490, 530, 551, 249, 356, 557, 249, 99, 84, - 593, 85, 254, 254, 253, 253, 495, 496, 497, 498, - 499, 500, 501, 250, 249, 706, 102, 357, 87, 100, - 88, 107, 250, 363, 719, 250, 342, 571, 432, 433, - 53, 53, 373, 76, 76, 598, 351, 472, 214, 79, - 79, 646, 250, 104, 106, 54, 54, 520, 521, 522, - 503, 504, 505, 541, 231, 600, 351, 523, 524, 523, - 524, 678, 251, 410, 351, 251, 89, 419, 90, 542, - 422, 473, 429, 430, 656, 271, 610, 436, 252, 211, - 637, 252, 541, 242, 498, -40, 354, 42, 247, 229, - 487, 657, 95, 351, 96, 443, 230, 254, 542, 253, - 423, 424, 425, 426, 427, 518, 519, 520, 521, 522, - 649, 232, 233, 409, 103, 234, 90, 523, 524, 235, - 410, 248, 647, 237, 615, 616, 238, 618, 619, 620, - 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, - 631, 632, 633, 634, 105, 636, 90, 459, 659, -261, - 247, -41, -261, 240, -43, 11, 689, -42, 329, 502, - 90, 654, 263, 330, 458, 331, 457, 76, -44, 273, - 409, 414, 332, 79, 333, 272, 249, 540, 459, 54, - 610, 274, 334, 248, 90, 610, 488, 335, 679, 90, - 459, 275, 343, 254, 344, 253, 639, 710, 277, 245, - 645, 246, 280, -254, 250, -254, 281, 282, 459, 503, - 504, 505, 506, 507, 508, 509, 510, 511, 577, 283, - 284, 285, 286, 287, 288, 289, 226, 290, 42, 363, - 518, 519, 520, 521, 522, 712, 291, 691, 249, 292, - 293, 294, 523, 524, 608, 610, 295, 296, 358, 297, - 298, 299, 601, 300, 611, 351, 301, 302, 303, 304, - 609, 305, 606, 306, 307, 53, 250, 44, 76, 308, - 581, 578, 721, 458, 79, 457, 76, 58, 51, 227, - 54, 574, 79, 68, 60, 228, 61, 67, 54, 70, - 309, 221, 310, 311, 643, 312, 682, 336, 705, 685, - -46, 707, -47, -48, 345, 364, 608, 350, 355, 367, - 410, 602, 359, 365, 369, 395, 397, 351, 398, 402, - 403, 405, 609, 415, 417, 435, 438, 254, 439, 253, - 703, 440, 441, -261, 448, 450, 450, 453, 454, 708, - 461, 477, 480, 478, 479, 652, 481, 491, 492, 226, - 493, 494, 555, 669, 527, 569, 528, 715, 611, 410, - 409, 674, 531, 611, 532, 533, 534, 535, 536, 21, - 537, 594, 539, 549, 584, 552, 553, 410, 554, 564, - 576, 556, 512, 579, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 522, 559, 560, 561, 562, 591, 563, - 565, 523, 524, 254, 566, 253, 567, 590, 538, 409, - 604, 603, 605, 617, 410, 635, 638, 650, 653, 651, - 655, 80, 667, 611, 693, 662, 677, 409, 374, 684, - 5, 375, 376, 377, 378, 379, 380, 686, 688, 694, - 698, 699, 702, 704, 711, 722, 410, 374, 709, 716, - 375, 376, 377, 378, 379, 380, 723, 728, 585, 7, - 447, 8, 597, 648, 409, 727, 223, 9, 583, 713, - 53, 11, 337, 76, 458, 416, 457, 76, 420, 79, - 270, 661, 431, 79, 663, 54, 476, 660, 14, 54, - 0, 0, 0, 0, 215, 16, 409, 17, 381, 0, - 0, 18, 0, 0, 19, 0, 0, 503, 504, 505, - 0, 20, 508, 509, 0, 0, 0, 381, 0, 0, - 0, 0, 22, 0, 23, 24, 25, 26, 0, 0, - 0, 0, 374, 0, 28, 375, 376, 377, 378, 379, - 380, 0, 0, 0, 0, 0, 382, 0, 0, 0, - 0, 0, 0, 0, 374, 0, 0, 375, 376, 377, - 378, 379, 380, 0, 0, 382, 0, 0, 31, 0, - 0, 0, 0, 32, 33, 34, 0, 0, 383, 35, - 0, 36, 0, 0, 0, 218, 0, 0, 0, 0, - 0, 384, 0, 0, 219, 0, 39, 383, 0, 0, - 0, 0, 381, 0, 40, 41, 0, 0, 0, 0, - 384, 0, 0, 0, 0, 0, 0, 385, 0, 0, - 386, 387, 388, 0, 381, 389, 390, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 385, 0, 391, 386, - 387, 463, 0, 0, 389, 390, 0, 0, 0, 0, - 382, 0, 0, 464, 0, 0, 0, 391, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 382, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 383, 0, 0, 516, 517, 518, 519, 520, - 521, 522, 0, 0, 0, 384, 0, 0, 0, 523, - 524, 0, 4, 5, 383, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 384, 0, 0, - 0, 385, 0, 0, 386, 387, 388, 0, 0, 389, - 390, 0, 7, 0, 8, 0, 0, 0, 588, 0, - 9, 10, 391, 385, 11, 0, 386, 387, 388, 12, - 0, 389, 390, 0, 0, 0, 0, 0, 13, 0, - 0, 14, 0, 0, 391, 0, 0, 15, 16, 0, - 17, 0, 0, 0, 18, 0, 0, 19, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, - 0, 21, 316, 0, 0, 22, 0, 23, 24, 25, - 26, 27, 0, 0, 0, 0, 0, 28, 0, 0, - 0, 0, 29, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 5, 0, 0, 0, 0, 30, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 31, 0, 0, 0, 0, 32, 33, 34, 0, - 0, 0, 35, 7, 36, 8, 0, 0, 37, 0, - 0, 9, 10, 0, 0, 11, 0, 38, 0, 39, - 12, 0, 0, 0, 0, 0, 0, 40, 41, 13, - 0, 0, 14, 0, 0, 0, 0, 0, 15, 16, - 0, 17, 0, 0, 0, 18, 0, 0, 19, 0, - 0, 0, 0, 0, 0, 20, 42, 0, 0, 326, - 0, 0, 21, 316, 0, 0, 22, 0, 23, 24, - 25, 26, 27, 0, 0, 0, 0, 0, 28, 0, - 0, 0, 0, 29, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 4, 5, 0, 0, 0, 0, - 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 0, 0, 32, 33, 34, - 0, 0, 0, 35, 7, 36, 8, 0, 0, 37, - 0, 0, 9, 10, 0, 0, 11, 0, 38, 0, - 39, 12, 0, 0, 0, 0, 0, 0, 40, 41, - 13, 0, 0, 14, 0, 0, 0, 0, 0, 15, - 16, 0, 17, 0, 0, 0, 18, 0, 0, 19, - 0, 0, 0, 0, 0, 0, 20, 42, 0, 0, - 690, 0, 0, 21, 0, 0, 0, 22, 0, 23, - 24, 25, 26, 27, 0, 0, 0, 0, 0, 28, - 0, 0, 0, 0, 29, 0, 0, 0, 0, 0, - 0, 0, 0, 4, 5, 0, 0, 0, 0, 0, - 0, 30, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 31, 0, 0, 0, 0, 32, 33, - 34, 0, 0, 7, 35, 8, 36, 0, 0, 0, - 37, 9, 0, 0, 0, 11, 0, 0, 0, 38, - 12, 39, 503, 504, 505, 506, 507, 508, 509, 40, - 41, 0, 14, 0, 0, 0, 0, 0, 15, 16, - 0, 17, 0, 0, 0, 18, 0, 0, 19, 0, - 0, 0, 0, 0, 0, 20, 0, 0, 42, 0, - 0, 575, 21, 0, 0, 0, 22, 0, 23, 24, - 25, 26, 0, 0, 0, 0, 0, 0, 28, 0, - 0, 0, 503, 504, 505, 506, 507, 508, 509, 0, - 0, 0, 4, 5, 0, 0, 0, 0, 0, 0, - 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 31, 0, 0, 0, 0, 32, 33, 34, - 0, 0, 7, 35, 8, 36, 0, 0, 0, 37, - 9, 0, 0, 0, 11, 0, 0, 0, 38, 12, - 39, 503, 504, 505, 506, 507, 508, 509, 40, 41, - 0, 14, 0, 0, 0, 0, 0, 15, 16, 0, - 17, 0, 0, 0, 18, 0, 0, 19, 0, 0, - 0, 0, 0, 0, 20, 0, 0, 42, 0, 0, - 456, 21, 0, 0, 0, 22, 0, 23, 24, 25, - 26, 0, 0, 0, 0, 0, 0, 28, 514, 515, - 516, 517, 518, 519, 520, 521, 522, 0, 0, 0, - 0, 4, 5, 0, 523, 524, 0, 0, 0, 30, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 31, 0, 0, 0, 0, 32, 33, 34, 0, - 0, 7, 35, 8, 36, 0, 0, 0, 37, 9, - 0, 0, 0, 11, 0, 0, 0, 38, 12, 39, - 516, 517, 518, 519, 520, 521, 522, 40, 41, 0, - 14, 0, 0, 0, 523, 524, 15, 16, 0, 17, - 0, 0, 0, 18, 0, 0, 19, 0, 0, 0, - 0, 0, 0, 20, 0, 0, 42, 0, 0, 586, - 21, 0, 0, 0, 22, 0, 23, 24, 25, 26, - 5, 0, 0, 0, 0, 0, 28, 0, 515, 516, - 517, 518, 519, 520, 521, 522, 0, 0, 0, 0, - 0, 0, 0, 523, 524, 0, 0, 0, 30, 7, - 0, 8, 0, 0, 0, 0, 0, 9, 0, 0, - 31, 11, 0, 0, 0, 32, 33, 34, 0, 0, - 0, 35, 0, 36, 0, 0, 0, 37, 14, 0, - 0, 0, 0, 0, 215, 16, 38, 17, 39, 0, - 0, 18, 0, 0, 19, 0, 40, 41, 0, 0, - 0, 20, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 22, 0, 23, 24, 25, 26, 0, 0, - 0, 0, 0, 0, 28, 42, 0, 0, 692, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 4, 5, 0, 0, 0, 0, 0, 0, 0, 0, - 6, 0, 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 32, 33, 34, 0, 0, 0, 35, - 7, 36, 8, 0, 0, 218, 0, 0, 9, 10, - 0, 0, 11, 0, 219, 0, 39, 12, 0, 0, - 0, 0, 0, 0, 40, 41, 13, 0, 0, 14, - 0, 0, 0, 0, 0, 15, 16, 0, 17, 0, - 0, 0, 18, 0, 0, 19, 0, 0, 0, 0, - 0, 0, 20, 42, 0, 0, 580, 0, 0, 21, - 0, 0, 0, 22, 0, 23, 24, 25, 26, 27, - 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, - 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 30, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, - 4, 5, 0, 0, 32, 33, 34, 0, 0, 315, - 35, 0, 36, 0, 0, 0, 37, 0, 0, 0, - 0, 0, 0, -68, 0, 38, 0, 39, 0, 0, - 7, 0, 8, 0, 0, 40, 41, 0, 9, 10, - 0, 0, 11, 0, 0, 0, 0, 12, 0, 0, - 0, 0, 0, 0, 0, 0, 13, 0, 0, 14, - 0, 0, 0, 0, 42, 15, 16, 0, 17, 0, - 0, 0, 18, 0, 0, 19, 0, 0, 0, 0, - 0, 0, 20, 0, 0, 0, 0, 0, 0, 21, - 316, 0, 0, 22, 0, 23, 24, 25, 26, 27, - 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, - 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 5, 0, 0, 0, 0, 30, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, - 0, 0, 0, 0, 32, 33, 34, 0, 0, 0, - 35, 7, 36, 8, 0, 0, 37, 0, 247, 9, - 0, 0, 0, 11, 0, 38, 0, 39, 0, 0, - 0, 0, 0, 0, 0, 40, 41, 0, 0, 0, - 14, 0, 0, 0, 0, 0, 215, 16, 0, 17, - 0, 248, 0, 18, 0, 0, 19, 0, 0, 0, - 0, 0, 0, 20, 42, 0, 0, 0, 0, 0, - 0, 5, 0, 0, 22, 0, 23, 24, 25, 26, - 0, 0, 0, 0, 0, 0, 28, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 7, 0, 8, 0, 0, 0, 249, 247, 9, 0, - 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, - 31, 0, 0, 0, 0, 32, 33, 34, 0, 14, - 0, 35, 0, 36, 250, 215, 16, 218, 17, 0, - 248, 0, 18, 0, 0, 19, 219, 0, 39, 0, - 0, 0, 20, 0, 0, 0, 40, 41, 0, 0, - 5, 0, 0, 22, 0, 23, 24, 25, 26, 0, - 0, 0, 0, 0, 641, 28, 0, 0, 0, 658, - 0, 0, 0, 0, 0, 42, 0, 0, 0, 7, - 0, 8, 0, 0, 0, 249, 0, 9, 0, 0, - 0, 11, 0, 0, 0, 0, 0, 0, 0, 31, - 0, 0, 0, 0, 32, 33, 34, 0, 14, 0, - 35, 0, 36, 250, 215, 16, 218, 17, 0, 0, - 0, 18, 0, 0, 19, 219, 0, 39, 0, 0, - 0, 20, 0, 0, 0, 40, 41, 0, 0, 5, - 0, 0, 22, 0, 23, 24, 25, 26, 0, 0, - 0, 0, 0, 672, 28, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 42, 0, 0, 0, 7, 0, - 8, 0, 0, 0, 0, 0, 9, 0, 0, 0, - 11, 0, 0, 0, 0, 0, 0, 0, 31, 0, - 0, 0, 0, 32, 33, 34, 0, 14, 0, 35, - 0, 36, 0, 215, 16, 218, 17, 0, 0, 0, - 18, 0, 0, 19, 219, 0, 39, 0, 0, 0, - 20, 0, 0, 0, 40, 41, 0, 0, 0, 0, - 0, 22, 0, 23, 24, 25, 26, 0, 0, 0, - 0, 0, 0, 28, 503, 504, 505, 506, 507, 508, - 509, 510, 511, 42, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 503, 504, 505, 506, 507, 508, 509, 31, 511, 0, - 0, 0, 32, 33, 34, 0, 0, 0, 35, 0, - 36, 0, 0, 0, 218, 0, 0, 0, 0, 0, - 0, 0, 0, 219, 0, 39, 0, 0, 0, 0, - 0, 0, 0, 40, 41, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 0, 0, 0, 0, 512, 0, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 0, 0, 42, 0, 0, 0, 0, 523, 524, 0, - 0, 0, 0, 0, 558, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 503, 504, 505, - 506, 507, 508, 509, 510, 511, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 503, 504, - 505, 506, 507, 508, 509, 510, 511, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 512, 0, 513, - 514, 515, 516, 517, 518, 519, 520, 521, 522, 503, - 504, 505, 506, 507, 508, 509, 523, 524, 0, 0, - 0, 0, 0, 607, 0, 513, 514, 515, 516, 517, - 518, 519, 520, 521, 522, 0, 0, 0, 0, 0, - 0, 0, 523, 524, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 512, 0, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 0, 0, 0, 0, 0, 0, 0, 523, 524, 589, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 512, 0, - 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, - 0, 0, 0, 0, 0, 0, 0, 523, 524, 681, - 512, 680, 513, 514, 515, 516, 517, 518, 519, 520, - 521, 522, 0, 0, 0, 0, 0, 0, 0, 523, - 524, 512, 0, 513, 514, 515, 516, 517, 518, 519, - 520, 521, 522, 0, 0, 0, 5, 0, 0, 0, - 523, 524, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 522, 0, 7, 0, 8, 0, 0, - 0, 523, 524, 9, 10, 0, 0, 11, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 13, 0, 0, 14, 0, 0, 0, 0, 0, - 215, 16, 0, 17, 0, 0, 0, 18, 0, 0, - 19, 0, 0, 0, 0, 0, 0, 20, 0, 0, - 0, 0, 0, 0, 0, 5, 0, 0, 22, 0, - 23, 24, 25, 26, 27, 0, 0, 216, 0, 0, - 28, 0, 0, 0, 217, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 0, 8, 0, 0, 0, - 0, 0, 9, 0, 0, 0, 11, 0, 0, 0, - 0, 0, 0, 0, 31, 0, 0, 0, 0, 32, - 33, 34, 0, 14, 0, 35, 0, 36, 0, 215, - 16, 218, 17, 0, 0, 0, 18, 0, 0, 19, - 219, 5, 39, 0, 0, 0, 20, 0, 0, 0, - 40, 41, 0, 0, 0, 0, 0, 22, 0, 23, - 24, 25, 26, 0, 0, 0, 0, 0, 0, 28, - 7, 0, 8, 0, 0, 0, 0, 0, 9, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, - 0, 0, 0, 31, 0, 215, 16, 0, 32, 33, - 34, 0, 18, 0, 35, 19, 36, 0, 0, 0, - 218, 0, 20, 0, 0, 0, 0, 0, 0, 219, - 0, 39, 0, 0, 0, 23, 24, 25, 26, 40, - 41, 0, 0, 0, 0, 28, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32, 33, 34, 0, 0, 0, - 35, 0, 0, 0, 0, 0, 218, 0, 0, 0, - 0, 0, 0, 0, 0, 219, 0, 39, 0, 0, - 0, 0, 0, 0, 108, 40, 41, 109, 110, 111, - 112, 113, 114, 0, 115, 0, 0, 116, 0, 117, - 0, 0, 0, 118, 119, 0, 120, 121, 122, 123, - 0, 124, 125, 126, 127, 128, 129, 130, 131, 0, - 132, 0, 0, 133, 134, 135, 136, 137, 0, 0, - 138, 0, 0, 0, 139, 0, 140, 141, 0, 142, - 143, 144, 145, 146, 147, 0, 148, 149, 150, 151, - 152, 153, 0, 0, 154, 0, 0, 155, 0, 0, - 0, 0, 0, 156, 157, 0, 158, 159, 0, 160, - 161, 0, 0, 0, 162, 163, 164, 165, 166, 167, - 0, 168, 169, 170, 171, 172, 173, 174, 0, 175, - 0, 176, 0, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 0, 186, 187, 188, 189, 0, 0, 0, - 0, 190, 0, 0, 191, 0, 0, 192, 193, 0, - 0, 194, 195, 196, 197, 0, 0, 198, 0, 199, - 0, 200, 201, 202, 203, 204, 205, 206, 0, 0, - 207 -}; - -static const yytype_int16 yycheck[] = -{ - 2, 53, 2, 2, 74, 50, 74, 214, 287, 2, - 256, 326, 2, 2, 345, 2, 252, 253, 2, 2, - 75, 2, 2, 288, 2, 53, 291, 6, 293, 313, - 46, 296, 295, 40, 347, 541, 301, 103, 601, 3, - 112, 5, 37, 38, 161, 100, 53, 17, 3, 17, - 5, 3, 9, 5, 53, 12, 72, 42, 138, 542, - 53, 208, 142, 53, 161, 212, 53, 606, 3, 161, - 5, 350, 611, 103, 71, 72, 73, 41, 72, 73, - 77, 97, 46, 77, 187, 284, 41, 60, 287, 41, - 170, 46, 26, 210, 187, 294, 208, 208, 297, 211, - 211, 86, 608, 133, 303, 304, 41, 17, 0, 212, - 74, 347, 213, 210, 99, 100, 101, 102, 210, 74, - 212, 214, 74, 27, 109, 187, 609, 143, 62, 444, - 103, 338, 671, 696, 341, 641, 208, 99, 28, 74, - 156, 456, 208, 33, 341, 187, 187, 209, 52, 187, - 208, 350, 351, 187, 438, 213, 226, 9, 226, 366, - 367, 368, 66, 646, 149, 129, 672, 71, 3, 154, - 367, 368, 214, 214, 129, 187, 214, 129, 213, 3, - 214, 5, 252, 253, 252, 253, 385, 386, 387, 388, - 389, 390, 391, 157, 129, 678, 34, 209, 3, 213, - 5, 39, 157, 273, 211, 157, 234, 443, 6, 7, - 212, 213, 282, 212, 213, 480, 208, 151, 167, 212, - 213, 213, 157, 218, 219, 212, 213, 197, 198, 199, - 15, 16, 17, 197, 210, 214, 208, 207, 208, 207, - 208, 213, 197, 295, 208, 197, 3, 302, 5, 213, - 305, 185, 307, 308, 585, 103, 502, 312, 213, 212, - 525, 213, 197, 260, 463, 212, 260, 208, 41, 212, - 211, 586, 3, 208, 5, 327, 212, 347, 213, 347, - 182, 183, 184, 185, 186, 195, 196, 197, 198, 199, - 555, 210, 212, 295, 3, 210, 5, 207, 208, 212, - 352, 74, 548, 212, 503, 504, 189, 506, 507, 508, - 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, - 519, 520, 521, 522, 3, 524, 5, 640, 591, 210, - 41, 212, 210, 210, 212, 46, 651, 212, 3, 391, - 5, 577, 212, 3, 346, 5, 346, 346, 212, 210, - 352, 550, 3, 346, 5, 9, 129, 409, 671, 346, - 606, 212, 3, 74, 5, 611, 368, 3, 614, 5, - 683, 3, 3, 443, 5, 443, 540, 692, 210, 3, - 544, 5, 213, 212, 157, 214, 213, 213, 701, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 450, 213, - 213, 213, 213, 213, 213, 213, 458, 213, 208, 479, - 195, 196, 197, 198, 199, 694, 213, 653, 129, 213, - 213, 213, 207, 208, 197, 671, 213, 213, 5, 213, - 213, 213, 484, 213, 502, 208, 213, 213, 213, 213, - 213, 213, 494, 213, 213, 447, 157, 447, 447, 213, - 452, 450, 717, 455, 447, 455, 455, 447, 447, 458, - 447, 445, 455, 447, 447, 458, 447, 447, 455, 447, - 213, 458, 213, 213, 542, 213, 640, 210, 677, 643, - 212, 680, 212, 212, 210, 189, 197, 215, 213, 213, - 542, 484, 214, 214, 9, 694, 9, 208, 9, 9, - 9, 9, 213, 9, 9, 9, 208, 577, 213, 577, - 674, 212, 210, 210, 189, 722, 723, 212, 210, 683, - 214, 210, 215, 211, 187, 570, 6, 214, 214, 581, - 214, 213, 187, 603, 214, 9, 214, 701, 606, 591, - 542, 609, 214, 611, 214, 214, 214, 214, 214, 93, - 214, 167, 214, 214, 211, 214, 214, 609, 214, 207, - 189, 214, 188, 212, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 214, 214, 214, 214, 187, 214, - 214, 207, 208, 653, 214, 653, 214, 214, 214, 591, - 212, 214, 212, 3, 646, 3, 9, 6, 187, 214, - 212, 208, 212, 671, 5, 211, 214, 609, 3, 214, - 5, 6, 7, 8, 9, 10, 11, 214, 214, 189, - 210, 214, 214, 214, 212, 189, 678, 3, 214, 214, - 6, 7, 8, 9, 10, 11, 189, 212, 454, 34, - 339, 36, 479, 550, 646, 723, 53, 42, 452, 696, - 652, 46, 226, 652, 656, 299, 656, 656, 303, 652, - 82, 594, 309, 656, 596, 652, 356, 592, 63, 656, - -1, -1, -1, -1, 69, 70, 678, 72, 73, -1, - -1, 76, -1, -1, 79, -1, -1, 15, 16, 17, - -1, 86, 20, 21, -1, -1, -1, 73, -1, -1, - -1, -1, 97, -1, 99, 100, 101, 102, -1, -1, - -1, -1, 3, -1, 109, 6, 7, 8, 9, 10, - 11, -1, -1, -1, -1, -1, 121, -1, -1, -1, - -1, -1, -1, -1, 3, -1, -1, 6, 7, 8, - 9, 10, 11, -1, -1, 121, -1, -1, 143, -1, - -1, -1, -1, 148, 149, 150, -1, -1, 153, 154, - -1, 156, -1, -1, -1, 160, -1, -1, -1, -1, - -1, 166, -1, -1, 169, -1, 171, 153, -1, -1, - -1, -1, 73, -1, 179, 180, -1, -1, -1, -1, - 166, -1, -1, -1, -1, -1, -1, 192, -1, -1, - 195, 196, 197, -1, 73, 200, 201, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 192, -1, 213, 195, - 196, 197, -1, -1, 200, 201, -1, -1, -1, -1, - 121, -1, -1, 209, -1, -1, -1, 213, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 121, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 153, -1, -1, 193, 194, 195, 196, 197, - 198, 199, -1, -1, -1, 166, -1, -1, -1, 207, - 208, -1, 4, 5, 153, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 166, -1, -1, - -1, 192, -1, -1, 195, 196, 197, -1, -1, 200, - 201, -1, 34, -1, 36, -1, -1, -1, 209, -1, - 42, 43, 213, 192, 46, -1, 195, 196, 197, 51, - -1, 200, 201, -1, -1, -1, -1, -1, 60, -1, - -1, 63, -1, -1, 213, -1, -1, 69, 70, -1, - 72, -1, -1, -1, 76, -1, -1, 79, -1, -1, - -1, -1, -1, -1, 86, -1, -1, -1, -1, -1, - -1, 93, 94, -1, -1, 97, -1, 99, 100, 101, - 102, 103, -1, -1, -1, -1, -1, 109, -1, -1, - -1, -1, 114, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 4, 5, -1, -1, -1, -1, 131, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 143, -1, -1, -1, -1, 148, 149, 150, -1, - -1, -1, 154, 34, 156, 36, -1, -1, 160, -1, - -1, 42, 43, -1, -1, 46, -1, 169, -1, 171, - 51, -1, -1, -1, -1, -1, -1, 179, 180, 60, - -1, -1, 63, -1, -1, -1, -1, -1, 69, 70, - -1, 72, -1, -1, -1, 76, -1, -1, 79, -1, - -1, -1, -1, -1, -1, 86, 208, -1, -1, 211, - -1, -1, 93, 94, -1, -1, 97, -1, 99, 100, - 101, 102, 103, -1, -1, -1, -1, -1, 109, -1, - -1, -1, -1, 114, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 4, 5, -1, -1, -1, -1, - 131, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 143, -1, -1, -1, -1, 148, 149, 150, - -1, -1, -1, 154, 34, 156, 36, -1, -1, 160, - -1, -1, 42, 43, -1, -1, 46, -1, 169, -1, - 171, 51, -1, -1, -1, -1, -1, -1, 179, 180, - 60, -1, -1, 63, -1, -1, -1, -1, -1, 69, - 70, -1, 72, -1, -1, -1, 76, -1, -1, 79, - -1, -1, -1, -1, -1, -1, 86, 208, -1, -1, - 211, -1, -1, 93, -1, -1, -1, 97, -1, 99, - 100, 101, 102, 103, -1, -1, -1, -1, -1, 109, - -1, -1, -1, -1, 114, -1, -1, -1, -1, -1, - -1, -1, -1, 4, 5, -1, -1, -1, -1, -1, - -1, 131, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 143, -1, -1, -1, -1, 148, 149, - 150, -1, -1, 34, 154, 36, 156, -1, -1, -1, - 160, 42, -1, -1, -1, 46, -1, -1, -1, 169, - 51, 171, 15, 16, 17, 18, 19, 20, 21, 179, - 180, -1, 63, -1, -1, -1, -1, -1, 69, 70, - -1, 72, -1, -1, -1, 76, -1, -1, 79, -1, - -1, -1, -1, -1, -1, 86, -1, -1, 208, -1, - -1, 211, 93, -1, -1, -1, 97, -1, 99, 100, - 101, 102, -1, -1, -1, -1, -1, -1, 109, -1, - -1, -1, 15, 16, 17, 18, 19, 20, 21, -1, - -1, -1, 4, 5, -1, -1, -1, -1, -1, -1, - 131, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 143, -1, -1, -1, -1, 148, 149, 150, - -1, -1, 34, 154, 36, 156, -1, -1, -1, 160, - 42, -1, -1, -1, 46, -1, -1, -1, 169, 51, - 171, 15, 16, 17, 18, 19, 20, 21, 179, 180, - -1, 63, -1, -1, -1, -1, -1, 69, 70, -1, - 72, -1, -1, -1, 76, -1, -1, 79, -1, -1, - -1, -1, -1, -1, 86, -1, -1, 208, -1, -1, - 211, 93, -1, -1, -1, 97, -1, 99, 100, 101, - 102, -1, -1, -1, -1, -1, -1, 109, 191, 192, - 193, 194, 195, 196, 197, 198, 199, -1, -1, -1, - -1, 4, 5, -1, 207, 208, -1, -1, -1, 131, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 143, -1, -1, -1, -1, 148, 149, 150, -1, - -1, 34, 154, 36, 156, -1, -1, -1, 160, 42, - -1, -1, -1, 46, -1, -1, -1, 169, 51, 171, - 193, 194, 195, 196, 197, 198, 199, 179, 180, -1, - 63, -1, -1, -1, 207, 208, 69, 70, -1, 72, - -1, -1, -1, 76, -1, -1, 79, -1, -1, -1, - -1, -1, -1, 86, -1, -1, 208, -1, -1, 211, - 93, -1, -1, -1, 97, -1, 99, 100, 101, 102, - 5, -1, -1, -1, -1, -1, 109, -1, 192, 193, - 194, 195, 196, 197, 198, 199, -1, -1, -1, -1, - -1, -1, -1, 207, 208, -1, -1, -1, 131, 34, - -1, 36, -1, -1, -1, -1, -1, 42, -1, -1, - 143, 46, -1, -1, -1, 148, 149, 150, -1, -1, - -1, 154, -1, 156, -1, -1, -1, 160, 63, -1, - -1, -1, -1, -1, 69, 70, 169, 72, 171, -1, - -1, 76, -1, -1, 79, -1, 179, 180, -1, -1, - -1, 86, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 97, -1, 99, 100, 101, 102, -1, -1, - -1, -1, -1, -1, 109, 208, -1, -1, 211, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 4, 5, -1, -1, -1, -1, -1, -1, -1, -1, - 14, -1, -1, -1, -1, -1, -1, -1, 143, -1, - -1, -1, -1, 148, 149, 150, -1, -1, -1, 154, - 34, 156, 36, -1, -1, 160, -1, -1, 42, 43, - -1, -1, 46, -1, 169, -1, 171, 51, -1, -1, - -1, -1, -1, -1, 179, 180, 60, -1, -1, 63, - -1, -1, -1, -1, -1, 69, 70, -1, 72, -1, - -1, -1, 76, -1, -1, 79, -1, -1, -1, -1, - -1, -1, 86, 208, -1, -1, 211, -1, -1, 93, - -1, -1, -1, 97, -1, 99, 100, 101, 102, 103, - -1, -1, -1, -1, -1, 109, -1, -1, -1, -1, - 114, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 131, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 143, - 4, 5, -1, -1, 148, 149, 150, -1, -1, 13, - 154, -1, 156, -1, -1, -1, 160, -1, -1, -1, - -1, -1, -1, 167, -1, 169, -1, 171, -1, -1, - 34, -1, 36, -1, -1, 179, 180, -1, 42, 43, - -1, -1, 46, -1, -1, -1, -1, 51, -1, -1, - -1, -1, -1, -1, -1, -1, 60, -1, -1, 63, - -1, -1, -1, -1, 208, 69, 70, -1, 72, -1, - -1, -1, 76, -1, -1, 79, -1, -1, -1, -1, - -1, -1, 86, -1, -1, -1, -1, -1, -1, 93, - 94, -1, -1, 97, -1, 99, 100, 101, 102, 103, - -1, -1, -1, -1, -1, 109, -1, -1, -1, -1, - 114, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 5, -1, -1, -1, -1, 131, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 143, - -1, -1, -1, -1, 148, 149, 150, -1, -1, -1, - 154, 34, 156, 36, -1, -1, 160, -1, 41, 42, - -1, -1, -1, 46, -1, 169, -1, 171, -1, -1, - -1, -1, -1, -1, -1, 179, 180, -1, -1, -1, - 63, -1, -1, -1, -1, -1, 69, 70, -1, 72, - -1, 74, -1, 76, -1, -1, 79, -1, -1, -1, - -1, -1, -1, 86, 208, -1, -1, -1, -1, -1, - -1, 5, -1, -1, 97, -1, 99, 100, 101, 102, - -1, -1, -1, -1, -1, -1, 109, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 34, -1, 36, -1, -1, -1, 129, 41, 42, -1, - -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, - 143, -1, -1, -1, -1, 148, 149, 150, -1, 63, - -1, 154, -1, 156, 157, 69, 70, 160, 72, -1, - 74, -1, 76, -1, -1, 79, 169, -1, 171, -1, - -1, -1, 86, -1, -1, -1, 179, 180, -1, -1, - 5, -1, -1, 97, -1, 99, 100, 101, 102, -1, - -1, -1, -1, -1, 197, 109, -1, -1, -1, 24, - -1, -1, -1, -1, -1, 208, -1, -1, -1, 34, - -1, 36, -1, -1, -1, 129, -1, 42, -1, -1, - -1, 46, -1, -1, -1, -1, -1, -1, -1, 143, - -1, -1, -1, -1, 148, 149, 150, -1, 63, -1, - 154, -1, 156, 157, 69, 70, 160, 72, -1, -1, - -1, 76, -1, -1, 79, 169, -1, 171, -1, -1, - -1, 86, -1, -1, -1, 179, 180, -1, -1, 5, - -1, -1, 97, -1, 99, 100, 101, 102, -1, -1, - -1, -1, -1, 197, 109, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 208, -1, -1, -1, 34, -1, - 36, -1, -1, -1, -1, -1, 42, -1, -1, -1, - 46, -1, -1, -1, -1, -1, -1, -1, 143, -1, - -1, -1, -1, 148, 149, 150, -1, 63, -1, 154, - -1, 156, -1, 69, 70, 160, 72, -1, -1, -1, - 76, -1, -1, 79, 169, -1, 171, -1, -1, -1, - 86, -1, -1, -1, 179, 180, -1, -1, -1, -1, - -1, 97, -1, 99, 100, 101, 102, -1, -1, -1, - -1, -1, -1, 109, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 208, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 15, 16, 17, 18, 19, 20, 21, 143, 23, -1, - -1, -1, 148, 149, 150, -1, -1, -1, 154, -1, - 156, -1, -1, -1, 160, -1, -1, -1, -1, -1, - -1, -1, -1, 169, -1, 171, -1, -1, -1, -1, - -1, -1, -1, 179, 180, 15, 16, 17, 18, 19, - 20, 21, 22, 23, -1, -1, -1, -1, 188, -1, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - -1, -1, 208, -1, -1, -1, -1, 207, 208, -1, - -1, -1, -1, -1, 214, 15, 16, 17, 18, 19, - 20, 21, 22, 23, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 15, 16, 17, - 18, 19, 20, 21, 22, 23, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 15, 16, - 17, 18, 19, 20, 21, 22, 23, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 188, -1, 190, - 191, 192, 193, 194, 195, 196, 197, 198, 199, 15, - 16, 17, 18, 19, 20, 21, 207, 208, -1, -1, - -1, -1, -1, 214, -1, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, -1, -1, -1, -1, -1, - -1, -1, 207, 208, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 188, -1, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - -1, -1, -1, -1, -1, -1, -1, 207, 208, 209, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 188, -1, - 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, - -1, -1, -1, -1, -1, -1, -1, 207, 208, 209, - 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, - 198, 199, -1, -1, -1, -1, -1, -1, -1, 207, - 208, 188, -1, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, -1, -1, -1, 5, -1, -1, -1, - 207, 208, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, -1, 34, -1, 36, -1, -1, - -1, 207, 208, 42, 43, -1, -1, 46, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 60, -1, -1, 63, -1, -1, -1, -1, -1, - 69, 70, -1, 72, -1, -1, -1, 76, -1, -1, - 79, -1, -1, -1, -1, -1, -1, 86, -1, -1, - -1, -1, -1, -1, -1, 5, -1, -1, 97, -1, - 99, 100, 101, 102, 103, -1, -1, 106, -1, -1, - 109, -1, -1, -1, 113, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 34, -1, 36, -1, -1, -1, - -1, -1, 42, -1, -1, -1, 46, -1, -1, -1, - -1, -1, -1, -1, 143, -1, -1, -1, -1, 148, - 149, 150, -1, 63, -1, 154, -1, 156, -1, 69, - 70, 160, 72, -1, -1, -1, 76, -1, -1, 79, - 169, 5, 171, -1, -1, -1, 86, -1, -1, -1, - 179, 180, -1, -1, -1, -1, -1, 97, -1, 99, - 100, 101, 102, -1, -1, -1, -1, -1, -1, 109, - 34, -1, 36, -1, -1, -1, -1, -1, 42, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 63, - -1, -1, -1, 143, -1, 69, 70, -1, 148, 149, - 150, -1, 76, -1, 154, 79, 156, -1, -1, -1, - 160, -1, 86, -1, -1, -1, -1, -1, -1, 169, - -1, 171, -1, -1, -1, 99, 100, 101, 102, 179, - 180, -1, -1, -1, -1, 109, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 148, 149, 150, -1, -1, -1, - 154, -1, -1, -1, -1, -1, 160, -1, -1, -1, - -1, -1, -1, -1, -1, 169, -1, 171, -1, -1, - -1, -1, -1, -1, 25, 179, 180, 28, 29, 30, - 31, 32, 33, -1, 35, -1, -1, 38, -1, 40, - -1, -1, -1, 44, 45, -1, 47, 48, 49, 50, - -1, 52, 53, 54, 55, 56, 57, 58, 59, -1, - 61, -1, -1, 64, 65, 66, 67, 68, -1, -1, - 71, -1, -1, -1, 75, -1, 77, 78, -1, 80, - 81, 82, 83, 84, 85, -1, 87, 88, 89, 90, - 91, 92, -1, -1, 95, -1, -1, 98, -1, -1, - -1, -1, -1, 104, 105, -1, 107, 108, -1, 110, - 111, -1, -1, -1, 115, 116, 117, 118, 119, 120, - -1, 122, 123, 124, 125, 126, 127, 128, -1, 130, - -1, 132, -1, 134, 135, 136, 137, 138, 139, 140, - 141, 142, -1, 144, 145, 146, 147, -1, -1, -1, - -1, 152, -1, -1, 155, -1, -1, 158, 159, -1, - -1, 162, 163, 164, 165, -1, -1, 168, -1, 170, - -1, 172, 173, 174, 175, 176, 177, 178, -1, -1, - 181 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_int16 yystos[] = -{ - 0, 217, 219, 0, 4, 5, 14, 34, 36, 42, - 43, 46, 51, 60, 63, 69, 70, 72, 76, 79, - 86, 93, 97, 99, 100, 101, 102, 103, 109, 114, - 131, 143, 148, 149, 150, 154, 156, 160, 169, 171, - 179, 180, 208, 218, 225, 226, 228, 229, 230, 231, - 234, 235, 241, 242, 253, 267, 271, 273, 274, 275, - 276, 277, 280, 281, 284, 286, 287, 288, 289, 291, - 292, 293, 294, 295, 297, 299, 317, 318, 319, 320, - 208, 322, 325, 326, 3, 5, 213, 3, 5, 3, - 5, 269, 99, 272, 9, 3, 5, 272, 3, 213, - 213, 272, 273, 3, 269, 3, 269, 273, 25, 28, - 29, 30, 31, 32, 33, 35, 38, 40, 44, 45, - 47, 48, 49, 50, 52, 53, 54, 55, 56, 57, - 58, 59, 61, 64, 65, 66, 67, 68, 71, 75, - 77, 78, 80, 81, 82, 83, 84, 85, 87, 88, - 89, 90, 91, 92, 95, 98, 104, 105, 107, 108, - 110, 111, 115, 116, 117, 118, 119, 120, 122, 123, - 124, 125, 126, 127, 128, 130, 132, 134, 135, 136, - 137, 138, 139, 140, 141, 142, 144, 145, 146, 147, - 152, 155, 158, 159, 162, 163, 164, 165, 168, 170, - 172, 173, 174, 175, 176, 177, 178, 181, 243, 245, - 316, 212, 221, 221, 167, 69, 106, 113, 160, 169, - 233, 253, 274, 280, 286, 290, 297, 317, 320, 212, - 212, 210, 210, 212, 210, 212, 224, 212, 189, 285, - 210, 298, 299, 298, 298, 3, 5, 41, 74, 129, - 157, 197, 213, 247, 270, 300, 301, 314, 253, 317, - 318, 320, 298, 212, 27, 52, 66, 71, 327, 328, - 322, 103, 9, 210, 212, 3, 318, 210, 161, 210, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, - 213, 213, 213, 187, 209, 13, 94, 225, 232, 235, - 274, 276, 277, 288, 289, 292, 211, 241, 242, 3, - 3, 5, 3, 5, 3, 3, 210, 314, 278, 220, - 133, 282, 286, 3, 5, 210, 223, 296, 300, 300, - 215, 208, 213, 240, 298, 213, 187, 209, 5, 214, - 250, 251, 252, 270, 189, 214, 260, 213, 263, 9, - 9, 12, 246, 270, 3, 6, 7, 8, 9, 10, - 11, 73, 121, 153, 166, 192, 195, 196, 197, 200, - 201, 213, 256, 257, 258, 256, 259, 9, 9, 244, - 259, 258, 9, 9, 258, 9, 258, 256, 239, 242, - 297, 258, 254, 255, 256, 9, 316, 9, 258, 318, - 254, 256, 318, 182, 183, 184, 185, 186, 315, 318, - 318, 246, 6, 7, 321, 9, 318, 245, 208, 213, - 212, 210, 224, 297, 211, 241, 279, 219, 189, 112, - 241, 265, 283, 212, 210, 223, 211, 225, 242, 295, - 300, 214, 259, 197, 209, 256, 236, 237, 238, 239, - 26, 62, 151, 185, 329, 330, 328, 210, 211, 187, - 215, 6, 227, 211, 241, 261, 265, 211, 242, 262, - 265, 214, 214, 214, 213, 256, 256, 256, 256, 256, - 256, 256, 297, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 188, 190, 191, 192, 193, 194, 195, 196, - 197, 198, 199, 207, 208, 187, 214, 214, 214, 187, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 297, 197, 213, 240, 247, 270, 306, 308, 309, 214, - 187, 214, 214, 214, 214, 187, 214, 214, 214, 214, - 214, 214, 214, 214, 207, 214, 214, 214, 245, 9, - 222, 300, 310, 224, 289, 211, 189, 297, 317, 212, - 211, 242, 266, 267, 211, 231, 211, 224, 209, 209, - 214, 187, 187, 214, 167, 323, 324, 252, 258, 6, - 214, 297, 320, 214, 212, 212, 297, 214, 197, 213, - 240, 247, 302, 304, 305, 256, 256, 3, 256, 256, - 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, - 256, 256, 256, 256, 256, 3, 256, 258, 9, 308, - 296, 197, 236, 247, 307, 308, 213, 240, 255, 258, - 6, 214, 221, 187, 300, 212, 223, 224, 24, 239, - 330, 326, 211, 323, 306, 312, 313, 212, 268, 270, - 304, 296, 197, 236, 247, 303, 304, 214, 213, 240, - 189, 209, 308, 296, 214, 308, 214, 236, 214, 224, - 211, 300, 211, 5, 189, 311, 187, 212, 210, 214, - 304, 296, 214, 308, 214, 256, 236, 256, 308, 214, - 224, 212, 259, 312, 248, 308, 214, 40, 53, 211, - 249, 258, 189, 189, 212, 264, 265, 264, 212 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_int16 yyr1[] = -{ - 0, 216, 217, 218, 218, 219, 220, 219, 219, 219, - 219, 219, 219, 219, 219, 221, 221, 222, 221, 221, - 221, 221, 221, 221, 221, 221, 223, 223, 224, 224, - 225, 225, 225, 225, 225, 225, 225, 226, 227, 227, - 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, - 230, 231, 232, 233, 233, 234, 235, 236, 236, 237, - 237, 238, 238, 239, 239, 240, 240, 240, 241, 241, - 242, 243, 243, 243, 244, 244, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - 245, 245, 245, 245, 245, 245, 246, 246, 247, 247, - 247, 247, 248, 248, 249, 249, 250, 250, 250, 251, - 251, 252, 252, 253, 254, 254, 255, 255, 256, 256, - 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, - 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, - 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, - 256, 256, 256, 256, 256, 256, 256, 256, 256, 257, - 257, 258, 259, 260, 260, 261, 261, 262, 262, 263, - 263, 264, 264, 265, 265, 266, 267, 267, 268, 268, - 269, 269, 269, 270, 270, 271, 271, 271, 271, 271, - 271, 271, 271, 271, 271, 271, 272, 272, 273, 273, - 273, 273, 273, 273, 273, 273, 273, 274, 274, 275, - 276, 277, 278, 278, 279, 280, 280, 281, 282, 282, - 283, 283, 284, 284, 285, 285, 286, 286, 287, 288, - 288, 288, 289, 289, 290, 290, 291, 292, 293, 293, - 293, 294, 295, 296, 296, 297, 297, 298, 298, 299, - 299, 299, 300, 300, 300, 301, 301, 301, 301, 302, - 302, 302, 303, 303, 304, 304, 305, 305, 305, 305, - 305, 306, 306, 306, 307, 307, 308, 308, 309, 309, - 309, 309, 309, 309, 310, 310, 311, 311, 312, 313, - 313, 314, 314, 315, 315, 315, 315, 315, 316, 316, - 316, 317, 318, 318, 318, 318, 318, 318, 318, 318, - 318, 318, 319, 320, 320, 321, 321, 321, 322, 322, - 323, 323, 324, 325, 326, 326, 327, 327, 328, 328, - 328, 328, 329, 329, 330, 330, 330, 330 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_int8 yyr2[] = -{ - 0, 2, 2, 0, 2, 0, 0, 6, 2, 2, - 3, 2, 2, 2, 2, 0, 2, 0, 6, 2, - 3, 2, 2, 2, 2, 2, 0, 2, 0, 1, - 1, 2, 2, 1, 2, 1, 1, 6, 1, 2, - 1, 2, 1, 2, 1, 2, 2, 2, 2, 4, - 3, 3, 5, 2, 2, 3, 4, 0, 1, 1, - 3, 1, 3, 3, 2, 3, 3, 2, 0, 1, - 3, 1, 3, 4, 1, 3, 0, 1, 4, 1, - 1, 1, 1, 1, 4, 4, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, - 4, 1, 1, 1, 4, 4, 1, 1, 1, 1, - 4, 4, 4, 4, 4, 1, 4, 1, 1, 4, - 1, 4, 1, 1, 4, 4, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 1, 1, 1, 4, 4, 1, 1, 1, 1, - 1, 6, 1, 4, 1, 1, 1, 4, 1, 1, - 1, 4, 4, 4, 4, 1, 1, 4, 4, 4, - 1, 1, 4, 4, 4, 1, 1, 1, 1, 1, - 1, 1, 0, 2, 4, 3, 0, 2, 1, 1, - 3, 3, 1, 5, 1, 3, 0, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 5, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, - 2, 2, 2, 3, 3, 5, 5, 4, 3, 1, - 3, 1, 1, 0, 2, 4, 3, 2, 2, 0, - 2, 2, 1, 3, 2, 1, 3, 2, 0, 1, - 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 2, - 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, - 5, 2, 0, 2, 2, 2, 2, 2, 2, 3, - 2, 3, 5, 5, 0, 2, 2, 2, 2, 6, - 8, 2, 2, 2, 2, 2, 2, 5, 1, 1, - 1, 1, 1, 0, 2, 2, 3, 0, 1, 2, - 2, 2, 3, 2, 1, 1, 3, 2, 4, 3, - 2, 1, 3, 2, 0, 1, 3, 2, 1, 3, - 4, 3, 2, 1, 3, 2, 0, 1, 1, 3, - 2, 1, 3, 4, 1, 3, 0, 2, 2, 1, - 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 1, 1, 1, 2, 1, 2, 1, - 2, 4, 5, 5, 10, 1, 3, 1, 0, 2, - 0, 2, 4, 6, 0, 3, 1, 3, 4, 1, - 1, 1, 1, 3, 1, 1, 1, 1 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ - do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ - while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*-----------------------------------. -| Print this symbol's value on YYO. | -`-----------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyoutput = yyo; - YYUSE (yyoutput); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyo, yytoknum[yytype], *yyvaluep); -# endif - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - -/*---------------------------. -| Print this symbol on YYO. | -`---------------------------*/ - -static void -yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyo, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyo, yytype, yyvaluep); - YYFPRINTF (yyo, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[+yyssp[yyi + 1 - yynrhs]], - &yyvsp[(yyi + 1) - (yynrhs)] - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) -# else -/* Return the length of YYSTR. */ -static YYPTRDIFF_T -yystrlen (const char *yystr) -{ - YYPTRDIFF_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYPTRDIFF_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYPTRDIFF_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - else - goto append; - - append: - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (yyres) - return yystpcpy (yyres, yystr) - yyres; - else - return yystrlen (yystr); -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, - yy_state_t *yyssp, int yytoken) -{ - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat: reported tokens (one for the "unexpected", - one per "expected"). */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Actual size of YYARG. */ - int yycount = 0; - /* Cumulated lengths of YYARG. */ - YYPTRDIFF_T yysize = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[+*yyssp]; - YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - yysize = yysize0; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYPTRDIFF_T yysize1 - = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - default: /* Avoid compiler warnings. */ - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - /* Don't count the "%s"s in the final size, but reserve room for - the terminator. */ - YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1; - if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) - yysize = yysize1; - else - return 2; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - ++yyp; - ++yyformat; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - yy_state_fast_t yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yy_state_t yyssa[YYINITDEPTH]; - yy_state_t *yyss; - yy_state_t *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYPTRDIFF_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - - -/*------------------------------------------------------------. -| yynewstate -- push a new state, which is found in yystate. | -`------------------------------------------------------------*/ -yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - -/*--------------------------------------------------------------------. -| yysetstate -- set current state (the top of the stack) to yystate. | -`--------------------------------------------------------------------*/ -yysetstate: - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - YY_ASSERT (0 <= yystate && yystate < YYNSTATES); - YY_IGNORE_USELESS_CAST_BEGIN - *yyssp = YY_CAST (yy_state_t, yystate); - YY_IGNORE_USELESS_CAST_END - - if (yyss + yystacksize - 1 <= yyssp) -#if !defined yyoverflow && !defined YYSTACK_RELOCATE - goto yyexhaustedlab; -#else - { - /* Get the current used size of the three stacks, in elements. */ - YYPTRDIFF_T yysize = yyssp - yyss + 1; - -# if defined yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - yy_state_t *yyss1 = yyss; - YYSTYPE *yyvs1 = yyvs; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * YYSIZEOF (*yyssp), - &yyvs1, yysize * YYSIZEOF (*yyvsp), - &yystacksize); - yyss = yyss1; - yyvs = yyvs1; - } -# else /* defined YYSTACK_RELOCATE */ - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yy_state_t *yyss1 = yyss; - union yyalloc *yyptr = - YY_CAST (union yyalloc *, - YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YY_IGNORE_USELESS_CAST_BEGIN - YYDPRINTF ((stderr, "Stack size increased to %ld\n", - YY_CAST (long, yystacksize))); - YY_IGNORE_USELESS_CAST_END - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } -#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - /* Discard the shifted token. */ - yychar = YYEMPTY; - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: -#line 328 "parser.y" - { fix_incomplete(); - check_statements((yyvsp[-1].stmt_list), FALSE); - check_all_user_types((yyvsp[-1].stmt_list)); - write_header((yyvsp[-1].stmt_list)); - write_id_data((yyvsp[-1].stmt_list)); - write_proxies((yyvsp[-1].stmt_list)); - write_client((yyvsp[-1].stmt_list)); - write_server((yyvsp[-1].stmt_list)); - write_regscript((yyvsp[-1].stmt_list)); -#ifndef __REACTOS__ - write_typelib_regscript((yyvsp[-1].stmt_list)); -#endif - write_dlldata((yyvsp[-1].stmt_list)); - write_local_stubs((yyvsp[-1].stmt_list)); - } -#line 2767 "parser.tab.c" - break; - - case 5: -#line 347 "parser.y" - { (yyval.stmt_list) = NULL; } -#line 2773 "parser.tab.c" - break; - - case 6: -#line 348 "parser.y" - { push_namespace((yyvsp[-1].str)); } -#line 2779 "parser.tab.c" - break; - - case 7: -#line 349 "parser.y" - { pop_namespace((yyvsp[-4].str)); (yyval.stmt_list) = append_statements((yyvsp[-5].stmt_list), (yyvsp[-1].stmt_list)); } -#line 2785 "parser.tab.c" - break; - - case 8: -#line 350 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_reference((yyvsp[0].type))); } -#line 2791 "parser.tab.c" - break; - - case 9: -#line 351 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type))); } -#line 2797 "parser.tab.c" - break; - - case 10: -#line 352 "parser.y" - { (yyval.stmt_list) = (yyvsp[-2].stmt_list); - reg_type((yyvsp[-1].type), (yyvsp[-1].type)->name, current_namespace, 0); - } -#line 2805 "parser.tab.c" - break; - - case 11: -#line 355 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type))); - reg_type((yyvsp[0].type), (yyvsp[0].type)->name, current_namespace, 0); - } -#line 2813 "parser.tab.c" - break; - - case 12: -#line 358 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_module((yyvsp[0].type))); } -#line 2819 "parser.tab.c" - break; - - case 13: -#line 359 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_library((yyvsp[0].typelib))); } -#line 2825 "parser.tab.c" - break; - - case 14: -#line 360 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement)); } -#line 2831 "parser.tab.c" - break; - - case 15: -#line 363 "parser.y" - { (yyval.stmt_list) = NULL; } -#line 2837 "parser.tab.c" - break; - - case 16: -#line 364 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_reference((yyvsp[0].type))); } -#line 2843 "parser.tab.c" - break; - - case 17: -#line 365 "parser.y" - { push_namespace((yyvsp[-1].str)); } -#line 2849 "parser.tab.c" - break; - - case 18: -#line 366 "parser.y" - { pop_namespace((yyvsp[-4].str)); (yyval.stmt_list) = append_statements((yyvsp[-5].stmt_list), (yyvsp[-1].stmt_list)); } -#line 2855 "parser.tab.c" - break; - - case 19: -#line 367 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type))); } -#line 2861 "parser.tab.c" - break; - - case 20: -#line 368 "parser.y" - { (yyval.stmt_list) = (yyvsp[-2].stmt_list); reg_type((yyvsp[-1].type), (yyvsp[-1].type)->name, current_namespace, 0); } -#line 2867 "parser.tab.c" - break; - - case 21: -#line 369 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_type_decl((yyvsp[0].type))); - reg_type((yyvsp[0].type), (yyvsp[0].type)->name, current_namespace, 0); - } -#line 2875 "parser.tab.c" - break; - - case 22: -#line 372 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_module((yyvsp[0].type))); } -#line 2881 "parser.tab.c" - break; - - case 23: -#line 373 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement)); } -#line 2887 "parser.tab.c" - break; - - case 24: -#line 374 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_importlib((yyvsp[0].str))); } -#line 2893 "parser.tab.c" - break; - - case 25: -#line 375 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), make_statement_library((yyvsp[0].typelib))); } -#line 2899 "parser.tab.c" - break; - - case 26: -#line 378 "parser.y" - { (yyval.stmt_list) = NULL; } -#line 2905 "parser.tab.c" - break; - - case 27: -#line 379 "parser.y" - { (yyval.stmt_list) = append_statement((yyvsp[-1].stmt_list), (yyvsp[0].statement)); } -#line 2911 "parser.tab.c" - break; - - case 30: -#line 387 "parser.y" - { (yyval.statement) = make_statement_cppquote((yyvsp[0].str)); } -#line 2917 "parser.tab.c" - break; - - case 31: -#line 388 "parser.y" - { (yyval.statement) = make_statement_type_decl((yyvsp[-1].type)); } -#line 2923 "parser.tab.c" - break; - - case 32: -#line 389 "parser.y" - { (yyval.statement) = make_statement_declaration((yyvsp[-1].var)); } -#line 2929 "parser.tab.c" - break; - - case 33: -#line 390 "parser.y" - { (yyval.statement) = make_statement_import((yyvsp[0].str)); } -#line 2935 "parser.tab.c" - break; - - case 34: -#line 391 "parser.y" - { (yyval.statement) = (yyvsp[-1].statement); } -#line 2941 "parser.tab.c" - break; - - case 35: -#line 392 "parser.y" - { (yyval.statement) = make_statement_pragma((yyvsp[0].str)); } -#line 2947 "parser.tab.c" - break; - - case 36: -#line 393 "parser.y" - { (yyval.statement) = NULL; } -#line 2953 "parser.tab.c" - break; - - case 37: -#line 397 "parser.y" - { - int result; - (yyval.statement) = NULL; - result = do_warning((yyvsp[-3].str), (yyvsp[-1].warning_list)); - if(!result) - error_loc("expected \"disable\" or \"enable\"\n"); - } -#line 2965 "parser.tab.c" - break; - - case 38: -#line 407 "parser.y" - { (yyval.warning_list) = append_warning(NULL, (yyvsp[0].num)); } -#line 2971 "parser.tab.c" - break; - - case 39: -#line 408 "parser.y" - { (yyval.warning_list) = append_warning((yyvsp[-1].warning_list), (yyvsp[0].num)); } -#line 2977 "parser.tab.c" - break; - - case 41: -#line 413 "parser.y" - { (yyval.type) = type_new_enum((yyvsp[0].str), current_namespace, FALSE, NULL); } -#line 2983 "parser.tab.c" - break; - - case 43: -#line 415 "parser.y" - { (yyval.type) = type_new_struct((yyvsp[0].str), current_namespace, FALSE, NULL); } -#line 2989 "parser.tab.c" - break; - - case 45: -#line 417 "parser.y" - { (yyval.type) = type_new_nonencapsulated_union((yyvsp[0].str), FALSE, NULL); } -#line 2995 "parser.tab.c" - break; - - case 46: -#line 418 "parser.y" - { (yyval.type) = (yyvsp[0].type); (yyval.type)->attrs = check_enum_attrs((yyvsp[-1].attr_list)); } -#line 3001 "parser.tab.c" - break; - - case 47: -#line 419 "parser.y" - { (yyval.type) = (yyvsp[0].type); (yyval.type)->attrs = check_struct_attrs((yyvsp[-1].attr_list)); } -#line 3007 "parser.tab.c" - break; - - case 48: -#line 420 "parser.y" - { (yyval.type) = (yyvsp[0].type); (yyval.type)->attrs = check_union_attrs((yyvsp[-1].attr_list)); } -#line 3013 "parser.tab.c" - break; - - case 49: -#line 423 "parser.y" - { (yyval.str) = (yyvsp[-1].str); } -#line 3019 "parser.tab.c" - break; - - case 50: -#line 425 "parser.y" - { assert(yychar == YYEMPTY); - (yyval.import) = xmalloc(sizeof(struct _import_t)); - (yyval.import)->name = (yyvsp[-1].str); - (yyval.import)->import_performed = do_import((yyvsp[-1].str)); - if (!(yyval.import)->import_performed) yychar = aEOF; - } -#line 3030 "parser.tab.c" - break; - - case 51: -#line 433 "parser.y" - { (yyval.str) = (yyvsp[-2].import)->name; - if ((yyvsp[-2].import)->import_performed) pop_import(); - free((yyvsp[-2].import)); - } -#line 3039 "parser.tab.c" - break; - - case 52: -#line 441 "parser.y" - { (yyval.str) = (yyvsp[-2].str); if(!parse_only) add_importlib((yyvsp[-2].str)); } -#line 3045 "parser.tab.c" - break; - - case 53: -#line 447 "parser.y" - { (yyval.str) = (yyvsp[0].str); } -#line 3051 "parser.tab.c" - break; - - case 54: -#line 448 "parser.y" - { (yyval.str) = (yyvsp[0].str); } -#line 3057 "parser.tab.c" - break; - - case 55: -#line 450 "parser.y" - { (yyval.typelib) = make_library((yyvsp[-1].str), check_library_attrs((yyvsp[-1].str), (yyvsp[-2].attr_list))); -/* ifdef __REACTOS__ */ - if (!parse_only) start_typelib((yyval.typelib)); -/* else - if (!parse_only && do_typelib) current_typelib = $$; -*/ - } -#line 3069 "parser.tab.c" - break; - - case 56: -#line 460 "parser.y" - { (yyval.typelib) = (yyvsp[-3].typelib); - (yyval.typelib)->stmts = (yyvsp[-2].stmt_list); - if (!parse_only) end_typelib(); - } -#line 3078 "parser.tab.c" - break; - - case 57: -#line 469 "parser.y" - { (yyval.var_list) = NULL; } -#line 3084 "parser.tab.c" - break; - - case 59: -#line 473 "parser.y" - { check_arg_attrs((yyvsp[0].var)); (yyval.var_list) = append_var( NULL, (yyvsp[0].var) ); } -#line 3090 "parser.tab.c" - break; - - case 60: -#line 474 "parser.y" - { check_arg_attrs((yyvsp[0].var)); (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[0].var) ); } -#line 3096 "parser.tab.c" - break; - - case 62: -#line 478 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[-2].var_list), make_var(strdup("...")) ); } -#line 3102 "parser.tab.c" - break; - - case 63: -#line 482 "parser.y" - { if ((yyvsp[-1].declspec)->stgclass != STG_NONE && (yyvsp[-1].declspec)->stgclass != STG_REGISTER) - error_loc("invalid storage class for function parameter\n"); - (yyval.var) = declare_var((yyvsp[-2].attr_list), (yyvsp[-1].declspec), (yyvsp[0].declarator), TRUE); - free((yyvsp[-1].declspec)); free((yyvsp[0].declarator)); - } -#line 3112 "parser.tab.c" - break; - - case 64: -#line 487 "parser.y" - { if ((yyvsp[-1].declspec)->stgclass != STG_NONE && (yyvsp[-1].declspec)->stgclass != STG_REGISTER) - error_loc("invalid storage class for function parameter\n"); - (yyval.var) = declare_var(NULL, (yyvsp[-1].declspec), (yyvsp[0].declarator), TRUE); - free((yyvsp[-1].declspec)); free((yyvsp[0].declarator)); - } -#line 3122 "parser.tab.c" - break; - - case 65: -#line 494 "parser.y" - { (yyval.expr) = (yyvsp[-1].expr); - if (!(yyval.expr)->is_const || (yyval.expr)->cval <= 0) - error_loc("array dimension is not a positive integer constant\n"); - } -#line 3131 "parser.tab.c" - break; - - case 66: -#line 498 "parser.y" - { (yyval.expr) = make_expr(EXPR_VOID); } -#line 3137 "parser.tab.c" - break; - - case 67: -#line 499 "parser.y" - { (yyval.expr) = make_expr(EXPR_VOID); } -#line 3143 "parser.tab.c" - break; - - case 68: -#line 502 "parser.y" - { (yyval.attr_list) = NULL; } -#line 3149 "parser.tab.c" - break; - - case 70: -#line 507 "parser.y" - { (yyval.attr_list) = (yyvsp[-1].attr_list); } -#line 3155 "parser.tab.c" - break; - - case 71: -#line 510 "parser.y" - { (yyval.attr_list) = append_attr( NULL, (yyvsp[0].attr) ); } -#line 3161 "parser.tab.c" - break; - - case 72: -#line 511 "parser.y" - { (yyval.attr_list) = append_attr( (yyvsp[-2].attr_list), (yyvsp[0].attr) ); } -#line 3167 "parser.tab.c" - break; - - case 73: -#line 512 "parser.y" - { (yyval.attr_list) = append_attr( (yyvsp[-3].attr_list), (yyvsp[0].attr) ); } -#line 3173 "parser.tab.c" - break; - - case 74: -#line 515 "parser.y" - { (yyval.str_list) = append_str( NULL, (yyvsp[0].str) ); } -#line 3179 "parser.tab.c" - break; - - case 75: -#line 516 "parser.y" - { (yyval.str_list) = append_str( (yyvsp[-2].str_list), (yyvsp[0].str) ); } -#line 3185 "parser.tab.c" - break; - - case 76: -#line 519 "parser.y" - { (yyval.attr) = NULL; } -#line 3191 "parser.tab.c" - break; - - case 77: -#line 520 "parser.y" - { (yyval.attr) = make_attr(ATTR_AGGREGATABLE); } -#line 3197 "parser.tab.c" - break; - - case 78: -#line 521 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ANNOTATION, (yyvsp[-1].str)); } -#line 3203 "parser.tab.c" - break; - - case 79: -#line 522 "parser.y" - { (yyval.attr) = make_attr(ATTR_APPOBJECT); } -#line 3209 "parser.tab.c" - break; - - case 80: -#line 523 "parser.y" - { (yyval.attr) = make_attr(ATTR_ASYNC); } -#line 3215 "parser.tab.c" - break; - - case 81: -#line 524 "parser.y" - { (yyval.attr) = make_attr(ATTR_AUTO_HANDLE); } -#line 3221 "parser.tab.c" - break; - - case 82: -#line 525 "parser.y" - { (yyval.attr) = make_attr(ATTR_BINDABLE); } -#line 3227 "parser.tab.c" - break; - - case 83: -#line 526 "parser.y" - { (yyval.attr) = make_attr(ATTR_BROADCAST); } -#line 3233 "parser.tab.c" - break; - - case 84: -#line 527 "parser.y" - { (yyval.attr) = make_attrp(ATTR_CALLAS, (yyvsp[-1].var)); } -#line 3239 "parser.tab.c" - break; - - case 85: -#line 528 "parser.y" - { (yyval.attr) = make_attrp(ATTR_CASE, (yyvsp[-1].expr_list)); } -#line 3245 "parser.tab.c" - break; - - case 86: -#line 529 "parser.y" - { (yyval.attr) = make_attr(ATTR_CODE); } -#line 3251 "parser.tab.c" - break; - - case 87: -#line 530 "parser.y" - { (yyval.attr) = make_attr(ATTR_COMMSTATUS); } -#line 3257 "parser.tab.c" - break; - - case 88: -#line 531 "parser.y" - { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); } -#line 3263 "parser.tab.c" - break; - - case 89: -#line 532 "parser.y" - { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_DONT_SERIALIZE */ } -#line 3269 "parser.tab.c" - break; - - case 90: -#line 533 "parser.y" - { (yyval.attr) = make_attrv(ATTR_CONTEXTHANDLE, 0); /* RPC_CONTEXT_HANDLE_SERIALIZE */ } -#line 3275 "parser.tab.c" - break; - - case 91: -#line 534 "parser.y" - { (yyval.attr) = make_attr(ATTR_CONTROL); } -#line 3281 "parser.tab.c" - break; - - case 92: -#line 535 "parser.y" - { (yyval.attr) = make_attr(ATTR_DECODE); } -#line 3287 "parser.tab.c" - break; - - case 93: -#line 536 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULT); } -#line 3293 "parser.tab.c" - break; - - case 94: -#line 537 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULTBIND); } -#line 3299 "parser.tab.c" - break; - - case 95: -#line 538 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULTCOLLELEM); } -#line 3305 "parser.tab.c" - break; - - case 96: -#line 539 "parser.y" - { (yyval.attr) = make_attrp(ATTR_DEFAULTVALUE, (yyvsp[-1].expr)); } -#line 3311 "parser.tab.c" - break; - - case 97: -#line 540 "parser.y" - { (yyval.attr) = make_attr(ATTR_DEFAULTVTABLE); } -#line 3317 "parser.tab.c" - break; - - case 98: -#line 541 "parser.y" - { (yyval.attr) = make_attr(ATTR_DISABLECONSISTENCYCHECK); } -#line 3323 "parser.tab.c" - break; - - case 99: -#line 542 "parser.y" - { (yyval.attr) = make_attr(ATTR_DISPLAYBIND); } -#line 3329 "parser.tab.c" - break; - - case 100: -#line 543 "parser.y" - { (yyval.attr) = make_attrp(ATTR_DLLNAME, (yyvsp[-1].str)); } -#line 3335 "parser.tab.c" - break; - - case 101: -#line 544 "parser.y" - { (yyval.attr) = make_attr(ATTR_DUAL); } -#line 3341 "parser.tab.c" - break; - - case 102: -#line 545 "parser.y" - { (yyval.attr) = make_attr(ATTR_ENABLEALLOCATE); } -#line 3347 "parser.tab.c" - break; - - case 103: -#line 546 "parser.y" - { (yyval.attr) = make_attr(ATTR_ENCODE); } -#line 3353 "parser.tab.c" - break; - - case 104: -#line 547 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ENDPOINT, (yyvsp[-1].str_list)); } -#line 3359 "parser.tab.c" - break; - - case 105: -#line 548 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ENTRY, (yyvsp[-1].expr)); } -#line 3365 "parser.tab.c" - break; - - case 106: -#line 549 "parser.y" - { (yyval.attr) = make_attr(ATTR_EXPLICIT_HANDLE); } -#line 3371 "parser.tab.c" - break; - - case 107: -#line 550 "parser.y" - { (yyval.attr) = make_attr(ATTR_FAULTSTATUS); } -#line 3377 "parser.tab.c" - break; - - case 108: -#line 551 "parser.y" - { (yyval.attr) = make_attr(ATTR_FORCEALLOCATE); } -#line 3383 "parser.tab.c" - break; - - case 109: -#line 552 "parser.y" - { (yyval.attr) = make_attr(ATTR_HANDLE); } -#line 3389 "parser.tab.c" - break; - - case 110: -#line 553 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPCONTEXT, (yyvsp[-1].expr)); } -#line 3395 "parser.tab.c" - break; - - case 111: -#line 554 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPFILE, (yyvsp[-1].str)); } -#line 3401 "parser.tab.c" - break; - - case 112: -#line 555 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPSTRING, (yyvsp[-1].str)); } -#line 3407 "parser.tab.c" - break; - - case 113: -#line 556 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPSTRINGCONTEXT, (yyvsp[-1].expr)); } -#line 3413 "parser.tab.c" - break; - - case 114: -#line 557 "parser.y" - { (yyval.attr) = make_attrp(ATTR_HELPSTRINGDLL, (yyvsp[-1].str)); } -#line 3419 "parser.tab.c" - break; - - case 115: -#line 558 "parser.y" - { (yyval.attr) = make_attr(ATTR_HIDDEN); } -#line 3425 "parser.tab.c" - break; - - case 116: -#line 559 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ID, (yyvsp[-1].expr)); } -#line 3431 "parser.tab.c" - break; - - case 117: -#line 560 "parser.y" - { (yyval.attr) = make_attr(ATTR_IDEMPOTENT); } -#line 3437 "parser.tab.c" - break; - - case 118: -#line 561 "parser.y" - { (yyval.attr) = make_attr(ATTR_IGNORE); } -#line 3443 "parser.tab.c" - break; - - case 119: -#line 562 "parser.y" - { (yyval.attr) = make_attrp(ATTR_IIDIS, (yyvsp[-1].expr)); } -#line 3449 "parser.tab.c" - break; - - case 120: -#line 563 "parser.y" - { (yyval.attr) = make_attr(ATTR_IMMEDIATEBIND); } -#line 3455 "parser.tab.c" - break; - - case 121: -#line 564 "parser.y" - { (yyval.attr) = make_attrp(ATTR_IMPLICIT_HANDLE, (yyvsp[-1].var)); } -#line 3461 "parser.tab.c" - break; - - case 122: -#line 565 "parser.y" - { (yyval.attr) = make_attr(ATTR_IN); } -#line 3467 "parser.tab.c" - break; - - case 123: -#line 566 "parser.y" - { (yyval.attr) = make_attr(ATTR_INPUTSYNC); } -#line 3473 "parser.tab.c" - break; - - case 124: -#line 567 "parser.y" - { (yyval.attr) = make_attrp(ATTR_LENGTHIS, (yyvsp[-1].expr_list)); } -#line 3479 "parser.tab.c" - break; - - case 125: -#line 568 "parser.y" - { (yyval.attr) = make_attrp(ATTR_LIBLCID, (yyvsp[-1].expr)); } -#line 3485 "parser.tab.c" - break; - - case 126: -#line 569 "parser.y" - { (yyval.attr) = make_attr(ATTR_PARAMLCID); } -#line 3491 "parser.tab.c" - break; - - case 127: -#line 570 "parser.y" - { (yyval.attr) = make_attr(ATTR_LICENSED); } -#line 3497 "parser.tab.c" - break; - - case 128: -#line 571 "parser.y" - { (yyval.attr) = make_attr(ATTR_LOCAL); } -#line 3503 "parser.tab.c" - break; - - case 129: -#line 572 "parser.y" - { (yyval.attr) = make_attr(ATTR_MAYBE); } -#line 3509 "parser.tab.c" - break; - - case 130: -#line 573 "parser.y" - { (yyval.attr) = make_attr(ATTR_MESSAGE); } -#line 3515 "parser.tab.c" - break; - - case 131: -#line 574 "parser.y" - { (yyval.attr) = make_attr(ATTR_NOCODE); } -#line 3521 "parser.tab.c" - break; - - case 132: -#line 575 "parser.y" - { (yyval.attr) = make_attr(ATTR_NONBROWSABLE); } -#line 3527 "parser.tab.c" - break; - - case 133: -#line 576 "parser.y" - { (yyval.attr) = make_attr(ATTR_NONCREATABLE); } -#line 3533 "parser.tab.c" - break; - - case 134: -#line 577 "parser.y" - { (yyval.attr) = make_attr(ATTR_NONEXTENSIBLE); } -#line 3539 "parser.tab.c" - break; - - case 135: -#line 578 "parser.y" - { (yyval.attr) = make_attr(ATTR_NOTIFY); } -#line 3545 "parser.tab.c" - break; - - case 136: -#line 579 "parser.y" - { (yyval.attr) = make_attr(ATTR_NOTIFYFLAG); } -#line 3551 "parser.tab.c" - break; - - case 137: -#line 580 "parser.y" - { (yyval.attr) = make_attr(ATTR_OBJECT); } -#line 3557 "parser.tab.c" - break; - - case 138: -#line 581 "parser.y" - { (yyval.attr) = make_attr(ATTR_ODL); } -#line 3563 "parser.tab.c" - break; - - case 139: -#line 582 "parser.y" - { (yyval.attr) = make_attr(ATTR_OLEAUTOMATION); } -#line 3569 "parser.tab.c" - break; - - case 140: -#line 583 "parser.y" - { (yyval.attr) = make_attrp(ATTR_OPTIMIZE, (yyvsp[-1].str)); } -#line 3575 "parser.tab.c" - break; - - case 141: -#line 584 "parser.y" - { (yyval.attr) = make_attr(ATTR_OPTIONAL); } -#line 3581 "parser.tab.c" - break; - - case 142: -#line 585 "parser.y" - { (yyval.attr) = make_attr(ATTR_OUT); } -#line 3587 "parser.tab.c" - break; - - case 143: -#line 586 "parser.y" - { (yyval.attr) = make_attr(ATTR_PARTIALIGNORE); } -#line 3593 "parser.tab.c" - break; - - case 144: -#line 587 "parser.y" - { (yyval.attr) = make_attrv(ATTR_POINTERDEFAULT, (yyvsp[-1].num)); } -#line 3599 "parser.tab.c" - break; - - case 145: -#line 588 "parser.y" - { (yyval.attr) = make_attrp(ATTR_PROGID, (yyvsp[-1].str)); } -#line 3605 "parser.tab.c" - break; - - case 146: -#line 589 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROPGET); } -#line 3611 "parser.tab.c" - break; - - case 147: -#line 590 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROPPUT); } -#line 3617 "parser.tab.c" - break; - - case 148: -#line 591 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROPPUTREF); } -#line 3623 "parser.tab.c" - break; - - case 149: -#line 592 "parser.y" - { (yyval.attr) = make_attr(ATTR_PROXY); } -#line 3629 "parser.tab.c" - break; - - case 150: -#line 593 "parser.y" - { (yyval.attr) = make_attr(ATTR_PUBLIC); } -#line 3635 "parser.tab.c" - break; - - case 151: -#line 595 "parser.y" - { expr_list_t *list = append_expr( NULL, (yyvsp[-3].expr) ); - list = append_expr( list, (yyvsp[-1].expr) ); - (yyval.attr) = make_attrp(ATTR_RANGE, list); } -#line 3643 "parser.tab.c" - break; - - case 152: -#line 598 "parser.y" - { (yyval.attr) = make_attr(ATTR_READONLY); } -#line 3649 "parser.tab.c" - break; - - case 153: -#line 599 "parser.y" - { (yyval.attr) = make_attrp(ATTR_REPRESENTAS, (yyvsp[-1].type)); } -#line 3655 "parser.tab.c" - break; - - case 154: -#line 600 "parser.y" - { (yyval.attr) = make_attr(ATTR_REQUESTEDIT); } -#line 3661 "parser.tab.c" - break; - - case 155: -#line 601 "parser.y" - { (yyval.attr) = make_attr(ATTR_RESTRICTED); } -#line 3667 "parser.tab.c" - break; - - case 156: -#line 602 "parser.y" - { (yyval.attr) = make_attr(ATTR_RETVAL); } -#line 3673 "parser.tab.c" - break; - - case 157: -#line 603 "parser.y" - { (yyval.attr) = make_attrp(ATTR_SIZEIS, (yyvsp[-1].expr_list)); } -#line 3679 "parser.tab.c" - break; - - case 158: -#line 604 "parser.y" - { (yyval.attr) = make_attr(ATTR_SOURCE); } -#line 3685 "parser.tab.c" - break; - - case 159: -#line 605 "parser.y" - { (yyval.attr) = make_attr(ATTR_STRICTCONTEXTHANDLE); } -#line 3691 "parser.tab.c" - break; - - case 160: -#line 606 "parser.y" - { (yyval.attr) = make_attr(ATTR_STRING); } -#line 3697 "parser.tab.c" - break; - - case 161: -#line 607 "parser.y" - { (yyval.attr) = make_attrp(ATTR_SWITCHIS, (yyvsp[-1].expr)); } -#line 3703 "parser.tab.c" - break; - - case 162: -#line 608 "parser.y" - { (yyval.attr) = make_attrp(ATTR_SWITCHTYPE, (yyvsp[-1].type)); } -#line 3709 "parser.tab.c" - break; - - case 163: -#line 609 "parser.y" - { (yyval.attr) = make_attrp(ATTR_TRANSMITAS, (yyvsp[-1].type)); } -#line 3715 "parser.tab.c" - break; - - case 164: -#line 610 "parser.y" - { (yyval.attr) = make_attrv(ATTR_THREADING, (yyvsp[-1].num)); } -#line 3721 "parser.tab.c" - break; - - case 165: -#line 611 "parser.y" - { (yyval.attr) = make_attr(ATTR_UIDEFAULT); } -#line 3727 "parser.tab.c" - break; - - case 166: -#line 612 "parser.y" - { (yyval.attr) = make_attr(ATTR_USESGETLASTERROR); } -#line 3733 "parser.tab.c" - break; - - case 167: -#line 613 "parser.y" - { (yyval.attr) = make_attrp(ATTR_USERMARSHAL, (yyvsp[-1].type)); } -#line 3739 "parser.tab.c" - break; - - case 168: -#line 614 "parser.y" - { (yyval.attr) = make_attrp(ATTR_UUID, (yyvsp[-1].uuid)); } -#line 3745 "parser.tab.c" - break; - - case 169: -#line 615 "parser.y" - { (yyval.attr) = make_attrp(ATTR_ASYNCUUID, (yyvsp[-1].uuid)); } -#line 3751 "parser.tab.c" - break; - - case 170: -#line 616 "parser.y" - { (yyval.attr) = make_attr(ATTR_V1ENUM); } -#line 3757 "parser.tab.c" - break; - - case 171: -#line 617 "parser.y" - { (yyval.attr) = make_attr(ATTR_VARARG); } -#line 3763 "parser.tab.c" - break; - - case 172: -#line 618 "parser.y" - { (yyval.attr) = make_attrv(ATTR_VERSION, (yyvsp[-1].num)); } -#line 3769 "parser.tab.c" - break; - - case 173: -#line 619 "parser.y" - { (yyval.attr) = make_attrp(ATTR_VIPROGID, (yyvsp[-1].str)); } -#line 3775 "parser.tab.c" - break; - - case 174: -#line 620 "parser.y" - { (yyval.attr) = make_attrp(ATTR_WIREMARSHAL, (yyvsp[-1].type)); } -#line 3781 "parser.tab.c" - break; - - case 175: -#line 621 "parser.y" - { (yyval.attr) = make_attrv(ATTR_POINTERTYPE, (yyvsp[0].num)); } -#line 3787 "parser.tab.c" - break; - - case 177: -#line 626 "parser.y" - { if (!is_valid_uuid((yyvsp[0].str))) - error_loc("invalid UUID: %s\n", (yyvsp[0].str)); - (yyval.uuid) = parse_uuid((yyvsp[0].str)); } -#line 3795 "parser.tab.c" - break; - - case 178: -#line 631 "parser.y" - { (yyval.str) = xstrdup("__cdecl"); } -#line 3801 "parser.tab.c" - break; - - case 179: -#line 632 "parser.y" - { (yyval.str) = xstrdup("__fastcall"); } -#line 3807 "parser.tab.c" - break; - - case 180: -#line 633 "parser.y" - { (yyval.str) = xstrdup("__pascal"); } -#line 3813 "parser.tab.c" - break; - - case 181: -#line 634 "parser.y" - { (yyval.str) = xstrdup("__stdcall"); } -#line 3819 "parser.tab.c" - break; - - case 182: -#line 637 "parser.y" - { (yyval.var_list) = NULL; } -#line 3825 "parser.tab.c" - break; - - case 183: -#line 638 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[-1].var_list), (yyvsp[0].var) ); } -#line 3831 "parser.tab.c" - break; - - case 184: -#line 641 "parser.y" - { attr_t *a = make_attrp(ATTR_CASE, append_expr( NULL, (yyvsp[-2].expr) )); - (yyval.var) = (yyvsp[0].var); if (!(yyval.var)) (yyval.var) = make_var(NULL); - (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a ); - } -#line 3840 "parser.tab.c" - break; - - case 185: -#line 645 "parser.y" - { attr_t *a = make_attr(ATTR_DEFAULT); - (yyval.var) = (yyvsp[0].var); if (!(yyval.var)) (yyval.var) = make_var(NULL); - (yyval.var)->attrs = append_attr( (yyval.var)->attrs, a ); - } -#line 3849 "parser.tab.c" - break; - - case 186: -#line 651 "parser.y" - { (yyval.var_list) = NULL; } -#line 3855 "parser.tab.c" - break; - - case 187: -#line 652 "parser.y" - { (yyval.var_list) = (yyvsp[-1].var_list); } -#line 3861 "parser.tab.c" - break; - - case 189: -#line 656 "parser.y" - { if (!(yyvsp[0].var)->eval) - (yyvsp[0].var)->eval = make_exprl(EXPR_NUM, 0 /* default for first enum entry */); - (yyval.var_list) = append_var( NULL, (yyvsp[0].var) ); - } -#line 3870 "parser.tab.c" - break; - - case 190: -#line 660 "parser.y" - { if (!(yyvsp[0].var)->eval) - { - var_t *last = LIST_ENTRY( list_tail((yyval.var_list)), var_t, entry ); - enum expr_type type = EXPR_NUM; - if (last->eval->type == EXPR_HEXNUM) type = EXPR_HEXNUM; - if (last->eval->cval + 1 < 0) type = EXPR_HEXNUM; - (yyvsp[0].var)->eval = make_exprl(type, last->eval->cval + 1); - } - (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[0].var) ); - } -#line 3885 "parser.tab.c" - break; - - case 191: -#line 672 "parser.y" - { (yyval.var) = reg_const((yyvsp[-2].var)); - (yyval.var)->eval = (yyvsp[0].expr); - (yyval.var)->type = type_new_int(TYPE_BASIC_INT, 0); - } -#line 3894 "parser.tab.c" - break; - - case 192: -#line 676 "parser.y" - { (yyval.var) = reg_const((yyvsp[0].var)); - (yyval.var)->type = type_new_int(TYPE_BASIC_INT, 0); - } -#line 3902 "parser.tab.c" - break; - - case 193: -#line 681 "parser.y" - { (yyval.type) = type_new_enum((yyvsp[-3].str), current_namespace, TRUE, (yyvsp[-1].var_list)); } -#line 3908 "parser.tab.c" - break; - - case 194: -#line 684 "parser.y" - { (yyval.expr_list) = append_expr( NULL, (yyvsp[0].expr) ); } -#line 3914 "parser.tab.c" - break; - - case 195: -#line 685 "parser.y" - { (yyval.expr_list) = append_expr( (yyvsp[-2].expr_list), (yyvsp[0].expr) ); } -#line 3920 "parser.tab.c" - break; - - case 196: -#line 688 "parser.y" - { (yyval.expr) = make_expr(EXPR_VOID); } -#line 3926 "parser.tab.c" - break; - - case 198: -#line 692 "parser.y" - { (yyval.expr) = make_exprl(EXPR_NUM, (yyvsp[0].num)); } -#line 3932 "parser.tab.c" - break; - - case 199: -#line 693 "parser.y" - { (yyval.expr) = make_exprl(EXPR_HEXNUM, (yyvsp[0].num)); } -#line 3938 "parser.tab.c" - break; - - case 200: -#line 694 "parser.y" - { (yyval.expr) = make_exprd(EXPR_DOUBLE, (yyvsp[0].dbl)); } -#line 3944 "parser.tab.c" - break; - - case 201: -#line 695 "parser.y" - { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 0); } -#line 3950 "parser.tab.c" - break; - - case 202: -#line 696 "parser.y" - { (yyval.expr) = make_exprl(EXPR_NUM, 0); } -#line 3956 "parser.tab.c" - break; - - case 203: -#line 697 "parser.y" - { (yyval.expr) = make_exprl(EXPR_TRUEFALSE, 1); } -#line 3962 "parser.tab.c" - break; - - case 204: -#line 698 "parser.y" - { (yyval.expr) = make_exprs(EXPR_STRLIT, (yyvsp[0].str)); } -#line 3968 "parser.tab.c" - break; - - case 205: -#line 699 "parser.y" - { (yyval.expr) = make_exprs(EXPR_WSTRLIT, (yyvsp[0].str)); } -#line 3974 "parser.tab.c" - break; - - case 206: -#line 700 "parser.y" - { (yyval.expr) = make_exprs(EXPR_CHARCONST, (yyvsp[0].str)); } -#line 3980 "parser.tab.c" - break; - - case 207: -#line 701 "parser.y" - { (yyval.expr) = make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str)); } -#line 3986 "parser.tab.c" - break; - - case 208: -#line 702 "parser.y" - { (yyval.expr) = make_expr3(EXPR_COND, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 3992 "parser.tab.c" - break; - - case 209: -#line 703 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LOGOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 3998 "parser.tab.c" - break; - - case 210: -#line 704 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LOGAND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4004 "parser.tab.c" - break; - - case 211: -#line 705 "parser.y" - { (yyval.expr) = make_expr2(EXPR_OR , (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4010 "parser.tab.c" - break; - - case 212: -#line 706 "parser.y" - { (yyval.expr) = make_expr2(EXPR_XOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4016 "parser.tab.c" - break; - - case 213: -#line 707 "parser.y" - { (yyval.expr) = make_expr2(EXPR_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4022 "parser.tab.c" - break; - - case 214: -#line 708 "parser.y" - { (yyval.expr) = make_expr2(EXPR_EQUALITY, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4028 "parser.tab.c" - break; - - case 215: -#line 709 "parser.y" - { (yyval.expr) = make_expr2(EXPR_INEQUALITY, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4034 "parser.tab.c" - break; - - case 216: -#line 710 "parser.y" - { (yyval.expr) = make_expr2(EXPR_GTR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4040 "parser.tab.c" - break; - - case 217: -#line 711 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LESS, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4046 "parser.tab.c" - break; - - case 218: -#line 712 "parser.y" - { (yyval.expr) = make_expr2(EXPR_GTREQL, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4052 "parser.tab.c" - break; - - case 219: -#line 713 "parser.y" - { (yyval.expr) = make_expr2(EXPR_LESSEQL, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4058 "parser.tab.c" - break; - - case 220: -#line 714 "parser.y" - { (yyval.expr) = make_expr2(EXPR_SHL, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4064 "parser.tab.c" - break; - - case 221: -#line 715 "parser.y" - { (yyval.expr) = make_expr2(EXPR_SHR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4070 "parser.tab.c" - break; - - case 222: -#line 716 "parser.y" - { (yyval.expr) = make_expr2(EXPR_ADD, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4076 "parser.tab.c" - break; - - case 223: -#line 717 "parser.y" - { (yyval.expr) = make_expr2(EXPR_SUB, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4082 "parser.tab.c" - break; - - case 224: -#line 718 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MOD, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4088 "parser.tab.c" - break; - - case 225: -#line 719 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MUL, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4094 "parser.tab.c" - break; - - case 226: -#line 720 "parser.y" - { (yyval.expr) = make_expr2(EXPR_DIV, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 4100 "parser.tab.c" - break; - - case 227: -#line 721 "parser.y" - { (yyval.expr) = make_expr1(EXPR_LOGNOT, (yyvsp[0].expr)); } -#line 4106 "parser.tab.c" - break; - - case 228: -#line 722 "parser.y" - { (yyval.expr) = make_expr1(EXPR_NOT, (yyvsp[0].expr)); } -#line 4112 "parser.tab.c" - break; - - case 229: -#line 723 "parser.y" - { (yyval.expr) = make_expr1(EXPR_POS, (yyvsp[0].expr)); } -#line 4118 "parser.tab.c" - break; - - case 230: -#line 724 "parser.y" - { (yyval.expr) = make_expr1(EXPR_NEG, (yyvsp[0].expr)); } -#line 4124 "parser.tab.c" - break; - - case 231: -#line 725 "parser.y" - { (yyval.expr) = make_expr1(EXPR_ADDRESSOF, (yyvsp[0].expr)); } -#line 4130 "parser.tab.c" - break; - - case 232: -#line 726 "parser.y" - { (yyval.expr) = make_expr1(EXPR_PPTR, (yyvsp[0].expr)); } -#line 4136 "parser.tab.c" - break; - - case 233: -#line 727 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MEMBER, make_expr1(EXPR_PPTR, (yyvsp[-2].expr)), make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str))); } -#line 4142 "parser.tab.c" - break; - - case 234: -#line 728 "parser.y" - { (yyval.expr) = make_expr2(EXPR_MEMBER, (yyvsp[-2].expr), make_exprs(EXPR_IDENTIFIER, (yyvsp[0].str))); } -#line 4148 "parser.tab.c" - break; - - case 235: -#line 730 "parser.y" - { (yyval.expr) = make_exprt(EXPR_CAST, declare_var(NULL, (yyvsp[-3].declspec), (yyvsp[-2].declarator), 0), (yyvsp[0].expr)); free((yyvsp[-3].declspec)); free((yyvsp[-2].declarator)); } -#line 4154 "parser.tab.c" - break; - - case 236: -#line 732 "parser.y" - { (yyval.expr) = make_exprt(EXPR_SIZEOF, declare_var(NULL, (yyvsp[-2].declspec), (yyvsp[-1].declarator), 0), NULL); free((yyvsp[-2].declspec)); free((yyvsp[-1].declarator)); } -#line 4160 "parser.tab.c" - break; - - case 237: -#line 733 "parser.y" - { (yyval.expr) = make_expr2(EXPR_ARRAY, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 4166 "parser.tab.c" - break; - - case 238: -#line 734 "parser.y" - { (yyval.expr) = (yyvsp[-1].expr); } -#line 4172 "parser.tab.c" - break; - - case 239: -#line 737 "parser.y" - { (yyval.expr_list) = append_expr( NULL, (yyvsp[0].expr) ); } -#line 4178 "parser.tab.c" - break; - - case 240: -#line 738 "parser.y" - { (yyval.expr_list) = append_expr( (yyvsp[-2].expr_list), (yyvsp[0].expr) ); } -#line 4184 "parser.tab.c" - break; - - case 241: -#line 741 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); - if (!(yyval.expr)->is_const) - error_loc("expression is not an integer constant\n"); - } -#line 4193 "parser.tab.c" - break; - - case 242: -#line 747 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); - if (!(yyval.expr)->is_const && (yyval.expr)->type != EXPR_STRLIT && (yyval.expr)->type != EXPR_WSTRLIT) - error_loc("expression is not constant\n"); - } -#line 4202 "parser.tab.c" - break; - - case 243: -#line 753 "parser.y" - { (yyval.var_list) = NULL; } -#line 4208 "parser.tab.c" - break; - - case 244: -#line 754 "parser.y" - { (yyval.var_list) = append_var_list((yyvsp[-1].var_list), (yyvsp[0].var_list)); } -#line 4214 "parser.tab.c" - break; - - case 245: -#line 758 "parser.y" - { const char *first = LIST_ENTRY(list_head((yyvsp[-1].declarator_list)), declarator_t, entry)->var->name; - check_field_attrs(first, (yyvsp[-3].attr_list)); - (yyval.var_list) = set_var_types((yyvsp[-3].attr_list), (yyvsp[-2].declspec), (yyvsp[-1].declarator_list)); - } -#line 4223 "parser.tab.c" - break; - - case 246: -#line 762 "parser.y" - { var_t *v = make_var(NULL); - v->type = (yyvsp[-1].type); v->attrs = (yyvsp[-2].attr_list); - (yyval.var_list) = append_var(NULL, v); - } -#line 4232 "parser.tab.c" - break; - - case 247: -#line 769 "parser.y" - { (yyval.var) = (yyvsp[-1].var); } -#line 4238 "parser.tab.c" - break; - - case 248: -#line 770 "parser.y" - { (yyval.var) = make_var(NULL); (yyval.var)->attrs = (yyvsp[-1].attr_list); } -#line 4244 "parser.tab.c" - break; - - case 249: -#line 773 "parser.y" - { (yyval.var_list) = NULL; } -#line 4250 "parser.tab.c" - break; - - case 250: -#line 774 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[-1].var_list), (yyvsp[0].var) ); } -#line 4256 "parser.tab.c" - break; - - case 251: -#line 778 "parser.y" - { (yyval.var) = (yyvsp[-1].var); } -#line 4262 "parser.tab.c" - break; - - case 252: -#line 779 "parser.y" - { (yyval.var) = NULL; } -#line 4268 "parser.tab.c" - break; - - case 253: -#line 782 "parser.y" - { (yyval.var) = declare_var(check_field_attrs((yyvsp[0].declarator)->var->name, (yyvsp[-2].attr_list)), - (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE); - free((yyvsp[0].declarator)); - } -#line 4277 "parser.tab.c" - break; - - case 254: -#line 786 "parser.y" - { var_t *v = make_var(NULL); - v->type = (yyvsp[0].type); v->attrs = (yyvsp[-1].attr_list); - (yyval.var) = v; - } -#line 4286 "parser.tab.c" - break; - - case 255: -#line 792 "parser.y" - { (yyval.var) = (yyvsp[0].var); - if (type_get_type((yyval.var)->type) != TYPE_FUNCTION) - error_loc("only methods may be declared inside the methods section of a dispinterface\n"); - check_function_attrs((yyval.var)->name, (yyval.var)->attrs); - } -#line 4296 "parser.tab.c" - break; - - case 256: -#line 801 "parser.y" - { (yyval.var) = declare_var((yyvsp[-2].attr_list), (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE); - free((yyvsp[0].declarator)); - } -#line 4304 "parser.tab.c" - break; - - case 257: -#line 804 "parser.y" - { (yyval.var) = declare_var(NULL, (yyvsp[-1].declspec), (yyvsp[0].declarator), FALSE); - free((yyvsp[0].declarator)); - } -#line 4312 "parser.tab.c" - break; - - case 258: -#line 809 "parser.y" - { (yyval.var) = NULL; } -#line 4318 "parser.tab.c" - break; - - case 260: -#line 813 "parser.y" - { (yyval.str) = NULL; } -#line 4324 "parser.tab.c" - break; - - case 261: -#line 814 "parser.y" - { (yyval.str) = (yyvsp[0].str); } -#line 4330 "parser.tab.c" - break; - - case 262: -#line 815 "parser.y" - { (yyval.str) = (yyvsp[0].str); } -#line 4336 "parser.tab.c" - break; - - case 263: -#line 818 "parser.y" - { (yyval.var) = make_var((yyvsp[0].str)); } -#line 4342 "parser.tab.c" - break; - - case 264: -#line 820 "parser.y" - { (yyval.var) = make_var((yyvsp[0].str)); } -#line 4348 "parser.tab.c" - break; - - case 265: -#line 823 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 4354 "parser.tab.c" - break; - - case 266: -#line 824 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 4360 "parser.tab.c" - break; - - case 268: -#line 826 "parser.y" - { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[0].type)), -1); } -#line 4366 "parser.tab.c" - break; - - case 269: -#line 827 "parser.y" - { (yyval.type) = type_new_int(type_basic_get_type((yyvsp[0].type)), 1); } -#line 4372 "parser.tab.c" - break; - - case 270: -#line 828 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT, 1); } -#line 4378 "parser.tab.c" - break; - - case 271: -#line 829 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 4384 "parser.tab.c" - break; - - case 272: -#line 830 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 4390 "parser.tab.c" - break; - - case 273: -#line 831 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 4396 "parser.tab.c" - break; - - case 274: -#line 832 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 4402 "parser.tab.c" - break; - - case 275: -#line 833 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 4408 "parser.tab.c" - break; - - case 278: -#line 840 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT, 0); } -#line 4414 "parser.tab.c" - break; - - case 279: -#line 841 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT16, 0); } -#line 4420 "parser.tab.c" - break; - - case 280: -#line 842 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT8, 0); } -#line 4426 "parser.tab.c" - break; - - case 281: -#line 843 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_LONG, 0); } -#line 4432 "parser.tab.c" - break; - - case 282: -#line 844 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_HYPER, 0); } -#line 4438 "parser.tab.c" - break; - - case 283: -#line 845 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT64, 0); } -#line 4444 "parser.tab.c" - break; - - case 284: -#line 846 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_CHAR, 0); } -#line 4450 "parser.tab.c" - break; - - case 285: -#line 847 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT32, 0); } -#line 4456 "parser.tab.c" - break; - - case 286: -#line 848 "parser.y" - { (yyval.type) = type_new_int(TYPE_BASIC_INT3264, 0); } -#line 4462 "parser.tab.c" - break; - - case 287: -#line 851 "parser.y" - { (yyval.type) = type_new_coclass((yyvsp[0].str)); } -#line 4468 "parser.tab.c" - break; - - case 288: -#line 852 "parser.y" - { (yyval.type) = find_type((yyvsp[0].str), NULL, 0); - if (type_get_type_detect_alias((yyval.type)) != TYPE_COCLASS) - error_loc("%s was not declared a coclass at %s:%d\n", - (yyvsp[0].str), (yyval.type)->loc_info.input_name, - (yyval.type)->loc_info.line_number); - } -#line 4479 "parser.tab.c" - break; - - case 289: -#line 860 "parser.y" - { (yyval.type) = (yyvsp[0].type); - check_def((yyval.type)); - (yyval.type)->attrs = check_coclass_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list)); - } -#line 4488 "parser.tab.c" - break; - - case 290: -#line 867 "parser.y" - { (yyval.type) = type_coclass_define((yyvsp[-4].type), (yyvsp[-2].ifref_list)); } -#line 4494 "parser.tab.c" - break; - - case 291: -#line 870 "parser.y" - { (yyval.str) = (yyvsp[0].str); } -#line 4500 "parser.tab.c" - break; - - case 292: -#line 873 "parser.y" - { (yyval.ifref_list) = NULL; } -#line 4506 "parser.tab.c" - break; - - case 293: -#line 874 "parser.y" - { (yyval.ifref_list) = append_ifref( (yyvsp[-1].ifref_list), (yyvsp[0].ifref) ); } -#line 4512 "parser.tab.c" - break; - - case 294: -#line 878 "parser.y" - { (yyval.ifref) = make_ifref((yyvsp[0].type)); (yyval.ifref)->attrs = (yyvsp[-1].attr_list); } -#line 4518 "parser.tab.c" - break; - - case 295: -#line 881 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); } -#line 4524 "parser.tab.c" - break; - - case 296: -#line 882 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); } -#line 4530 "parser.tab.c" - break; - - case 297: -#line 885 "parser.y" - { attr_t *attrs; - (yyval.type) = (yyvsp[0].type); - check_def((yyval.type)); - attrs = make_attr(ATTR_DISPINTERFACE); - (yyval.type)->attrs = append_attr( check_dispiface_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list)), attrs ); - (yyval.type)->defined = TRUE; - } -#line 4542 "parser.tab.c" - break; - - case 298: -#line 894 "parser.y" - { (yyval.var_list) = NULL; } -#line 4548 "parser.tab.c" - break; - - case 299: -#line 895 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[-1].var) ); } -#line 4554 "parser.tab.c" - break; - - case 300: -#line 898 "parser.y" - { (yyval.var_list) = NULL; } -#line 4560 "parser.tab.c" - break; - - case 301: -#line 899 "parser.y" - { (yyval.var_list) = append_var( (yyvsp[-2].var_list), (yyvsp[-1].var) ); } -#line 4566 "parser.tab.c" - break; - - case 302: -#line 905 "parser.y" - { (yyval.type) = (yyvsp[-4].type); - type_dispinterface_define((yyval.type), (yyvsp[-2].var_list), (yyvsp[-1].var_list)); - } -#line 4574 "parser.tab.c" - break; - - case 303: -#line 909 "parser.y" - { (yyval.type) = (yyvsp[-4].type); - type_dispinterface_define_from_iface((yyval.type), (yyvsp[-2].type)); - } -#line 4582 "parser.tab.c" - break; - - case 304: -#line 914 "parser.y" - { (yyval.type) = NULL; } -#line 4588 "parser.tab.c" - break; - - case 305: -#line 915 "parser.y" - { (yyval.type) = find_type_or_error2((yyvsp[0].str), 0); } -#line 4594 "parser.tab.c" - break; - - case 306: -#line 918 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); } -#line 4600 "parser.tab.c" - break; - - case 307: -#line 919 "parser.y" - { (yyval.type) = get_type(TYPE_INTERFACE, (yyvsp[0].str), current_namespace, 0); } -#line 4606 "parser.tab.c" - break; - - case 308: -#line 922 "parser.y" - { (yyval.ifinfo).interface = (yyvsp[0].type); - (yyval.ifinfo).old_pointer_default = pointer_default; - if (is_attr((yyvsp[-1].attr_list), ATTR_POINTERDEFAULT)) - pointer_default = get_attrv((yyvsp[-1].attr_list), ATTR_POINTERDEFAULT); - check_def((yyvsp[0].type)); - (yyvsp[0].type)->attrs = check_iface_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list)); - (yyvsp[0].type)->defined = TRUE; - } -#line 4619 "parser.tab.c" - break; - - case 309: -#line 933 "parser.y" - { (yyval.type) = (yyvsp[-5].ifinfo).interface; - if((yyval.type) == (yyvsp[-4].type)) - error_loc("Interface can't inherit from itself\n"); - type_interface_define((yyval.type), (yyvsp[-4].type), (yyvsp[-2].stmt_list)); - check_async_uuid((yyval.type)); - pointer_default = (yyvsp[-5].ifinfo).old_pointer_default; - } -#line 4631 "parser.tab.c" - break; - - case 310: -#line 944 "parser.y" - { (yyval.type) = (yyvsp[-7].ifinfo).interface; - type_interface_define((yyval.type), find_type_or_error2((yyvsp[-5].str), 0), (yyvsp[-2].stmt_list)); - pointer_default = (yyvsp[-7].ifinfo).old_pointer_default; - } -#line 4640 "parser.tab.c" - break; - - case 311: -#line 948 "parser.y" - { (yyval.type) = (yyvsp[-1].type); } -#line 4646 "parser.tab.c" - break; - - case 312: -#line 952 "parser.y" - { (yyval.type) = (yyvsp[-1].type); } -#line 4652 "parser.tab.c" - break; - - case 313: -#line 953 "parser.y" - { (yyval.type) = (yyvsp[-1].type); } -#line 4658 "parser.tab.c" - break; - - case 314: -#line 956 "parser.y" - { (yyval.type) = type_new_module((yyvsp[0].str)); } -#line 4664 "parser.tab.c" - break; - - case 315: -#line 957 "parser.y" - { (yyval.type) = type_new_module((yyvsp[0].str)); } -#line 4670 "parser.tab.c" - break; - - case 316: -#line 960 "parser.y" - { (yyval.type) = (yyvsp[0].type); - (yyval.type)->attrs = check_module_attrs((yyvsp[0].type)->name, (yyvsp[-1].attr_list)); - } -#line 4678 "parser.tab.c" - break; - - case 317: -#line 966 "parser.y" - { (yyval.type) = (yyvsp[-4].type); - type_module_define((yyval.type), (yyvsp[-2].stmt_list)); - } -#line 4686 "parser.tab.c" - break; - - case 318: -#line 972 "parser.y" - { (yyval.stgclass) = STG_EXTERN; } -#line 4692 "parser.tab.c" - break; - - case 319: -#line 973 "parser.y" - { (yyval.stgclass) = STG_STATIC; } -#line 4698 "parser.tab.c" - break; - - case 320: -#line 974 "parser.y" - { (yyval.stgclass) = STG_REGISTER; } -#line 4704 "parser.tab.c" - break; - - case 321: -#line 978 "parser.y" - { (yyval.attr) = make_attr(ATTR_INLINE); } -#line 4710 "parser.tab.c" - break; - - case 322: -#line 982 "parser.y" - { (yyval.attr) = make_attr(ATTR_CONST); } -#line 4716 "parser.tab.c" - break; - - case 323: -#line 985 "parser.y" - { (yyval.attr_list) = NULL; } -#line 4722 "parser.tab.c" - break; - - case 324: -#line 986 "parser.y" - { (yyval.attr_list) = append_attr((yyvsp[-1].attr_list), (yyvsp[0].attr)); } -#line 4728 "parser.tab.c" - break; - - case 325: -#line 989 "parser.y" - { (yyval.declspec) = make_decl_spec((yyvsp[-1].type), (yyvsp[0].declspec), NULL, NULL, STG_NONE); } -#line 4734 "parser.tab.c" - break; - - case 326: -#line 991 "parser.y" - { (yyval.declspec) = make_decl_spec((yyvsp[-1].type), (yyvsp[-2].declspec), (yyvsp[0].declspec), NULL, STG_NONE); } -#line 4740 "parser.tab.c" - break; - - case 327: -#line 994 "parser.y" - { (yyval.declspec) = NULL; } -#line 4746 "parser.tab.c" - break; - - case 329: -#line 999 "parser.y" - { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL, (yyvsp[-1].attr), STG_NONE); } -#line 4752 "parser.tab.c" - break; - - case 330: -#line 1000 "parser.y" - { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL, (yyvsp[-1].attr), STG_NONE); } -#line 4758 "parser.tab.c" - break; - - case 331: -#line 1001 "parser.y" - { (yyval.declspec) = make_decl_spec(NULL, (yyvsp[0].declspec), NULL, NULL, (yyvsp[-1].stgclass)); } -#line 4764 "parser.tab.c" - break; - - case 332: -#line 1006 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_chain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); } -#line 4770 "parser.tab.c" - break; - - case 333: -#line 1007 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); - else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); } -#line 4777 "parser.tab.c" - break; - - case 335: -#line 1013 "parser.y" - { (yyval.declarator) = make_declarator((yyvsp[0].var)); } -#line 4783 "parser.tab.c" - break; - - case 336: -#line 1014 "parser.y" - { (yyval.declarator) = (yyvsp[-1].declarator); } -#line 4789 "parser.tab.c" - break; - - case 337: -#line 1015 "parser.y" - { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->type = append_array((yyval.declarator)->type, (yyvsp[0].expr)); } -#line 4795 "parser.tab.c" - break; - - case 338: -#line 1016 "parser.y" - { (yyval.declarator) = (yyvsp[-3].declarator); - (yyval.declarator)->func_type = append_chain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list))); - (yyval.declarator)->type = NULL; - } -#line 4804 "parser.tab.c" - break; - - case 339: -#line 1025 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_chain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); } -#line 4810 "parser.tab.c" - break; - - case 340: -#line 1026 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); - else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); } -#line 4817 "parser.tab.c" - break; - - case 342: -#line 1034 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_chain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); } -#line 4823 "parser.tab.c" - break; - - case 343: -#line 1035 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); if ((yyval.declarator)->func_type) (yyval.declarator)->func_type->attrs = append_attr((yyval.declarator)->func_type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); - else if ((yyval.declarator)->type) (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); } -#line 4830 "parser.tab.c" - break; - - case 344: -#line 1040 "parser.y" - { (yyval.declarator) = make_declarator(NULL); } -#line 4836 "parser.tab.c" - break; - - case 346: -#line 1046 "parser.y" - { (yyval.declarator) = (yyvsp[-1].declarator); } -#line 4842 "parser.tab.c" - break; - - case 347: -#line 1047 "parser.y" - { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->type = append_array((yyval.declarator)->type, (yyvsp[0].expr)); } -#line 4848 "parser.tab.c" - break; - - case 348: -#line 1048 "parser.y" - { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->type = append_array((yyval.declarator)->type, (yyvsp[0].expr)); } -#line 4854 "parser.tab.c" - break; - - case 349: -#line 1050 "parser.y" - { (yyval.declarator) = make_declarator(NULL); - (yyval.declarator)->func_type = append_chain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list))); - (yyval.declarator)->type = NULL; - } -#line 4863 "parser.tab.c" - break; - - case 350: -#line 1055 "parser.y" - { (yyval.declarator) = (yyvsp[-3].declarator); - (yyval.declarator)->func_type = append_chain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list))); - (yyval.declarator)->type = NULL; - } -#line 4872 "parser.tab.c" - break; - - case 351: -#line 1064 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_chain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); } -#line 4878 "parser.tab.c" - break; - - case 352: -#line 1065 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); } -#line 4884 "parser.tab.c" - break; - - case 354: -#line 1072 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type = append_chain_type((yyval.declarator)->type, type_new_pointer(pointer_default, NULL, (yyvsp[-1].attr_list))); } -#line 4890 "parser.tab.c" - break; - - case 355: -#line 1073 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); (yyval.declarator)->type->attrs = append_attr((yyval.declarator)->type->attrs, make_attrp(ATTR_CALLCONV, (yyvsp[-1].str))); } -#line 4896 "parser.tab.c" - break; - - case 356: -#line 1077 "parser.y" - { (yyval.declarator) = make_declarator(NULL); } -#line 4902 "parser.tab.c" - break; - - case 358: -#line 1085 "parser.y" - { (yyval.declarator) = make_declarator((yyvsp[0].var)); } -#line 4908 "parser.tab.c" - break; - - case 359: -#line 1086 "parser.y" - { (yyval.declarator) = (yyvsp[-1].declarator); } -#line 4914 "parser.tab.c" - break; - - case 360: -#line 1087 "parser.y" - { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->type = append_array((yyval.declarator)->type, (yyvsp[0].expr)); } -#line 4920 "parser.tab.c" - break; - - case 361: -#line 1088 "parser.y" - { (yyval.declarator) = make_declarator(NULL); (yyval.declarator)->type = append_array((yyval.declarator)->type, (yyvsp[0].expr)); } -#line 4926 "parser.tab.c" - break; - - case 362: -#line 1090 "parser.y" - { (yyval.declarator) = make_declarator(NULL); - (yyval.declarator)->func_type = append_chain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list))); - (yyval.declarator)->type = NULL; - } -#line 4935 "parser.tab.c" - break; - - case 363: -#line 1095 "parser.y" - { (yyval.declarator) = (yyvsp[-3].declarator); - (yyval.declarator)->func_type = append_chain_type((yyval.declarator)->type, type_new_function((yyvsp[-1].var_list))); - (yyval.declarator)->type = NULL; - } -#line 4944 "parser.tab.c" - break; - - case 364: -#line 1102 "parser.y" - { (yyval.declarator_list) = append_declarator( NULL, (yyvsp[0].declarator) ); } -#line 4950 "parser.tab.c" - break; - - case 365: -#line 1103 "parser.y" - { (yyval.declarator_list) = append_declarator( (yyvsp[-2].declarator_list), (yyvsp[0].declarator) ); } -#line 4956 "parser.tab.c" - break; - - case 366: -#line 1106 "parser.y" - { (yyval.expr) = NULL; } -#line 4962 "parser.tab.c" - break; - - case 367: -#line 1107 "parser.y" - { (yyval.expr) = (yyvsp[0].expr); } -#line 4968 "parser.tab.c" - break; - - case 368: -#line 1110 "parser.y" - { (yyval.declarator) = (yyvsp[-1].declarator); (yyval.declarator)->bits = (yyvsp[0].expr); - if (!(yyval.declarator)->bits && !(yyval.declarator)->var->name) - error_loc("unnamed fields are not allowed\n"); - } -#line 4977 "parser.tab.c" - break; - - case 369: -#line 1117 "parser.y" - { (yyval.declarator_list) = append_declarator( NULL, (yyvsp[0].declarator) ); } -#line 4983 "parser.tab.c" - break; - - case 370: -#line 1119 "parser.y" - { (yyval.declarator_list) = append_declarator( (yyvsp[-2].declarator_list), (yyvsp[0].declarator) ); } -#line 4989 "parser.tab.c" - break; - - case 371: -#line 1123 "parser.y" - { (yyval.declarator) = (yyvsp[0].declarator); } -#line 4995 "parser.tab.c" - break; - - case 372: -#line 1124 "parser.y" - { (yyval.declarator) = (yyvsp[-2].declarator); (yyvsp[-2].declarator)->var->eval = (yyvsp[0].expr); } -#line 5001 "parser.tab.c" - break; - - case 373: -#line 1128 "parser.y" - { (yyval.num) = THREADING_APARTMENT; } -#line 5007 "parser.tab.c" - break; - - case 374: -#line 1129 "parser.y" - { (yyval.num) = THREADING_NEUTRAL; } -#line 5013 "parser.tab.c" - break; - - case 375: -#line 1130 "parser.y" - { (yyval.num) = THREADING_SINGLE; } -#line 5019 "parser.tab.c" - break; - - case 376: -#line 1131 "parser.y" - { (yyval.num) = THREADING_FREE; } -#line 5025 "parser.tab.c" - break; - - case 377: -#line 1132 "parser.y" - { (yyval.num) = THREADING_BOTH; } -#line 5031 "parser.tab.c" - break; - - case 378: -#line 1136 "parser.y" - { (yyval.num) = FC_RP; } -#line 5037 "parser.tab.c" - break; - - case 379: -#line 1137 "parser.y" - { (yyval.num) = FC_UP; } -#line 5043 "parser.tab.c" - break; - - case 380: -#line 1138 "parser.y" - { (yyval.num) = FC_FP; } -#line 5049 "parser.tab.c" - break; - - case 381: -#line 1141 "parser.y" - { (yyval.type) = type_new_struct((yyvsp[-3].str), current_namespace, TRUE, (yyvsp[-1].var_list)); } -#line 5055 "parser.tab.c" - break; - - case 382: -#line 1144 "parser.y" - { (yyval.type) = type_new_void(); } -#line 5061 "parser.tab.c" - break; - - case 383: -#line 1145 "parser.y" - { (yyval.type) = find_type_or_error((yyvsp[0].str), 0); } -#line 5067 "parser.tab.c" - break; - - case 384: -#line 1146 "parser.y" - { (yyval.type) = (yyvsp[0].type); } -#line 5073 "parser.tab.c" - break; - - case 385: -#line 1147 "parser.y" - { (yyval.type) = (yyvsp[0].type); } -#line 5079 "parser.tab.c" - break; - - case 386: -#line 1148 "parser.y" - { (yyval.type) = type_new_enum((yyvsp[0].str), current_namespace, FALSE, NULL); } -#line 5085 "parser.tab.c" - break; - - case 387: -#line 1149 "parser.y" - { (yyval.type) = (yyvsp[0].type); } -#line 5091 "parser.tab.c" - break; - - case 388: -#line 1150 "parser.y" - { (yyval.type) = type_new_struct((yyvsp[0].str), current_namespace, FALSE, NULL); } -#line 5097 "parser.tab.c" - break; - - case 389: -#line 1151 "parser.y" - { (yyval.type) = (yyvsp[0].type); } -#line 5103 "parser.tab.c" - break; - - case 390: -#line 1152 "parser.y" - { (yyval.type) = type_new_nonencapsulated_union((yyvsp[0].str), FALSE, NULL); } -#line 5109 "parser.tab.c" - break; - - case 391: -#line 1153 "parser.y" - { (yyval.type) = make_safearray((yyvsp[-1].type)); } -#line 5115 "parser.tab.c" - break; - - case 392: -#line 1157 "parser.y" - { (yyvsp[-4].attr_list) = append_attribs((yyvsp[-4].attr_list), (yyvsp[-2].attr_list)); - reg_typedefs((yyvsp[-1].declspec), (yyvsp[0].declarator_list), check_typedef_attrs((yyvsp[-4].attr_list))); - (yyval.statement) = make_statement_typedef((yyvsp[0].declarator_list)); - } -#line 5124 "parser.tab.c" - break; - - case 393: -#line 1164 "parser.y" - { (yyval.type) = type_new_nonencapsulated_union((yyvsp[-3].str), TRUE, (yyvsp[-1].var_list)); } -#line 5130 "parser.tab.c" - break; - - case 394: -#line 1167 "parser.y" - { (yyval.type) = type_new_encapsulated_union((yyvsp[-8].str), (yyvsp[-5].var), (yyvsp[-3].var), (yyvsp[-1].var_list)); } -#line 5136 "parser.tab.c" - break; - - case 395: -#line 1171 "parser.y" - { (yyval.num) = MAKEVERSION((yyvsp[0].num), 0); } -#line 5142 "parser.tab.c" - break; - - case 396: -#line 1172 "parser.y" - { (yyval.num) = MAKEVERSION((yyvsp[-2].num), (yyvsp[0].num)); } -#line 5148 "parser.tab.c" - break; - - case 397: -#line 1173 "parser.y" - { (yyval.num) = (yyvsp[0].num); } -#line 5154 "parser.tab.c" - break; - - case 402: -#line 1188 "parser.y" - { type_t *type = find_type_or_error((yyvsp[-1].str), 0); - type->attrs = append_attr_list(type->attrs, (yyvsp[-2].attr_list)); - } -#line 5162 "parser.tab.c" - break; - - case 403: -#line 1195 "parser.y" - { type_t *iface = find_type_or_error2((yyvsp[-3].str), 0); - if (type_get_type(iface) != TYPE_INTERFACE) - error_loc("%s is not an interface\n", iface->name); - iface->attrs = append_attr_list(iface->attrs, (yyvsp[-5].attr_list)); - } -#line 5172 "parser.tab.c" - break; - - case 404: -#line 1203 "parser.y" - { (yyval.attr_list) = NULL; } -#line 5178 "parser.tab.c" - break; - - case 405: -#line 1204 "parser.y" - { (yyval.attr_list) = (yyvsp[-1].attr_list); } -#line 5184 "parser.tab.c" - break; - - case 406: -#line 1208 "parser.y" - { (yyval.attr_list) = append_attr(NULL, (yyvsp[0].attr)); } -#line 5190 "parser.tab.c" - break; - - case 407: -#line 1209 "parser.y" - { (yyval.attr_list) = append_attr((yyvsp[-2].attr_list), (yyvsp[0].attr)); } -#line 5196 "parser.tab.c" - break; - - case 408: -#line 1214 "parser.y" - { (yyval.attr) = make_attrv(ATTR_ALLOCATE, (yyvsp[-1].num)); } -#line 5202 "parser.tab.c" - break; - - case 409: -#line 1215 "parser.y" - { (yyval.attr) = make_attr(ATTR_ENCODE); } -#line 5208 "parser.tab.c" - break; - - case 410: -#line 1216 "parser.y" - { (yyval.attr) = make_attr(ATTR_DECODE); } -#line 5214 "parser.tab.c" - break; - - case 411: -#line 1217 "parser.y" - { (yyval.attr) = make_attr(ATTR_EXPLICIT_HANDLE); } -#line 5220 "parser.tab.c" - break; - - case 412: -#line 1221 "parser.y" - { (yyval.num) = (yyvsp[0].num); } -#line 5226 "parser.tab.c" - break; - - case 413: -#line 1223 "parser.y" - { (yyval.num) = (yyvsp[-2].num) | (yyvsp[0].num); } -#line 5232 "parser.tab.c" - break; - - case 414: -#line 1227 "parser.y" - { (yyval.num) = FC_DONT_FREE; } -#line 5238 "parser.tab.c" - break; - - case 415: -#line 1228 "parser.y" - { (yyval.num) = 0; } -#line 5244 "parser.tab.c" - break; - - case 416: -#line 1229 "parser.y" - { (yyval.num) = FC_ALLOCATE_ALL_NODES; } -#line 5250 "parser.tab.c" - break; - - case 417: -#line 1230 "parser.y" - { (yyval.num) = 0; } -#line 5256 "parser.tab.c" - break; - - -#line 5260 "parser.tab.c" - - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - { - const int yylhs = yyr1[yyn] - YYNTOKENS; - const int yyi = yypgoto[yylhs] + *yyssp; - yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp - ? yytable[yyi] - : yydefgoto[yylhs]); - } - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - /* Pacify compilers when the user code never invokes YYERROR and the - label yyerrorlab therefore never appears in user code. */ - if (0) - YYERROR; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - - -/*-----------------------------------------------------. -| yyreturn -- parsing is finished, return the result. | -`-----------------------------------------------------*/ -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[+*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 1232 "parser.y" - - -static void decl_builtin_basic(const char *name, enum type_basic_type type) -{ - type_t *t = type_new_basic(type); - reg_type(t, name, NULL, 0); -} - -static void decl_builtin_alias(const char *name, type_t *t) -{ - reg_type(type_new_alias(t, name), name, NULL, 0); -} - -void init_types(void) -{ - decl_builtin_basic("byte", TYPE_BASIC_BYTE); - decl_builtin_basic("wchar_t", TYPE_BASIC_WCHAR); - decl_builtin_basic("float", TYPE_BASIC_FLOAT); - decl_builtin_basic("double", TYPE_BASIC_DOUBLE); - decl_builtin_basic("error_status_t", TYPE_BASIC_ERROR_STATUS_T); - decl_builtin_basic("handle_t", TYPE_BASIC_HANDLE); - decl_builtin_alias("boolean", type_new_basic(TYPE_BASIC_BYTE)); -} - -static str_list_t *append_str(str_list_t *list, char *str) -{ - struct str_list_entry_t *entry; - - if (!str) return list; - if (!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - entry = xmalloc( sizeof(*entry) ); - entry->str = str; - list_add_tail( list, &entry->entry ); - return list; -} - -static attr_list_t *append_attr(attr_list_t *list, attr_t *attr) -{ - attr_t *attr_existing; - if (!attr) return list; - if (!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - LIST_FOR_EACH_ENTRY(attr_existing, list, attr_t, entry) - if (attr_existing->type == attr->type) - { - parser_warning("duplicate attribute %s\n", get_attr_display_name(attr->type)); - /* use the last attribute, like MIDL does */ - list_remove(&attr_existing->entry); - break; - } - list_add_tail( list, &attr->entry ); - return list; -} - -static attr_list_t *move_attr(attr_list_t *dst, attr_list_t *src, enum attr_type type) -{ - attr_t *attr; - if (!src) return dst; - LIST_FOR_EACH_ENTRY(attr, src, attr_t, entry) - if (attr->type == type) - { - list_remove(&attr->entry); - return append_attr(dst, attr); - } - return dst; -} - -static attr_list_t *append_attr_list(attr_list_t *new_list, attr_list_t *old_list) -{ - struct list *entry; - - if (!old_list) return new_list; - - while ((entry = list_head(old_list))) - { - attr_t *attr = LIST_ENTRY(entry, attr_t, entry); - list_remove(entry); - new_list = append_attr(new_list, attr); - } - return new_list; -} - -typedef int (*map_attrs_filter_t)(attr_list_t*,const attr_t*); - -static attr_list_t *map_attrs(const attr_list_t *list, map_attrs_filter_t filter) -{ - attr_list_t *new_list; - const attr_t *attr; - attr_t *new_attr; - - if (!list) return NULL; - - new_list = xmalloc( sizeof(*list) ); - list_init( new_list ); - LIST_FOR_EACH_ENTRY(attr, list, const attr_t, entry) - { - if (filter && !filter(new_list, attr)) continue; - new_attr = xmalloc(sizeof(*new_attr)); - *new_attr = *attr; - list_add_tail(new_list, &new_attr->entry); - } - return new_list; -} - -static decl_spec_t *make_decl_spec(type_t *type, decl_spec_t *left, decl_spec_t *right, attr_t *attr, enum storage_class stgclass) -{ - decl_spec_t *declspec = left ? left : right; - if (!declspec) - { - declspec = xmalloc(sizeof(*declspec)); - declspec->type = NULL; - declspec->attrs = NULL; - declspec->stgclass = STG_NONE; - } - declspec->type = type; - if (left && declspec != left) - { - declspec->attrs = append_attr_list(declspec->attrs, left->attrs); - if (declspec->stgclass == STG_NONE) - declspec->stgclass = left->stgclass; - else if (left->stgclass != STG_NONE) - error_loc("only one storage class can be specified\n"); - assert(!left->type); - free(left); - } - if (right && declspec != right) - { - declspec->attrs = append_attr_list(declspec->attrs, right->attrs); - if (declspec->stgclass == STG_NONE) - declspec->stgclass = right->stgclass; - else if (right->stgclass != STG_NONE) - error_loc("only one storage class can be specified\n"); - assert(!right->type); - free(right); - } - - declspec->attrs = append_attr(declspec->attrs, attr); - if (declspec->stgclass == STG_NONE) - declspec->stgclass = stgclass; - else if (stgclass != STG_NONE) - error_loc("only one storage class can be specified\n"); - - /* apply attributes to type */ - if (type && declspec->attrs) - { - attr_list_t *attrs; - declspec->type = duptype(type, 1); - attrs = map_attrs(type->attrs, NULL); - declspec->type->attrs = append_attr_list(attrs, declspec->attrs); - declspec->attrs = NULL; - } - - return declspec; -} - -static attr_t *make_attr(enum attr_type type) -{ - attr_t *a = xmalloc(sizeof(attr_t)); - a->type = type; - a->u.ival = 0; - return a; -} - -static attr_t *make_attrv(enum attr_type type, unsigned int val) -{ - attr_t *a = xmalloc(sizeof(attr_t)); - a->type = type; - a->u.ival = val; - return a; -} - -static attr_t *make_attrp(enum attr_type type, void *val) -{ - attr_t *a = xmalloc(sizeof(attr_t)); - a->type = type; - a->u.pval = val; - return a; -} - -static expr_list_t *append_expr(expr_list_t *list, expr_t *expr) -{ - if (!expr) return list; - if (!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - list_add_tail( list, &expr->entry ); - return list; -} - -static type_t *append_array(type_t *chain, expr_t *expr) -{ - type_t *array; - - if (!expr) - return chain; - - /* An array is always a reference pointer unless explicitly marked otherwise - * (regardless of what the default pointer attribute is). */ - array = type_new_array(NULL, NULL, FALSE, expr->is_const ? expr->cval : 0, - expr->is_const ? NULL : expr, NULL, FC_RP); - - return append_chain_type(chain, array); -} - -static struct list type_pool = LIST_INIT(type_pool); -typedef struct -{ - type_t data; - struct list link; -} type_pool_node_t; - -type_t *alloc_type(void) -{ - type_pool_node_t *node = xmalloc(sizeof *node); - list_add_tail(&type_pool, &node->link); - return &node->data; -} - -void set_all_tfswrite(int val) -{ - type_pool_node_t *node; - LIST_FOR_EACH_ENTRY(node, &type_pool, type_pool_node_t, link) - node->data.tfswrite = val; -} - -void clear_all_offsets(void) -{ - type_pool_node_t *node; - LIST_FOR_EACH_ENTRY(node, &type_pool, type_pool_node_t, link) - node->data.typestring_offset = node->data.ptrdesc = 0; -} - -static void type_function_add_head_arg(type_t *type, var_t *arg) -{ - if (!type->details.function->args) - { - type->details.function->args = xmalloc( sizeof(*type->details.function->args) ); - list_init( type->details.function->args ); - } - list_add_head( type->details.function->args, &arg->entry ); -} - -static int is_allowed_range_type(const type_t *type) -{ - switch (type_get_type(type)) - { - case TYPE_ENUM: - return TRUE; - case TYPE_BASIC: - switch (type_basic_get_type(type)) - { - case TYPE_BASIC_INT8: - case TYPE_BASIC_INT16: - case TYPE_BASIC_INT32: - case TYPE_BASIC_INT64: - case TYPE_BASIC_INT: - case TYPE_BASIC_INT3264: - case TYPE_BASIC_LONG: - case TYPE_BASIC_BYTE: - case TYPE_BASIC_CHAR: - case TYPE_BASIC_WCHAR: - case TYPE_BASIC_HYPER: - return TRUE; - case TYPE_BASIC_FLOAT: - case TYPE_BASIC_DOUBLE: - case TYPE_BASIC_ERROR_STATUS_T: - case TYPE_BASIC_HANDLE: - return FALSE; - } - return FALSE; - default: - return FALSE; - } -} - -static type_t *get_array_or_ptr_ref(type_t *type) -{ - if (is_ptr(type)) - return type_pointer_get_ref(type); - else if (is_array(type)) - return type_array_get_element(type); - return NULL; -} - -static type_t *append_chain_type(type_t *chain, type_t *type) -{ - type_t *chain_type; - - if (!chain) - return type; - for (chain_type = chain; get_array_or_ptr_ref(chain_type); chain_type = get_array_or_ptr_ref(chain_type)) - ; - - if (is_ptr(chain_type)) - chain_type->details.pointer.ref = type; - else if (is_array(chain_type)) - chain_type->details.array.elem = type; - else - assert(0); - - return chain; -} - -static warning_list_t *append_warning(warning_list_t *list, int num) -{ - warning_t *entry; - - if(!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - entry = xmalloc( sizeof(*entry) ); - entry->num = num; - list_add_tail( list, &entry->entry ); - return list; -} - -static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const declarator_t *decl, - int top) -{ - var_t *v = decl->var; - expr_list_t *sizes = get_attrp(attrs, ATTR_SIZEIS); - expr_list_t *lengs = get_attrp(attrs, ATTR_LENGTHIS); - expr_t *dim; - type_t **ptype; - type_t *func_type = decl ? decl->func_type : NULL; - type_t *type = decl_spec->type; - - if (is_attr(type->attrs, ATTR_INLINE)) - { - if (!func_type) - error_loc("inline attribute applied to non-function type\n"); - else - { - type_t *t; - /* move inline attribute from return type node to function node */ - for (t = func_type; is_ptr(t); t = type_pointer_get_ref(t)) - ; - t->attrs = move_attr(t->attrs, type->attrs, ATTR_INLINE); - } - } - - /* add type onto the end of the pointers in pident->type */ - v->type = append_chain_type(decl ? decl->type : NULL, type); - v->stgclass = decl_spec->stgclass; - v->attrs = attrs; - - /* check for pointer attribute being applied to non-pointer, non-array - * type */ - if (!is_array(v->type)) - { - int ptr_attr = get_attrv(v->attrs, ATTR_POINTERTYPE); - const type_t *ptr = NULL; - /* pointer attributes on the left side of the type belong to the function - * pointer, if one is being declared */ - type_t **pt = func_type ? &func_type : &v->type; - for (ptr = *pt; ptr && !ptr_attr; ) - { - ptr_attr = get_attrv(ptr->attrs, ATTR_POINTERTYPE); - if (!ptr_attr && type_is_alias(ptr)) - ptr = type_alias_get_aliasee(ptr); - else - break; - } - if (is_ptr(ptr)) - { - if (ptr_attr && ptr_attr != FC_UP && - type_get_type(type_pointer_get_ref(ptr)) == TYPE_INTERFACE) - warning_loc_info(&v->loc_info, - "%s: pointer attribute applied to interface " - "pointer type has no effect\n", v->name); - if (!ptr_attr && top && (*pt)->details.pointer.def_fc != FC_RP) - { - /* FIXME: this is a horrible hack to cope with the issue that we - * store an offset to the typeformat string in the type object, but - * two typeformat strings may be written depending on whether the - * pointer is a toplevel parameter or not */ - *pt = duptype(*pt, 1); - } - } - else if (ptr_attr) - error_loc("%s: pointer attribute applied to non-pointer type\n", v->name); - } - - if (is_attr(v->attrs, ATTR_STRING)) - { - type_t *t = type; - - if (!is_ptr(v->type) && !is_array(v->type)) - error_loc("'%s': [string] attribute applied to non-pointer, non-array type\n", - v->name); - - for (;;) - { - if (is_ptr(t)) - t = type_pointer_get_ref(t); - else if (is_array(t)) - t = type_array_get_element(t); - else - break; - } - - if (type_get_type(t) != TYPE_BASIC && - (get_basic_fc(t) != FC_CHAR && - get_basic_fc(t) != FC_BYTE && - get_basic_fc(t) != FC_WCHAR)) - { - error_loc("'%s': [string] attribute is only valid on 'char', 'byte', or 'wchar_t' pointers and arrays\n", - v->name); - } - } - - if (is_attr(v->attrs, ATTR_V1ENUM)) - { - if (type_get_type_detect_alias(v->type) != TYPE_ENUM) - error_loc("'%s': [v1_enum] attribute applied to non-enum type\n", v->name); - } - - if (is_attr(v->attrs, ATTR_RANGE) && !is_allowed_range_type(v->type)) - error_loc("'%s': [range] attribute applied to non-integer type\n", - v->name); - - ptype = &v->type; - if (sizes) LIST_FOR_EACH_ENTRY(dim, sizes, expr_t, entry) - { - if (dim->type != EXPR_VOID) - { - if (is_array(*ptype)) - { - if (!type_array_get_conformance(*ptype) || - type_array_get_conformance(*ptype)->type != EXPR_VOID) - error_loc("%s: cannot specify size_is for an already sized array\n", v->name); - else - *ptype = type_new_array((*ptype)->name, - type_array_get_element(*ptype), FALSE, - 0, dim, NULL, 0); - } - else if (is_ptr(*ptype)) - *ptype = type_new_array((*ptype)->name, type_pointer_get_ref(*ptype), TRUE, - 0, dim, NULL, pointer_default); - else - error_loc("%s: size_is attribute applied to illegal type\n", v->name); - } - - if (is_ptr(*ptype)) - ptype = &(*ptype)->details.pointer.ref; - else if (is_array(*ptype)) - ptype = &(*ptype)->details.array.elem; - else - error_loc("%s: too many expressions in size_is attribute\n", v->name); - } - - ptype = &v->type; - if (lengs) LIST_FOR_EACH_ENTRY(dim, lengs, expr_t, entry) - { - if (dim->type != EXPR_VOID) - { - if (is_array(*ptype)) - { - *ptype = type_new_array((*ptype)->name, - type_array_get_element(*ptype), - type_array_is_decl_as_ptr(*ptype), - type_array_get_dim(*ptype), - type_array_get_conformance(*ptype), - dim, type_array_get_ptr_default_fc(*ptype)); - } - else - error_loc("%s: length_is attribute applied to illegal type\n", v->name); - } - - if (is_ptr(*ptype)) - ptype = &(*ptype)->details.pointer.ref; - else if (is_array(*ptype)) - ptype = &(*ptype)->details.array.elem; - else - error_loc("%s: too many expressions in length_is attribute\n", v->name); - } - - /* v->type is currently pointing to the type on the left-side of the - * declaration, so we need to fix this up so that it is the return type of the - * function and make v->type point to the function side of the declaration */ - if (func_type) - { - type_t *ft, *t; - type_t *return_type = v->type; - v->type = func_type; - for (ft = v->type; is_ptr(ft); ft = type_pointer_get_ref(ft)) - ; - assert(type_get_type_detect_alias(ft) == TYPE_FUNCTION); - ft->details.function->retval = make_var(xstrdup("_RetVal")); - ft->details.function->retval->type = return_type; - /* move calling convention attribute, if present, from pointer nodes to - * function node */ - for (t = v->type; is_ptr(t); t = type_pointer_get_ref(t)) - ft->attrs = move_attr(ft->attrs, t->attrs, ATTR_CALLCONV); - } - else - { - type_t *t; - for (t = v->type; is_ptr(t); t = type_pointer_get_ref(t)) - if (is_attr(t->attrs, ATTR_CALLCONV)) - error_loc("calling convention applied to non-function-pointer type\n"); - } - - if (decl->bits) - v->type = type_new_bitfield(v->type, decl->bits); - - return v; -} - -static var_list_t *set_var_types(attr_list_t *attrs, decl_spec_t *decl_spec, declarator_list_t *decls) -{ - declarator_t *decl, *next; - var_list_t *var_list = NULL; - - LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry ) - { - var_t *var = declare_var(attrs, decl_spec, decl, 0); - var_list = append_var(var_list, var); - free(decl); - } - free(decl_spec); - return var_list; -} - -static ifref_list_t *append_ifref(ifref_list_t *list, ifref_t *iface) -{ - if (!iface) return list; - if (!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - list_add_tail( list, &iface->entry ); - return list; -} - -static ifref_t *make_ifref(type_t *iface) -{ - ifref_t *l = xmalloc(sizeof(ifref_t)); - l->iface = iface; - l->attrs = NULL; - return l; -} - -var_list_t *append_var(var_list_t *list, var_t *var) -{ - if (!var) return list; - if (!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - list_add_tail( list, &var->entry ); - return list; -} - -static var_list_t *append_var_list(var_list_t *list, var_list_t *vars) -{ - if (!vars) return list; - if (!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - list_move_tail( list, vars ); - return list; -} - -var_t *make_var(char *name) -{ - var_t *v = xmalloc(sizeof(var_t)); - v->name = name; - v->type = NULL; - v->attrs = NULL; - v->eval = NULL; - v->stgclass = STG_NONE; - init_loc_info(&v->loc_info); - return v; -} - -static var_t *copy_var(var_t *src, char *name, map_attrs_filter_t attr_filter) -{ - var_t *v = xmalloc(sizeof(var_t)); - v->name = name; - v->type = src->type; - v->attrs = map_attrs(src->attrs, attr_filter); - v->eval = src->eval; - v->stgclass = src->stgclass; - v->loc_info = src->loc_info; - return v; -} - -static declarator_list_t *append_declarator(declarator_list_t *list, declarator_t *d) -{ - if (!d) return list; - if (!list) { - list = xmalloc(sizeof(*list)); - list_init(list); - } - list_add_tail(list, &d->entry); - return list; -} - -static declarator_t *make_declarator(var_t *var) -{ - declarator_t *d = xmalloc(sizeof(*d)); - d->var = var ? var : make_var(NULL); - d->type = NULL; - d->func_type = NULL; - d->bits = NULL; - return d; -} - -static type_t *make_safearray(type_t *type) -{ - return type_new_array(NULL, type_new_alias(type, "SAFEARRAY"), TRUE, 0, - NULL, NULL, FC_RP); -} - -static typelib_t *make_library(const char *name, const attr_list_t *attrs) -{ - typelib_t *typelib = xmalloc(sizeof(*typelib)); - typelib->name = xstrdup(name); - typelib->attrs = attrs; - list_init( &typelib->importlibs ); - return typelib; -} - -static int hash_ident(const char *name) -{ - const char *p = name; - int sum = 0; - /* a simple sum hash is probably good enough */ - while (*p) { - sum += *p; - p++; - } - return sum & (HASHMAX-1); -} - -/***** type repository *****/ - -static struct namespace *find_sub_namespace(struct namespace *namespace, const char *name) -{ - struct namespace *cur; - - LIST_FOR_EACH_ENTRY(cur, &namespace->children, struct namespace, entry) { - if(!strcmp(cur->name, name)) - return cur; - } - - return NULL; -} - -static void push_namespace(const char *name) -{ - struct namespace *namespace; - - namespace = find_sub_namespace(current_namespace, name); - if(!namespace) { - namespace = xmalloc(sizeof(*namespace)); - namespace->name = xstrdup(name); - namespace->parent = current_namespace; - list_add_tail(¤t_namespace->children, &namespace->entry); - list_init(&namespace->children); - memset(namespace->type_hash, 0, sizeof(namespace->type_hash)); - } - - current_namespace = namespace; -} - -static void pop_namespace(const char *name) -{ - assert(!strcmp(current_namespace->name, name) && current_namespace->parent); - current_namespace = current_namespace->parent; -} - -struct rtype { - const char *name; - type_t *type; - int t; - struct rtype *next; -}; - -type_t *reg_type(type_t *type, const char *name, struct namespace *namespace, int t) -{ - struct rtype *nt; - int hash; - if (!name) { - error_loc("registering named type without name\n"); - return type; - } - if (!namespace) - namespace = &global_namespace; - hash = hash_ident(name); - nt = xmalloc(sizeof(struct rtype)); - nt->name = name; - if (is_global_namespace(namespace)) - type->c_name = name; - else - type->c_name = format_namespace(namespace, "__x_", "_C", name); - nt->type = type; - nt->t = t; - nt->next = namespace->type_hash[hash]; - namespace->type_hash[hash] = nt; - if ((t == tsSTRUCT || t == tsUNION)) - fix_incomplete_types(type); - return type; -} - -static int is_incomplete(const type_t *t) -{ - return !t->defined && - (type_get_type_detect_alias(t) == TYPE_STRUCT || - type_get_type_detect_alias(t) == TYPE_UNION || - type_get_type_detect_alias(t) == TYPE_ENCAPSULATED_UNION); -} - -void add_incomplete(type_t *t) -{ - struct typenode *tn = xmalloc(sizeof *tn); - tn->type = t; - list_add_tail(&incomplete_types, &tn->entry); -} - -static void fix_type(type_t *t) -{ - if (type_is_alias(t) && is_incomplete(t)) { - type_t *ot = type_alias_get_aliasee(t); - fix_type(ot); - if (type_get_type_detect_alias(ot) == TYPE_STRUCT || - type_get_type_detect_alias(ot) == TYPE_UNION || - type_get_type_detect_alias(ot) == TYPE_ENCAPSULATED_UNION) - t->details.structure = ot->details.structure; - t->defined = ot->defined; - } -} - -static void fix_incomplete(void) -{ - struct typenode *tn, *next; - - LIST_FOR_EACH_ENTRY_SAFE(tn, next, &incomplete_types, struct typenode, entry) { - fix_type(tn->type); - list_remove(&tn->entry); - free(tn); - } -} - -static void fix_incomplete_types(type_t *complete_type) -{ - struct typenode *tn, *next; - - LIST_FOR_EACH_ENTRY_SAFE(tn, next, &incomplete_types, struct typenode, entry) - { - if (type_is_equal(complete_type, tn->type)) - { - tn->type->details.structure = complete_type->details.structure; - list_remove(&tn->entry); - free(tn); - } - } -} - -static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, attr_list_t *attrs) -{ - const declarator_t *decl; - type_t *type = decl_spec->type; - - if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC)) - attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) ); - - /* We must generate names for tagless enum, struct or union. - Typedef-ing a tagless enum, struct or union means we want the typedef - to be included in a library hence the public attribute. */ - if (type_get_type_detect_alias(type) == TYPE_ENUM || - type_get_type_detect_alias(type) == TYPE_STRUCT || - type_get_type_detect_alias(type) == TYPE_UNION || - type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION) - { - if (!type->name) - type->name = gen_name(); - - /* replace existing attributes when generating a typelib */ - if (do_typelib) - type->attrs = attrs; - } - -#ifdef __REACTOS__ /* r53187 / 5bf224e */ - /* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already have it. */ - if (type_get_type_detect_alias(type) == TYPE_UNION && - is_attr(attrs, ATTR_SWITCHTYPE) && - !is_attr(type->attrs, ATTR_SWITCHTYPE)) - type->attrs = append_attr(type->attrs, make_attrp(ATTR_SWITCHTYPE, get_attrp(attrs, ATTR_SWITCHTYPE))); -#endif - - LIST_FOR_EACH_ENTRY( decl, decls, const declarator_t, entry ) - { - - if (decl->var->name) { - type_t *cur; - var_t *name; - - cur = find_type(decl->var->name, current_namespace, 0); - - /* - * MIDL allows shadowing types that are declared in imported files. - * We don't throw an error in this case and instead add a new type - * (which is earlier on the list in hash table, so it will be used - * instead of shadowed type). - * - * FIXME: We may consider string separated type tables for each input - * for cleaner solution. - */ - if (cur && input_name == cur->loc_info.input_name) - error_loc("%s: redefinition error; original definition was at %s:%d\n", - cur->name, cur->loc_info.input_name, - cur->loc_info.line_number); - - name = declare_var(attrs, decl_spec, decl, 0); - cur = type_new_alias(name->type, name->name); - cur->attrs = attrs; - - if (is_incomplete(cur)) - add_incomplete(cur); - reg_type(cur, cur->name, current_namespace, 0); - } - } - return type; -} - -type_t *find_type(const char *name, struct namespace *namespace, int t) -{ - struct rtype *cur; - - if(namespace && namespace != &global_namespace) { - for(cur = namespace->type_hash[hash_ident(name)]; cur; cur = cur->next) { - if(cur->t == t && !strcmp(cur->name, name)) - return cur->type; - } - } - for(cur = global_namespace.type_hash[hash_ident(name)]; cur; cur = cur->next) { - if(cur->t == t && !strcmp(cur->name, name)) - return cur->type; - } - return NULL; -} - -static type_t *find_type_or_error(const char *name, int t) -{ - type_t *type = find_type(name, NULL, t); - if (!type) { - error_loc("type '%s' not found\n", name); - return NULL; - } - return type; -} - -static type_t *find_type_or_error2(char *name, int t) -{ - type_t *tp = find_type_or_error(name, t); - free(name); - return tp; -} - -int is_type(const char *name) -{ - return find_type(name, current_namespace, 0) != NULL; -} - -type_t *get_type(enum type_type type, char *name, struct namespace *namespace, int t) -{ - type_t *tp; - if (!namespace) - namespace = &global_namespace; - if (name) { - tp = find_type(name, namespace, t); - if (tp) { - free(name); - return tp; - } - } - tp = make_type(type); - tp->name = name; - tp->namespace = namespace; - if (!name) return tp; - return reg_type(tp, name, namespace, t); -} - -/***** constant repository *****/ - -struct rconst { - char *name; - var_t *var; - struct rconst *next; -}; - -struct rconst *const_hash[HASHMAX]; - -static var_t *reg_const(var_t *var) -{ - struct rconst *nc; - int hash; - if (!var->name) { - error_loc("registering constant without name\n"); - return var; - } - hash = hash_ident(var->name); - nc = xmalloc(sizeof(struct rconst)); - nc->name = var->name; - nc->var = var; - nc->next = const_hash[hash]; - const_hash[hash] = nc; - return var; -} - -var_t *find_const(const char *name, int f) -{ - struct rconst *cur = const_hash[hash_ident(name)]; - while (cur && strcmp(cur->name, name)) - cur = cur->next; - if (!cur) { - if (f) error_loc("constant '%s' not found\n", name); - return NULL; - } - return cur->var; -} - -static char *gen_name(void) -{ - static const char format[] = "__WIDL_%s_generated_name_%08lX"; - static unsigned long n = 0; - static const char *file_id; - static size_t size; - char *name; - - if (! file_id) - { - char *dst = dup_basename(input_idl_name, ".idl"); - file_id = dst; - - for (; *dst; ++dst) - if (! isalnum((unsigned char) *dst)) - *dst = '_'; - - size = sizeof format - 7 + strlen(file_id) + 8; - } - - name = xmalloc(size); - sprintf(name, format, file_id, n++); - return name; -} - -struct allowed_attr -{ - unsigned int dce_compatible : 1; - unsigned int acf : 1; - unsigned int on_interface : 1; - unsigned int on_function : 1; - unsigned int on_arg : 1; - unsigned int on_type : 1; - unsigned int on_enum : 1; - unsigned int on_struct : 2; - unsigned int on_union : 1; - unsigned int on_field : 1; - unsigned int on_library : 1; - unsigned int on_dispinterface : 1; - unsigned int on_module : 1; - unsigned int on_coclass : 1; - const char *display_name; -}; - -struct allowed_attr allowed_attr[] = -{ - /* attr { D ACF I Fn ARG T En St Un Fi L DI M C } */ - /* ATTR_AGGREGATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "aggregatable" }, - /* ATTR_ALLOCATE */ { 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "allocate" }, - /* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" }, - /* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" }, - /* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" }, - /* ATTR_ASYNCUUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "async_uuid" }, - /* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" }, - /* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" }, - /* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" }, - /* ATTR_CALLAS */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "call_as" }, - /* ATTR_CALLCONV */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL }, - /* ATTR_CASE */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "case" }, - /* ATTR_CODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "code" }, - /* ATTR_COMMSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "comm_status" }, - /* ATTR_CONST */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "const" }, - /* ATTR_CONTEXTHANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "context_handle" }, - /* ATTR_CONTROL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "control" }, - /* ATTR_DECODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "decode" }, - /* ATTR_DEFAULT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, "default" }, - /* ATTR_DEFAULTBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultbind" }, - /* ATTR_DEFAULTCOLLELEM */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultcollelem" }, - /* ATTR_DEFAULTVALUE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "defaultvalue" }, - /* ATTR_DEFAULTVTABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "defaultvtable" }, - /* ATTR_DISABLECONSISTENCYCHECK */{ 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "disable_consistency_check" }, - /* ATTR_DISPINTERFACE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL }, - /* ATTR_DISPLAYBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "displaybind" }, - /* ATTR_DLLNAME */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, "dllname" }, - /* ATTR_DUAL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "dual" }, - /* ATTR_ENABLEALLOCATE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "enable_allocate" }, - /* ATTR_ENCODE */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "encode" }, - /* ATTR_ENDPOINT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "endpoint" }, - /* ATTR_ENTRY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "entry" }, - /* ATTR_EXPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "explicit_handle" }, - /* ATTR_FAULTSTATUS */ { 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "fault_status" }, - /* ATTR_FORCEALLOCATE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "force_allocate" }, - /* ATTR_HANDLE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "handle" }, - /* ATTR_HELPCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpcontext" }, - /* ATTR_HELPFILE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpfile" }, - /* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstring" }, - /* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" }, - /* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" }, - /* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" }, - /* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, "id" }, - /* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" }, - /* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "ignore" }, - /* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" }, - /* ATTR_IMMEDIATEBIND */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "immediatebind" }, - /* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" }, - /* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" }, - /* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" }, - /* ATTR_INPUTSYNC */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" }, - /* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "length_is" }, - /* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" }, - /* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "licensed" }, - /* ATTR_LOCAL */ { 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "local" }, - /* ATTR_MAYBE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "maybe" }, - /* ATTR_MESSAGE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "message" }, - /* ATTR_NOCODE */ { 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nocode" }, - /* ATTR_NONBROWSABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonbrowsable" }, - /* ATTR_NONCREATABLE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "noncreatable" }, - /* ATTR_NONEXTENSIBLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "nonextensible" }, - /* ATTR_NOTIFY */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify" }, - /* ATTR_NOTIFYFLAG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "notify_flag" }, - /* ATTR_OBJECT */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "object" }, - /* ATTR_ODL */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "odl" }, - /* ATTR_OLEAUTOMATION */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "oleautomation" }, - /* ATTR_OPTIMIZE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optimize" }, - /* ATTR_OPTIONAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "optional" }, - /* ATTR_OUT */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "out" }, - /* ATTR_PARAMLCID */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "lcid" }, - /* ATTR_PARTIALIGNORE */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "partial_ignore" }, - /* ATTR_POINTERDEFAULT */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "pointer_default" }, - /* ATTR_POINTERTYPE */ { 1, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "ref, unique or ptr" }, - /* ATTR_PROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "progid" }, - /* ATTR_PROPGET */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propget" }, - /* ATTR_PROPPUT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propput" }, - /* ATTR_PROPPUTREF */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "propputref" }, - /* ATTR_PROXY */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "proxy" }, - /* ATTR_PUBLIC */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "public" }, - /* ATTR_RANGE */ { 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, "range" }, - /* ATTR_READONLY */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "readonly" }, - /* ATTR_REPRESENTAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "represent_as" }, - /* ATTR_REQUESTEDIT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "requestedit" }, - /* ATTR_RESTRICTED */ { 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, "restricted" }, - /* ATTR_RETVAL */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "retval" }, - /* ATTR_SIZEIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "size_is" }, - /* ATTR_SOURCE */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, "source" }, - /* ATTR_STRICTCONTEXTHANDLE */ { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "strict_context_handle" }, - /* ATTR_STRING */ { 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, "string" }, - /* ATTR_SWITCHIS */ { 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "switch_is" }, - /* ATTR_SWITCHTYPE */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, "switch_type" }, - /* ATTR_THREADING */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "threading" }, - /* ATTR_TRANSMITAS */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "transmit_as" }, - /* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" }, - /* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" }, - /* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" }, - /* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, "uuid" }, - /* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" }, - /* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" }, - /* ATTR_VERSION */ { 1, 0, 1, 0, 0, 1, 1, 2, 0, 0, 1, 0, 0, 1, "version" }, - /* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" }, - /* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" }, -}; - -const char *get_attr_display_name(enum attr_type type) -{ - return allowed_attr[type].display_name; -} - -static attr_list_t *check_iface_attrs(const char *name, attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_interface) - error_loc("inapplicable attribute %s for interface %s\n", - allowed_attr[attr->type].display_name, name); - if (attr->type == ATTR_IMPLICIT_HANDLE) - { - const var_t *var = attr->u.pval; - if (type_get_type( var->type) == TYPE_BASIC && - type_basic_get_type( var->type ) == TYPE_BASIC_HANDLE) - continue; - if (is_aliaschain_attr( var->type, ATTR_HANDLE )) - continue; - error_loc("attribute %s requires a handle type in interface %s\n", - allowed_attr[attr->type].display_name, name); - } - } - return attrs; -} - -static attr_list_t *check_function_attrs(const char *name, attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_function) - error_loc("inapplicable attribute %s for function %s\n", - allowed_attr[attr->type].display_name, name); - } - return attrs; -} - -static void check_arg_attrs(const var_t *arg) -{ - const attr_t *attr; - - if (arg->attrs) - { - LIST_FOR_EACH_ENTRY(attr, arg->attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_arg) - error_loc("inapplicable attribute %s for argument %s\n", - allowed_attr[attr->type].display_name, arg->name); - } - } -} - -static attr_list_t *check_typedef_attrs(attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_type) - error_loc("inapplicable attribute %s for typedef\n", - allowed_attr[attr->type].display_name); - } - return attrs; -} - -static attr_list_t *check_enum_attrs(attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_enum) - error_loc("inapplicable attribute %s for enum\n", - allowed_attr[attr->type].display_name); - } - return attrs; -} - -static attr_list_t *check_struct_attrs(attr_list_t *attrs) -{ - int mask = winrt_mode ? 3 : 1; - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!(allowed_attr[attr->type].on_struct & mask)) - error_loc("inapplicable attribute %s for struct\n", - allowed_attr[attr->type].display_name); - } - return attrs; -} - -static attr_list_t *check_union_attrs(attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_union) - error_loc("inapplicable attribute %s for union\n", - allowed_attr[attr->type].display_name); - } - return attrs; -} - -static attr_list_t *check_field_attrs(const char *name, attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_field) - error_loc("inapplicable attribute %s for field %s\n", - allowed_attr[attr->type].display_name, name); - } - return attrs; -} - -static attr_list_t *check_library_attrs(const char *name, attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_library) - error_loc("inapplicable attribute %s for library %s\n", - allowed_attr[attr->type].display_name, name); - } - return attrs; -} - -static attr_list_t *check_dispiface_attrs(const char *name, attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_dispinterface) - error_loc("inapplicable attribute %s for dispinterface %s\n", - allowed_attr[attr->type].display_name, name); - } - return attrs; -} - -static attr_list_t *check_module_attrs(const char *name, attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_module) - error_loc("inapplicable attribute %s for module %s\n", - allowed_attr[attr->type].display_name, name); - } - return attrs; -} - -static attr_list_t *check_coclass_attrs(const char *name, attr_list_t *attrs) -{ - const attr_t *attr; - if (!attrs) return attrs; - LIST_FOR_EACH_ENTRY(attr, attrs, const attr_t, entry) - { - if (!allowed_attr[attr->type].on_coclass) - error_loc("inapplicable attribute %s for coclass %s\n", - allowed_attr[attr->type].display_name, name); - } - return attrs; -} - -static int is_allowed_conf_type(const type_t *type) -{ - switch (type_get_type(type)) - { - case TYPE_ENUM: - return TRUE; - case TYPE_BASIC: - switch (type_basic_get_type(type)) - { - case TYPE_BASIC_INT8: - case TYPE_BASIC_INT16: - case TYPE_BASIC_INT32: - case TYPE_BASIC_INT64: - case TYPE_BASIC_INT: - case TYPE_BASIC_LONG: - case TYPE_BASIC_CHAR: - case TYPE_BASIC_HYPER: - case TYPE_BASIC_BYTE: - case TYPE_BASIC_WCHAR: - return TRUE; - default: - return FALSE; - } - case TYPE_ALIAS: - /* shouldn't get here because of type_get_type call above */ - assert(0); - /* fall through */ - case TYPE_STRUCT: - case TYPE_UNION: - case TYPE_ENCAPSULATED_UNION: - case TYPE_ARRAY: - case TYPE_POINTER: - case TYPE_VOID: - case TYPE_MODULE: - case TYPE_COCLASS: - case TYPE_FUNCTION: - case TYPE_INTERFACE: - case TYPE_BITFIELD: - return FALSE; - } - return FALSE; -} - -static int is_ptr_guid_type(const type_t *type) -{ - /* first, make sure it is a pointer to something */ - if (!is_ptr(type)) return FALSE; - - /* second, make sure it is a pointer to something of size sizeof(GUID), - * i.e. 16 bytes */ - return (type_memsize(type_pointer_get_ref(type)) == 16); -} - -static void check_conformance_expr_list(const char *attr_name, const var_t *arg, const type_t *container_type, expr_list_t *expr_list) -{ - expr_t *dim; - struct expr_loc expr_loc; - expr_loc.v = arg; - expr_loc.attr = attr_name; - if (expr_list) LIST_FOR_EACH_ENTRY(dim, expr_list, expr_t, entry) - { - if (dim->type != EXPR_VOID) - { - const type_t *expr_type = expr_resolve_type(&expr_loc, container_type, dim); - if (!is_allowed_conf_type(expr_type)) - error_loc_info(&arg->loc_info, "expression must resolve to integral type <= 32bits for attribute %s\n", - attr_name); - } - } -} - -static void check_remoting_fields(const var_t *var, type_t *type); - -/* checks that properties common to fields and arguments are consistent */ -static void check_field_common(const type_t *container_type, - const char *container_name, const var_t *arg) -{ - type_t *type = arg->type; - int more_to_do; - const char *container_type_name; - const char *var_type; - - switch (type_get_type(container_type)) - { - case TYPE_STRUCT: - container_type_name = "struct"; - var_type = "field"; - break; - case TYPE_UNION: - container_type_name = "union"; - var_type = "arm"; - break; - case TYPE_ENCAPSULATED_UNION: - container_type_name = "encapsulated union"; - var_type = "arm"; - break; - case TYPE_FUNCTION: - container_type_name = "function"; - var_type = "parameter"; - break; - default: - /* should be no other container types */ - assert(0); - return; - } - - if (is_attr(arg->attrs, ATTR_LENGTHIS) && - (is_attr(arg->attrs, ATTR_STRING) || is_aliaschain_attr(arg->type, ATTR_STRING))) - error_loc_info(&arg->loc_info, - "string and length_is specified for argument %s are mutually exclusive attributes\n", - arg->name); - - if (is_attr(arg->attrs, ATTR_SIZEIS)) - { - expr_list_t *size_is_exprs = get_attrp(arg->attrs, ATTR_SIZEIS); - check_conformance_expr_list("size_is", arg, container_type, size_is_exprs); - } - if (is_attr(arg->attrs, ATTR_LENGTHIS)) - { - expr_list_t *length_is_exprs = get_attrp(arg->attrs, ATTR_LENGTHIS); - check_conformance_expr_list("length_is", arg, container_type, length_is_exprs); - } - if (is_attr(arg->attrs, ATTR_IIDIS)) - { - struct expr_loc expr_loc; - expr_t *expr = get_attrp(arg->attrs, ATTR_IIDIS); - if (expr->type != EXPR_VOID) - { - const type_t *expr_type; - expr_loc.v = arg; - expr_loc.attr = "iid_is"; - expr_type = expr_resolve_type(&expr_loc, container_type, expr); - if (!expr_type || !is_ptr_guid_type(expr_type)) - error_loc_info(&arg->loc_info, "expression must resolve to pointer to GUID type for attribute iid_is\n"); - } - } - if (is_attr(arg->attrs, ATTR_SWITCHIS)) - { - struct expr_loc expr_loc; - expr_t *expr = get_attrp(arg->attrs, ATTR_SWITCHIS); - if (expr->type != EXPR_VOID) - { - const type_t *expr_type; - expr_loc.v = arg; - expr_loc.attr = "switch_is"; - expr_type = expr_resolve_type(&expr_loc, container_type, expr); - if (!expr_type || !is_allowed_conf_type(expr_type)) - error_loc_info(&arg->loc_info, "expression must resolve to integral type <= 32bits for attribute %s\n", - expr_loc.attr); - } - } - - do - { - more_to_do = FALSE; - - switch (typegen_detect_type(type, arg->attrs, TDT_IGNORE_STRINGS)) - { - case TGT_STRUCT: - case TGT_UNION: - check_remoting_fields(arg, type); - break; - case TGT_INVALID: - { - const char *reason = "is invalid"; - switch (type_get_type(type)) - { - case TYPE_VOID: - reason = "cannot derive from void *"; - break; - case TYPE_FUNCTION: - reason = "cannot be a function pointer"; - break; - case TYPE_BITFIELD: - reason = "cannot be a bit-field"; - break; - case TYPE_COCLASS: - reason = "cannot be a class"; - break; - case TYPE_INTERFACE: - reason = "cannot be a non-pointer to an interface"; - break; - case TYPE_MODULE: - reason = "cannot be a module"; - break; - default: - break; - } - error_loc_info(&arg->loc_info, "%s \'%s\' of %s \'%s\' %s\n", - var_type, arg->name, container_type_name, container_name, reason); - break; - } - case TGT_CTXT_HANDLE: - case TGT_CTXT_HANDLE_POINTER: - if (type_get_type(container_type) != TYPE_FUNCTION) - error_loc_info(&arg->loc_info, - "%s \'%s\' of %s \'%s\' cannot be a context handle\n", - var_type, arg->name, container_type_name, - container_name); - break; - case TGT_STRING: - { - const type_t *t = type; - while (is_ptr(t)) - t = type_pointer_get_ref(t); - if (is_aliaschain_attr(t, ATTR_RANGE)) - warning_loc_info(&arg->loc_info, "%s: range not verified for a string of ranged types\n", arg->name); - break; - } - case TGT_POINTER: - type = type_pointer_get_ref(type); - more_to_do = TRUE; - break; - case TGT_ARRAY: - type = type_array_get_element(type); - more_to_do = TRUE; - break; - case TGT_USER_TYPE: - case TGT_IFACE_POINTER: - case TGT_BASIC: - case TGT_ENUM: - case TGT_RANGE: - /* nothing to do */ - break; - } - } while (more_to_do); -} - -static void check_remoting_fields(const var_t *var, type_t *type) -{ - const var_t *field; - const var_list_t *fields = NULL; - - type = type_get_real_type(type); - - if (type->checked) - return; - - type->checked = TRUE; - - if (type_get_type(type) == TYPE_STRUCT) - { - if (type_is_complete(type)) - fields = type_struct_get_fields(type); - else - error_loc_info(&var->loc_info, "undefined type declaration %s\n", type->name); - } - else if (type_get_type(type) == TYPE_UNION || type_get_type(type) == TYPE_ENCAPSULATED_UNION) - fields = type_union_get_cases(type); - - if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry ) - if (field->type) check_field_common(type, type->name, field); -} - -/* checks that arguments for a function make sense for marshalling and unmarshalling */ -static void check_remoting_args(const var_t *func) -{ - const char *funcname = func->name; - const var_t *arg; - - if (func->type->details.function->args) LIST_FOR_EACH_ENTRY( arg, func->type->details.function->args, const var_t, entry ) - { - const type_t *type = arg->type; - - /* check that [out] parameters have enough pointer levels */ - if (is_attr(arg->attrs, ATTR_OUT)) - { - switch (typegen_detect_type(type, arg->attrs, TDT_ALL_TYPES)) - { - case TGT_BASIC: - case TGT_ENUM: - case TGT_RANGE: - case TGT_STRUCT: - case TGT_UNION: - case TGT_CTXT_HANDLE: - case TGT_USER_TYPE: - error_loc_info(&arg->loc_info, "out parameter \'%s\' of function \'%s\' is not a pointer\n", arg->name, funcname); - break; - case TGT_IFACE_POINTER: - error_loc_info(&arg->loc_info, "out interface pointer \'%s\' of function \'%s\' is not a double pointer\n", arg->name, funcname); - break; - case TGT_STRING: - if (is_array(type)) - { - /* needs conformance or fixed dimension */ - if (type_array_has_conformance(type) && - type_array_get_conformance(type)->type != EXPR_VOID) break; - if (!type_array_has_conformance(type) && type_array_get_dim(type)) break; - } - if (is_attr( arg->attrs, ATTR_IN )) break; - error_loc_info(&arg->loc_info, "out parameter \'%s\' of function \'%s\' cannot be an unsized string\n", arg->name, funcname); - break; - case TGT_INVALID: - /* already error'd before we get here */ - case TGT_CTXT_HANDLE_POINTER: - case TGT_POINTER: - case TGT_ARRAY: - /* OK */ - break; - } - } - - check_field_common(func->type, funcname, arg); - } - - if (type_get_type(type_function_get_rettype(func->type)) != TYPE_VOID) - { - var_t var; - var = *func; - var.type = type_function_get_rettype(func->type); - var.name = xstrdup("return value"); - check_field_common(func->type, funcname, &var); - free(var.name); - } -} - -static void add_explicit_handle_if_necessary(const type_t *iface, var_t *func) -{ - unsigned char explicit_fc, implicit_fc; - - /* check for a defined binding handle */ - if (!get_func_handle_var( iface, func, &explicit_fc, &implicit_fc ) || !explicit_fc) - { - /* no explicit handle specified so add - * "[in] handle_t IDL_handle" as the first parameter to the - * function */ - var_t *idl_handle = make_var(xstrdup("IDL_handle")); - idl_handle->attrs = append_attr(NULL, make_attr(ATTR_IN)); - idl_handle->type = find_type_or_error("handle_t", 0); - type_function_add_head_arg(func->type, idl_handle); - } -} - -static void check_functions(const type_t *iface, int is_inside_library) -{ - const statement_t *stmt; - if (is_attr(iface->attrs, ATTR_EXPLICIT_HANDLE)) - { - STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) ) - { - var_t *func = stmt->u.var; - add_explicit_handle_if_necessary(iface, func); - } - } - if (!is_inside_library && !is_attr(iface->attrs, ATTR_LOCAL)) - { - STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) ) - { - const var_t *func = stmt->u.var; - if (!is_attr(func->attrs, ATTR_LOCAL)) - check_remoting_args(func); - } - } -} - -static char *concat_str(const char *prefix, const char *str) -{ - char *ret = xmalloc(strlen(prefix) + strlen(str) + 1); - strcpy(ret, prefix); - strcat(ret, str); - return ret; -} - -static int async_iface_attrs(attr_list_t *attrs, const attr_t *attr) -{ - switch(attr->type) - { - case ATTR_UUID: - return 0; - case ATTR_ASYNCUUID: - append_attr(attrs, make_attrp(ATTR_UUID, attr->u.pval)); - return 0; - default: - return 1; - } -} - -static int arg_in_attrs(attr_list_t *attrs, const attr_t *attr) -{ - return attr->type != ATTR_OUT && attr->type != ATTR_RETVAL; -} - -static int arg_out_attrs(attr_list_t *attrs, const attr_t *attr) -{ - return attr->type != ATTR_IN; -} - -static void check_async_uuid(type_t *iface) -{ - statement_list_t *stmts = NULL; - statement_t *stmt; - type_t *async_iface; - type_t *inherit; - - if (!is_attr(iface->attrs, ATTR_ASYNCUUID)) return; - - inherit = iface->details.iface->inherit; - if (inherit && strcmp(inherit->name, "IUnknown")) - inherit = inherit->details.iface->async_iface; - if (!inherit) - error_loc("async_uuid applied to an interface with incompatible parent\n"); - - async_iface = get_type(TYPE_INTERFACE, concat_str("Async", iface->name), iface->namespace, 0); - async_iface->attrs = map_attrs(iface->attrs, async_iface_attrs); - - STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) ) - { - var_t *begin_func, *finish_func, *func = stmt->u.var, *arg; - var_list_t *begin_args = NULL, *finish_args = NULL, *args; - - args = func->type->details.function->args; - if (args) LIST_FOR_EACH_ENTRY(arg, args, var_t, entry) - { - if (is_attr(arg->attrs, ATTR_IN) || !is_attr(arg->attrs, ATTR_OUT)) - begin_args = append_var(begin_args, copy_var(arg, strdup(arg->name), arg_in_attrs)); - if (is_attr(arg->attrs, ATTR_OUT)) - finish_args = append_var(finish_args, copy_var(arg, strdup(arg->name), arg_out_attrs)); - } - - begin_func = copy_var(func, concat_str("Begin_", func->name), NULL); - begin_func->type = type_new_function(begin_args); - begin_func->type->attrs = func->attrs; - begin_func->type->details.function->retval = func->type->details.function->retval; - stmts = append_statement(stmts, make_statement_declaration(begin_func)); - - finish_func = copy_var(func, concat_str("Finish_", func->name), NULL); - finish_func->type = type_new_function(finish_args); - finish_func->type->attrs = func->attrs; - finish_func->type->details.function->retval = func->type->details.function->retval; - stmts = append_statement(stmts, make_statement_declaration(finish_func)); - } - - type_interface_define(async_iface, inherit, stmts); - iface->details.iface->async_iface = async_iface->details.iface->async_iface = async_iface; -} - -static void check_statements(const statement_list_t *stmts, int is_inside_library) -{ - const statement_t *stmt; - - if (stmts) LIST_FOR_EACH_ENTRY(stmt, stmts, const statement_t, entry) - { - switch(stmt->type) { - case STMT_LIBRARY: - check_statements(stmt->u.lib->stmts, TRUE); - break; - case STMT_TYPE: - switch(type_get_type(stmt->u.type)) { - case TYPE_INTERFACE: - check_functions(stmt->u.type, is_inside_library); - break; - case TYPE_COCLASS: - if(winrt_mode) - error_loc("coclass is not allowed in Windows Runtime mode\n"); - break; - default: - break; - } - break; - default: - break; - } - } -} - -static void check_all_user_types(const statement_list_t *stmts) -{ - const statement_t *stmt; - - if (stmts) LIST_FOR_EACH_ENTRY(stmt, stmts, const statement_t, entry) - { - if (stmt->type == STMT_LIBRARY) - check_all_user_types(stmt->u.lib->stmts); - else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE && - !is_local(stmt->u.type->attrs)) - { - const statement_t *stmt_func; - STATEMENTS_FOR_EACH_FUNC(stmt_func, type_iface_get_stmts(stmt->u.type)) { - const var_t *func = stmt_func->u.var; - check_for_additional_prototype_types(func->type->details.function->args); - } - } - } -} - -int is_valid_uuid(const char *s) -{ - int i; - - for (i = 0; i < 36; ++i) - if (i == 8 || i == 13 || i == 18 || i == 23) - { - if (s[i] != '-') - return FALSE; - } - else - if (!isxdigit(s[i])) - return FALSE; - - return s[i] == '\0'; -} - -static statement_t *make_statement(enum statement_type type) -{ - statement_t *stmt = xmalloc(sizeof(*stmt)); - stmt->type = type; - return stmt; -} - -static statement_t *make_statement_type_decl(type_t *type) -{ - statement_t *stmt = make_statement(STMT_TYPE); - stmt->u.type = type; - return stmt; -} - -static statement_t *make_statement_reference(type_t *type) -{ - statement_t *stmt = make_statement(STMT_TYPEREF); - stmt->u.type = type; - return stmt; -} - -static statement_t *make_statement_declaration(var_t *var) -{ - statement_t *stmt = make_statement(STMT_DECLARATION); - stmt->u.var = var; - if (var->stgclass == STG_EXTERN && var->eval) - warning("'%s' initialised and declared extern\n", var->name); - if (is_const_decl(var)) - { - if (var->eval) - reg_const(var); - } - else if (type_get_type(var->type) == TYPE_FUNCTION) - check_function_attrs(var->name, var->attrs); - else if (var->stgclass == STG_NONE || var->stgclass == STG_REGISTER) - error_loc("instantiation of data is illegal\n"); - return stmt; -} - -static statement_t *make_statement_library(typelib_t *typelib) -{ - statement_t *stmt = make_statement(STMT_LIBRARY); - stmt->u.lib = typelib; - return stmt; -} - -static statement_t *make_statement_pragma(const char *str) -{ - statement_t *stmt = make_statement(STMT_PRAGMA); - stmt->u.str = str; - return stmt; -} - -static statement_t *make_statement_cppquote(const char *str) -{ - statement_t *stmt = make_statement(STMT_CPPQUOTE); - stmt->u.str = str; - return stmt; -} - -static statement_t *make_statement_importlib(const char *str) -{ - statement_t *stmt = make_statement(STMT_IMPORTLIB); - stmt->u.str = str; - return stmt; -} - -static statement_t *make_statement_import(const char *str) -{ - statement_t *stmt = make_statement(STMT_IMPORT); - stmt->u.str = str; - return stmt; -} - -static statement_t *make_statement_module(type_t *type) -{ - statement_t *stmt = make_statement(STMT_MODULE); - stmt->u.type = type; - return stmt; -} - -static statement_t *make_statement_typedef(declarator_list_t *decls) -{ - declarator_t *decl, *next; - statement_t *stmt; - type_list_t **type_list; - - if (!decls) return NULL; - - stmt = make_statement(STMT_TYPEDEF); - stmt->u.type_list = NULL; - type_list = &stmt->u.type_list; - - LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry ) - { - var_t *var = decl->var; - type_t *type = find_type_or_error(var->name, 0); - *type_list = xmalloc(sizeof(type_list_t)); - (*type_list)->type = type; - (*type_list)->next = NULL; - - type_list = &(*type_list)->next; - free(decl); - free(var); - } - - return stmt; -} - -static statement_list_t *append_statements(statement_list_t *l1, statement_list_t *l2) -{ - if (!l2) return l1; - if (!l1 || l1 == l2) return l2; - list_move_tail (l1, l2); - return l1; -} - -static attr_list_t *append_attribs(attr_list_t *l1, attr_list_t *l2) -{ - if (!l2) return l1; - if (!l1 || l1 == l2) return l2; - list_move_tail (l1, l2); - return l1; -} - -static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt) -{ - if (!stmt) return list; - if (!list) - { - list = xmalloc( sizeof(*list) ); - list_init( list ); - } - list_add_tail( list, &stmt->entry ); - return list; -} - -void init_loc_info(loc_info_t *i) -{ - i->input_name = input_name ? input_name : "stdin"; - i->line_number = line_number; - i->near_text = parser_text; -} - -static void check_def(const type_t *t) -{ - if (t->defined) - error_loc("%s: redefinition error; original definition was at %s:%d\n", - t->name, t->loc_info.input_name, t->loc_info.line_number); -} diff --git a/sdk/tools/widl/parser.tab.h b/sdk/tools/widl/parser.tab.h deleted file mode 100644 index eebf1e566a4..00000000000 --- a/sdk/tools/widl/parser.tab.h +++ /dev/null @@ -1,289 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.5.4. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, - Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* Undocumented macros, especially those whose name start with YY_, - are private implementation details. Do not rely on them. */ - -#ifndef YY_PARSER_PARSER_TAB_H_INCLUDED -# define YY_PARSER_PARSER_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int parser_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - aIDENTIFIER = 258, - aPRAGMA = 259, - aKNOWNTYPE = 260, - aNUM = 261, - aHEXNUM = 262, - aDOUBLE = 263, - aSTRING = 264, - aWSTRING = 265, - aSQSTRING = 266, - aUUID = 267, - aEOF = 268, - aACF = 269, - SHL = 270, - SHR = 271, - MEMBERPTR = 272, - EQUALITY = 273, - INEQUALITY = 274, - GREATEREQUAL = 275, - LESSEQUAL = 276, - LOGICALOR = 277, - LOGICALAND = 278, - ELLIPSIS = 279, - tAGGREGATABLE = 280, - tALLNODES = 281, - tALLOCATE = 282, - tANNOTATION = 283, - tAPPOBJECT = 284, - tASYNC = 285, - tASYNCUUID = 286, - tAUTOHANDLE = 287, - tBINDABLE = 288, - tBOOLEAN = 289, - tBROADCAST = 290, - tBYTE = 291, - tBYTECOUNT = 292, - tCALLAS = 293, - tCALLBACK = 294, - tCASE = 295, - tCDECL = 296, - tCHAR = 297, - tCOCLASS = 298, - tCODE = 299, - tCOMMSTATUS = 300, - tCONST = 301, - tCONTEXTHANDLE = 302, - tCONTEXTHANDLENOSERIALIZE = 303, - tCONTEXTHANDLESERIALIZE = 304, - tCONTROL = 305, - tCPPQUOTE = 306, - tDECODE = 307, - tDEFAULT = 308, - tDEFAULTBIND = 309, - tDEFAULTCOLLELEM = 310, - tDEFAULTVALUE = 311, - tDEFAULTVTABLE = 312, - tDISABLECONSISTENCYCHECK = 313, - tDISPLAYBIND = 314, - tDISPINTERFACE = 315, - tDLLNAME = 316, - tDONTFREE = 317, - tDOUBLE = 318, - tDUAL = 319, - tENABLEALLOCATE = 320, - tENCODE = 321, - tENDPOINT = 322, - tENTRY = 323, - tENUM = 324, - tERRORSTATUST = 325, - tEXPLICITHANDLE = 326, - tEXTERN = 327, - tFALSE = 328, - tFASTCALL = 329, - tFAULTSTATUS = 330, - tFLOAT = 331, - tFORCEALLOCATE = 332, - tHANDLE = 333, - tHANDLET = 334, - tHELPCONTEXT = 335, - tHELPFILE = 336, - tHELPSTRING = 337, - tHELPSTRINGCONTEXT = 338, - tHELPSTRINGDLL = 339, - tHIDDEN = 340, - tHYPER = 341, - tID = 342, - tIDEMPOTENT = 343, - tIGNORE = 344, - tIIDIS = 345, - tIMMEDIATEBIND = 346, - tIMPLICITHANDLE = 347, - tIMPORT = 348, - tIMPORTLIB = 349, - tIN = 350, - tIN_LINE = 351, - tINLINE = 352, - tINPUTSYNC = 353, - tINT = 354, - tINT32 = 355, - tINT3264 = 356, - tINT64 = 357, - tINTERFACE = 358, - tLCID = 359, - tLENGTHIS = 360, - tLIBRARY = 361, - tLICENSED = 362, - tLOCAL = 363, - tLONG = 364, - tMAYBE = 365, - tMESSAGE = 366, - tMETHODS = 367, - tMODULE = 368, - tNAMESPACE = 369, - tNOCODE = 370, - tNONBROWSABLE = 371, - tNONCREATABLE = 372, - tNONEXTENSIBLE = 373, - tNOTIFY = 374, - tNOTIFYFLAG = 375, - tNULL = 376, - tOBJECT = 377, - tODL = 378, - tOLEAUTOMATION = 379, - tOPTIMIZE = 380, - tOPTIONAL = 381, - tOUT = 382, - tPARTIALIGNORE = 383, - tPASCAL = 384, - tPOINTERDEFAULT = 385, - tPRAGMA_WARNING = 386, - tPROGID = 387, - tPROPERTIES = 388, - tPROPGET = 389, - tPROPPUT = 390, - tPROPPUTREF = 391, - tPROXY = 392, - tPTR = 393, - tPUBLIC = 394, - tRANGE = 395, - tREADONLY = 396, - tREF = 397, - tREGISTER = 398, - tREPRESENTAS = 399, - tREQUESTEDIT = 400, - tRESTRICTED = 401, - tRETVAL = 402, - tSAFEARRAY = 403, - tSHORT = 404, - tSIGNED = 405, - tSINGLENODE = 406, - tSIZEIS = 407, - tSIZEOF = 408, - tSMALL = 409, - tSOURCE = 410, - tSTATIC = 411, - tSTDCALL = 412, - tSTRICTCONTEXTHANDLE = 413, - tSTRING = 414, - tSTRUCT = 415, - tSWITCH = 416, - tSWITCHIS = 417, - tSWITCHTYPE = 418, - tTHREADING = 419, - tTRANSMITAS = 420, - tTRUE = 421, - tTYPEDEF = 422, - tUIDEFAULT = 423, - tUNION = 424, - tUNIQUE = 425, - tUNSIGNED = 426, - tUSESGETLASTERROR = 427, - tUSERMARSHAL = 428, - tUUID = 429, - tV1ENUM = 430, - tVARARG = 431, - tVERSION = 432, - tVIPROGID = 433, - tVOID = 434, - tWCHAR = 435, - tWIREMARSHAL = 436, - tAPARTMENT = 437, - tNEUTRAL = 438, - tSINGLE = 439, - tFREE = 440, - tBOTH = 441, - CAST = 442, - PPTR = 443, - POS = 444, - NEG = 445, - ADDRESSOF = 446 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -union YYSTYPE -{ -#line 144 "parser.y" - - attr_t *attr; - attr_list_t *attr_list; - str_list_t *str_list; - expr_t *expr; - expr_list_t *expr_list; - type_t *type; - var_t *var; - var_list_t *var_list; - declarator_t *declarator; - declarator_list_t *declarator_list; - statement_t *statement; - statement_list_t *stmt_list; - warning_t *warning; - warning_list_t *warning_list; - ifref_t *ifref; - ifref_list_t *ifref_list; - char *str; - UUID *uuid; - unsigned int num; - double dbl; - interface_info_t ifinfo; - typelib_t *typelib; - struct _import_t *import; - struct _decl_spec_t *declspec; - enum storage_class stgclass; - -#line 277 "parser.tab.h" - -}; -typedef union YYSTYPE YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE parser_lval; - -int parser_parse (void); - -#endif /* !YY_PARSER_PARSER_TAB_H_INCLUDED */ diff --git a/sdk/tools/widl/parser.yy.c b/sdk/tools/widl/parser.yy.c deleted file mode 100644 index 0937358237e..00000000000 --- a/sdk/tools/widl/parser.yy.c +++ /dev/null @@ -1,3039 +0,0 @@ -#line 2 "parser.yy.c" - -#line 4 "parser.yy.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer parser__create_buffer -#define yy_delete_buffer parser__delete_buffer -#define yy_scan_buffer parser__scan_buffer -#define yy_scan_string parser__scan_string -#define yy_scan_bytes parser__scan_bytes -#define yy_init_buffer parser__init_buffer -#define yy_flush_buffer parser__flush_buffer -#define yy_load_buffer_state parser__load_buffer_state -#define yy_switch_to_buffer parser__switch_to_buffer -#define yypush_buffer_state parser_push_buffer_state -#define yypop_buffer_state parser_pop_buffer_state -#define yyensure_buffer_stack parser_ensure_buffer_stack -#define yy_flex_debug parser__flex_debug -#define yyin parser_in -#define yyleng parser_leng -#define yylex parser_lex -#define yylineno parser_lineno -#define yyout parser_out -#define yyrestart parser_restart -#define yytext parser_text -#define yywrap parser_wrap -#define yyalloc parser_alloc -#define yyrealloc parser_realloc -#define yyfree parser_free - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define parser__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer parser__create_buffer -#endif - -#ifdef yy_delete_buffer -#define parser__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer parser__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define parser__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer parser__scan_buffer -#endif - -#ifdef yy_scan_string -#define parser__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string parser__scan_string -#endif - -#ifdef yy_scan_bytes -#define parser__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes parser__scan_bytes -#endif - -#ifdef yy_init_buffer -#define parser__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer parser__init_buffer -#endif - -#ifdef yy_flush_buffer -#define parser__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer parser__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define parser__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state parser__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define parser__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer parser__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define parser_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state parser_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define parser_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state parser_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define parser_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack parser_ensure_buffer_stack -#endif - -#ifdef yylex -#define parser_lex_ALREADY_DEFINED -#else -#define yylex parser_lex -#endif - -#ifdef yyrestart -#define parser_restart_ALREADY_DEFINED -#else -#define yyrestart parser_restart -#endif - -#ifdef yylex_init -#define parser_lex_init_ALREADY_DEFINED -#else -#define yylex_init parser_lex_init -#endif - -#ifdef yylex_init_extra -#define parser_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra parser_lex_init_extra -#endif - -#ifdef yylex_destroy -#define parser_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy parser_lex_destroy -#endif - -#ifdef yyget_debug -#define parser_get_debug_ALREADY_DEFINED -#else -#define yyget_debug parser_get_debug -#endif - -#ifdef yyset_debug -#define parser_set_debug_ALREADY_DEFINED -#else -#define yyset_debug parser_set_debug -#endif - -#ifdef yyget_extra -#define parser_get_extra_ALREADY_DEFINED -#else -#define yyget_extra parser_get_extra -#endif - -#ifdef yyset_extra -#define parser_set_extra_ALREADY_DEFINED -#else -#define yyset_extra parser_set_extra -#endif - -#ifdef yyget_in -#define parser_get_in_ALREADY_DEFINED -#else -#define yyget_in parser_get_in -#endif - -#ifdef yyset_in -#define parser_set_in_ALREADY_DEFINED -#else -#define yyset_in parser_set_in -#endif - -#ifdef yyget_out -#define parser_get_out_ALREADY_DEFINED -#else -#define yyget_out parser_get_out -#endif - -#ifdef yyset_out -#define parser_set_out_ALREADY_DEFINED -#else -#define yyset_out parser_set_out -#endif - -#ifdef yyget_leng -#define parser_get_leng_ALREADY_DEFINED -#else -#define yyget_leng parser_get_leng -#endif - -#ifdef yyget_text -#define parser_get_text_ALREADY_DEFINED -#else -#define yyget_text parser_get_text -#endif - -#ifdef yyget_lineno -#define parser_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno parser_get_lineno -#endif - -#ifdef yyset_lineno -#define parser_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno parser_set_lineno -#endif - -#ifdef yywrap -#define parser_wrap_ALREADY_DEFINED -#else -#define yywrap parser_wrap -#endif - -#ifdef yyalloc -#define parser_alloc_ALREADY_DEFINED -#else -#define yyalloc parser_alloc -#endif - -#ifdef yyrealloc -#define parser_realloc_ALREADY_DEFINED -#else -#define yyrealloc parser_realloc -#endif - -#ifdef yyfree -#define parser_free_ALREADY_DEFINED -#else -#define yyfree parser_free -#endif - -#ifdef yytext -#define parser_text_ALREADY_DEFINED -#else -#define yytext parser_text -#endif - -#ifdef yyleng -#define parser_leng_ALREADY_DEFINED -#else -#define yyleng parser_leng -#endif - -#ifdef yyin -#define parser_in_ALREADY_DEFINED -#else -#define yyin parser_in -#endif - -#ifdef yyout -#define parser_out_ALREADY_DEFINED -#else -#define yyout parser_out -#endif - -#ifdef yy_flex_debug -#define parser__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug parser__flex_debug -#endif - -#ifdef yylineno -#define parser_lineno_ALREADY_DEFINED -#else -#define yylineno parser_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ - -#include -#include -#include -#include - -/* end standard C headers. */ - -/* begin standard C++ headers. */ - -/* flex integer type definitions */ - -#ifndef YYFLEX_INTTYPES_DEFINED -#define YYFLEX_INTTYPES_DEFINED - -/* Prefer C99 integer types if available. */ -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -/* Include and not because Solaris 2.6 has the former - * and not the latter. - */ -#include -# define YYFLEX_USE_STDINT -# else -# if defined(_MSC_VER) && _MSC_VER >= 1600 -/* Visual C++ 2010 does not define __STDC_VERSION__ and has but not - * . - */ -#include -# define YYFLEX_USE_STDINT -# endif -# endif -# ifdef YYFLEX_USE_STDINT -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -# else -typedef unsigned char flex_uint8_t; -typedef short int flex_int16_t; -typedef unsigned short int flex_uint16_t; -# ifdef __STDC__ -typedef signed char flex_int8_t; -/* ISO C only requires at least 16 bits for int. */ -#include -# if UINT_MAX >= 4294967295 -# define YYFLEX_INT32_DEFINED -typedef int flex_int32_t; -typedef unsigned int flex_uint32_t; -# endif -# else -typedef char flex_int8_t; -# endif -# ifndef YYFLEX_INT32_DEFINED -typedef long int flex_int32_t; -typedef unsigned long int flex_uint32_t; -# endif -# endif -#endif /* YYFLEX_INTTYPES_DEFINED */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an - * integer in range [0..255] for use as an array index. - */ -#define YY_SC_TO_UI(c) ((YY_CHAR) (c)) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - #define YY_LINENO_REWIND_TO(ptr) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = NULL; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -static void yyensure_buffer_stack ( void ); -static void yy_load_buffer_state ( void ); -static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file ); -#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -#define yy_new_buffer yy_create_buffer -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer( yyin, YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ -typedef flex_uint8_t YY_CHAR; - -FILE *yyin = NULL, *yyout = NULL; - -typedef int yy_state_type; - -extern int yylineno; -int yylineno = 1; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state ( void ); -static yy_state_type yy_try_NUL_trans ( yy_state_type current_state ); -static int yy_get_next_buffer ( void ); -static void yynoreturn yy_fatal_error ( const char* msg ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 41 -#define YY_END_OF_BUFFER 42 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static const flex_int16_t yy_accept[210] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 3, 3, - 6, 6, 0, 0, 42, 40, 29, 28, 40, 8, - 40, 12, 40, 40, 24, 24, 40, 40, 40, 27, - 27, 27, 19, 40, 29, 2, 27, 18, 41, 9, - 18, 11, 24, 24, 21, 21, 21, 20, 29, 2, - 3, 6, 6, 6, 13, 18, 34, 38, 32, 0, - 0, 24, 24, 24, 0, 30, 36, 33, 35, 31, - 27, 10, 27, 37, 0, 2, 0, 2, 0, 27, - 17, 15, 14, 24, 0, 21, 21, 0, 2, 2, - 3, 6, 6, 6, 16, 39, 25, 24, 24, 23, - - 27, 0, 0, 27, 24, 0, 21, 6, 6, 0, - 23, 23, 27, 0, 0, 27, 24, 0, 21, 6, - 6, 0, 25, 23, 23, 27, 0, 0, 27, 24, - 0, 21, 6, 5, 27, 0, 0, 27, 24, 0, - 21, 6, 5, 27, 0, 0, 27, 24, 0, 21, - 6, 27, 0, 1, 27, 24, 0, 21, 6, 27, - 0, 27, 0, 24, 4, 0, 26, 0, 27, 0, - 4, 0, 27, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 22, 0 - } ; - -static const YY_CHAR yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 5, 6, 1, 1, 7, 8, 9, - 1, 1, 10, 1, 11, 12, 1, 13, 14, 14, - 14, 14, 14, 14, 14, 14, 14, 1, 1, 15, - 16, 17, 1, 1, 18, 19, 19, 19, 20, 21, - 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, - 22, 24, 25, 22, 26, 22, 22, 27, 28, 22, - 29, 30, 31, 1, 32, 1, 33, 19, 34, 35, - - 36, 19, 37, 38, 39, 22, 22, 40, 41, 42, - 43, 44, 22, 45, 22, 46, 47, 22, 48, 49, - 22, 22, 1, 50, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static const YY_CHAR yy_meta[51] = - { 0, - 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 1, 1, 1, 3, 3, 3, - 3, 4, 4, 4, 4, 4, 4, 4, 1, 1, - 1, 4, 3, 3, 3, 3, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 1 - } ; - -static const flex_int16_t yy_base[251] = - { 0, - 0, 49, 49, 53, 54, 57, 90, 59, 404, 397, - 138, 139, 140, 141, 399, 677, 677, 677, 381, 677, - 389, 677, 378, 382, 176, 138, 48, 377, 50, 0, - 387, 372, 677, 335, 151, 152, 345, 677, 677, 677, - 48, 677, 213, 118, 250, 0, 378, 677, 66, 377, - 0, 0, 339, 337, 677, 138, 677, 677, 677, 363, - 56, 181, 129, 48, 0, 677, 677, 677, 677, 677, - 0, 677, 351, 677, 156, 154, 332, 157, 325, 328, - 677, 677, 677, 274, 0, 309, 0, 71, 360, 359, - 0, 0, 325, 316, 677, 677, 199, 677, 677, 137, - - 337, 320, 317, 309, 333, 0, 368, 308, 296, 195, - 191, 142, 322, 298, 300, 304, 392, 0, 427, 303, - 288, 61, 230, 677, 677, 309, 299, 285, 281, 451, - 0, 486, 288, 0, 296, 275, 284, 271, 510, 0, - 545, 279, 0, 294, 266, 302, 269, 569, 0, 604, - 263, 271, 265, 294, 254, 292, 279, 278, 239, 80, - 244, 239, 0, 351, 0, 164, 677, 238, 245, 0, - 0, 244, 274, 0, 273, 167, 0, 241, 262, 227, - 0, 225, 0, 226, 0, 219, 0, 222, 247, 677, - 0, 0, 0, 0, 246, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 677, 677, 640, - 644, 648, 650, 654, 656, 660, 664, 253, 252, 251, - 249, 248, 668, 242, 239, 238, 672, 234, 227, 226, - 221, 219, 217, 215, 211, 208, 207, 197, 188, 180, - 178, 172, 171, 169, 144, 83, 82, 78, 77, 73 - } ; - -static const flex_int16_t yy_def[251] = - { 0, - 209, 1, 210, 210, 210, 210, 209, 7, 211, 211, - 212, 212, 210, 210, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 213, - 213, 213, 209, 209, 209, 209, 213, 209, 209, 209, - 214, 209, 209, 43, 215, 215, 215, 209, 209, 209, - 216, 217, 217, 217, 209, 214, 209, 209, 209, 209, - 209, 209, 209, 209, 218, 209, 209, 209, 209, 209, - 213, 209, 213, 209, 209, 209, 209, 209, 209, 213, - 209, 209, 209, 209, 219, 215, 215, 209, 209, 209, - 216, 217, 217, 217, 209, 209, 209, 209, 209, 218, - - 213, 209, 209, 213, 209, 220, 215, 217, 217, 209, - 209, 209, 213, 209, 209, 213, 209, 221, 215, 217, - 217, 209, 209, 209, 209, 213, 209, 209, 213, 209, - 222, 215, 217, 223, 213, 209, 209, 213, 209, 224, - 215, 217, 223, 213, 209, 209, 213, 209, 225, 215, - 217, 213, 209, 209, 213, 209, 209, 215, 217, 213, - 209, 213, 226, 209, 227, 209, 209, 209, 213, 228, - 227, 209, 213, 229, 209, 209, 230, 209, 209, 209, - 231, 209, 232, 209, 233, 209, 234, 209, 209, 209, - 235, 236, 237, 238, 209, 239, 240, 241, 242, 243, - - 244, 245, 246, 247, 248, 249, 250, 209, 0, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209 - } ; - -static const flex_int16_t yy_nxt[728] = - { 0, - 16, 17, 18, 19, 20, 16, 21, 22, 16, 16, - 23, 24, 25, 26, 27, 28, 29, 30, 30, 30, - 30, 30, 31, 30, 32, 30, 30, 30, 33, 16, - 16, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 34, - 35, 39, 82, 40, 36, 39, 39, 40, 42, 39, - 49, 42, 66, 67, 50, 69, 70, 88, 97, 97, - 99, 89, 88, 123, 123, 208, 89, 83, 41, 207, - 206, 166, 41, 41, 205, 204, 41, 99, 167, 37, - 16, 17, 18, 19, 20, 16, 21, 22, 16, 16, - - 23, 24, 43, 44, 27, 28, 29, 45, 45, 45, - 45, 46, 47, 46, 46, 46, 46, 46, 33, 16, - 48, 46, 45, 45, 45, 45, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 34, - 39, 39, 39, 39, 209, 95, 203, 55, 55, 61, - 62, 62, 75, 78, 98, 78, 76, 75, 78, 111, - 63, 76, 112, 64, 125, 166, 209, 83, 176, 56, - 56, 202, 167, 201, 200, 98, 111, 63, 53, 53, - 199, 125, 198, 112, 64, 54, 54, 61, 62, 62, - 197, 77, 61, 62, 62, 79, 77, 79, 63, 195, - - 79, 64, 65, 63, 122, 122, 64, 123, 123, 194, - 193, 97, 97, 192, 178, 63, 124, 189, 110, 187, - 63, 185, 64, 183, 65, 84, 84, 64, 179, 177, - 85, 85, 85, 85, 110, 63, 174, 124, 64, 65, - 170, 157, 123, 123, 149, 85, 85, 85, 85, 110, - 140, 131, 63, 118, 106, 100, 196, 191, 190, 64, - 188, 65, 86, 86, 186, 110, 184, 86, 86, 86, - 86, 182, 181, 180, 176, 176, 175, 173, 172, 169, - 168, 165, 86, 86, 86, 86, 105, 105, 163, 163, - 162, 106, 106, 106, 106, 154, 63, 161, 160, 64, - - 159, 155, 163, 154, 164, 164, 106, 106, 106, 106, - 153, 152, 151, 63, 63, 147, 146, 64, 145, 144, - 64, 107, 107, 142, 138, 137, 107, 107, 107, 107, - 136, 63, 135, 134, 133, 129, 128, 127, 64, 126, - 121, 107, 107, 107, 107, 117, 117, 120, 116, 115, - 118, 118, 118, 118, 114, 63, 113, 109, 64, 108, - 90, 90, 104, 164, 164, 118, 118, 118, 118, 103, - 102, 101, 63, 63, 96, 94, 64, 93, 90, 64, - 119, 119, 72, 80, 74, 119, 119, 119, 119, 73, - 63, 72, 68, 60, 59, 58, 57, 64, 209, 39, - - 119, 119, 119, 119, 130, 130, 39, 209, 209, 131, - 131, 131, 131, 209, 63, 209, 209, 64, 209, 209, - 209, 209, 209, 209, 131, 131, 131, 131, 209, 209, - 209, 63, 209, 209, 209, 209, 209, 209, 64, 132, - 132, 209, 209, 209, 132, 132, 132, 132, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 132, - 132, 132, 132, 139, 139, 209, 209, 209, 140, 140, - 140, 140, 209, 63, 209, 209, 64, 209, 209, 209, - 209, 209, 209, 140, 140, 140, 140, 209, 209, 209, - 63, 209, 209, 209, 209, 209, 209, 64, 141, 141, - - 209, 209, 209, 141, 141, 141, 141, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 141, 141, - 141, 141, 148, 148, 209, 209, 209, 149, 149, 149, - 149, 209, 63, 209, 209, 64, 209, 209, 209, 209, - 209, 209, 149, 149, 149, 149, 209, 209, 209, 63, - 209, 209, 209, 209, 209, 209, 64, 150, 150, 209, - 209, 209, 150, 150, 150, 150, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 150, 150, 150, - 150, 156, 156, 209, 209, 209, 157, 157, 157, 157, - 209, 63, 209, 209, 64, 209, 209, 209, 209, 209, - - 209, 157, 157, 157, 157, 209, 209, 209, 63, 209, - 209, 209, 209, 209, 209, 64, 158, 158, 209, 209, - 209, 158, 158, 158, 158, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 158, 158, 158, 158, - 38, 38, 38, 38, 51, 51, 51, 51, 52, 52, - 52, 52, 71, 71, 81, 209, 81, 81, 87, 87, - 91, 209, 91, 91, 92, 209, 92, 92, 143, 209, - 143, 143, 171, 209, 171, 171, 15, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209 - } ; - -static const flex_int16_t yy_chk[728] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 3, 41, 3, 2, 4, 5, 4, 5, 6, - 8, 6, 27, 27, 8, 29, 29, 49, 61, 61, - 64, 49, 88, 122, 122, 250, 88, 41, 3, 249, - 248, 160, 4, 5, 247, 246, 6, 64, 160, 2, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 11, 12, 13, 14, 44, 56, 245, 13, 14, 26, - 26, 26, 35, 36, 63, 76, 35, 75, 78, 100, - 26, 75, 100, 26, 112, 166, 44, 56, 176, 13, - 14, 244, 166, 243, 242, 63, 100, 26, 11, 12, - 241, 112, 240, 100, 26, 11, 12, 25, 25, 25, - 239, 35, 62, 62, 62, 36, 75, 76, 25, 238, - - 78, 25, 25, 62, 110, 110, 62, 110, 110, 237, - 236, 97, 97, 235, 176, 25, 111, 234, 97, 233, - 62, 232, 25, 231, 25, 43, 43, 62, 230, 229, - 43, 43, 43, 43, 97, 43, 228, 111, 43, 43, - 226, 225, 123, 123, 224, 43, 43, 43, 43, 123, - 222, 221, 43, 220, 219, 218, 195, 189, 188, 43, - 186, 43, 45, 45, 184, 123, 182, 45, 45, 45, - 45, 180, 179, 178, 175, 173, 172, 169, 168, 162, - 161, 159, 45, 45, 45, 45, 84, 84, 158, 157, - 155, 84, 84, 84, 84, 154, 84, 153, 152, 84, - - 151, 147, 156, 146, 156, 156, 84, 84, 84, 84, - 145, 144, 142, 84, 156, 138, 137, 156, 136, 135, - 84, 86, 86, 133, 129, 128, 86, 86, 86, 86, - 127, 156, 126, 121, 120, 116, 115, 114, 156, 113, - 109, 86, 86, 86, 86, 105, 105, 108, 104, 103, - 105, 105, 105, 105, 102, 105, 101, 94, 105, 93, - 90, 89, 80, 164, 164, 105, 105, 105, 105, 79, - 77, 73, 105, 164, 60, 54, 164, 53, 50, 105, - 107, 107, 47, 37, 34, 107, 107, 107, 107, 32, - 164, 31, 28, 24, 23, 21, 19, 164, 15, 10, - - 107, 107, 107, 107, 117, 117, 9, 0, 0, 117, - 117, 117, 117, 0, 117, 0, 0, 117, 0, 0, - 0, 0, 0, 0, 117, 117, 117, 117, 0, 0, - 0, 117, 0, 0, 0, 0, 0, 0, 117, 119, - 119, 0, 0, 0, 119, 119, 119, 119, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 119, - 119, 119, 119, 130, 130, 0, 0, 0, 130, 130, - 130, 130, 0, 130, 0, 0, 130, 0, 0, 0, - 0, 0, 0, 130, 130, 130, 130, 0, 0, 0, - 130, 0, 0, 0, 0, 0, 0, 130, 132, 132, - - 0, 0, 0, 132, 132, 132, 132, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 132, 132, - 132, 132, 139, 139, 0, 0, 0, 139, 139, 139, - 139, 0, 139, 0, 0, 139, 0, 0, 0, 0, - 0, 0, 139, 139, 139, 139, 0, 0, 0, 139, - 0, 0, 0, 0, 0, 0, 139, 141, 141, 0, - 0, 0, 141, 141, 141, 141, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 141, 141, 141, - 141, 148, 148, 0, 0, 0, 148, 148, 148, 148, - 0, 148, 0, 0, 148, 0, 0, 0, 0, 0, - - 0, 148, 148, 148, 148, 0, 0, 0, 148, 0, - 0, 0, 0, 0, 0, 148, 150, 150, 0, 0, - 0, 150, 150, 150, 150, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 150, 150, 150, 150, - 210, 210, 210, 210, 211, 211, 211, 211, 212, 212, - 212, 212, 213, 213, 214, 0, 214, 214, 215, 215, - 216, 0, 216, 216, 217, 0, 217, 217, 223, 0, - 223, 223, 227, 0, 227, 227, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, - 209, 209, 209, 209, 209, 209, 209 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -#line 1 "parser.l" -/* -*-C-*- - * IDL Compiler - * - * Copyright 2002 Ove Kaaven - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - */ -#define YY_NO_INPUT 1 - - - - - - -#line 44 "parser.l" - -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_UNISTD_H -#include -#else -#define YY_NO_UNISTD_H -#endif - -#include "widl.h" -#include "utils.h" -#include "parser.h" -#include "wine/wpp.h" - -#include "parser.tab.h" - -static void addcchar(char c); -static char *get_buffered_cstring(void); - -static char *cbuffer; -static int cbufidx; -static int cbufalloc = 0; - -static int kw_token(const char *kw); -static int attr_token(const char *kw); - -static void switch_to_acf(void); - -static warning_list_t *disabled_warnings = NULL; - -#define MAX_IMPORT_DEPTH 20 -struct { - YY_BUFFER_STATE state; - char *input_name; - int line_number; - char *temp_name; -} import_stack[MAX_IMPORT_DEPTH]; -int import_stack_ptr = 0; - -/* converts an integer in string form to an unsigned long and prints an error - * on overflow */ -static unsigned int xstrtoul(const char *nptr, char **endptr, int base) -{ - unsigned long val; - - errno = 0; - val = strtoul(nptr, endptr, base); - if ((val == ULONG_MAX && errno == ERANGE) || ((unsigned int)val != val)) - error_loc("integer constant %s is too large\n", nptr); - return val; -} - -UUID *parse_uuid(const char *u) -{ - UUID* uuid = xmalloc(sizeof(UUID)); - char b[3]; - /* it would be nice to use UuidFromStringA */ - uuid->Data1 = strtoul(u, NULL, 16); - uuid->Data2 = strtoul(u+9, NULL, 16); - uuid->Data3 = strtoul(u+14, NULL, 16); - b[2] = 0; - memcpy(b, u+19, 2); uuid->Data4[0] = strtoul(b, NULL, 16); - memcpy(b, u+21, 2); uuid->Data4[1] = strtoul(b, NULL, 16); - memcpy(b, u+24, 2); uuid->Data4[2] = strtoul(b, NULL, 16); - memcpy(b, u+26, 2); uuid->Data4[3] = strtoul(b, NULL, 16); - memcpy(b, u+28, 2); uuid->Data4[4] = strtoul(b, NULL, 16); - memcpy(b, u+30, 2); uuid->Data4[5] = strtoul(b, NULL, 16); - memcpy(b, u+32, 2); uuid->Data4[6] = strtoul(b, NULL, 16); - memcpy(b, u+34, 2); uuid->Data4[7] = strtoul(b, NULL, 16); - return uuid; -} - -#line 1029 "parser.yy.c" -/* - ************************************************************************** - * The flexer starts here - ************************************************************************** - */ -#line 1035 "parser.yy.c" - -#define INITIAL 0 -#define QUOTE 1 -#define WSTRQUOTE 2 -#define ATTR 3 -#define PP_LINE 4 -#define PP_PRAGMA 5 -#define SQUOTE 6 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals ( void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput ( void ); -#else -static int input ( void ); -#endif - -#endif - - static int yy_start_stack_ptr = 0; - static int yy_start_stack_depth = 0; - static int *yy_start_stack = NULL; - - static void yy_push_state ( int _new_state ); - - static void yy_pop_state ( void ); - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - int n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK /*LINTED*/break; -#endif - -#define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - yy_state_type yy_current_state; - char *yy_cp, *yy_bp; - int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - { -#line 132 "parser.l" - -#line 1269 "parser.yy.c" - - while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 210 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - ++yy_cp; - } - while ( yy_current_state != 209 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 133 "parser.l" -yy_push_state(PP_PRAGMA); - YY_BREAK -case 2: -YY_RULE_SETUP -#line 134 "parser.l" -yy_push_state(PP_LINE); - YY_BREAK -case 3: -YY_RULE_SETUP -#line 135 "parser.l" -{ - int lineno; - char *cptr, *fname; - yy_pop_state(); - lineno = (int)strtol(yytext, &cptr, 10); - if(!lineno) - error_loc("Malformed '#...' line-directive; invalid linenumber\n"); - fname = strchr(cptr, '"'); - if(!fname) - error_loc("Malformed '#...' line-directive; missing filename\n"); - fname++; - cptr = strchr(fname, '"'); - if(!cptr) - error_loc("Malformed '#...' line-directive; missing terminating \"\n"); - *cptr = '\0'; - line_number = lineno - 1; /* We didn't read the newline */ - input_name = xstrdup(fname); - } - YY_BREAK -case 4: -YY_RULE_SETUP -#line 153 "parser.l" -yyless(9); yy_pop_state(); return tCPPQUOTE; - YY_BREAK -case 5: -YY_RULE_SETUP -#line 154 "parser.l" -{ - if(import_stack_ptr) { - if(!winrt_mode) - error_loc("winrt IDL file imported in non-winrt mode\n"); - }else { - const char *ptr = yytext+5; - - winrt_mode = TRUE; - - while(isspace(*ptr)) - ptr++; - if(!strncmp(ptr, "ns_prefix", 9) && (!*(ptr += 9) || isspace(*ptr))) - use_abi_namespace = TRUE; - } - yy_pop_state(); - } - YY_BREAK -case 6: -YY_RULE_SETUP -#line 170 "parser.l" -parser_lval.str = xstrdup(yytext); yy_pop_state(); return aPRAGMA; - YY_BREAK -case 7: -YY_RULE_SETUP -#line 171 "parser.l" -return tPRAGMA_WARNING; - YY_BREAK -case 8: -YY_RULE_SETUP -#line 172 "parser.l" -yy_push_state(QUOTE); cbufidx = 0; - YY_BREAK -case 9: -YY_RULE_SETUP -#line 173 "parser.l" -{ - yy_pop_state(); - parser_lval.str = get_buffered_cstring(); - return aSTRING; - } - YY_BREAK -case 10: -YY_RULE_SETUP -#line 178 "parser.l" -yy_push_state(WSTRQUOTE); cbufidx = 0; - YY_BREAK -case 11: -YY_RULE_SETUP -#line 179 "parser.l" -{ - yy_pop_state(); - parser_lval.str = get_buffered_cstring(); - return aWSTRING; - } - YY_BREAK -case 12: -YY_RULE_SETUP -#line 184 "parser.l" -yy_push_state(SQUOTE); cbufidx = 0; - YY_BREAK -case 13: -YY_RULE_SETUP -#line 185 "parser.l" -{ - yy_pop_state(); - parser_lval.str = get_buffered_cstring(); - return aSQSTRING; - } - YY_BREAK -case 14: -#line 191 "parser.l" -case 15: -YY_RULE_SETUP -#line 191 "parser.l" -addcchar(yytext[1]); - YY_BREAK -case 16: -YY_RULE_SETUP -#line 192 "parser.l" -addcchar(yytext[1]); - YY_BREAK -case 17: -YY_RULE_SETUP -#line 193 "parser.l" -addcchar('\\'); addcchar(yytext[1]); - YY_BREAK -case 18: -YY_RULE_SETUP -#line 194 "parser.l" -addcchar(yytext[0]); - YY_BREAK -case 19: -YY_RULE_SETUP -#line 195 "parser.l" -yy_push_state(ATTR); return '['; - YY_BREAK -case 20: -YY_RULE_SETUP -#line 196 "parser.l" -yy_pop_state(); return ']'; - YY_BREAK -case 21: -YY_RULE_SETUP -#line 197 "parser.l" -return attr_token(yytext); - YY_BREAK -case 22: -YY_RULE_SETUP -#line 198 "parser.l" -{ - parser_lval.uuid = parse_uuid(yytext); - return aUUID; - } - YY_BREAK -case 23: -YY_RULE_SETUP -#line 202 "parser.l" -{ - parser_lval.num = xstrtoul(yytext, NULL, 0); - return aHEXNUM; - } - YY_BREAK -case 24: -YY_RULE_SETUP -#line 206 "parser.l" -{ - parser_lval.num = xstrtoul(yytext, NULL, 0); - return aNUM; - } - YY_BREAK -case 25: -YY_RULE_SETUP -#line 210 "parser.l" -{ - parser_lval.dbl = strtod(yytext, NULL); - return aDOUBLE; - } - YY_BREAK -case 26: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ -YY_RULE_SETUP -#line 214 "parser.l" -return tSAFEARRAY; - YY_BREAK -case 27: -YY_RULE_SETUP -#line 215 "parser.l" -return kw_token(yytext); - YY_BREAK -case 28: -/* rule 28 can match eol */ -YY_RULE_SETUP -#line 216 "parser.l" -line_number++; - YY_BREAK -case 29: -YY_RULE_SETUP -#line 217 "parser.l" - - YY_BREAK -case 30: -YY_RULE_SETUP -#line 218 "parser.l" -return SHL; - YY_BREAK -case 31: -YY_RULE_SETUP -#line 219 "parser.l" -return SHR; - YY_BREAK -case 32: -YY_RULE_SETUP -#line 220 "parser.l" -return MEMBERPTR; - YY_BREAK -case 33: -YY_RULE_SETUP -#line 221 "parser.l" -return EQUALITY; - YY_BREAK -case 34: -YY_RULE_SETUP -#line 222 "parser.l" -return INEQUALITY; - YY_BREAK -case 35: -YY_RULE_SETUP -#line 223 "parser.l" -return GREATEREQUAL; - YY_BREAK -case 36: -YY_RULE_SETUP -#line 224 "parser.l" -return LESSEQUAL; - YY_BREAK -case 37: -YY_RULE_SETUP -#line 225 "parser.l" -return LOGICALOR; - YY_BREAK -case 38: -YY_RULE_SETUP -#line 226 "parser.l" -return LOGICALAND; - YY_BREAK -case 39: -YY_RULE_SETUP -#line 227 "parser.l" -return ELLIPSIS; - YY_BREAK -case 40: -YY_RULE_SETUP -#line 228 "parser.l" -return yytext[0]; - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(QUOTE): -case YY_STATE_EOF(WSTRQUOTE): -case YY_STATE_EOF(ATTR): -case YY_STATE_EOF(PP_LINE): -case YY_STATE_EOF(PP_PRAGMA): -case YY_STATE_EOF(SQUOTE): -#line 229 "parser.l" -{ - if (import_stack_ptr) - return aEOF; - if (acf_name) - { - switch_to_acf(); - return aACF; - } - yyterminate(); - } - YY_BREAK -case 41: -YY_RULE_SETUP -#line 239 "parser.l" -ECHO; - YY_BREAK -#line 1604 "parser.yy.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ - } /* end of user's declarations */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - char *source = (yytext_ptr); - int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr) - 1); - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc( (void *) b->yy_ch_buf, - (yy_size_t) (b->yy_buf_size + 2) ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = NULL; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if (((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - int new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc( - (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - /* "- 2" to take care of EOB's */ - YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - yy_state_type yy_current_state; - char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 210 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - int yy_is_jam; - char *yy_cp = (yy_c_buf_p); - - YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 210 ) - yy_c = yy_meta[yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c]; - yy_is_jam = (yy_current_state == 209); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_UNPUT - -#endif - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (int) ((yy_c_buf_p) - (yytext_ptr)); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart( yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return 0; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer( yyin, YY_BUF_SIZE ); - } - - yy_init_buffer( YY_CURRENT_BUFFER, input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer( b, file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree( (void *) b->yy_ch_buf ); - - yyfree( (void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer( b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - yy_size_t num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - yy_size_t grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return NULL; - - b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = NULL; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer( b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (const char * yystr ) -{ - - return yy_scan_bytes( yystr, (int) strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = (yy_size_t) (_yybytes_len + 2); - buf = (char *) yyalloc( n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer( buf, n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - - static void yy_push_state (int _new_state ) -{ - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; - - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_size_t) (yy_start_stack_depth) * sizeof( int ); - - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) yyalloc( new_size ); - - else - (yy_start_stack) = (int *) yyrealloc( - (void *) (yy_start_stack), new_size ); - - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } - - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - - BEGIN(_new_state); -} - - static void yy_pop_state (void) -{ - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yynoreturn yy_fatal_error (const char* msg ) -{ - fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param _line_number line number - * - */ -void yyset_lineno (int _line_number ) -{ - - yylineno = _line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param _in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * _in_str ) -{ - yyin = _in_str ; -} - -void yyset_out (FILE * _out_str ) -{ - yyout = _out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int _bdebug ) -{ - yy_flex_debug = _bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = NULL; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = NULL; - (yy_init) = 0; - (yy_start) = 0; - - (yy_start_stack_ptr) = 0; - (yy_start_stack_depth) = 0; - (yy_start_stack) = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = NULL; - yyout = NULL; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer( YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Destroy the start condition stack. */ - yyfree( (yy_start_stack) ); - (yy_start_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, const char * s2, int n ) -{ - - int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (const char * s ) -{ - int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return malloc(size); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return realloc(ptr, size); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#line 239 "parser.l" - - -#ifndef parser_wrap -int parser_wrap(void) -{ - return 1; -} -#endif - -struct keyword { - const char *kw; - int token; -}; - -/* This table MUST be alphabetically sorted on the kw field */ -static const struct keyword keywords[] = { - {"FALSE", tFALSE}, - {"NULL", tNULL}, - {"TRUE", tTRUE}, - {"__cdecl", tCDECL}, - {"__fastcall", tFASTCALL}, - {"__int32", tINT32}, - {"__int3264", tINT3264}, - {"__int64", tINT64}, - {"__pascal", tPASCAL}, - {"__stdcall", tSTDCALL}, - {"_cdecl", tCDECL}, - {"_fastcall", tFASTCALL}, - {"_pascal", tPASCAL}, - {"_stdcall", tSTDCALL}, - {"boolean", tBOOLEAN}, - {"byte", tBYTE}, - {"case", tCASE}, - {"cdecl", tCDECL}, - {"char", tCHAR}, - {"coclass", tCOCLASS}, - {"const", tCONST}, - {"cpp_quote", tCPPQUOTE}, - {"default", tDEFAULT}, - {"dispinterface", tDISPINTERFACE}, - {"double", tDOUBLE}, - {"enum", tENUM}, - {"error_status_t", tERRORSTATUST}, - {"extern", tEXTERN}, - {"float", tFLOAT}, - {"handle_t", tHANDLET}, - {"hyper", tHYPER}, - {"import", tIMPORT}, - {"importlib", tIMPORTLIB}, - {"inline", tINLINE}, - {"int", tINT}, - {"interface", tINTERFACE}, - {"library", tLIBRARY}, - {"long", tLONG}, - {"methods", tMETHODS}, - {"module", tMODULE}, - {"namespace", tNAMESPACE}, - {"pascal", tPASCAL}, - {"properties", tPROPERTIES}, - {"register", tREGISTER}, - {"short", tSHORT}, - {"signed", tSIGNED}, - {"sizeof", tSIZEOF}, - {"small", tSMALL}, - {"static", tSTATIC}, - {"stdcall", tSTDCALL}, - {"struct", tSTRUCT}, - {"switch", tSWITCH}, - {"typedef", tTYPEDEF}, - {"union", tUNION}, - {"unsigned", tUNSIGNED}, - {"void", tVOID}, - {"wchar_t", tWCHAR}, -}; -#define NKEYWORDS (sizeof(keywords)/sizeof(keywords[0])) - -/* keywords only recognized in attribute lists - * This table MUST be alphabetically sorted on the kw field - */ -static const struct keyword attr_keywords[] = -{ - {"aggregatable", tAGGREGATABLE}, - {"all_nodes", tALLNODES}, - {"allocate", tALLOCATE}, - {"annotation", tANNOTATION}, - {"apartment", tAPARTMENT}, - {"appobject", tAPPOBJECT}, - {"async", tASYNC}, - {"async_uuid", tASYNCUUID}, - {"auto_handle", tAUTOHANDLE}, - {"bindable", tBINDABLE}, - {"both", tBOTH}, - {"broadcast", tBROADCAST}, - {"byte_count", tBYTECOUNT}, - {"call_as", tCALLAS}, - {"callback", tCALLBACK}, - {"code", tCODE}, - {"comm_status", tCOMMSTATUS}, - {"context_handle", tCONTEXTHANDLE}, - {"context_handle_noserialize", tCONTEXTHANDLENOSERIALIZE}, - {"context_handle_serialize", tCONTEXTHANDLENOSERIALIZE}, - {"control", tCONTROL}, - {"decode", tDECODE}, - {"defaultbind", tDEFAULTBIND}, - {"defaultcollelem", tDEFAULTCOLLELEM}, - {"defaultvalue", tDEFAULTVALUE}, - {"defaultvtable", tDEFAULTVTABLE}, - {"disable_consistency_check", tDISABLECONSISTENCYCHECK}, - {"displaybind", tDISPLAYBIND}, - {"dllname", tDLLNAME}, - {"dont_free", tDONTFREE}, - {"dual", tDUAL}, - {"enable_allocate", tENABLEALLOCATE}, - {"encode", tENCODE}, - {"endpoint", tENDPOINT}, - {"entry", tENTRY}, - {"explicit_handle", tEXPLICITHANDLE}, - {"fault_status", tFAULTSTATUS}, - {"force_allocate", tFORCEALLOCATE}, - {"free", tFREE}, - {"handle", tHANDLE}, - {"helpcontext", tHELPCONTEXT}, - {"helpfile", tHELPFILE}, - {"helpstring", tHELPSTRING}, - {"helpstringcontext", tHELPSTRINGCONTEXT}, - {"helpstringdll", tHELPSTRINGDLL}, - {"hidden", tHIDDEN}, - {"id", tID}, - {"idempotent", tIDEMPOTENT}, - {"ignore", tIGNORE}, - {"iid_is", tIIDIS}, - {"immediatebind", tIMMEDIATEBIND}, - {"implicit_handle", tIMPLICITHANDLE}, - {"in", tIN}, - {"in_line", tIN_LINE}, - {"input_sync", tINPUTSYNC}, - {"lcid", tLCID}, - {"length_is", tLENGTHIS}, - {"licensed", tLICENSED}, - {"local", tLOCAL}, - {"maybe", tMAYBE}, - {"message", tMESSAGE}, - {"neutral", tNEUTRAL}, - {"nocode", tNOCODE}, - {"nonbrowsable", tNONBROWSABLE}, - {"noncreatable", tNONCREATABLE}, - {"nonextensible", tNONEXTENSIBLE}, - {"notify", tNOTIFY}, - {"notify_flag", tNOTIFYFLAG}, - {"object", tOBJECT}, - {"odl", tODL}, - {"oleautomation", tOLEAUTOMATION}, - {"optimize", tOPTIMIZE}, - {"optional", tOPTIONAL}, - {"out", tOUT}, - {"partial_ignore", tPARTIALIGNORE}, - {"pointer_default", tPOINTERDEFAULT}, - {"progid", tPROGID}, - {"propget", tPROPGET}, - {"propput", tPROPPUT}, - {"propputref", tPROPPUTREF}, - {"proxy", tPROXY}, - {"ptr", tPTR}, - {"public", tPUBLIC}, - {"range", tRANGE}, - {"readonly", tREADONLY}, - {"ref", tREF}, - {"represent_as", tREPRESENTAS}, - {"requestedit", tREQUESTEDIT}, - {"restricted", tRESTRICTED}, - {"retval", tRETVAL}, - {"single", tSINGLE}, - {"single_node", tSINGLENODE}, - {"size_is", tSIZEIS}, - {"source", tSOURCE}, - {"strict_context_handle", tSTRICTCONTEXTHANDLE}, - {"string", tSTRING}, - {"switch_is", tSWITCHIS}, - {"switch_type", tSWITCHTYPE}, - {"threading", tTHREADING}, - {"transmit_as", tTRANSMITAS}, - {"uidefault", tUIDEFAULT}, - {"unique", tUNIQUE}, - {"user_marshal", tUSERMARSHAL}, - {"usesgetlasterror", tUSESGETLASTERROR}, - {"uuid", tUUID}, - {"v1_enum", tV1ENUM}, - {"vararg", tVARARG}, - {"version", tVERSION}, - {"vi_progid", tVIPROGID}, - {"wire_marshal", tWIREMARSHAL}, -}; - -/* attributes TODO: - custom - first_is - last_is - max_is - min_is -*/ - -#define KWP(p) ((const struct keyword *)(p)) - -static int kw_cmp_func(const void *s1, const void *s2) -{ - return strcmp(KWP(s1)->kw, KWP(s2)->kw); -} - -static int kw_token(const char *kw) -{ - struct keyword key, *kwp; - key.kw = kw; - kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func); - if (kwp && (winrt_mode || kwp->token != tNAMESPACE)) { - parser_lval.str = xstrdup(kwp->kw); - return kwp->token; - } - parser_lval.str = xstrdup(kw); - return is_type(kw) ? aKNOWNTYPE : aIDENTIFIER; -} - -static int attr_token(const char *kw) -{ - struct keyword key, *kwp; - key.kw = kw; - kwp = bsearch(&key, attr_keywords, sizeof(attr_keywords)/sizeof(attr_keywords[0]), - sizeof(attr_keywords[0]), kw_cmp_func); - if (kwp) { - parser_lval.str = xstrdup(kwp->kw); - return kwp->token; - } - return kw_token(kw); -} - -static void addcchar(char c) -{ - if(cbufidx >= cbufalloc) - { - cbufalloc += 1024; - cbuffer = xrealloc(cbuffer, cbufalloc * sizeof(cbuffer[0])); - if(cbufalloc > 65536) - parser_warning("Reallocating string buffer larger than 64kB\n"); - } - cbuffer[cbufidx++] = c; -} - -static char *get_buffered_cstring(void) -{ - addcchar(0); - return xstrdup(cbuffer); -} - -void pop_import(void) -{ - int ptr = import_stack_ptr-1; - - fclose(yyin); - yy_delete_buffer( YY_CURRENT_BUFFER ); - yy_switch_to_buffer( import_stack[ptr].state ); - if (temp_name) { - unlink(temp_name); - free(temp_name); - } - temp_name = import_stack[ptr].temp_name; - input_name = import_stack[ptr].input_name; - line_number = import_stack[ptr].line_number; - import_stack_ptr--; -} - -struct imports { - char *name; - struct imports *next; -} *first_import; - -int do_import(char *fname) -{ - FILE *f; - char *path, *name; - struct imports *import; - int ptr = import_stack_ptr; - int ret, fd; - - import = first_import; - while (import && strcmp(import->name, fname)) - import = import->next; - if (import) return 0; /* already imported */ - - import = xmalloc(sizeof(struct imports)); - import->name = xstrdup(fname); - import->next = first_import; - first_import = import; - - /* don't search for a file name with a path in the include directories, - * for compatibility with MIDL */ - if (strchr( fname, '/' ) || strchr( fname, '\\' )) - path = xstrdup( fname ); - else if (!(path = wpp_find_include( fname, input_name ))) - error_loc("Unable to open include file %s\n", fname); - - if (import_stack_ptr == MAX_IMPORT_DEPTH) - error_loc("Exceeded max import depth\n"); - - import_stack[ptr].temp_name = temp_name; - import_stack[ptr].input_name = input_name; - import_stack[ptr].line_number = line_number; - import_stack_ptr++; - input_name = path; - line_number = 1; - - name = xstrdup( "widl.XXXXXX" ); - if((fd = mkstemps( name, 0 )) == -1) - error("Could not generate a temp name from %s\n", name); - - temp_name = name; - if (!(f = fdopen(fd, "wt"))) - error("Could not open fd %s for writing\n", name); - - ret = wpp_parse( path, f ); - fclose( f ); - if (ret) exit(1); - - if((f = fopen(temp_name, "r")) == NULL) - error_loc("Unable to open %s\n", temp_name); - - import_stack[ptr].state = YY_CURRENT_BUFFER; - yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE)); - return 1; -} - -void abort_import(void) -{ - int ptr; - - for (ptr=0; ptrnum == warning) - return; - warning_entry = xmalloc( sizeof(*warning_entry) ); - warning_entry->num = warning; - list_add_tail(disabled_warnings, &warning_entry->entry); -} - -static void warning_enable(int warning) -{ - warning_t *warning_entry; - LIST_FOR_EACH_ENTRY(warning_entry, disabled_warnings, warning_t, entry) - if(warning_entry->num == warning) - { - list_remove(&warning_entry->entry); - free(warning_entry); - break; - } -} - -int do_warning(char *toggle, warning_list_t *wnum) -{ - warning_t *warning, *next; - int ret = 1; - if(!disabled_warnings) - { - disabled_warnings = xmalloc( sizeof(*disabled_warnings) ); - list_init( disabled_warnings ); - } - - if(!strcmp(toggle, "disable")) - LIST_FOR_EACH_ENTRY(warning, wnum, warning_t, entry) - warning_disable(warning->num); - else if(!strcmp(toggle, "enable")) - LIST_FOR_EACH_ENTRY(warning, wnum, warning_t, entry) - warning_enable(warning->num); - else - ret = 0; - - LIST_FOR_EACH_ENTRY_SAFE(warning, next, wnum, warning_t, entry) - free(warning); - return ret; -} - -int is_warning_enabled(int warning) -{ - warning_t *warning_entry; - if(!disabled_warnings) - return 1; - LIST_FOR_EACH_ENTRY(warning_entry, disabled_warnings, warning_t, entry) - if(warning_entry->num == warning) - return 0; - return 1; -} - diff --git a/sdk/tools/widl/parser.yy.h b/sdk/tools/widl/parser.yy.h deleted file mode 100644 index 1cc3c578e75..00000000000 --- a/sdk/tools/widl/parser.yy.h +++ /dev/null @@ -1,698 +0,0 @@ -#ifndef parser_HEADER_H -#define parser_HEADER_H 1 -#define parser_IN_HEADER 1 - -#line 6 "parser.yy.h" - -#line 8 "parser.yy.h" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 6 -#define YY_FLEX_SUBMINOR_VERSION 4 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -#ifdef yy_create_buffer -#define parser__create_buffer_ALREADY_DEFINED -#else -#define yy_create_buffer parser__create_buffer -#endif - -#ifdef yy_delete_buffer -#define parser__delete_buffer_ALREADY_DEFINED -#else -#define yy_delete_buffer parser__delete_buffer -#endif - -#ifdef yy_scan_buffer -#define parser__scan_buffer_ALREADY_DEFINED -#else -#define yy_scan_buffer parser__scan_buffer -#endif - -#ifdef yy_scan_string -#define parser__scan_string_ALREADY_DEFINED -#else -#define yy_scan_string parser__scan_string -#endif - -#ifdef yy_scan_bytes -#define parser__scan_bytes_ALREADY_DEFINED -#else -#define yy_scan_bytes parser__scan_bytes -#endif - -#ifdef yy_init_buffer -#define parser__init_buffer_ALREADY_DEFINED -#else -#define yy_init_buffer parser__init_buffer -#endif - -#ifdef yy_flush_buffer -#define parser__flush_buffer_ALREADY_DEFINED -#else -#define yy_flush_buffer parser__flush_buffer -#endif - -#ifdef yy_load_buffer_state -#define parser__load_buffer_state_ALREADY_DEFINED -#else -#define yy_load_buffer_state parser__load_buffer_state -#endif - -#ifdef yy_switch_to_buffer -#define parser__switch_to_buffer_ALREADY_DEFINED -#else -#define yy_switch_to_buffer parser__switch_to_buffer -#endif - -#ifdef yypush_buffer_state -#define parser_push_buffer_state_ALREADY_DEFINED -#else -#define yypush_buffer_state parser_push_buffer_state -#endif - -#ifdef yypop_buffer_state -#define parser_pop_buffer_state_ALREADY_DEFINED -#else -#define yypop_buffer_state parser_pop_buffer_state -#endif - -#ifdef yyensure_buffer_stack -#define parser_ensure_buffer_stack_ALREADY_DEFINED -#else -#define yyensure_buffer_stack parser_ensure_buffer_stack -#endif - -#ifdef yylex -#define parser_lex_ALREADY_DEFINED -#else -#define yylex parser_lex -#endif - -#ifdef yyrestart -#define parser_restart_ALREADY_DEFINED -#else -#define yyrestart parser_restart -#endif - -#ifdef yylex_init -#define parser_lex_init_ALREADY_DEFINED -#else -#define yylex_init parser_lex_init -#endif - -#ifdef yylex_init_extra -#define parser_lex_init_extra_ALREADY_DEFINED -#else -#define yylex_init_extra parser_lex_init_extra -#endif - -#ifdef yylex_destroy -#define parser_lex_destroy_ALREADY_DEFINED -#else -#define yylex_destroy parser_lex_destroy -#endif - -#ifdef yyget_debug -#define parser_get_debug_ALREADY_DEFINED -#else -#define yyget_debug parser_get_debug -#endif - -#ifdef yyset_debug -#define parser_set_debug_ALREADY_DEFINED -#else -#define yyset_debug parser_set_debug -#endif - -#ifdef yyget_extra -#define parser_get_extra_ALREADY_DEFINED -#else -#define yyget_extra parser_get_extra -#endif - -#ifdef yyset_extra -#define parser_set_extra_ALREADY_DEFINED -#else -#define yyset_extra parser_set_extra -#endif - -#ifdef yyget_in -#define parser_get_in_ALREADY_DEFINED -#else -#define yyget_in parser_get_in -#endif - -#ifdef yyset_in -#define parser_set_in_ALREADY_DEFINED -#else -#define yyset_in parser_set_in -#endif - -#ifdef yyget_out -#define parser_get_out_ALREADY_DEFINED -#else -#define yyget_out parser_get_out -#endif - -#ifdef yyset_out -#define parser_set_out_ALREADY_DEFINED -#else -#define yyset_out parser_set_out -#endif - -#ifdef yyget_leng -#define parser_get_leng_ALREADY_DEFINED -#else -#define yyget_leng parser_get_leng -#endif - -#ifdef yyget_text -#define parser_get_text_ALREADY_DEFINED -#else -#define yyget_text parser_get_text -#endif - -#ifdef yyget_lineno -#define parser_get_lineno_ALREADY_DEFINED -#else -#define yyget_lineno parser_get_lineno -#endif - -#ifdef yyset_lineno -#define parser_set_lineno_ALREADY_DEFINED -#else -#define yyset_lineno parser_set_lineno -#endif - -#ifdef yywrap -#define parser_wrap_ALREADY_DEFINED -#else -#define yywrap parser_wrap -#endif - -#ifdef yyalloc -#define parser_alloc_ALREADY_DEFINED -#else -#define yyalloc parser_alloc -#endif - -#ifdef yyrealloc -#define parser_realloc_ALREADY_DEFINED -#else -#define yyrealloc parser_realloc -#endif - -#ifdef yyfree -#define parser_free_ALREADY_DEFINED -#else -#define yyfree parser_free -#endif - -#ifdef yytext -#define parser_text_ALREADY_DEFINED -#else -#define yytext parser_text -#endif - -#ifdef yyleng -#define parser_leng_ALREADY_DEFINED -#else -#define yyleng parser_leng -#endif - -#ifdef yyin -#define parser_in_ALREADY_DEFINED -#else -#define yyin parser_in -#endif - -#ifdef yyout -#define parser_out_ALREADY_DEFINED -#else -#define yyout parser_out -#endif - -#ifdef yy_flex_debug -#define parser__flex_debug_ALREADY_DEFINED -#else -#define yy_flex_debug parser__flex_debug -#endif - -#ifdef yylineno -#define parser_lineno_ALREADY_DEFINED -#else -#define yylineno parser_lineno -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ - -#include -#include -#include -#include - -/* end standard C headers. */ - -/* begin standard C++ headers. */ - -/* flex integer type definitions */ - -#ifndef YYFLEX_INTTYPES_DEFINED -#define YYFLEX_INTTYPES_DEFINED - -/* Prefer C99 integer types if available. */ -# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L -/* Include and not because Solaris 2.6 has the former - * and not the latter. - */ -#include -# define YYFLEX_USE_STDINT -# else -# if defined(_MSC_VER) && _MSC_VER >= 1600 -/* Visual C++ 2010 does not define __STDC_VERSION__ and has but not - * . - */ -#include -# define YYFLEX_USE_STDINT -# endif -# endif -# ifdef YYFLEX_USE_STDINT -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -# else -typedef unsigned char flex_uint8_t; -typedef short int flex_int16_t; -typedef unsigned short int flex_uint16_t; -# ifdef __STDC__ -typedef signed char flex_int8_t; -/* ISO C only requires at least 16 bits for int. */ -#include -# if UINT_MAX >= 4294967295 -# define YYFLEX_INT32_DEFINED -typedef int flex_int32_t; -typedef unsigned int flex_uint32_t; -# endif -# else -typedef char flex_int8_t; -# endif -# ifndef YYFLEX_INT32_DEFINED -typedef long int flex_int32_t; -typedef unsigned long int flex_uint32_t; -# endif -# endif -#endif /* YYFLEX_INTTYPES_DEFINED */ - -/* TODO: this is always defined, so inline it */ -#define yyconst const - -#if defined(__GNUC__) && __GNUC__ >= 3 -#define yynoreturn __attribute__((__noreturn__)) -#else -#define yynoreturn -#endif - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - int yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -void yyrestart ( FILE *input_file ); -void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size ); -void yy_delete_buffer ( YY_BUFFER_STATE b ); -void yy_flush_buffer ( YY_BUFFER_STATE b ); -void yypush_buffer_state ( YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state ( void ); - -YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size ); -YY_BUFFER_STATE yy_scan_string ( const char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len ); - -void *yyalloc ( yy_size_t ); -void *yyrealloc ( void *, yy_size_t ); -void yyfree ( void * ); - -/* Begin user sect3 */ - -extern int yylineno; - -extern char *yytext; -#ifdef yytext_ptr -#undef yytext_ptr -#endif -#define yytext_ptr yytext - -#ifdef YY_HEADER_EXPORT_START_CONDITIONS -#define INITIAL 0 -#define QUOTE 1 -#define WSTRQUOTE 2 -#define ATTR 3 -#define PP_LINE 4 -#define PP_PRAGMA 5 -#define SQUOTE 6 - -#endif - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy ( void ); - -int yyget_debug ( void ); - -void yyset_debug ( int debug_flag ); - -YY_EXTRA_TYPE yyget_extra ( void ); - -void yyset_extra ( YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in ( void ); - -void yyset_in ( FILE * _in_str ); - -FILE *yyget_out ( void ); - -void yyset_out ( FILE * _out_str ); - - int yyget_leng ( void ); - -char *yyget_text ( void ); - -int yyget_lineno ( void ); - -void yyset_lineno ( int _line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap ( void ); -#else -extern int yywrap ( void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy ( char *, const char *, int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen ( const char * ); -#endif - -#ifndef YY_NO_INPUT - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - -#undef YY_NEW_FILE -#undef YY_FLUSH_BUFFER -#undef yy_set_bol -#undef yy_new_buffer -#undef yy_set_interactive -#undef YY_DO_BEFORE_ACTION - -#ifdef YY_DECL_IS_OURS -#undef YY_DECL_IS_OURS -#undef YY_DECL -#endif - -#ifndef parser__create_buffer_ALREADY_DEFINED -#undef yy_create_buffer -#endif -#ifndef parser__delete_buffer_ALREADY_DEFINED -#undef yy_delete_buffer -#endif -#ifndef parser__scan_buffer_ALREADY_DEFINED -#undef yy_scan_buffer -#endif -#ifndef parser__scan_string_ALREADY_DEFINED -#undef yy_scan_string -#endif -#ifndef parser__scan_bytes_ALREADY_DEFINED -#undef yy_scan_bytes -#endif -#ifndef parser__init_buffer_ALREADY_DEFINED -#undef yy_init_buffer -#endif -#ifndef parser__flush_buffer_ALREADY_DEFINED -#undef yy_flush_buffer -#endif -#ifndef parser__load_buffer_state_ALREADY_DEFINED -#undef yy_load_buffer_state -#endif -#ifndef parser__switch_to_buffer_ALREADY_DEFINED -#undef yy_switch_to_buffer -#endif -#ifndef parser_push_buffer_state_ALREADY_DEFINED -#undef yypush_buffer_state -#endif -#ifndef parser_pop_buffer_state_ALREADY_DEFINED -#undef yypop_buffer_state -#endif -#ifndef parser_ensure_buffer_stack_ALREADY_DEFINED -#undef yyensure_buffer_stack -#endif -#ifndef parser_lex_ALREADY_DEFINED -#undef yylex -#endif -#ifndef parser_restart_ALREADY_DEFINED -#undef yyrestart -#endif -#ifndef parser_lex_init_ALREADY_DEFINED -#undef yylex_init -#endif -#ifndef parser_lex_init_extra_ALREADY_DEFINED -#undef yylex_init_extra -#endif -#ifndef parser_lex_destroy_ALREADY_DEFINED -#undef yylex_destroy -#endif -#ifndef parser_get_debug_ALREADY_DEFINED -#undef yyget_debug -#endif -#ifndef parser_set_debug_ALREADY_DEFINED -#undef yyset_debug -#endif -#ifndef parser_get_extra_ALREADY_DEFINED -#undef yyget_extra -#endif -#ifndef parser_set_extra_ALREADY_DEFINED -#undef yyset_extra -#endif -#ifndef parser_get_in_ALREADY_DEFINED -#undef yyget_in -#endif -#ifndef parser_set_in_ALREADY_DEFINED -#undef yyset_in -#endif -#ifndef parser_get_out_ALREADY_DEFINED -#undef yyget_out -#endif -#ifndef parser_set_out_ALREADY_DEFINED -#undef yyset_out -#endif -#ifndef parser_get_leng_ALREADY_DEFINED -#undef yyget_leng -#endif -#ifndef parser_get_text_ALREADY_DEFINED -#undef yyget_text -#endif -#ifndef parser_get_lineno_ALREADY_DEFINED -#undef yyget_lineno -#endif -#ifndef parser_set_lineno_ALREADY_DEFINED -#undef yyset_lineno -#endif -#ifndef parser_get_column_ALREADY_DEFINED -#undef yyget_column -#endif -#ifndef parser_set_column_ALREADY_DEFINED -#undef yyset_column -#endif -#ifndef parser_wrap_ALREADY_DEFINED -#undef yywrap -#endif -#ifndef parser_get_lval_ALREADY_DEFINED -#undef yyget_lval -#endif -#ifndef parser_set_lval_ALREADY_DEFINED -#undef yyset_lval -#endif -#ifndef parser_get_lloc_ALREADY_DEFINED -#undef yyget_lloc -#endif -#ifndef parser_set_lloc_ALREADY_DEFINED -#undef yyset_lloc -#endif -#ifndef parser_alloc_ALREADY_DEFINED -#undef yyalloc -#endif -#ifndef parser_realloc_ALREADY_DEFINED -#undef yyrealloc -#endif -#ifndef parser_free_ALREADY_DEFINED -#undef yyfree -#endif -#ifndef parser_text_ALREADY_DEFINED -#undef yytext -#endif -#ifndef parser_leng_ALREADY_DEFINED -#undef yyleng -#endif -#ifndef parser_in_ALREADY_DEFINED -#undef yyin -#endif -#ifndef parser_out_ALREADY_DEFINED -#undef yyout -#endif -#ifndef parser__flex_debug_ALREADY_DEFINED -#undef yy_flex_debug -#endif -#ifndef parser_lineno_ALREADY_DEFINED -#undef yylineno -#endif -#ifndef parser_tables_fload_ALREADY_DEFINED -#undef yytables_fload -#endif -#ifndef parser_tables_destroy_ALREADY_DEFINED -#undef yytables_destroy -#endif -#ifndef parser_TABLES_NAME_ALREADY_DEFINED -#undef yyTABLES_NAME -#endif - -#line 239 "parser.l" - - -#line 697 "parser.yy.h" -#undef parser_IN_HEADER -#endif /* parser_HEADER_H */ diff --git a/sdk/tools/wpp/CMakeLists.txt b/sdk/tools/wpp/CMakeLists.txt index 389b0c5130f..11999c26949 100644 --- a/sdk/tools/wpp/CMakeLists.txt +++ b/sdk/tools/wpp/CMakeLists.txt @@ -30,15 +30,17 @@ if(CMAKE_CROSSCOMPILING) include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/wine) endif() +FLEX_TARGET(pp_scanner ppl.l ${CMAKE_CURRENT_BINARY_DIR}/ppl.yy.c) +BISON_TARGET(pp_parser ppy.y ${CMAKE_CURRENT_BINARY_DIR}/ppy.tab.c COMPILE_FLAGS "-p ppy_") +ADD_FLEX_BISON_DEPENDENCY(pp_scanner pp_parser) + list(APPEND SOURCE preproc.c - wpp.c - ppl.yy.c - ppy.tab.c) + wpp.c) if(CMAKE_CROSSCOMPILING) - add_library(wpp ${SOURCE}) + add_library(wpp ${SOURCE} ${FLEX_pp_scanner_OUTPUT_SOURCE} ${BISON_pp_parser_OUTPUT_SOURCE}) else() - add_library(wpphost ${SOURCE}) + add_library(wpphost ${SOURCE} ${FLEX_pp_scanner_OUTPUTS} ${BISON_pp_parser_OUTPUTS}) target_link_libraries(wpphost PRIVATE host_includes) endif() diff --git a/sdk/tools/wpp/ppl.yy.c b/sdk/tools/wpp/ppl.yy.c deleted file mode 100644 index 36daf267c26..00000000000 --- a/sdk/tools/wpp/ppl.yy.c +++ /dev/null @@ -1,4602 +0,0 @@ -#line 2 "ppl.yy.c" -#line 125 "ppl.l" -#include "config.h" -#include "wine/port.h" - - - -#line 9 "ppl.yy.c" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define yy_create_buffer ppy__create_buffer -#define yy_delete_buffer ppy__delete_buffer -#define yy_flex_debug ppy__flex_debug -#define yy_init_buffer ppy__init_buffer -#define yy_flush_buffer ppy__flush_buffer -#define yy_load_buffer_state ppy__load_buffer_state -#define yy_switch_to_buffer ppy__switch_to_buffer -#define yyin ppy_in -#define yyleng ppy_leng -#define yylex ppy_lex -#define yylineno ppy_lineno -#define yyout ppy_out -#define yyrestart ppy_restart -#define yytext ppy_text -#define yywrap ppy_wrap -#define yyalloc ppy_alloc -#define yyrealloc ppy_realloc -#define yyfree ppy_free - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE ppy_restart(ppy_in ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -extern int ppy_leng; - -extern FILE *ppy_in, *ppy_out; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - #define YY_LESS_LINENO(n) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up ppy_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up ppy_text again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - -#ifndef YY_STRUCT_YY_BUFFER_STATE -#define YY_STRUCT_YY_BUFFER_STATE -struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via ppy_restart()), so that the user can continue scanning by - * just pointing ppy_in at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when ppy_text is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int ppy_leng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow ppy_wrap()'s to do buffer switches - * instead of setting up a fresh ppy_in. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void ppy_restart (FILE *input_file ); -void ppy__switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE ppy__create_buffer (FILE *file,int size ); -void ppy__delete_buffer (YY_BUFFER_STATE b ); -void ppy__flush_buffer (YY_BUFFER_STATE b ); -void ppy_push_buffer_state (YY_BUFFER_STATE new_buffer ); -void ppy_pop_buffer_state (void ); - -static void ppy_ensure_buffer_stack (void ); -static void ppy__load_buffer_state (void ); -static void ppy__init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER ppy__flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE ppy__scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE ppy__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE ppy__scan_bytes (yyconst char *bytes,int len ); - -void *ppy_alloc (yy_size_t ); -void *ppy_realloc (void *,yy_size_t ); -void ppy_free (void * ); - -#define yy_new_buffer ppy__create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - ppy_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - ppy__create_buffer(ppy_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - ppy_ensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - ppy__create_buffer(ppy_in,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -typedef unsigned char YY_CHAR; - -FILE *ppy_in = (FILE *) 0, *ppy_out = (FILE *) 0; - -typedef int yy_state_type; - -extern int ppy_lineno; - -int ppy_lineno = 1; - -extern char *ppy_text; -#define yytext_ptr ppy_text - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up ppy_text. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - ppy_leng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 143 -#define YY_END_OF_BUFFER 144 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[416] = - { 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 117, 117, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 144, 133, 134, 135, 121, 142, - 122, 133, 132, 133, 134, 1, 21, 16, 18, 16, - 21, 20, 17, 17, 17, 17, 17, 17, 17, 17, - 68, 71, 69, 70, 28, 25, 26, 24, 28, 23, - 28, 28, 123, 131, 124, 142, 125, 126, 142, 127, - 128, 117, 118, 117, 77, 75, 77, 77, 74, 77, - - 78, 82, 84, 83, 142, 79, 90, 86, 90, 85, - 88, 90, 90, 87, 90, 92, 100, 102, 95, 101, - 97, 96, 93, 97, 92, 106, 106, 104, 103, 106, - 114, 113, 110, 111, 107, 108, 109, 114, 114, 133, - 134, 138, 121, 138, 122, 133, 132, 133, 53, 50, - 47, 53, 52, 53, 51, 53, 33, 35, 53, 53, - 53, 53, 49, 53, 53, 58, 55, 56, 58, 54, - 58, 62, 59, 60, 62, 62, 22, 67, 64, 67, - 65, 67, 63, 67, 29, 30, 32, 32, 32, 29, - 1, 140, 143, 141, 139, 139, 133, 134, 133, 116, - - 120, 132, 136, 137, 134, 1, 16, 17, 17, 17, - 17, 17, 17, 17, 17, 18, 19, 20, 17, 17, - 17, 17, 17, 11, 17, 17, 17, 17, 17, 68, - 69, 70, 72, 70, 25, 27, 28, 123, 130, 129, - 130, 125, 127, 117, 117, 117, 119, 75, 73, 74, - 76, 77, 78, 79, 81, 79, 86, 85, 90, 87, - 91, 90, 92, 94, 97, 96, 96, 93, 99, 97, - 92, 106, 104, 103, 106, 105, 106, 114, 114, 112, - 115, 114, 133, 138, 138, 50, 44, 41, 33, 34, - 33, 33, 37, 35, 35, 35, 39, 45, 43, 46, - - 40, 48, 49, 132, 42, 55, 54, 57, 58, 59, - 61, 0, 22, 64, 63, 67, 66, 67, 29, 31, - 32, 29, 140, 139, 120, 120, 17, 17, 17, 17, - 17, 17, 11, 17, 17, 17, 17, 17, 17, 17, - 69, 80, 89, 98, 34, 34, 33, 33, 33, 36, - 35, 35, 35, 132, 120, 17, 12, 13, 17, 17, - 17, 17, 17, 17, 15, 17, 17, 17, 34, 34, - 34, 33, 36, 36, 35, 132, 17, 12, 13, 14, - 4, 7, 9, 17, 17, 15, 17, 8, 17, 34, - 36, 36, 36, 132, 3, 14, 4, 7, 9, 10, - - 17, 6, 8, 17, 36, 132, 3, 10, 2, 6, - 5, 38, 2, 5, 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 5, 6, 7, 1, 1, 8, 9, 10, - 11, 12, 1, 13, 1, 14, 15, 16, 17, 17, - 17, 17, 17, 17, 17, 18, 18, 1, 1, 19, - 20, 21, 1, 1, 22, 22, 22, 22, 22, 22, - 23, 23, 23, 23, 23, 24, 23, 23, 23, 23, - 23, 23, 23, 23, 25, 23, 23, 26, 23, 23, - 1, 27, 1, 1, 28, 1, 29, 30, 31, 32, - - 33, 34, 35, 36, 37, 36, 36, 38, 39, 40, - 41, 42, 36, 43, 44, 45, 46, 36, 47, 48, - 36, 36, 1, 49, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[50] = - { 0, - 1, 2, 3, 2, 1, 4, 5, 1, 6, 7, - 8, 9, 8, 10, 11, 12, 12, 12, 1, 1, - 13, 14, 15, 15, 15, 15, 16, 17, 14, 14, - 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, - 15, 15, 15, 15, 15, 15, 15, 15, 1 - } ; - -static yyconst flex_int16_t yy_base[460] = - { 0, - 0, 48, 55, 0, 102, 103, 130, 0, 177, 178, - 179, 182, 186, 187, 104, 107, 214, 0, 261, 262, - 289, 0, 338, 0, 386, 389, 414, 439, 466, 0, - 515, 0, 564, 0, 399, 403, 612, 638, 665, 0, - 428, 618, 714, 763, 1130, 0, 49, 1886, 1886, 1886, - 1886, 96, 0, 109, 118, 1886, 1886, 811, 1886, 1126, - 111, 111, 858, 1095, 154, 161, 1090, 1083, 1085, 1095, - 0, 1886, 184, 124, 1886, 196, 1886, 1886, 254, 1886, - 0, 199, 0, 1886, 1886, 269, 0, 1886, 1120, 0, - 1886, 0, 1886, 263, 1886, 208, 1886, 267, 1112, 277, - - 0, 1886, 1886, 1886, 271, 281, 1886, 393, 1886, 396, - 1886, 1107, 396, 0, 406, 0, 1886, 1886, 1113, 1886, - 400, 905, 0, 418, 954, 1886, 430, 1886, 1886, 433, - 0, 1886, 1886, 1886, 1886, 1886, 1886, 432, 435, 0, - 449, 1886, 1886, 1886, 1886, 444, 0, 1003, 1886, 456, - 1886, 1099, 1886, 1110, 1886, 449, 1037, 714, 443, 1097, - 603, 0, 623, 1083, 1066, 1886, 615, 1886, 619, 0, - 632, 1886, 644, 1886, 635, 634, 635, 1886, 655, 1886, - 1886, 646, 0, 659, 0, 1886, 1886, 725, 738, 741, - 1886, 742, 1886, 1886, 0, 735, 0, 747, 741, 1886, - - 0, 0, 1886, 1111, 755, 1886, 0, 0, 1079, 747, - 754, 1074, 1067, 1069, 1079, 1886, 1886, 1104, 1069, 717, - 1070, 1058, 1067, 777, 1063, 1052, 1062, 1056, 1041, 0, - 0, 1886, 1886, 1079, 787, 1886, 1078, 0, 1886, 1886, - 1077, 0, 0, 0, 743, 765, 1886, 791, 1886, 1069, - 1886, 1075, 0, 1886, 794, 1074, 795, 798, 1062, 0, - 1886, 1071, 0, 1886, 789, 0, 1085, 0, 801, 1070, - 0, 804, 1886, 1886, 807, 1886, 1069, 0, 804, 1886, - 1886, 1068, 806, 1886, 0, 818, 1886, 1886, 847, 843, - 874, 799, 0, 905, 903, 800, 1886, 1886, 1886, 1886, - - 1886, 1886, 1066, 1026, 1886, 823, 0, 1886, 1048, 824, - 1886, 1047, 816, 871, 0, 1886, 1886, 1027, 0, 1886, - 1006, 872, 876, 0, 1134, 0, 969, 971, 948, 943, - 906, 897, 880, 875, 871, 864, 844, 835, 833, 799, - 0, 884, 1886, 890, 907, 845, 618, 863, 873, 914, - 889, 910, 912, 799, 1183, 795, 938, 942, 796, 786, - 747, 702, 695, 614, 959, 610, 598, 428, 932, 945, - 946, 1886, 947, 952, 1886, 406, 395, 975, 984, 985, - 990, 993, 994, 385, 372, 997, 365, 998, 247, 1886, - 966, 991, 994, 241, 1023, 1024, 1029, 1032, 1033, 1036, - - 153, 1037, 1040, 74, 1886, 22, 1041, 1044, 1045, 1054, - 1055, 0, 1062, 1063, 1886, 1232, 1249, 1266, 1283, 1300, - 1317, 1334, 1351, 1368, 1385, 1402, 1419, 1436, 1449, 1451, - 1468, 1485, 1502, 1519, 1536, 1553, 1570, 1587, 1598, 1615, - 1632, 1638, 1655, 1672, 1689, 1695, 1712, 1729, 1746, 1752, - 1758, 1775, 1792, 1800, 1817, 1834, 1851, 1056, 1868 - } ; - -static yyconst flex_int16_t yy_def[460] = - { 0, - 415, 1, 415, 3, 416, 416, 415, 7, 417, 417, - 418, 418, 419, 419, 420, 420, 415, 17, 421, 421, - 415, 21, 415, 23, 422, 422, 423, 423, 415, 29, - 415, 31, 415, 33, 424, 424, 425, 425, 415, 39, - 426, 426, 427, 427, 415, 428, 415, 415, 415, 415, - 415, 429, 430, 429, 415, 415, 415, 415, 415, 58, - 415, 415, 58, 63, 63, 63, 63, 63, 63, 63, - 431, 415, 432, 415, 415, 415, 415, 415, 415, 415, - 430, 415, 433, 415, 415, 434, 435, 415, 434, 436, - 415, 437, 415, 438, 415, 415, 415, 415, 439, 415, - - 440, 415, 415, 415, 441, 415, 415, 415, 415, 415, - 415, 415, 415, 442, 415, 443, 415, 415, 415, 415, - 444, 445, 446, 415, 446, 415, 415, 415, 415, 415, - 447, 415, 415, 415, 415, 415, 415, 448, 415, 428, - 415, 415, 415, 415, 415, 429, 430, 449, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 430, 415, 430, 415, 415, 415, 415, 415, 450, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 451, 452, 453, 415, 415, 415, 415, 453, - 415, 415, 415, 415, 454, 454, 428, 415, 429, 415, - - 455, 430, 415, 415, 415, 415, 58, 63, 63, 63, - 63, 63, 63, 63, 63, 415, 415, 415, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 431, - 456, 415, 415, 415, 415, 415, 415, 433, 415, 415, - 415, 435, 436, 437, 438, 438, 415, 415, 415, 439, - 415, 415, 440, 415, 415, 415, 415, 415, 415, 442, - 415, 415, 443, 415, 444, 457, 445, 446, 415, 415, - 125, 415, 415, 415, 415, 415, 415, 447, 448, 415, - 415, 415, 429, 415, 449, 415, 415, 415, 415, 415, - 415, 415, 458, 415, 415, 415, 415, 415, 415, 415, - - 415, 415, 415, 430, 415, 415, 450, 415, 415, 415, - 415, 415, 415, 415, 451, 415, 415, 415, 453, 415, - 415, 453, 415, 454, 459, 455, 63, 63, 63, 63, - 63, 63, 415, 63, 63, 63, 63, 63, 63, 63, - 456, 415, 415, 415, 415, 415, 415, 415, 415, 458, - 415, 415, 415, 430, 459, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 415, 415, - 415, 415, 415, 415, 415, 430, 63, 415, 415, 63, - 63, 63, 63, 63, 63, 415, 63, 63, 63, 415, - 415, 415, 415, 430, 63, 415, 415, 415, 415, 63, - - 63, 63, 415, 63, 415, 430, 415, 415, 63, 415, - 63, 430, 415, 415, 0, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415 - } ; - -static yyconst flex_int16_t yy_nxt[1936] = - { 0, - 46, 47, 48, 47, 46, 49, 50, 46, 51, 46, - 46, 46, 46, 46, 52, 46, 46, 46, 46, 46, - 46, 53, 53, 53, 53, 53, 54, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 46, 55, - 198, 55, 198, 412, 56, 57, 58, 59, 60, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 61, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 62, 57, 63, 63, 63, 64, 65, 63, 63, - 63, 66, 67, 63, 63, 63, 68, 63, 63, 63, - - 69, 70, 63, 57, 72, 72, 93, 200, 411, 93, - 201, 203, 204, 217, 218, 94, 73, 73, 94, 205, - 415, 205, 200, 415, 206, 201, 233, 234, 74, 74, - 75, 76, 77, 76, 75, 78, 75, 75, 75, 75, - 75, 75, 75, 75, 79, 75, 75, 75, 80, 75, - 75, 81, 81, 81, 81, 81, 82, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 81, 81, 81, 81, 81, 81, 75, 84, - 84, 84, 85, 85, 84, 409, 232, 88, 84, 84, - 88, 220, 223, 221, 224, 200, 222, 235, 201, 235, - - 225, 236, 237, 86, 86, 89, 91, 91, 89, 248, - 232, 248, 89, 89, 95, 96, 97, 96, 95, 95, - 95, 95, 95, 95, 95, 95, 95, 95, 98, 95, - 95, 95, 95, 95, 95, 99, 99, 99, 99, 99, - 100, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 95, 102, 102, 200, 103, 103, 201, 104, - 104, 240, 241, 406, 246, 105, 105, 247, 200, 251, - 252, 201, 200, 255, 256, 201, 404, 106, 106, 107, - 108, 109, 108, 107, 107, 107, 107, 107, 107, 110, - - 107, 111, 112, 113, 107, 107, 107, 107, 107, 107, - 114, 114, 114, 114, 114, 115, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, - 114, 114, 114, 114, 114, 114, 114, 107, 116, 116, - 117, 116, 116, 118, 119, 116, 120, 116, 116, 116, - 116, 116, 121, 122, 122, 122, 116, 116, 116, 123, - 123, 123, 123, 123, 124, 125, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 116, 127, 128, 127, - 127, 128, 127, 402, 257, 129, 257, 258, 129, 258, - - 173, 174, 173, 401, 173, 174, 173, 200, 261, 262, - 201, 200, 130, 175, 201, 130, 132, 175, 400, 133, - 269, 270, 134, 135, 136, 176, 137, 395, 138, 176, - 186, 272, 273, 272, 187, 276, 277, 281, 282, 274, - 139, 132, 188, 280, 133, 394, 201, 134, 135, 136, - 198, 137, 198, 138, 189, 415, 275, 286, 415, 286, - 200, 297, 298, 201, 389, 139, 140, 141, 142, 141, - 140, 143, 144, 140, 145, 140, 140, 140, 140, 140, - 146, 140, 140, 140, 140, 140, 140, 147, 147, 147, - 147, 147, 148, 147, 147, 147, 147, 147, 147, 147, - - 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, - 147, 147, 147, 147, 140, 149, 150, 151, 150, 152, - 153, 149, 154, 155, 149, 149, 149, 149, 149, 156, - 157, 158, 158, 159, 160, 161, 162, 162, 162, 162, - 162, 163, 162, 162, 162, 162, 164, 162, 162, 162, - 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, - 162, 162, 162, 165, 166, 167, 168, 167, 166, 166, - 166, 166, 166, 166, 166, 166, 166, 166, 169, 166, - 166, 166, 166, 166, 166, 170, 170, 170, 170, 170, - 171, 170, 170, 170, 170, 170, 170, 170, 170, 170, - - 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, - 170, 170, 166, 76, 77, 76, 306, 78, 306, 190, - 186, 190, 300, 301, 191, 302, 303, 177, 177, 177, - 200, 388, 188, 201, 308, 309, 311, 312, 82, 76, - 77, 76, 372, 78, 189, 310, 200, 310, 387, 201, - 313, 313, 313, 177, 177, 177, 314, 200, 314, 385, - 201, 317, 318, 372, 82, 178, 179, 180, 179, 178, - 178, 178, 178, 178, 181, 181, 178, 178, 178, 182, - 178, 178, 178, 178, 178, 178, 183, 183, 183, 183, - 183, 184, 183, 183, 183, 183, 183, 183, 183, 183, - - 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 183, 183, 183, 178, 50, 192, 193, 192, 50, 194, - 50, 50, 50, 50, 50, 50, 50, 384, 196, 294, - 294, 294, 50, 50, 50, 383, 200, 295, 296, 201, - 320, 321, 322, 323, 322, 323, 200, 206, 198, 325, - 198, 295, 415, 328, 415, 415, 205, 415, 205, 296, - 329, 206, 50, 50, 192, 193, 192, 50, 194, 50, - 50, 50, 50, 50, 50, 50, 246, 196, 333, 247, - 333, 50, 50, 50, 220, 223, 221, 224, 235, 222, - 235, 382, 248, 225, 248, 342, 257, 342, 257, 258, - - 415, 258, 344, 415, 344, 272, 273, 272, 334, 276, - 277, 50, 207, 274, 207, 415, 335, 415, 415, 286, - 415, 286, 349, 353, 306, 310, 306, 310, 381, 380, - 275, 313, 313, 313, 377, 376, 349, 353, 368, 208, - 208, 208, 209, 210, 208, 208, 208, 211, 212, 208, - 208, 208, 213, 208, 208, 208, 214, 215, 208, 415, - 290, 415, 289, 289, 290, 367, 345, 346, 371, 366, - 291, 292, 314, 322, 314, 322, 365, 323, 206, 323, - 345, 333, 371, 333, 291, 342, 372, 342, 346, 208, - 208, 344, 292, 344, 208, 208, 372, 347, 348, 208, - - 372, 364, 363, 208, 208, 266, 266, 362, 266, 266, - 372, 347, 266, 375, 266, 266, 266, 266, 266, 348, - 294, 294, 294, 266, 266, 266, 351, 352, 295, 296, - 369, 370, 266, 375, 375, 375, 361, 373, 374, 378, - 351, 378, 295, 379, 369, 379, 360, 375, 352, 375, - 296, 373, 370, 266, 263, 263, 390, 263, 263, 374, - 386, 263, 386, 263, 263, 263, 263, 263, 390, 390, - 391, 392, 263, 263, 263, 393, 378, 390, 378, 359, - 358, 271, 390, 390, 391, 379, 396, 379, 396, 393, - 405, 397, 392, 397, 398, 399, 398, 399, 386, 403, - - 386, 403, 263, 283, 357, 356, 285, 283, 320, 283, - 283, 405, 283, 283, 405, 283, 283, 405, 283, 283, - 283, 283, 283, 283, 407, 396, 407, 396, 405, 317, - 397, 405, 397, 398, 399, 398, 399, 408, 410, 408, - 410, 403, 407, 403, 407, 408, 413, 408, 413, 311, - 308, 283, 289, 289, 290, 410, 414, 410, 414, 354, - 291, 292, 293, 413, 414, 413, 414, 350, 302, 350, - 281, 276, 269, 261, 291, 343, 255, 251, 249, 240, - 236, 233, 292, 340, 293, 266, 266, 339, 266, 266, - 338, 337, 266, 336, 266, 266, 266, 266, 266, 332, - - 331, 330, 327, 266, 266, 266, 217, 229, 228, 227, - 226, 219, 266, 203, 305, 304, 299, 288, 287, 264, - 259, 249, 415, 229, 228, 227, 226, 219, 216, 415, - 415, 415, 415, 266, 326, 326, 415, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 326, 415, 415, 415, - 415, 415, 326, 326, 326, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 326, 326, 326, 415, 326, 326, 326, 326, - 326, 326, 326, 326, 326, 326, 415, 415, 415, 415, - - 415, 326, 326, 326, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 326, 71, 71, 71, 71, 71, 71, 71, 71, - 71, 71, 71, 71, 71, 71, 71, 71, 71, 83, - 83, 83, 83, 83, 83, 83, 83, 83, 83, 83, - 83, 83, 83, 83, 83, 83, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 90, 90, 90, 90, 90, 90, 90, - 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, - - 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 92, 92, 92, 92, 92, 92, 92, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 126, 126, 126, 126, 126, 126, - 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, - 126, 131, 131, 131, 131, 131, 131, 131, 131, 131, - 131, 131, 131, 131, 131, 131, 131, 131, 172, 172, - 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 75, 75, 75, 75, 75, - 75, 75, 75, 75, 75, 75, 75, 75, 75, 75, - - 75, 75, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 195, - 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, - 195, 195, 195, 195, 195, 195, 197, 415, 415, 415, - 415, 415, 197, 197, 197, 197, 415, 197, 197, 199, - 415, 415, 415, 199, 415, 199, 199, 199, 199, 199, - 199, 199, 202, 415, 202, 202, 415, 202, 230, 230, - 415, 230, 230, 230, 230, 230, 230, 230, 415, 230, - 230, 230, 230, 415, 230, 231, 231, 231, 231, 231, - 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, - - 231, 231, 238, 238, 415, 415, 238, 238, 238, 238, - 238, 238, 238, 238, 238, 238, 238, 415, 238, 239, - 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, - 239, 239, 239, 239, 239, 239, 242, 242, 415, 242, - 242, 415, 242, 242, 242, 242, 242, 242, 242, 242, - 242, 415, 242, 243, 243, 415, 243, 243, 243, 243, - 243, 243, 243, 243, 243, 415, 243, 243, 415, 243, - 244, 244, 415, 244, 244, 244, 244, 244, 415, 244, - 244, 244, 244, 244, 244, 244, 244, 245, 245, 415, - 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, - - 245, 245, 245, 245, 250, 415, 415, 415, 415, 250, - 415, 250, 250, 415, 250, 253, 253, 415, 415, 253, - 415, 253, 253, 253, 253, 415, 253, 253, 253, 253, - 415, 253, 254, 254, 254, 254, 254, 254, 254, 254, - 254, 254, 254, 254, 254, 254, 254, 254, 254, 260, - 415, 260, 260, 415, 260, 263, 263, 415, 415, 415, - 415, 263, 263, 263, 263, 415, 415, 263, 415, 415, - 415, 263, 265, 265, 415, 415, 415, 415, 265, 265, - 265, 265, 265, 265, 265, 265, 265, 415, 265, 267, - 267, 415, 415, 415, 415, 267, 267, 267, 267, 415, - - 267, 267, 267, 267, 415, 267, 268, 415, 268, 268, - 415, 268, 278, 278, 415, 415, 278, 415, 415, 415, - 278, 278, 415, 278, 278, 278, 278, 415, 278, 279, - 279, 415, 415, 279, 415, 415, 415, 279, 279, 279, - 279, 279, 279, 279, 415, 279, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, - 284, 284, 284, 307, 415, 307, 307, 415, 307, 315, - 415, 315, 315, 415, 315, 316, 316, 316, 316, 316, - 316, 316, 316, 316, 316, 316, 316, 316, 316, 316, - 316, 316, 319, 319, 415, 319, 415, 319, 319, 319, - - 319, 319, 415, 319, 319, 319, 319, 415, 319, 324, - 324, 324, 415, 324, 324, 324, 324, 326, 326, 415, - 326, 326, 326, 326, 326, 326, 326, 326, 326, 326, - 326, 326, 326, 326, 341, 341, 415, 341, 341, 341, - 341, 341, 415, 341, 415, 341, 341, 341, 341, 415, - 341, 266, 266, 415, 415, 415, 415, 266, 266, 266, - 266, 415, 415, 266, 415, 415, 415, 266, 355, 355, - 415, 355, 355, 355, 355, 355, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 45, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415 - } ; - -static yyconst flex_int16_t yy_chk[1936] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 47, 2, 47, 406, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 5, 6, 15, 52, 404, 16, - 52, 54, 54, 62, 62, 15, 5, 6, 16, 55, - 54, 55, 61, 54, 55, 61, 74, 74, 5, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 9, - 10, 11, 9, 10, 12, 401, 73, 11, 13, 14, - 12, 65, 66, 65, 66, 73, 65, 76, 73, 76, - - 66, 82, 82, 9, 10, 11, 13, 14, 12, 96, - 73, 96, 13, 14, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, - 17, 17, 17, 19, 20, 79, 19, 20, 79, 19, - 20, 86, 86, 394, 94, 19, 20, 94, 98, 100, - 100, 98, 105, 106, 106, 105, 389, 19, 20, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, - 21, 21, 21, 21, 21, 21, 21, 21, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, - 23, 23, 23, 23, 23, 23, 23, 25, 25, 25, - 26, 26, 26, 387, 108, 25, 108, 110, 26, 110, - - 35, 35, 35, 385, 36, 36, 36, 113, 115, 115, - 113, 121, 25, 35, 121, 26, 27, 36, 384, 27, - 124, 124, 27, 27, 27, 35, 27, 377, 27, 36, - 41, 127, 127, 127, 41, 130, 130, 139, 139, 127, - 27, 28, 41, 138, 28, 376, 138, 28, 28, 28, - 141, 28, 141, 28, 41, 146, 127, 150, 146, 150, - 156, 159, 159, 156, 368, 28, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - - 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, - 29, 29, 29, 29, 29, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 37, 37, 37, 167, 37, 167, 42, - 42, 42, 161, 161, 42, 163, 163, 37, 37, 37, - 169, 367, 42, 169, 171, 171, 176, 176, 37, 38, - 38, 38, 347, 38, 42, 173, 175, 173, 366, 175, - 177, 177, 177, 38, 38, 38, 179, 182, 179, 364, - 182, 184, 184, 347, 38, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 363, 43, 158, - 158, 158, 43, 43, 43, 362, 188, 158, 158, 188, - 189, 189, 190, 192, 190, 192, 196, 190, 198, 196, - 198, 158, 199, 220, 245, 199, 205, 245, 205, 158, - 220, 205, 43, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 246, 44, 224, 246, - 224, 44, 44, 44, 210, 211, 210, 211, 235, 210, - 235, 361, 248, 211, 248, 255, 257, 255, 257, 258, - - 265, 258, 269, 265, 269, 272, 272, 272, 224, 275, - 275, 44, 58, 272, 58, 279, 224, 283, 279, 286, - 283, 286, 292, 296, 306, 310, 306, 310, 360, 359, - 272, 313, 313, 313, 356, 354, 292, 296, 340, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 63, - 290, 63, 289, 289, 289, 339, 290, 290, 346, 338, - 289, 289, 314, 322, 314, 322, 337, 323, 322, 323, - 290, 333, 346, 333, 289, 342, 348, 342, 290, 63, - 63, 344, 289, 344, 63, 63, 349, 291, 291, 63, - - 348, 336, 335, 63, 63, 122, 122, 334, 122, 122, - 349, 291, 122, 351, 122, 122, 122, 122, 122, 291, - 294, 294, 294, 122, 122, 122, 295, 295, 294, 294, - 345, 345, 122, 352, 351, 353, 332, 350, 350, 357, - 295, 357, 294, 358, 345, 358, 331, 352, 295, 353, - 294, 350, 345, 122, 125, 125, 369, 125, 125, 350, - 365, 125, 365, 125, 125, 125, 125, 125, 370, 371, - 373, 373, 125, 125, 125, 374, 378, 369, 378, 330, - 329, 125, 370, 371, 373, 379, 380, 379, 380, 374, - 391, 381, 373, 381, 382, 383, 382, 383, 386, 388, - - 386, 388, 125, 148, 328, 327, 148, 148, 321, 148, - 148, 391, 148, 148, 392, 148, 148, 393, 148, 148, - 148, 148, 148, 148, 395, 396, 395, 396, 392, 318, - 397, 393, 397, 398, 399, 398, 399, 400, 402, 400, - 402, 403, 407, 403, 407, 408, 409, 408, 409, 312, - 309, 148, 157, 157, 157, 410, 411, 410, 411, 304, - 157, 157, 157, 413, 414, 413, 414, 458, 303, 458, - 282, 277, 270, 262, 157, 259, 256, 252, 250, 241, - 237, 234, 157, 229, 157, 267, 267, 228, 267, 267, - 227, 226, 267, 225, 267, 267, 267, 267, 267, 223, - - 222, 221, 219, 267, 267, 267, 218, 215, 214, 213, - 212, 209, 267, 204, 165, 164, 160, 154, 152, 119, - 112, 99, 89, 70, 69, 68, 67, 64, 60, 45, - 0, 0, 0, 267, 325, 325, 0, 325, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 0, 0, 0, - 0, 0, 325, 325, 325, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 325, 355, 355, 0, 355, 355, 355, 355, - 355, 355, 355, 355, 355, 355, 0, 0, 0, 0, - - 0, 355, 355, 355, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 355, 416, 416, 416, 416, 416, 416, 416, 416, - 416, 416, 416, 416, 416, 416, 416, 416, 416, 417, - 417, 417, 417, 417, 417, 417, 417, 417, 417, 417, - 417, 417, 417, 417, 417, 417, 418, 418, 418, 418, - 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, - 418, 418, 418, 419, 419, 419, 419, 419, 419, 419, - 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, - - 420, 420, 420, 420, 420, 420, 420, 420, 420, 420, - 420, 420, 420, 420, 420, 420, 420, 421, 421, 421, - 421, 421, 421, 421, 421, 421, 421, 421, 421, 421, - 421, 421, 421, 421, 422, 422, 422, 422, 422, 422, - 422, 422, 422, 422, 422, 422, 422, 422, 422, 422, - 422, 423, 423, 423, 423, 423, 423, 423, 423, 423, - 423, 423, 423, 423, 423, 423, 423, 423, 424, 424, - 424, 424, 424, 424, 424, 424, 424, 424, 424, 424, - 424, 424, 424, 424, 424, 425, 425, 425, 425, 425, - 425, 425, 425, 425, 425, 425, 425, 425, 425, 425, - - 425, 425, 426, 426, 426, 426, 426, 426, 426, 426, - 426, 426, 426, 426, 426, 426, 426, 426, 426, 427, - 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 427, 427, 427, 427, 427, 427, 428, 0, 0, 0, - 0, 0, 428, 428, 428, 428, 0, 428, 428, 429, - 0, 0, 0, 429, 0, 429, 429, 429, 429, 429, - 429, 429, 430, 0, 430, 430, 0, 430, 431, 431, - 0, 431, 431, 431, 431, 431, 431, 431, 0, 431, - 431, 431, 431, 0, 431, 432, 432, 432, 432, 432, - 432, 432, 432, 432, 432, 432, 432, 432, 432, 432, - - 432, 432, 433, 433, 0, 0, 433, 433, 433, 433, - 433, 433, 433, 433, 433, 433, 433, 0, 433, 434, - 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, - 434, 434, 434, 434, 434, 434, 435, 435, 0, 435, - 435, 0, 435, 435, 435, 435, 435, 435, 435, 435, - 435, 0, 435, 436, 436, 0, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 0, 436, 436, 0, 436, - 437, 437, 0, 437, 437, 437, 437, 437, 0, 437, - 437, 437, 437, 437, 437, 437, 437, 438, 438, 0, - 438, 438, 438, 438, 438, 438, 438, 438, 438, 438, - - 438, 438, 438, 438, 439, 0, 0, 0, 0, 439, - 0, 439, 439, 0, 439, 440, 440, 0, 0, 440, - 0, 440, 440, 440, 440, 0, 440, 440, 440, 440, - 0, 440, 441, 441, 441, 441, 441, 441, 441, 441, - 441, 441, 441, 441, 441, 441, 441, 441, 441, 442, - 0, 442, 442, 0, 442, 443, 443, 0, 0, 0, - 0, 443, 443, 443, 443, 0, 0, 443, 0, 0, - 0, 443, 444, 444, 0, 0, 0, 0, 444, 444, - 444, 444, 444, 444, 444, 444, 444, 0, 444, 445, - 445, 0, 0, 0, 0, 445, 445, 445, 445, 0, - - 445, 445, 445, 445, 0, 445, 446, 0, 446, 446, - 0, 446, 447, 447, 0, 0, 447, 0, 0, 0, - 447, 447, 0, 447, 447, 447, 447, 0, 447, 448, - 448, 0, 0, 448, 0, 0, 0, 448, 448, 448, - 448, 448, 448, 448, 0, 448, 449, 449, 449, 449, - 449, 449, 449, 449, 449, 449, 449, 449, 449, 449, - 449, 449, 449, 450, 0, 450, 450, 0, 450, 451, - 0, 451, 451, 0, 451, 452, 452, 452, 452, 452, - 452, 452, 452, 452, 452, 452, 452, 452, 452, 452, - 452, 452, 453, 453, 0, 453, 0, 453, 453, 453, - - 453, 453, 0, 453, 453, 453, 453, 0, 453, 454, - 454, 454, 0, 454, 454, 454, 454, 455, 455, 0, - 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, - 455, 455, 455, 455, 456, 456, 0, 456, 456, 456, - 456, 456, 0, 456, 0, 456, 456, 456, 456, 0, - 456, 457, 457, 0, 0, 0, 0, 457, 457, 457, - 457, 0, 0, 457, 0, 0, 0, 457, 459, 459, - 0, 459, 459, 459, 459, 459, 459, 459, 459, 459, - 459, 459, 459, 459, 459, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 415 - } ; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int ppy__flex_debug; -int ppy__flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *ppy_text; -#line 1 "ppl.l" -/* -*-C-*- - * Wrc preprocessor lexical analysis - * - * Copyright 1999-2000 Bertho A. Stultiens (BS) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA - * - * History: - * 24-Apr-2000 BS - Started from scratch to restructure everything - * and reintegrate the source into the wine-tree. - * 04-Jan-2000 BS - Added comments about the lexicographical - * grammar to give some insight in the complexity. - * 28-Dec-1999 BS - Eliminated backing-up of the flexer by running - * `flex -b' on the source. This results in some - * weirdo extra rules, but a much faster scanner. - * 23-Dec-1999 BS - Started this file - * - *------------------------------------------------------------------------- - * The preprocessor's lexographical grammar (approximately): - * - * pp := {ws} # {ws} if {ws} {expr} {ws} \n - * | {ws} # {ws} ifdef {ws} {id} {ws} \n - * | {ws} # {ws} ifndef {ws} {id} {ws} \n - * | {ws} # {ws} elif {ws} {expr} {ws} \n - * | {ws} # {ws} else {ws} \n - * | {ws} # {ws} endif {ws} \n - * | {ws} # {ws} include {ws} < {anytext} > \n - * | {ws} # {ws} include {ws} " {anytext} " \n - * | {ws} # {ws} define {ws} {anytext} \n - * | {ws} # {ws} define( {arglist} ) {ws} {expansion} \n - * | {ws} # {ws} pragma {ws} {anytext} \n - * | {ws} # {ws} ident {ws} {anytext} \n - * | {ws} # {ws} error {ws} {anytext} \n - * | {ws} # {ws} warning {ws} {anytext} \n - * | {ws} # {ws} line {ws} " {anytext} " {number} \n - * | {ws} # {ws} {number} " {anytext} " {number} [ {number} [{number}] ] \n - * | {ws} # {ws} \n - * - * ws := [ \t\r\f\v]* - * - * expr := {expr} [+-*%^/|&] {expr} - * | {expr} {logor|logand} {expr} - * | [!~+-] {expr} - * | {expr} ? {expr} : {expr} - * - * logor := || - * - * logand := && - * - * id := [a-zA-Z_][a-zA-Z0-9_]* - * - * anytext := [^\n]* (see note) - * - * arglist := - * | {id} - * | {arglist} , {id} - * | {arglist} , {id} ... - * - * expansion := {id} - * | # {id} - * | {anytext} - * | {anytext} ## {anytext} - * - * number := [0-9]+ - * - * Note: "anytext" is not always "[^\n]*". This is because the - * trailing context must be considered as well. - * - * The only certain assumption for the preprocessor to make is that - * directives start at the beginning of the line, followed by a '#' - * and end with a newline. - * Any directive may be suffixed with a line-continuation. Also - * classical comment / *...* / (note: no comments within comments, - * therefore spaces) is considered to be a line-continuation - * (according to gcc and egcs AFAIK, ANSI is a bit vague). - * Comments have not been added to the above grammar for simplicity - * reasons. However, it is allowed to enter comment anywhere within - * the directives as long as they do not interfere with the context. - * All comments are considered to be deletable whitespace (both - * classical form "/ *...* /" and C++ form "//...\n"). - * - * All recursive scans, except for macro-expansion, are done by the - * parser, whereas the simple state transitions of non-recursive - * directives are done in the scanner. This results in the many - * exclusive start-conditions of the scanner. - * - * Macro expansions are slightly more difficult because they have to - * prescan the arguments. Parameter substitution is literal if the - * substitution is # or ## (either side). This enables new identifiers - * to be created (see 'info cpp' node Macro|Pitfalls|Prescan for more - * information). - * - * FIXME: Variable macro parameters is recognized, but not yet - * expanded. I have to reread the ANSI standard on the subject (yes, - * ANSI defines it). - * - * The following special defines are supported: - * __FILE__ -> "thissource.c" - * __LINE__ -> 123 - * __DATE__ -> "May 1 2000" - * __TIME__ -> "23:59:59" - * These macros expand, as expected, into their ANSI defined values. - * - * The same include prevention is implemented as gcc and egcs does. - * This results in faster processing because we do not read the text - * at all. Some wine-sources attempt to include the same file 4 or 5 - * times. This strategy also saves a lot blank output-lines, which in - * its turn improves the real resource scanner/parser. - * - */ - -/* - * Special flex options and exclusive scanner start-conditions - */ -#define YY_NO_INPUT 1 - - - - - - - - - - - - - - - - - - - - - -#line 164 "ppl.l" -#include -#include -#include -#include -#include -#include -#include - -#ifndef LLONG_MAX -# define LLONG_MAX ((long long)0x7fffffff << 32 | 0xffffffff) -# define LLONG_MIN (-LLONG_MAX - 1) -#endif -#ifndef ULLONG_MAX -# define ULLONG_MAX ((long long)0xffffffff << 32 | 0xffffffff) -#endif - -#ifndef HAVE_UNISTD_H -#define YY_NO_UNISTD_H -#endif - -#include "wine/wpp.h" -#include "wpp_private.h" -#include "ppy.tab.h" - -/* - * Make sure that we are running an appropriate version of flex. - */ -#if !defined(YY_FLEX_MAJOR_VERSION) || (1000 * YY_FLEX_MAJOR_VERSION + YY_FLEX_MINOR_VERSION < 2005) -#error Must use flex version 2.5.1 or higher (yy_scan_* routines are required). -#endif - -#define YY_READ_BUF_SIZE 65536 /* So we read most of a file at once */ - -#define yy_current_state() YY_START -#define yy_pp_state(x) yy_pop_state(); yy_push_state(x) - -/* - * Always update the current character position within a line - */ -#define YY_USER_ACTION pp_status.char_number+=ppy_leng; - -/* - * Buffer management for includes and expansions - */ -#define MAXBUFFERSTACK 128 /* Nesting more than 128 includes or macro expansion textss is insane */ - -typedef struct bufferstackentry { - YY_BUFFER_STATE bufferstate; /* Buffer to switch back to */ - void *filehandle; /* Handle to be used with wpp_callbacks->read */ - pp_entry_t *define; /* Points to expanding define or NULL if handling includes */ - int line_number; /* Line that we were handling */ - int char_number; /* The current position on that line */ - char *filename; /* Filename that we were handling */ - int if_depth; /* How many #if:s deep to check matching #endif:s */ - int ncontinuations; /* Remember the continuation state */ - int should_pop; /* Set if we must pop the start-state on EOF */ - /* Include management */ - include_state_t incl; - char *include_filename; -} bufferstackentry_t; - -#define ALLOCBLOCKSIZE (1 << 10) /* Allocate these chunks at a time for string-buffers */ - -/* - * Macro expansion nesting - * We need the stack to handle expansions while scanning - * a macro's arguments. The TOS must always be the macro - * that receives the current expansion from the scanner. - */ -#define MAXMACEXPSTACK 128 /* Nesting more than 128 macro expansions is insane */ - -typedef struct macexpstackentry { - pp_entry_t *ppp; /* This macro we are scanning */ - char **args; /* With these arguments */ - char **ppargs; /* Resulting in these preprocessed arguments */ - int *nnls; /* Number of newlines per argument */ - int nargs; /* And this many arguments scanned */ - int parentheses; /* Nesting level of () */ - int curargsize; /* Current scanning argument's size */ - int curargalloc; /* Current scanning argument's block allocated */ - char *curarg; /* Current scanning argument's content */ -} macexpstackentry_t; - -#define MACROPARENTHESES() (top_macro()->parentheses) - -/* - * Prototypes - */ -static void newline(int); -static int make_number(int radix, YYSTYPE *val, const char *str, int len); -static void put_buffer(const char *s, int len); -/* Buffer management */ -static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop); -static bufferstackentry_t *pop_buffer(void); -/* String functions */ -static void new_string(void); -static void add_string(const char *str, int len); -static char *get_string(void); -static void put_string(void); -static int string_start(void); -/* Macro functions */ -static void push_macro(pp_entry_t *ppp); -static macexpstackentry_t *top_macro(void); -static macexpstackentry_t *pop_macro(void); -static void free_macro(macexpstackentry_t *mep); -static void add_text_to_macro(const char *text, int len); -static void macro_add_arg(int last); -static void macro_add_expansion(void); -/* Expansion */ -static void expand_special(pp_entry_t *ppp); -static void expand_define(pp_entry_t *ppp); -static void expand_macro(macexpstackentry_t *mep); - -/* - * Local variables - */ -static int ncontinuations; - -static int strbuf_idx = 0; -static int strbuf_alloc = 0; -static char *strbuffer = NULL; -static int str_startline; - -static macexpstackentry_t *macexpstack[MAXMACEXPSTACK]; -static int macexpstackidx = 0; - -static bufferstackentry_t bufferstack[MAXBUFFERSTACK]; -static int bufferstackidx = 0; - -/* - * Global variables - */ -include_state_t pp_incl_state = -{ - -1, /* state */ - NULL, /* ppp */ - 0, /* ifdepth */ - 0 /* seen_junk */ -}; - -includelogicentry_t *pp_includelogiclist = NULL; - -#define YY_INPUT(buf,result,max_size) \ - { \ - result = wpp_callbacks->read(pp_status.file, buf, max_size); \ - } - -#define BUFFERINITIALCAPACITY 256 - -void pp_writestring(const char *format, ...) -{ - va_list valist; - int len; - static char *buffer; - static int buffercapacity; - char *new_buffer; - - if(buffercapacity == 0) - { - buffer = pp_xmalloc(BUFFERINITIALCAPACITY); - if(buffer == NULL) - return; - buffercapacity = BUFFERINITIALCAPACITY; - } - - va_start(valist, format); - len = vsnprintf(buffer, buffercapacity, - format, valist); - va_end(valist); - /* If the string is longer than buffersize, vsnprintf returns - * the string length with glibc >= 2.1, -1 with glibc < 2.1 */ - while(len > buffercapacity || len < 0) - { - do - { - buffercapacity *= 2; - } while(len > buffercapacity); - - new_buffer = pp_xrealloc(buffer, buffercapacity); - if(new_buffer == NULL) - { - va_end(valist); - return; - } - buffer = new_buffer; - va_start(valist, format); - len = vsnprintf(buffer, buffercapacity, - format, valist); - va_end(valist); - } - - wpp_callbacks->write(buffer, len); -} - -/* - ************************************************************************** - * The scanner starts here - ************************************************************************** - */ -#line 1402 "ppl.yy.c" - -#define INITIAL 0 -#define pp_pp 1 -#define pp_eol 2 -#define pp_inc 3 -#define pp_dqs 4 -#define pp_sqs 5 -#define pp_iqs 6 -#define pp_comment 7 -#define pp_def 8 -#define pp_define 9 -#define pp_macro 10 -#define pp_mbody 11 -#define pp_macign 12 -#define pp_macscan 13 -#define pp_macexp 14 -#define pp_if 15 -#define pp_ifd 16 -#define pp_endif 17 -#define pp_line 18 -#define pp_defined 19 -#define pp_ignore 20 -#define RCINCL 21 - -#ifndef YY_NO_UNISTD_H -/* Special case for "unistd.h", since it is non-ANSI. We include it way - * down here because we want the user's section 1 to have been scanned first. - * The user has a chance to override it with an option. - */ -#include -#endif - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int ppy_lex_destroy (void ); - -int ppy_get_debug (void ); - -void ppy_set_debug (int debug_flag ); - -YY_EXTRA_TYPE ppy_get_extra (void ); - -void ppy_set_extra (YY_EXTRA_TYPE user_defined ); - -FILE *ppy_get_in (void ); - -void ppy_set_in (FILE * in_str ); - -FILE *ppy_get_out (void ); - -void ppy_set_out (FILE * out_str ); - -int ppy_get_leng (void ); - -char *ppy_get_text (void ); - -int ppy_get_lineno (void ); - -void ppy_set_lineno (int line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int ppy_wrap (void ); -#else -extern int ppy_wrap (void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - - static int yy_start_stack_ptr = 0; - static int yy_start_stack_depth = 0; - static int *yy_start_stack = NULL; - - static void yy_push_state (int new_state ); - - static void yy_pop_state (void ); - - static int yy_top_state (void ); - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* This used to be an fputs(), but since the string might contain NUL's, - * we now use fwrite(). - */ -#define ECHO do { if (fwrite( ppy_text, ppy_leng, 1, ppy_out )) {} } while (0) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( ppy_in )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( ppy_in ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, ppy_in))==0 && ferror(ppy_in)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(ppy_in); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int ppy_lex (void); - -#define YY_DECL int ppy_lex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after ppy_text and ppy_leng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - if ( ppy_leng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (ppy_text[ppy_leng - 1] == '\n'); \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 366 "ppl.l" - - /* - * Catch line-continuations. - * Note: Gcc keeps the line-continuations in, for example, strings - * intact. However, I prefer to remove them all so that the next - * scanner will not need to reduce the continuation state. - * - * <*>\\\n newline(0); - */ - - /* - * Detect the leading # of a preprocessor directive. - */ -#line 1635 "ppl.yy.c" - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! ppy_in ) - ppy_in = stdin; - - if ( ! ppy_out ) - ppy_out = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - ppy_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - ppy__create_buffer(ppy_in,YY_BUF_SIZE ); - } - - ppy__load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of ppy_text. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 416 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_current_state != 415 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -YY_RULE_SETUP -#line 379 "ppl.l" -pp_incl_state.seen_junk++; yy_push_state(pp_pp); - YY_BREAK -/* - * Scan for the preprocessor directives - */ -case 2: -YY_RULE_SETUP -#line 384 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_inc); return tINCLUDE;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 3: -YY_RULE_SETUP -#line 385 "ppl.l" -yy_pp_state(yy_current_state() != pp_ignore ? pp_def : pp_eol); - YY_BREAK -case 4: -YY_RULE_SETUP -#line 386 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tERROR; - YY_BREAK -case 5: -YY_RULE_SETUP -#line 387 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tWARNING; - YY_BREAK -case 6: -YY_RULE_SETUP -#line 388 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tPRAGMA; - YY_BREAK -case 7: -YY_RULE_SETUP -#line 389 "ppl.l" -yy_pp_state(pp_eol); if(yy_top_state() != pp_ignore) return tPPIDENT; - YY_BREAK -case 8: -YY_RULE_SETUP -#line 390 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_ifd); return tUNDEF;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 9: -YY_RULE_SETUP -#line 391 "ppl.l" -yy_pp_state(pp_ifd); return tIFDEF; - YY_BREAK -case 10: -YY_RULE_SETUP -#line 392 "ppl.l" -pp_incl_state.seen_junk--; yy_pp_state(pp_ifd); return tIFNDEF; - YY_BREAK -case 11: -YY_RULE_SETUP -#line 393 "ppl.l" -yy_pp_state(pp_if); return tIF; - YY_BREAK -case 12: -YY_RULE_SETUP -#line 394 "ppl.l" -yy_pp_state(pp_if); return tELIF; - YY_BREAK -case 13: -YY_RULE_SETUP -#line 395 "ppl.l" -yy_pp_state(pp_endif); return tELSE; - YY_BREAK -case 14: -YY_RULE_SETUP -#line 396 "ppl.l" -yy_pp_state(pp_endif); return tENDIF; - YY_BREAK -case 15: -YY_RULE_SETUP -#line 397 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_line); return tLINE;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 16: -YY_RULE_SETUP -#line 398 "ppl.l" -if(yy_top_state() != pp_ignore) {yy_pp_state(pp_line); return tGCCLINE;} else {yy_pp_state(pp_eol);} - YY_BREAK -case 17: -YY_RULE_SETUP -#line 399 "ppl.l" -ppy_error("Invalid preprocessor token '%s'", ppy_text); - YY_BREAK -case 18: -/* rule 18 can match eol */ -YY_RULE_SETUP -#line 400 "ppl.l" -newline(1); yy_pop_state(); return tNL; /* This could be the null-token */ - YY_BREAK -case 19: -/* rule 19 can match eol */ -YY_RULE_SETUP -#line 401 "ppl.l" -newline(0); - YY_BREAK -case 20: -YY_RULE_SETUP -#line 402 "ppl.l" -ppy_error("Preprocessor junk '%s'", ppy_text); - YY_BREAK -case 21: -YY_RULE_SETUP -#line 403 "ppl.l" -return *ppy_text; - YY_BREAK -/* - * Handle #include and #line - */ -case 22: -YY_RULE_SETUP -#line 408 "ppl.l" -return make_number(10, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 23: -YY_RULE_SETUP -#line 409 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_iqs); - YY_BREAK -case 24: -YY_RULE_SETUP -#line 410 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -case 25: -YY_RULE_SETUP -#line 411 "ppl.l" -; - YY_BREAK -case 26: -/* rule 26 can match eol */ -YY_RULE_SETUP -#line 412 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 27: -/* rule 27 can match eol */ -YY_RULE_SETUP -#line 413 "ppl.l" -newline(0); - YY_BREAK -case 28: -YY_RULE_SETUP -#line 414 "ppl.l" -ppy_error(yy_current_state() == pp_inc ? "Trailing junk in #include" : "Trailing junk in #line"); - YY_BREAK -/* - * Ignore all input when a false clause is parsed - */ -case 29: -YY_RULE_SETUP -#line 419 "ppl.l" -; - YY_BREAK -case 30: -/* rule 30 can match eol */ -YY_RULE_SETUP -#line 420 "ppl.l" -newline(1); - YY_BREAK -case 31: -/* rule 31 can match eol */ -YY_RULE_SETUP -#line 421 "ppl.l" -newline(0); - YY_BREAK -case 32: -YY_RULE_SETUP -#line 422 "ppl.l" -; - YY_BREAK -/* - * Handle #if and #elif. - * These require conditionals to be evaluated, but we do not - * want to jam the scanner normally when we see these tokens. - * Note: tIDENT is handled below. - */ -case 33: -YY_RULE_SETUP -#line 431 "ppl.l" -return make_number(8, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 34: -YY_RULE_SETUP -#line 432 "ppl.l" -ppy_error("Invalid octal digit"); - YY_BREAK -case 35: -YY_RULE_SETUP -#line 433 "ppl.l" -return make_number(10, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 36: -YY_RULE_SETUP -#line 434 "ppl.l" -return make_number(16, &ppy_lval, ppy_text, ppy_leng); - YY_BREAK -case 37: -YY_RULE_SETUP -#line 435 "ppl.l" -ppy_error("Invalid hex number"); - YY_BREAK -case 38: -YY_RULE_SETUP -#line 436 "ppl.l" -yy_push_state(pp_defined); return tDEFINED; - YY_BREAK -case 39: -YY_RULE_SETUP -#line 437 "ppl.l" -return tLSHIFT; - YY_BREAK -case 40: -YY_RULE_SETUP -#line 438 "ppl.l" -return tRSHIFT; - YY_BREAK -case 41: -YY_RULE_SETUP -#line 439 "ppl.l" -return tLOGAND; - YY_BREAK -case 42: -YY_RULE_SETUP -#line 440 "ppl.l" -return tLOGOR; - YY_BREAK -case 43: -YY_RULE_SETUP -#line 441 "ppl.l" -return tEQ; - YY_BREAK -case 44: -YY_RULE_SETUP -#line 442 "ppl.l" -return tNE; - YY_BREAK -case 45: -YY_RULE_SETUP -#line 443 "ppl.l" -return tLTE; - YY_BREAK -case 46: -YY_RULE_SETUP -#line 444 "ppl.l" -return tGTE; - YY_BREAK -case 47: -/* rule 47 can match eol */ -YY_RULE_SETUP -#line 445 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 48: -/* rule 48 can match eol */ -YY_RULE_SETUP -#line 446 "ppl.l" -newline(0); - YY_BREAK -case 49: -YY_RULE_SETUP -#line 447 "ppl.l" -ppy_error("Junk in conditional expression"); - YY_BREAK -case 50: -YY_RULE_SETUP -#line 448 "ppl.l" -; - YY_BREAK -case 51: -YY_RULE_SETUP -#line 449 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 52: -YY_RULE_SETUP -#line 450 "ppl.l" -ppy_error("String constants not allowed in conditionals"); - YY_BREAK -case 53: -YY_RULE_SETUP -#line 451 "ppl.l" -return *ppy_text; - YY_BREAK -/* - * Handle #ifdef, #ifndef and #undef - * to get only an untranslated/unexpanded identifier - */ -case 54: -YY_RULE_SETUP -#line 457 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 55: -YY_RULE_SETUP -#line 458 "ppl.l" -; - YY_BREAK -case 56: -/* rule 56 can match eol */ -YY_RULE_SETUP -#line 459 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 57: -/* rule 57 can match eol */ -YY_RULE_SETUP -#line 460 "ppl.l" -newline(0); - YY_BREAK -case 58: -YY_RULE_SETUP -#line 461 "ppl.l" -ppy_error("Identifier expected"); - YY_BREAK -/* - * Handle #else and #endif. - */ -case 59: -YY_RULE_SETUP -#line 466 "ppl.l" -; - YY_BREAK -case 60: -/* rule 60 can match eol */ -YY_RULE_SETUP -#line 467 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 61: -/* rule 61 can match eol */ -YY_RULE_SETUP -#line 468 "ppl.l" -newline(0); - YY_BREAK -case 62: -YY_RULE_SETUP -#line 469 "ppl.l" -ppy_error("Garbage after #else or #endif."); - YY_BREAK -/* - * Handle the special 'defined' keyword. - * This is necessary to get the identifier prior to any - * substitutions. - */ -case 63: -YY_RULE_SETUP -#line 476 "ppl.l" -yy_pop_state(); ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 64: -YY_RULE_SETUP -#line 477 "ppl.l" -; - YY_BREAK -case 65: -YY_RULE_SETUP -#line 478 "ppl.l" -return *ppy_text; - YY_BREAK -case 66: -/* rule 66 can match eol */ -YY_RULE_SETUP -#line 479 "ppl.l" -newline(0); - YY_BREAK -case 67: -/* rule 67 can match eol */ -YY_RULE_SETUP -#line 480 "ppl.l" -ppy_error("Identifier expected"); - YY_BREAK -/* - * Handle #error, #warning, #pragma and #ident. - * Pass everything literally to the parser, which - * will act appropriately. - * Comments are stripped from the literal text. - */ -case 68: -YY_RULE_SETUP -#line 488 "ppl.l" -if(yy_top_state() != pp_ignore) { ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; } - YY_BREAK -case 69: -YY_RULE_SETUP -#line 489 "ppl.l" -if(yy_top_state() != pp_ignore) { ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; } - YY_BREAK -case 70: -/* rule 70 can match eol */ -YY_RULE_SETUP -#line 490 "ppl.l" -if(yy_top_state() != pp_ignore) { ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; } - YY_BREAK -case 71: -/* rule 71 can match eol */ -YY_RULE_SETUP -#line 491 "ppl.l" -newline(1); yy_pop_state(); if(yy_current_state() != pp_ignore) { return tNL; } - YY_BREAK -case 72: -/* rule 72 can match eol */ -YY_RULE_SETUP -#line 492 "ppl.l" -newline(0); - YY_BREAK -/* - * Handle left side of #define - */ -case 73: -YY_RULE_SETUP -#line 497 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); if(ppy_lval.cptr) ppy_lval.cptr[ppy_leng-1] = '\0'; yy_pp_state(pp_macro); return tMACRO; - YY_BREAK -case 74: -YY_RULE_SETUP -#line 498 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); yy_pp_state(pp_define); return tDEFINE; - YY_BREAK -case 75: -YY_RULE_SETUP -#line 499 "ppl.l" -; - YY_BREAK -case 76: -/* rule 76 can match eol */ -YY_RULE_SETUP -#line 500 "ppl.l" -newline(0); - YY_BREAK -case 77: -/* rule 77 can match eol */ -YY_RULE_SETUP -#line 501 "ppl.l" -perror("Identifier expected"); - YY_BREAK -/* - * Scan the substitution of a define - */ -case 78: -YY_RULE_SETUP -#line 506 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 79: -/* rule 79 can match eol */ -YY_RULE_SETUP -#line 507 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 80: -/* rule 80 can match eol */ -YY_RULE_SETUP -#line 508 "ppl.l" -newline(0); ppy_lval.cptr = pp_xstrdup(" "); return tLITERAL; - YY_BREAK -case 81: -/* rule 81 can match eol */ -YY_RULE_SETUP -#line 509 "ppl.l" -newline(0); - YY_BREAK -case 82: -/* rule 82 can match eol */ -YY_RULE_SETUP -#line 510 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 83: -YY_RULE_SETUP -#line 511 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 84: -YY_RULE_SETUP -#line 512 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -/* - * Scan the definition macro arguments - */ -case 85: -YY_RULE_SETUP -#line 517 "ppl.l" -yy_pp_state(pp_mbody); return tMACROEND; - YY_BREAK -case 86: -YY_RULE_SETUP -#line 518 "ppl.l" -; - YY_BREAK -case 87: -YY_RULE_SETUP -#line 519 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 88: -YY_RULE_SETUP -#line 520 "ppl.l" -return ','; - YY_BREAK -case 89: -YY_RULE_SETUP -#line 521 "ppl.l" -return tELIPSIS; - YY_BREAK -case 90: -/* rule 90 can match eol */ -YY_RULE_SETUP -#line 522 "ppl.l" -ppy_error("Argument identifier expected"); - YY_BREAK -case 91: -/* rule 91 can match eol */ -YY_RULE_SETUP -#line 523 "ppl.l" -newline(0); - YY_BREAK -/* - * Scan the substitution of a macro - */ -case 92: -YY_RULE_SETUP -#line 528 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 93: -YY_RULE_SETUP -#line 529 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tIDENT; - YY_BREAK -case 94: -YY_RULE_SETUP -#line 530 "ppl.l" -return tCONCAT; - YY_BREAK -case 95: -YY_RULE_SETUP -#line 531 "ppl.l" -return tSTRINGIZE; - YY_BREAK -case 96: -YY_RULE_SETUP -#line 532 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 97: -YY_RULE_SETUP -#line 533 "ppl.l" -ppy_lval.cptr = pp_xstrdup(ppy_text); return tLITERAL; - YY_BREAK -case 98: -/* rule 98 can match eol */ -YY_RULE_SETUP -#line 534 "ppl.l" -newline(0); ppy_lval.cptr = pp_xstrdup(" "); return tLITERAL; - YY_BREAK -case 99: -/* rule 99 can match eol */ -YY_RULE_SETUP -#line 535 "ppl.l" -newline(0); - YY_BREAK -case 100: -/* rule 100 can match eol */ -YY_RULE_SETUP -#line 536 "ppl.l" -newline(1); yy_pop_state(); return tNL; - YY_BREAK -case 101: -YY_RULE_SETUP -#line 537 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 102: -YY_RULE_SETUP -#line 538 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -/* - * Macro expansion text scanning. - * This state is active just after the identifier is scanned - * that triggers an expansion. We *must* delete the leading - * whitespace before we can start scanning for arguments. - * - * If we do not see a '(' as next trailing token, then we have - * a false alarm. We just continue with a nose-bleed... - */ -case 103: -*yy_cp = (yy_hold_char); /* undo effects of setting up ppy_text */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up ppy_text again */ -YY_RULE_SETUP -#line 549 "ppl.l" -yy_pp_state(pp_macscan); - YY_BREAK -case 104: -/* rule 104 can match eol */ -YY_RULE_SETUP -#line 550 "ppl.l" -{ - if(yy_top_state() != pp_macscan) - newline(0); - } - YY_BREAK -case 105: -/* rule 105 can match eol */ -YY_RULE_SETUP -#line 554 "ppl.l" -newline(0); - YY_BREAK -case 106: -YY_RULE_SETUP -#line 555 "ppl.l" -{ - macexpstackentry_t *mac = pop_macro(); - yy_pop_state(); - put_buffer(mac->ppp->ident, strlen(mac->ppp->ident)); - put_buffer(ppy_text, ppy_leng); - free_macro(mac); - } - YY_BREAK -/* - * Macro expansion argument text scanning. - * This state is active when a macro's arguments are being read for expansion. - */ -case 107: -YY_RULE_SETUP -#line 567 "ppl.l" -{ - if(++MACROPARENTHESES() > 1) - add_text_to_macro(ppy_text, ppy_leng); - } - YY_BREAK -case 108: -YY_RULE_SETUP -#line 571 "ppl.l" -{ - if(--MACROPARENTHESES() == 0) - { - yy_pop_state(); - macro_add_arg(1); - } - else - add_text_to_macro(ppy_text, ppy_leng); - } - YY_BREAK -case 109: -YY_RULE_SETUP -#line 580 "ppl.l" -{ - if(MACROPARENTHESES() > 1) - add_text_to_macro(ppy_text, ppy_leng); - else - macro_add_arg(0); - } - YY_BREAK -case 110: -YY_RULE_SETUP -#line 586 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -case 111: -YY_RULE_SETUP -#line 587 "ppl.l" -new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 112: -YY_RULE_SETUP -#line 588 "ppl.l" -yy_push_state(pp_comment); add_text_to_macro(" ", 1); - YY_BREAK -case 113: -/* rule 113 can match eol */ -YY_RULE_SETUP -#line 589 "ppl.l" -pp_status.line_number++; pp_status.char_number = 1; add_text_to_macro(ppy_text, ppy_leng); - YY_BREAK -case 114: -YY_RULE_SETUP -#line 590 "ppl.l" -add_text_to_macro(ppy_text, ppy_leng); - YY_BREAK -case 115: -/* rule 115 can match eol */ -YY_RULE_SETUP -#line 591 "ppl.l" -newline(0); - YY_BREAK -/* - * Comment handling (almost all start-conditions) - */ -case 116: -YY_RULE_SETUP -#line 596 "ppl.l" -yy_push_state(pp_comment); - YY_BREAK -case 117: -YY_RULE_SETUP -#line 597 "ppl.l" -; - YY_BREAK -case 118: -/* rule 118 can match eol */ -YY_RULE_SETUP -#line 598 "ppl.l" -newline(0); - YY_BREAK -case 119: -YY_RULE_SETUP -#line 599 "ppl.l" -yy_pop_state(); - YY_BREAK -/* - * Remove C++ style comment (almost all start-conditions) - */ -case 120: -YY_RULE_SETUP -#line 604 "ppl.l" -{ - if(ppy_text[ppy_leng-1] == '\\') - ppy_warning("C++ style comment ends with an escaped newline (escape ignored)"); - } - YY_BREAK -/* - * Single, double and <> quoted constants - */ -case 121: -YY_RULE_SETUP -#line 612 "ppl.l" -pp_incl_state.seen_junk++; new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_dqs); - YY_BREAK -case 122: -YY_RULE_SETUP -#line 613 "ppl.l" -pp_incl_state.seen_junk++; new_string(); add_string(ppy_text, ppy_leng); yy_push_state(pp_sqs); - YY_BREAK -case 123: -YY_RULE_SETUP -#line 614 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 124: -YY_RULE_SETUP -#line 615 "ppl.l" -{ - add_string(ppy_text, ppy_leng); - yy_pop_state(); - switch(yy_current_state()) - { - case pp_pp: - case pp_define: - case pp_mbody: - case pp_inc: - case RCINCL: - if (yy_current_state()==RCINCL) yy_pop_state(); - ppy_lval.cptr = get_string(); - return tDQSTRING; - case pp_line: - ppy_lval.cptr = get_string(); - return tDQSTRING; - default: - put_string(); - } - } - YY_BREAK -case 125: -YY_RULE_SETUP -#line 635 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 126: -YY_RULE_SETUP -#line 636 "ppl.l" -{ - add_string(ppy_text, ppy_leng); - yy_pop_state(); - switch(yy_current_state()) - { - case pp_if: - case pp_define: - case pp_mbody: - ppy_lval.cptr = get_string(); - return tSQSTRING; - default: - put_string(); - } - } - YY_BREAK -case 127: -YY_RULE_SETUP -#line 650 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 128: -YY_RULE_SETUP -#line 651 "ppl.l" -{ - add_string(ppy_text, ppy_leng); - yy_pop_state(); - ppy_lval.cptr = get_string(); - return tIQSTRING; - } - YY_BREAK -case 129: -/* rule 129 can match eol */ -YY_RULE_SETUP -#line 657 "ppl.l" -{ - /* - * This is tricky; we need to remove the line-continuation - * from preprocessor strings, but OTOH retain them in all - * other strings. This is because the resource grammar is - * even more braindead than initially analysed and line- - * continuations in strings introduce, sigh, newlines in - * the output. There goes the concept of non-breaking, non- - * spacing whitespace. - */ - switch(yy_top_state()) - { - case pp_pp: - case pp_define: - case pp_mbody: - case pp_inc: - case pp_line: - newline(0); - break; - default: - add_string(ppy_text, ppy_leng); - newline(-1); - } - } - YY_BREAK -case 130: -YY_RULE_SETUP -#line 681 "ppl.l" -add_string(ppy_text, ppy_leng); - YY_BREAK -case 131: -/* rule 131 can match eol */ -YY_RULE_SETUP -#line 682 "ppl.l" -{ - newline(1); - add_string(ppy_text, ppy_leng); - ppy_warning("Newline in string constant encountered (started line %d)", string_start()); - } - YY_BREAK -/* - * Identifier scanning - */ -case 132: -YY_RULE_SETUP -#line 691 "ppl.l" -{ - pp_entry_t *ppp; - pp_incl_state.seen_junk++; - if(!(ppp = pplookup(ppy_text))) - { - if(yy_current_state() == pp_inc) - ppy_error("Expected include filename"); - - else if(yy_current_state() == pp_if) - { - ppy_lval.cptr = pp_xstrdup(ppy_text); - return tIDENT; - } - else { - if((yy_current_state()==INITIAL) && (strcasecmp(ppy_text,"RCINCLUDE")==0)){ - yy_push_state(RCINCL); - return tRCINCLUDE; - } - else put_buffer(ppy_text, ppy_leng); - } - } - else if(!ppp->expanding) - { - switch(ppp->type) - { - case def_special: - expand_special(ppp); - break; - case def_define: - expand_define(ppp); - break; - case def_macro: - yy_push_state(pp_macign); - push_macro(ppp); - break; - default: - pp_internal_error(__FILE__, __LINE__, "Invalid define type %d\n", ppp->type); - } - } - else put_buffer(ppy_text, ppy_leng); - } - YY_BREAK -/* - * Everything else that needs to be passed and - * newline and continuation handling - */ -case 133: -YY_RULE_SETUP -#line 737 "ppl.l" -pp_incl_state.seen_junk++; put_buffer(ppy_text, ppy_leng); - YY_BREAK -case 134: -YY_RULE_SETUP -#line 738 "ppl.l" -put_buffer(ppy_text, ppy_leng); - YY_BREAK -case 135: -/* rule 135 can match eol */ -YY_RULE_SETUP -#line 739 "ppl.l" -newline(1); - YY_BREAK -case 136: -/* rule 136 can match eol */ -YY_RULE_SETUP -#line 740 "ppl.l" -newline(0); - YY_BREAK -case 137: -YY_RULE_SETUP -#line 741 "ppl.l" -pp_incl_state.seen_junk++; put_buffer(ppy_text, ppy_leng); - YY_BREAK -/* - * Special catcher for macro argmument expansion to prevent - * newlines to propagate to the output or admin. - */ -case 138: -/* rule 138 can match eol */ -YY_RULE_SETUP -#line 747 "ppl.l" -put_buffer(ppy_text, ppy_leng); - YY_BREAK -case 139: -YY_RULE_SETUP -#line 749 "ppl.l" -{ - ppy_lval.cptr=pp_xstrdup(ppy_text); - yy_pop_state(); - return tRCINCLUDEPATH; - } - YY_BREAK -case 140: -YY_RULE_SETUP -#line 755 "ppl.l" -; - YY_BREAK -case 141: -YY_RULE_SETUP -#line 757 "ppl.l" -{ - new_string(); add_string(ppy_text,ppy_leng);yy_push_state(pp_dqs); - } - YY_BREAK -/* - * This is a 'catch-all' rule to discover errors in the scanner - * in an orderly manner. - */ -case 142: -YY_RULE_SETUP -#line 765 "ppl.l" -pp_incl_state.seen_junk++; ppy_warning("Unmatched text '%c' (0x%02x); please report\n", isprint(*ppy_text & 0xff) ? *ppy_text : ' ', *ppy_text); - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(pp_pp): -case YY_STATE_EOF(pp_eol): -case YY_STATE_EOF(pp_inc): -case YY_STATE_EOF(pp_dqs): -case YY_STATE_EOF(pp_sqs): -case YY_STATE_EOF(pp_iqs): -case YY_STATE_EOF(pp_comment): -case YY_STATE_EOF(pp_def): -case YY_STATE_EOF(pp_define): -case YY_STATE_EOF(pp_macro): -case YY_STATE_EOF(pp_mbody): -case YY_STATE_EOF(pp_macign): -case YY_STATE_EOF(pp_macscan): -case YY_STATE_EOF(pp_macexp): -case YY_STATE_EOF(pp_if): -case YY_STATE_EOF(pp_ifd): -case YY_STATE_EOF(pp_endif): -case YY_STATE_EOF(pp_line): -case YY_STATE_EOF(pp_defined): -case YY_STATE_EOF(pp_ignore): -case YY_STATE_EOF(RCINCL): -#line 767 "ppl.l" -{ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - bufferstackentry_t *bep = pop_buffer(); - - if((!bep && pp_get_if_depth()) || (bep && pp_get_if_depth() != bep->if_depth)) - ppy_warning("Unmatched #if/#endif at end of file"); - - if(!bep) - { - if(YY_START != INITIAL) - { - ppy_error("Unexpected end of file during preprocessing"); - BEGIN(INITIAL); - } - yyterminate(); - } - else if(bep->should_pop == 2) - { - macexpstackentry_t *mac; - mac = pop_macro(); - expand_macro(mac); - } - ppy__delete_buffer(b); - } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 792 "ppl.l" -ECHO; - YY_BREAK -#line 2739 "ppl.yy.c" - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed ppy_in at a new source and called - * ppy_lex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = ppy_in; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( ppy_wrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * ppy_text, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of ppy_lex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ - - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - ppy_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - ppy_restart(ppy_in ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) ppy_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 416 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 416 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 415); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - ppy_restart(ppy_in ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( ppy_wrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve ppy_text */ - (yy_hold_char) = *++(yy_c_buf_p); - - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void ppy_restart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - ppy_ensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - ppy__create_buffer(ppy_in,YY_BUF_SIZE ); - } - - ppy__init_buffer(YY_CURRENT_BUFFER,input_file ); - ppy__load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void ppy__switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * ppy_pop_buffer_state(); - * ppy_push_buffer_state(new_buffer); - */ - ppy_ensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - ppy__load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (ppy_wrap()) processing, but the only time this flag - * is looked at is after ppy_wrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void ppy__load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - ppy_in = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE ppy__create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) ppy_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in ppy__create_buffer()" ); - - b->yy_buf_size = size; - - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) ppy_alloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in ppy__create_buffer()" ); - - b->yy_is_our_buffer = 1; - - ppy__init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with ppy__create_buffer() - * - */ - void ppy__delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - ppy_free((void *) b->yy_ch_buf ); - - ppy_free((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a ppy_restart() or at EOF. - */ - static void ppy__init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - ppy__flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then ppy__init_buffer was _probably_ - * called from ppy_restart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void ppy__flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - ppy__load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void ppy_push_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - ppy_ensure_buffer_stack(); - - /* This block is copied from ppy__switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from ppy__switch_to_buffer. */ - ppy__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void ppy_pop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - ppy__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - ppy__load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void ppy_ensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. - */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)ppy_alloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in ppy_ensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)ppy_realloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in ppy_ensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE ppy__scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) ppy_alloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in ppy__scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - ppy__switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to ppy_lex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * ppy__scan_bytes() instead. - */ -YY_BUFFER_STATE ppy__scan_string (yyconst char * yystr ) -{ - - return ppy__scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to ppy_lex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE ppy__scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) ppy_alloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in ppy__scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = ppy__scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in ppy__scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - - static void yy_push_state (int new_state ) -{ - if ( (yy_start_stack_ptr) >= (yy_start_stack_depth) ) - { - yy_size_t new_size; - - (yy_start_stack_depth) += YY_START_STACK_INCR; - new_size = (yy_start_stack_depth) * sizeof( int ); - - if ( ! (yy_start_stack) ) - (yy_start_stack) = (int *) ppy_alloc(new_size ); - - else - (yy_start_stack) = (int *) ppy_realloc((void *) (yy_start_stack),new_size ); - - if ( ! (yy_start_stack) ) - YY_FATAL_ERROR( "out of memory expanding start-condition stack" ); - } - - (yy_start_stack)[(yy_start_stack_ptr)++] = YY_START; - - BEGIN(new_state); -} - - static void yy_pop_state (void) -{ - if ( --(yy_start_stack_ptr) < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); - - BEGIN((yy_start_stack)[(yy_start_stack_ptr)]); -} - - static int yy_top_state (void) -{ - return (yy_start_stack)[(yy_start_stack_ptr) - 1]; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up ppy_text. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - ppy_text[ppy_leng] = (yy_hold_char); \ - (yy_c_buf_p) = ppy_text + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - ppy_leng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int ppy_get_lineno (void) -{ - - return ppy_lineno; -} - -/** Get the input stream. - * - */ -FILE *ppy_get_in (void) -{ - return ppy_in; -} - -/** Get the output stream. - * - */ -FILE *ppy_get_out (void) -{ - return ppy_out; -} - -/** Get the length of the current token. - * - */ -int ppy_get_leng (void) -{ - return ppy_leng; -} - -/** Get the current token. - * - */ - -char *ppy_get_text (void) -{ - return ppy_text; -} - -/** Set the current line number. - * @param line_number - * - */ -void ppy_set_lineno (int line_number ) -{ - - ppy_lineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see ppy__switch_to_buffer - */ -void ppy_set_in (FILE * in_str ) -{ - ppy_in = in_str ; -} - -void ppy_set_out (FILE * out_str ) -{ - ppy_out = out_str ; -} - -int ppy_get_debug (void) -{ - return ppy__flex_debug; -} - -void ppy_set_debug (int bdebug ) -{ - ppy__flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from ppy_lex_destroy(), so don't allocate here. - */ - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - - (yy_start_stack_ptr) = 0; - (yy_start_stack_depth) = 0; - (yy_start_stack) = NULL; - -/* Defined in main.c */ -#ifdef YY_STDINIT - ppy_in = stdin; - ppy_out = stdout; -#else - ppy_in = (FILE *) 0; - ppy_out = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * ppy_lex_init() - */ - return 0; -} - -/* ppy_lex_destroy is for both reentrant and non-reentrant scanners. */ -int ppy_lex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - ppy__delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - ppy_pop_buffer_state(); - } - - /* Destroy the stack itself. */ - ppy_free((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Destroy the start condition stack. */ - ppy_free((yy_start_stack) ); - (yy_start_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * ppy_lex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *ppy_alloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *ppy_realloc (void * ptr, yy_size_t size ) -{ - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void ppy_free (void * ptr ) -{ - free( (char *) ptr ); /* see ppy_realloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -#line 792 "ppl.l" - - -/* - ************************************************************************** - * Support functions - ************************************************************************** - */ - -#ifndef ppy_wrap -int ppy_wrap(void) -{ - return 1; -} -#endif - - -/* - *------------------------------------------------------------------------- - * Output newlines or set them as continuations - * - * Input: -1 - Don't count this one, but update local position (see pp_dqs) - * 0 - Line-continuation seen and cache output - * 1 - Newline seen and flush output - *------------------------------------------------------------------------- - */ -static void newline(int dowrite) -{ - pp_status.line_number++; - pp_status.char_number = 1; - - if(dowrite == -1) - return; - - ncontinuations++; - if(dowrite) - { - for(;ncontinuations; ncontinuations--) - put_buffer("\n", 1); - } -} - - -/* - *------------------------------------------------------------------------- - * Make a number out of an any-base and suffixed string - * - * Possible number extensions: - * - "" int - * - "L" long int - * - "LL" long long int - * - "U" unsigned int - * - "UL" unsigned long int - * - "ULL" unsigned long long int - * - "LU" unsigned long int - * - "LLU" unsigned long long int - * - "LUL" invalid - * - * FIXME: - * The sizes of resulting 'int' and 'long' are compiler specific. - * I depend on sizeof(int) > 2 here (although a relatively safe - * assumption). - * Long longs are not yet implemented because this is very compiler - * specific and I don't want to think too much about the problems. - * - *------------------------------------------------------------------------- - */ -static int make_number(int radix, YYSTYPE *val, const char *str, int len) -{ - int is_l = 0; - int is_ll = 0; - int is_u = 0; - char ext[4]; - long l; - - ext[3] = '\0'; - ext[2] = toupper(str[len-1]); - ext[1] = len > 1 ? toupper(str[len-2]) : ' '; - ext[0] = len > 2 ? toupper(str[len-3]) : ' '; - - if(!strcmp(ext, "LUL")) - { - ppy_error("Invalid constant suffix"); - return 0; - } - else if(!strcmp(ext, "LLU") || !strcmp(ext, "ULL")) - { - is_ll++; - is_u++; - } - else if(!strcmp(ext+1, "LU") || !strcmp(ext+1, "UL")) - { - is_l++; - is_u++; - } - else if(!strcmp(ext+1, "LL")) - { - is_ll++; - } - else if(!strcmp(ext+2, "L")) - { - is_l++; - } - else if(!strcmp(ext+2, "U")) - { - is_u++; - } - - if(is_ll) - { -/* Assume as in the declaration of wrc_ull_t and wrc_sll_t */ -#ifdef HAVE_LONG_LONG - if (is_u) - { - errno = 0; - val->ull = strtoull(str, NULL, radix); - if (val->ull == ULLONG_MAX && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tULONGLONG; - } - else - { - errno = 0; - val->sll = strtoll(str, NULL, radix); - if ((val->sll == LLONG_MIN || val->sll == LLONG_MAX) && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tSLONGLONG; - } -#else - pp_internal_error(__FILE__, __LINE__, "long long constants not supported on this platform"); -#endif - } - else if(is_u && is_l) - { - errno = 0; - val->ulong = strtoul(str, NULL, radix); - if (val->ulong == ULONG_MAX && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tULONG; - } - else if(!is_u && is_l) - { - errno = 0; - val->slong = strtol(str, NULL, radix); - if ((val->slong == LONG_MIN || val->slong == LONG_MAX) && errno == ERANGE) - ppy_error("integer constant %s is too large\n", str); - return tSLONG; - } - else if(is_u && !is_l) - { - unsigned long ul; - errno = 0; - ul = strtoul(str, NULL, radix); - if ((ul == ULONG_MAX && errno == ERANGE) || (ul > UINT_MAX)) - ppy_error("integer constant %s is too large\n", str); - val->uint = (unsigned int)ul; - return tUINT; - } - - /* Else it must be an int... */ - errno = 0; - l = strtol(str, NULL, radix); - if (((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) || - (l > INT_MAX) || (l < INT_MIN)) - ppy_error("integer constant %s is too large\n", str); - val->sint = (int)l; - return tSINT; -} - - -/* - *------------------------------------------------------------------------- - * Macro and define expansion support - * - * FIXME: Variable macro arguments. - *------------------------------------------------------------------------- - */ -static void expand_special(pp_entry_t *ppp) -{ - static char *buf = NULL; - char *new_buf; - - assert(ppp->type == def_special); - - if(!strcmp(ppp->ident, "__LINE__")) - { - new_buf = pp_xrealloc(buf, 32); - if(!new_buf) - return; - buf = new_buf; - sprintf(buf, "%d", pp_status.line_number); - } - else if(!strcmp(ppp->ident, "__FILE__")) - { - new_buf = pp_xrealloc(buf, strlen(pp_status.input) + 3); - if(!new_buf) - return; - buf = new_buf; - sprintf(buf, "\"%s\"", pp_status.input); - } - else - pp_internal_error(__FILE__, __LINE__, "Special macro '%s' not found...\n", ppp->ident); - - if(pp_flex_debug) - fprintf(stderr, "expand_special(%d): %s:%d: '%s' -> '%s'\n", - macexpstackidx, - pp_status.input, - pp_status.line_number, - ppp->ident, - buf ? buf : ""); - - if(buf && buf[0]) - { - push_buffer(ppp, NULL, NULL, 0); - ppy__scan_string(buf); - } -} - -static void expand_define(pp_entry_t *ppp) -{ - assert(ppp->type == def_define); - - if(pp_flex_debug) - fprintf(stderr, "expand_define(%d): %s:%d: '%s' -> '%s'\n", - macexpstackidx, - pp_status.input, - pp_status.line_number, - ppp->ident, - ppp->subst.text); - if(ppp->subst.text && ppp->subst.text[0]) - { - push_buffer(ppp, NULL, NULL, 0); - ppy__scan_string(ppp->subst.text); - } -} - -static int curdef_idx = 0; -static int curdef_alloc = 0; -static char *curdef_text = NULL; - -static void add_text(const char *str, int len) -{ - int new_alloc; - char *new_text; - - if(len == 0) - return; - if(curdef_idx >= curdef_alloc || curdef_alloc - curdef_idx < len) - { - new_alloc = curdef_alloc + ((len + ALLOCBLOCKSIZE-1) & ~(ALLOCBLOCKSIZE-1)); - new_text = pp_xrealloc(curdef_text, new_alloc * sizeof(curdef_text[0])); - if(!new_text) - return; - curdef_text = new_text; - curdef_alloc = new_alloc; - if(curdef_alloc > 65536) - ppy_warning("Reallocating macro-expansion buffer larger than 64kB"); - } - memcpy(&curdef_text[curdef_idx], str, len); - curdef_idx += len; -} - -static mtext_t *add_expand_text(mtext_t *mtp, macexpstackentry_t *mep, int *nnl) -{ - char *cptr; - char *exp; - int tag; - int n; - - if(mtp == NULL) - return NULL; - - switch(mtp->type) - { - case exp_text: - if(pp_flex_debug) - fprintf(stderr, "add_expand_text: exp_text: '%s'\n", mtp->subst.text); - add_text(mtp->subst.text, strlen(mtp->subst.text)); - break; - - case exp_stringize: - if(pp_flex_debug) - fprintf(stderr, "add_expand_text: exp_stringize(%d): '%s'\n", - mtp->subst.argidx, - mep->args[mtp->subst.argidx]); - cptr = mep->args[mtp->subst.argidx]; - add_text("\"", 1); - while(*cptr) - { - if(*cptr == '"' || *cptr == '\\') - add_text("\\", 1); - add_text(cptr, 1); - cptr++; - } - add_text("\"", 1); - break; - - case exp_concat: - if(pp_flex_debug) - fprintf(stderr, "add_expand_text: exp_concat\n"); - /* Remove trailing whitespace from current expansion text */ - while(curdef_idx) - { - if(isspace(curdef_text[curdef_idx-1] & 0xff)) - curdef_idx--; - else - break; - } - /* tag current position and recursively expand the next part */ - tag = curdef_idx; - mtp = add_expand_text(mtp->next, mep, nnl); - - /* Now get rid of the leading space of the expansion */ - cptr = &curdef_text[tag]; - n = curdef_idx - tag; - while(n) - { - if(isspace(*cptr & 0xff)) - { - cptr++; - n--; - } - else - break; - } - if(cptr != &curdef_text[tag]) - { - memmove(&curdef_text[tag], cptr, n); - curdef_idx -= (curdef_idx - tag) - n; - } - break; - - case exp_subst: - if((mtp->next && mtp->next->type == exp_concat) || (mtp->prev && mtp->prev->type == exp_concat)) - exp = mep->args[mtp->subst.argidx]; - else - exp = mep->ppargs[mtp->subst.argidx]; - if(exp) - { - add_text(exp, strlen(exp)); - *nnl -= mep->nnls[mtp->subst.argidx]; - cptr = strchr(exp, '\n'); - while(cptr) - { - *cptr = ' '; - cptr = strchr(cptr+1, '\n'); - } - mep->nnls[mtp->subst.argidx] = 0; - } - if(pp_flex_debug) - fprintf(stderr, "add_expand_text: exp_subst(%d): '%s'\n", mtp->subst.argidx, exp); - break; - - default: - pp_internal_error(__FILE__, __LINE__, "Invalid expansion type (%d) in macro expansion\n", mtp->type); - } - return mtp; -} - -static void expand_macro(macexpstackentry_t *mep) -{ - mtext_t *mtp; - int n, k; - char *cptr; - int nnl = 0; - pp_entry_t *ppp = mep->ppp; - int nargs = mep->nargs; - - assert(ppp->type == def_macro); - assert(ppp->expanding == 0); - - if((ppp->nargs >= 0 && nargs != ppp->nargs) || (ppp->nargs < 0 && nargs < -ppp->nargs)) - { - ppy_error("Too %s macro arguments (%d)", nargs < abs(ppp->nargs) ? "few" : "many", nargs); - return; - } - - for(n = 0; n < nargs; n++) - nnl += mep->nnls[n]; - - if(pp_flex_debug) - fprintf(stderr, "expand_macro(%d): %s:%d: '%s'(%d,%d) -> ...\n", - macexpstackidx, - pp_status.input, - pp_status.line_number, - ppp->ident, - mep->nargs, - nnl); - - curdef_idx = 0; - - for(mtp = ppp->subst.mtext; mtp; mtp = mtp->next) - { - if(!(mtp = add_expand_text(mtp, mep, &nnl))) - break; - } - - for(n = 0; n < nnl; n++) - add_text("\n", 1); - - /* To make sure there is room and termination (see below) */ - add_text(" \0", 2); - - /* Strip trailing whitespace from expansion */ - for(k = curdef_idx, cptr = &curdef_text[curdef_idx-1]; k > 0; k--, cptr--) - { - if(!isspace(*cptr & 0xff)) - break; - } - - /* - * We must add *one* whitespace to make sure that there - * is a token-separation after the expansion. - */ - *(++cptr) = ' '; - *(++cptr) = '\0'; - k++; - - /* Strip leading whitespace from expansion */ - for(n = 0, cptr = curdef_text; n < k; n++, cptr++) - { - if(!isspace(*cptr & 0xff)) - break; - } - - if(k - n > 0) - { - if(pp_flex_debug) - fprintf(stderr, "expand_text: '%s'\n", curdef_text + n); - push_buffer(ppp, NULL, NULL, 0); - /*ppy__scan_bytes(curdef_text + n,k - n);*/ - ppy__scan_string(curdef_text + n); - } -} - -/* - *------------------------------------------------------------------------- - * String collection routines - *------------------------------------------------------------------------- - */ -static void new_string(void) -{ -#ifdef DEBUG - if(strbuf_idx) - ppy_warning("new_string: strbuf_idx != 0"); -#endif - strbuf_idx = 0; - str_startline = pp_status.line_number; -} - -static void add_string(const char *str, int len) -{ - int new_alloc; - char *new_buffer; - - if(len == 0) - return; - if(strbuf_idx >= strbuf_alloc || strbuf_alloc - strbuf_idx < len) - { - new_alloc = strbuf_alloc + ((len + ALLOCBLOCKSIZE-1) & ~(ALLOCBLOCKSIZE-1)); - new_buffer = pp_xrealloc(strbuffer, new_alloc * sizeof(strbuffer[0])); - if(!new_buffer) - return; - strbuffer = new_buffer; - strbuf_alloc = new_alloc; - if(strbuf_alloc > 65536) - ppy_warning("Reallocating string buffer larger than 64kB"); - } - memcpy(&strbuffer[strbuf_idx], str, len); - strbuf_idx += len; -} - -static char *get_string(void) -{ - char *str = pp_xmalloc(strbuf_idx + 1); - if(!str) - return NULL; - memcpy(str, strbuffer, strbuf_idx); - str[strbuf_idx] = '\0'; -#ifdef DEBUG - strbuf_idx = 0; -#endif - return str; -} - -static void put_string(void) -{ - put_buffer(strbuffer, strbuf_idx); -#ifdef DEBUG - strbuf_idx = 0; -#endif -} - -static int string_start(void) -{ - return str_startline; -} - - -/* - *------------------------------------------------------------------------- - * Buffer management - *------------------------------------------------------------------------- - */ -static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop) -{ - if(ppy_debug) - printf("push_buffer(%d): %p %p %p %d\n", bufferstackidx, ppp, filename, incname, pop); - if(bufferstackidx >= MAXBUFFERSTACK) - pp_internal_error(__FILE__, __LINE__, "Buffer stack overflow"); - - memset(&bufferstack[bufferstackidx], 0, sizeof(bufferstack[0])); - bufferstack[bufferstackidx].bufferstate = YY_CURRENT_BUFFER; - bufferstack[bufferstackidx].filehandle = pp_status.file; - bufferstack[bufferstackidx].define = ppp; - bufferstack[bufferstackidx].line_number = pp_status.line_number; - bufferstack[bufferstackidx].char_number = pp_status.char_number; - bufferstack[bufferstackidx].if_depth = pp_get_if_depth(); - bufferstack[bufferstackidx].should_pop = pop; - bufferstack[bufferstackidx].filename = pp_status.input; - bufferstack[bufferstackidx].ncontinuations = ncontinuations; - bufferstack[bufferstackidx].incl = pp_incl_state; - bufferstack[bufferstackidx].include_filename = incname; - - if(ppp) - ppp->expanding = 1; - else if(filename) - { - /* These will track the ppy_error to the correct file and line */ - pp_status.line_number = 1; - pp_status.char_number = 1; - pp_status.input = filename; - ncontinuations = 0; - } - else if(!pop) - pp_internal_error(__FILE__, __LINE__, "Pushing buffer without knowing where to go to"); - bufferstackidx++; -} - -static bufferstackentry_t *pop_buffer(void) -{ - if(bufferstackidx < 0) - pp_internal_error(__FILE__, __LINE__, "Bufferstack underflow?"); - - if(bufferstackidx == 0) - return NULL; - - bufferstackidx--; - - if(bufferstack[bufferstackidx].define) - bufferstack[bufferstackidx].define->expanding = 0; - else - { - includelogicentry_t *iep = NULL; - - if(!bufferstack[bufferstackidx].should_pop) - { - wpp_callbacks->close(pp_status.file); - pp_writestring("# %d \"%s\" 2\n", bufferstack[bufferstackidx].line_number, bufferstack[bufferstackidx].filename); - - /* We have EOF, check the include logic */ - if(pp_incl_state.state == 2 && !pp_incl_state.seen_junk && pp_incl_state.ppp) - { - pp_entry_t *ppp = pplookup(pp_incl_state.ppp); - if(ppp) - { - iep = pp_xmalloc(sizeof(includelogicentry_t)); - if (iep) - { - iep->ppp = ppp; - ppp->iep = iep; - iep->filename = bufferstack[bufferstackidx].include_filename; - iep->prev = NULL; - iep->next = pp_includelogiclist; - if(iep->next) - iep->next->prev = iep; - pp_includelogiclist = iep; - if(pp_status.debug) - fprintf(stderr, "pop_buffer: %s:%d: includelogic added, include_ppp='%s', file='%s'\n", - bufferstack[bufferstackidx].filename, bufferstack[bufferstackidx].line_number, pp_incl_state.ppp, iep->filename); - } - } - } - free(pp_incl_state.ppp); - pp_incl_state = bufferstack[bufferstackidx].incl; - - } - if (bufferstack[bufferstackidx].include_filename) - { - free(pp_status.input); - pp_status.input = bufferstack[bufferstackidx].filename; - } - pp_status.line_number = bufferstack[bufferstackidx].line_number; - pp_status.char_number = bufferstack[bufferstackidx].char_number; - ncontinuations = bufferstack[bufferstackidx].ncontinuations; - if (!iep) - free(bufferstack[bufferstackidx].include_filename); - } - - if(ppy_debug) - printf("pop_buffer(%d): %p %p (%d, %d, %d) %p %d\n", - bufferstackidx, - bufferstack[bufferstackidx].bufferstate, - bufferstack[bufferstackidx].define, - bufferstack[bufferstackidx].line_number, - bufferstack[bufferstackidx].char_number, - bufferstack[bufferstackidx].if_depth, - bufferstack[bufferstackidx].filename, - bufferstack[bufferstackidx].should_pop); - - pp_status.file = bufferstack[bufferstackidx].filehandle; - ppy__switch_to_buffer(bufferstack[bufferstackidx].bufferstate); - - if(bufferstack[bufferstackidx].should_pop) - { - if(yy_current_state() == pp_macexp) - macro_add_expansion(); - else - pp_internal_error(__FILE__, __LINE__, "Pop buffer and state without macro expansion state"); - yy_pop_state(); - } - - return &bufferstack[bufferstackidx]; -} - - -/* - *------------------------------------------------------------------------- - * Macro nestng support - *------------------------------------------------------------------------- - */ -static void push_macro(pp_entry_t *ppp) -{ - if(macexpstackidx >= MAXMACEXPSTACK) - { - ppy_error("Too many nested macros"); - return; - } - - macexpstack[macexpstackidx] = pp_xmalloc(sizeof(macexpstack[0][0])); - if(!macexpstack[macexpstackidx]) - return; - memset( macexpstack[macexpstackidx], 0, sizeof(macexpstack[0][0])); - macexpstack[macexpstackidx]->ppp = ppp; - macexpstackidx++; -} - -static macexpstackentry_t *top_macro(void) -{ - return macexpstackidx > 0 ? macexpstack[macexpstackidx-1] : NULL; -} - -static macexpstackentry_t *pop_macro(void) -{ - if(macexpstackidx <= 0) - pp_internal_error(__FILE__, __LINE__, "Macro expansion stack underflow\n"); - return macexpstack[--macexpstackidx]; -} - -static void free_macro(macexpstackentry_t *mep) -{ - int i; - - for(i = 0; i < mep->nargs; i++) - free(mep->args[i]); - free(mep->args); - free(mep->nnls); - free(mep->curarg); - free(mep); -} - -static void add_text_to_macro(const char *text, int len) -{ - macexpstackentry_t *mep = top_macro(); - - assert(mep->ppp->expanding == 0); - - if(mep->curargalloc - mep->curargsize <= len+1) /* +1 for '\0' */ - { - char *new_curarg; - int new_alloc = mep->curargalloc + ((ALLOCBLOCKSIZE > len+1) ? ALLOCBLOCKSIZE : len+1); - new_curarg = pp_xrealloc(mep->curarg, new_alloc * sizeof(mep->curarg[0])); - if(!new_curarg) - return; - mep->curarg = new_curarg; - mep->curargalloc = new_alloc; - } - memcpy(mep->curarg + mep->curargsize, text, len); - mep->curargsize += len; - mep->curarg[mep->curargsize] = '\0'; -} - -static void macro_add_arg(int last) -{ - int nnl = 0; - char *cptr; - char **new_args, **new_ppargs; - int *new_nnls; - macexpstackentry_t *mep = top_macro(); - - assert(mep->ppp->expanding == 0); - - new_args = pp_xrealloc(mep->args, (mep->nargs+1) * sizeof(mep->args[0])); - if(!new_args) - return; - mep->args = new_args; - - new_ppargs = pp_xrealloc(mep->ppargs, (mep->nargs+1) * sizeof(mep->ppargs[0])); - if(!new_ppargs) - return; - mep->ppargs = new_ppargs; - - new_nnls = pp_xrealloc(mep->nnls, (mep->nargs+1) * sizeof(mep->nnls[0])); - if(!new_nnls) - return; - mep->nnls = new_nnls; - - mep->args[mep->nargs] = pp_xstrdup(mep->curarg ? mep->curarg : ""); - if(!mep->args[mep->nargs]) - return; - cptr = mep->args[mep->nargs]-1; - while((cptr = strchr(cptr+1, '\n'))) - { - nnl++; - } - mep->nnls[mep->nargs] = nnl; - mep->nargs++; - free(mep->curarg); - mep->curargalloc = mep->curargsize = 0; - mep->curarg = NULL; - - if(pp_flex_debug) - fprintf(stderr, "macro_add_arg: %s:%d: %d -> '%s'\n", - pp_status.input, - pp_status.line_number, - mep->nargs-1, - mep->args[mep->nargs-1]); - - /* Each macro argument must be expanded to cope with stingize */ - if(last || mep->args[mep->nargs-1][0]) - { - yy_push_state(pp_macexp); - push_buffer(NULL, NULL, NULL, last ? 2 : 1); - ppy__scan_string(mep->args[mep->nargs-1]); - /*mep->bufferstackidx = bufferstackidx; But not nested! */ - } -} - -static void macro_add_expansion(void) -{ - macexpstackentry_t *mep = top_macro(); - - assert(mep->ppp->expanding == 0); - - mep->ppargs[mep->nargs-1] = pp_xstrdup(mep->curarg ? mep->curarg : ""); - free(mep->curarg); - mep->curargalloc = mep->curargsize = 0; - mep->curarg = NULL; - - if(pp_flex_debug) - fprintf(stderr, "macro_add_expansion: %s:%d: %d -> '%s'\n", - pp_status.input, - pp_status.line_number, - mep->nargs-1, - mep->ppargs[mep->nargs-1] ? mep->ppargs[mep->nargs-1] : ""); -} - - -/* - *------------------------------------------------------------------------- - * Output management - *------------------------------------------------------------------------- - */ -static void put_buffer(const char *s, int len) -{ - if(top_macro()) - add_text_to_macro(s, len); - else - wpp_callbacks->write(s, len); -} - - -/* - *------------------------------------------------------------------------- - * Include management - *------------------------------------------------------------------------- - */ -void pp_do_include(char *fname, int type) -{ - char *newpath; - int n; - includelogicentry_t *iep; - void *fp; - - if(!fname) - return; - - for(iep = pp_includelogiclist; iep; iep = iep->next) - { - if(!strcmp(iep->filename, fname)) - { - /* - * We are done. The file was included before. - * If the define was deleted, then this entry would have - * been deleted too. - */ - free(fname); - return; - } - } - - n = strlen(fname); - - if(n <= 2) - { - ppy_error("Empty include filename"); - free(fname); - return; - } - - /* Undo the effect of the quotation */ - fname[n-1] = '\0'; - - if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL) - { - ppy_error("Unable to open include file %s", fname+1); - free(fname); - return; - } - - fname[n-1] = *fname; /* Redo the quotes */ - push_buffer(NULL, newpath, fname, 0); - pp_incl_state.seen_junk = 0; - pp_incl_state.state = 0; - pp_incl_state.ppp = NULL; - - if(pp_status.debug) - fprintf(stderr, "pp_do_include: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n", - pp_status.input, pp_status.line_number, pp_incl_state.state, pp_incl_state.ppp, pp_incl_state.ifdepth); - pp_status.file = fp; - ppy__switch_to_buffer(ppy__create_buffer(NULL, YY_BUF_SIZE)); - - pp_writestring("# 1 \"%s\" 1%s\n", newpath, type ? "" : " 3"); -} - -/* - *------------------------------------------------------------------------- - * Push/pop preprocessor ignore state when processing conditionals - * which are false. - *------------------------------------------------------------------------- - */ -void pp_push_ignore_state(void) -{ - yy_push_state(pp_ignore); -} - -void pp_pop_ignore_state(void) -{ - yy_pop_state(); -} - diff --git a/sdk/tools/wpp/ppy.tab.c b/sdk/tools/wpp/ppy.tab.c deleted file mode 100644 index 0c490282d6a..00000000000 --- a/sdk/tools/wpp/ppy.tab.c +++ /dev/null @@ -1,2614 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ - -/* Bison implementation for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "3.0.2" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 0 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - - -/* Substitute the variable and function names. */ -#define yyparse ppy_parse -#define yylex ppy_lex -#define yyerror ppy_error -#define yydebug ppy_debug -#define yynerrs ppy_nerrs - -#define yylval ppy_lval -#define yychar ppy_char - -/* Copy the first part of user declarations. */ -#line 30 "ppy.y" /* yacc.c:339 */ - -#include "config.h" -#include "wine/port.h" - -#include -#include -#include -#include -#include -#include - -#include "wpp_private.h" - - -#define UNARY_OP(r, v, OP) \ - switch(v.type) \ - { \ - case cv_sint: r.val.si = OP v.val.si; break; \ - case cv_uint: r.val.ui = OP v.val.ui; break; \ - case cv_slong: r.val.sl = OP v.val.sl; break; \ - case cv_ulong: r.val.ul = OP v.val.ul; break; \ - case cv_sll: r.val.sll = OP v.val.sll; break; \ - case cv_ull: r.val.ull = OP v.val.ull; break; \ - } - -#define cv_signed(v) ((v.type & FLAG_SIGNED) != 0) - -#define BIN_OP_INT(r, v1, v2, OP) \ - r.type = v1.type; \ - if(cv_signed(v1) && cv_signed(v2)) \ - r.val.si = v1.val.si OP v2.val.si; \ - else if(cv_signed(v1) && !cv_signed(v2)) \ - r.val.si = v1.val.si OP (signed) v2.val.ui; \ - else if(!cv_signed(v1) && cv_signed(v2)) \ - r.val.si = (signed) v1.val.ui OP v2.val.si; \ - else \ - r.val.ui = v1.val.ui OP v2.val.ui; - -#define BIN_OP_LONG(r, v1, v2, OP) \ - r.type = v1.type; \ - if(cv_signed(v1) && cv_signed(v2)) \ - r.val.sl = v1.val.sl OP v2.val.sl; \ - else if(cv_signed(v1) && !cv_signed(v2)) \ - r.val.sl = v1.val.sl OP (signed long) v2.val.ul; \ - else if(!cv_signed(v1) && cv_signed(v2)) \ - r.val.sl = (signed long) v1.val.ul OP v2.val.sl; \ - else \ - r.val.ul = v1.val.ul OP v2.val.ul; - -#define BIN_OP_LONGLONG(r, v1, v2, OP) \ - r.type = v1.type; \ - if(cv_signed(v1) && cv_signed(v2)) \ - r.val.sll = v1.val.sll OP v2.val.sll; \ - else if(cv_signed(v1) && !cv_signed(v2)) \ - r.val.sll = v1.val.sll OP (wrc_sll_t) v2.val.ull; \ - else if(!cv_signed(v1) && cv_signed(v2)) \ - r.val.sll = (wrc_sll_t) v1.val.ull OP v2.val.sll; \ - else \ - r.val.ull = v1.val.ull OP v2.val.ull; - -#define BIN_OP(r, v1, v2, OP) \ - switch(v1.type & SIZE_MASK) \ - { \ - case SIZE_INT: BIN_OP_INT(r, v1, v2, OP); break; \ - case SIZE_LONG: BIN_OP_LONG(r, v1, v2, OP); break; \ - case SIZE_LONGLONG: BIN_OP_LONGLONG(r, v1, v2, OP); break; \ - default: pp_internal_error(__FILE__, __LINE__, "Invalid type indicator (0x%04x)", v1.type); \ - } - - -/* - * Prototypes - */ -static int boolean(cval_t *v); -static void promote_equal_size(cval_t *v1, cval_t *v2); -static void cast_to_sint(cval_t *v); -static void cast_to_uint(cval_t *v); -static void cast_to_slong(cval_t *v); -static void cast_to_ulong(cval_t *v); -static void cast_to_sll(cval_t *v); -static void cast_to_ull(cval_t *v); -static marg_t *new_marg(char *str, def_arg_t type); -static marg_t *add_new_marg(char *str, def_arg_t type); -static int marg_index(char *id); -static mtext_t *new_mtext(char *str, int idx, def_exp_t type); -static mtext_t *combine_mtext(mtext_t *tail, mtext_t *mtp); -static char *merge_text(char *s1, char *s2); - -/* - * Local variables - */ -static marg_t **macro_args; /* Macro parameters array while parsing */ -static int nmacro_args; - - -#line 170 "ppy.tab.c" /* yacc.c:339 */ - -# ifndef YY_NULLPTR -# if defined __cplusplus && 201103L <= __cplusplus -# define YY_NULLPTR nullptr -# else -# define YY_NULLPTR 0 -# endif -# endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - - -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int ppy_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tRCINCLUDE = 258, - tIF = 259, - tIFDEF = 260, - tIFNDEF = 261, - tELSE = 262, - tELIF = 263, - tENDIF = 264, - tDEFINED = 265, - tNL = 266, - tINCLUDE = 267, - tLINE = 268, - tGCCLINE = 269, - tERROR = 270, - tWARNING = 271, - tPRAGMA = 272, - tPPIDENT = 273, - tUNDEF = 274, - tMACROEND = 275, - tCONCAT = 276, - tELIPSIS = 277, - tSTRINGIZE = 278, - tIDENT = 279, - tLITERAL = 280, - tMACRO = 281, - tDEFINE = 282, - tDQSTRING = 283, - tSQSTRING = 284, - tIQSTRING = 285, - tUINT = 286, - tSINT = 287, - tULONG = 288, - tSLONG = 289, - tULONGLONG = 290, - tSLONGLONG = 291, - tRCINCLUDEPATH = 292, - tLOGOR = 293, - tLOGAND = 294, - tEQ = 295, - tNE = 296, - tLTE = 297, - tGTE = 298, - tLSHIFT = 299, - tRSHIFT = 300 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; -union YYSTYPE -{ -#line 126 "ppy.y" /* yacc.c:355 */ - - int sint; - unsigned int uint; - long slong; - unsigned long ulong; - wrc_sll_t sll; - wrc_ull_t ull; - int *iptr; - char *cptr; - cval_t cval; - marg_t *marg; - mtext_t *mtext; - -#line 267 "ppy.tab.c" /* yacc.c:355 */ -}; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE ppy_lval; - -int ppy_parse (void); - - - -/* Copy the second part of user declarations. */ - -#line 282 "ppy.tab.c" /* yacc.c:358 */ - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#else -typedef signed char yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(Msgid) dgettext ("bison-runtime", Msgid) -# endif -# endif -# ifndef YY_ -# define YY_(Msgid) Msgid -# endif -#endif - -#ifndef YY_ATTRIBUTE -# if (defined __GNUC__ \ - && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ - || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C -# define YY_ATTRIBUTE(Spec) __attribute__(Spec) -# else -# define YY_ATTRIBUTE(Spec) /* empty */ -# endif -#endif - -#ifndef YY_ATTRIBUTE_PURE -# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) -#endif - -#ifndef YY_ATTRIBUTE_UNUSED -# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) -#endif - -#if !defined _Noreturn \ - && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) -# if defined _MSC_VER && 1200 <= _MSC_VER -# define _Noreturn __declspec (noreturn) -# else -# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(E) ((void) (E)) -#else -# define YYUSE(E) /* empty */ -#endif - -#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ -/* Suppress an incorrect diagnostic about yylval being uninitialized. */ -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ - _Pragma ("GCC diagnostic push") \ - _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ - _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") -# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ - _Pragma ("GCC diagnostic pop") -#else -# define YY_INITIAL_VALUE(Value) Value -#endif -#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN -# define YY_IGNORE_MAYBE_UNINITIALIZED_END -#endif -#ifndef YY_INITIAL_VALUE -# define YY_INITIAL_VALUE(Value) /* Nothing. */ -#endif - - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS -# include /* INFRINGES ON USER NAME SPACE */ - /* Use EXIT_SUCCESS as a witness for stdlib.h. */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's 'empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined EXIT_SUCCESS \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef EXIT_SUCCESS -# define EXIT_SUCCESS 0 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined EXIT_SUCCESS -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined EXIT_SUCCESS -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -# define YYCOPY_NEEDED 1 - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined YYCOPY_NEEDED && YYCOPY_NEEDED -/* Copy COUNT objects from SRC to DST. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(Dst, Src, Count) \ - __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) -# else -# define YYCOPY(Dst, Src, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (Dst)[yyi] = (Src)[yyi]; \ - } \ - while (0) -# endif -# endif -#endif /* !YYCOPY_NEEDED */ - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 2 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 303 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 62 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 13 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 84 -/* YYNSTATES -- Number of states. */ -#define YYNSTATES 153 - -/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned - by yylex, with out-of-bounds checking. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 300 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM - as returned by yylex, without out-of-bounds checking. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 58, 2, 2, 2, 2, 44, 2, - 60, 61, 55, 53, 59, 54, 2, 56, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 39, 2, - 47, 2, 49, 38, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 43, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 42, 2, 57, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 40, 41, 45, 46, 48, 50, 51, - 52 -}; - -#if YYDEBUG - /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 181, 181, 182, 186, 187, 188, 189, 190, 210, - 234, 260, 277, 278, 279, 282, 283, 284, 286, 288, - 290, 292, 293, 294, 295, 296, 297, 310, 316, 317, - 320, 321, 322, 323, 324, 325, 328, 331, 332, 335, - 336, 339, 340, 344, 345, 351, 352, 355, 356, 357, - 358, 359, 366, 375, 376, 377, 378, 379, 380, 381, - 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, - 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, - 402, 403, 404, 405, 406 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || 0 -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "tRCINCLUDE", "tIF", "tIFDEF", "tIFNDEF", - "tELSE", "tELIF", "tENDIF", "tDEFINED", "tNL", "tINCLUDE", "tLINE", - "tGCCLINE", "tERROR", "tWARNING", "tPRAGMA", "tPPIDENT", "tUNDEF", - "tMACROEND", "tCONCAT", "tELIPSIS", "tSTRINGIZE", "tIDENT", "tLITERAL", - "tMACRO", "tDEFINE", "tDQSTRING", "tSQSTRING", "tIQSTRING", "tUINT", - "tSINT", "tULONG", "tSLONG", "tULONGLONG", "tSLONGLONG", - "tRCINCLUDEPATH", "'?'", "':'", "tLOGOR", "tLOGAND", "'|'", "'^'", "'&'", - "tEQ", "tNE", "'<'", "tLTE", "'>'", "tGTE", "tLSHIFT", "tRSHIFT", "'+'", - "'-'", "'*'", "'/'", "'~'", "'!'", "','", "'('", "')'", "$accept", - "pp_file", "preprocessor", "opt_text", "text", "res_arg", "allmargs", - "emargs", "margs", "opt_mtexts", "mtexts", "mtext", "pp_expr", YY_NULLPTR -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[NUM] -- (External) token number corresponding to the - (internal) symbol number NUM (which must be that of a token). */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 63, 58, - 293, 294, 124, 94, 38, 295, 296, 60, 297, 62, - 298, 299, 300, 43, 45, 42, 47, 126, 33, 44, - 40, 41 -}; -# endif - -#define YYPACT_NINF -27 - -#define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-27))) - -#define YYTABLE_NINF -1 - -#define yytable_value_is_error(Yytable_value) \ - 0 - - /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -static const yytype_int16 yypact[] = -{ - -27, 142, -27, -26, -3, -12, -2, 30, -3, 41, - 91, 21, 2, -19, -19, -19, -19, 32, -27, -19, - -27, -27, -27, -23, -27, -27, -27, -27, -27, -27, - -27, -3, -3, -3, -3, -3, 38, 66, 109, -27, - 85, -27, 113, 133, 115, -27, 124, -27, -27, -27, - 179, -9, 278, 280, 281, 282, 129, 283, -27, 271, - -10, -10, -27, -27, 57, -27, -3, -3, -3, -3, - -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, - -3, -3, -3, -3, -27, -27, -27, -27, -27, 285, - 3, -27, -27, -27, -27, -27, -27, -27, -27, -27, - 277, -27, 239, -27, 238, -27, 132, 167, 182, 196, - 209, 221, 231, 231, 111, 111, 111, 111, 61, 61, - -10, -10, -27, -27, -27, -27, 4, 19, 266, -27, - -3, -27, 6, -27, 276, -27, -27, -27, -27, 290, - 19, -27, -27, -27, 151, -27, 7, -27, -27, -27, - -27, 291, -27 -}; - - /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. - Performed when YYTABLE does not specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 28, 28, 28, 28, 0, 36, 28, - 3, 27, 26, 0, 61, 54, 53, 56, 55, 58, - 57, 0, 0, 0, 0, 0, 0, 0, 0, 10, - 0, 11, 0, 0, 0, 21, 0, 30, 31, 32, - 0, 29, 0, 0, 0, 0, 37, 0, 59, 0, - 79, 80, 81, 82, 0, 6, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 7, 8, 9, 4, 5, 0, - 0, 22, 33, 34, 35, 23, 24, 25, 12, 42, - 0, 38, 39, 13, 0, 83, 0, 62, 63, 74, - 72, 73, 64, 65, 66, 68, 67, 69, 77, 78, - 70, 71, 75, 76, 15, 16, 0, 43, 0, 60, - 0, 17, 0, 50, 0, 52, 47, 48, 49, 0, - 44, 45, 40, 41, 84, 18, 0, 51, 14, 46, - 19, 0, 20 -}; - - /* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -27, -27, -27, -11, -27, -27, -27, -27, -27, -27, - -27, 163, -8 -}; - - /* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 1, 20, 50, 51, 56, 100, 101, 102, 139, - 140, 141, 36 -}; - - /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule whose - number is the opposite. If YYTABLE_NINF, syntax error. */ -static const yytype_uint8 yytable[] = -{ - 40, 58, 21, 52, 53, 54, 47, 23, 57, 48, - 49, 22, 37, 45, 125, 131, 92, 145, 150, 93, - 94, 24, 38, 60, 61, 62, 63, 64, 25, 26, - 27, 28, 29, 30, 46, 126, 132, 59, 146, 151, - 133, 39, 134, 135, 136, 82, 83, 137, 138, 65, - 31, 32, 41, 44, 33, 34, 55, 35, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 121, 122, 123, 66, 84, 67, 68, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 66, 86, 67, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 80, 81, 82, 83, 105, 42, - 85, 43, 144, 66, 87, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, - 82, 83, 2, 89, 88, 3, 4, 5, 6, 7, - 8, 9, 90, 99, 10, 11, 12, 13, 14, 15, - 16, 17, 78, 79, 80, 81, 82, 83, 18, 19, - 66, 130, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 66, - 91, 67, 68, 69, 70, 71, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 68, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 72, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 142, 95, - 143, 96, 97, 98, 103, 104, 124, 127, 128, 129, - 147, 148, 152, 149 -}; - -static const yytype_uint8 yycheck[] = -{ - 8, 24, 28, 14, 15, 16, 25, 10, 19, 28, - 29, 37, 24, 11, 11, 11, 25, 11, 11, 28, - 29, 24, 24, 31, 32, 33, 34, 35, 31, 32, - 33, 34, 35, 36, 32, 32, 32, 60, 32, 32, - 21, 11, 23, 24, 25, 55, 56, 28, 29, 11, - 53, 54, 11, 32, 57, 58, 24, 60, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 38, 11, 40, 41, - 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 38, 11, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 53, 54, 55, 56, 61, 28, - 11, 30, 130, 38, 11, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 0, 28, 11, 3, 4, 5, 6, 7, - 8, 9, 28, 24, 12, 13, 14, 15, 16, 17, - 18, 19, 51, 52, 53, 54, 55, 56, 26, 27, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 38, - 11, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, 54, 55, 56, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, 54, 55, 56, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 22, 11, - 24, 11, 11, 11, 11, 24, 11, 20, 59, 61, - 24, 11, 11, 140 -}; - - /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 63, 0, 3, 4, 5, 6, 7, 8, 9, - 12, 13, 14, 15, 16, 17, 18, 19, 26, 27, - 64, 28, 37, 10, 24, 31, 32, 33, 34, 35, - 36, 53, 54, 57, 58, 60, 74, 24, 24, 11, - 74, 11, 28, 30, 32, 11, 32, 25, 28, 29, - 65, 66, 65, 65, 65, 24, 67, 65, 24, 60, - 74, 74, 74, 74, 74, 11, 38, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, 56, 11, 11, 11, 11, 11, 28, - 28, 11, 25, 28, 29, 11, 11, 11, 11, 24, - 68, 69, 70, 11, 24, 61, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 11, 11, 32, 20, 59, 61, - 39, 11, 32, 21, 23, 24, 25, 28, 29, 71, - 72, 73, 22, 24, 74, 11, 32, 24, 11, 73, - 11, 32, 11 -}; - - /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 62, 63, 63, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, - 64, 64, 64, 64, 64, 64, 64, 64, 65, 65, - 66, 66, 66, 66, 66, 66, 67, 68, 68, 69, - 69, 70, 70, 71, 71, 72, 72, 73, 73, 73, - 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74 -}; - - /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 0, 2, 3, 3, 3, 3, 3, 3, - 2, 2, 3, 3, 6, 4, 4, 5, 6, 7, - 8, 2, 3, 3, 3, 3, 2, 2, 0, 1, - 1, 1, 1, 2, 2, 2, 0, 0, 1, 1, - 3, 3, 1, 0, 1, 1, 2, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, - 4, 1, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, - 2, 2, 2, 3, 5 -}; - - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - YYPOPSTACK (yylen); \ - yystate = *yyssp; \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (0) - -/* Error token number */ -#define YYTERROR 1 -#define YYERRCODE 256 - - - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) - -/* This macro is provided for backward compatibility. */ -#ifndef YY_LOCATION_PRINT -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -#endif - - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - - -/*----------------------------------------. -| Print this symbol's value on YYOUTPUT. | -`----------------------------------------*/ - -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - FILE *yyo = yyoutput; - YYUSE (yyo); - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - YYUSE (yytype); -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -{ - YYFPRINTF (yyoutput, "%s %s (", - yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -static void -yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) -{ - unsigned long int yylno = yyrline[yyrule]; - int yynrhs = yyr2[yyrule]; - int yyi; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, - yystos[yyssp[yyi + 1 - yynrhs]], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyssp, yyvsp, Rule); \ -} while (0) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -yystrlen (const char *yystr) -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -yystpcpy (char *yydest, const char *yysrc) -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message - about the unexpected token YYTOKEN for the state stack whose top is - YYSSP. - - Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is - not large enough to hold the message. In that case, also set - *YYMSG_ALLOC to the required number of bytes. Return 2 if the - required number of bytes is too large to store. */ -static int -yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, - yytype_int16 *yyssp, int yytoken) -{ - YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); - YYSIZE_T yysize = yysize0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - /* Internationalized format string. */ - const char *yyformat = YY_NULLPTR; - /* Arguments of yyformat. */ - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - /* Number of reported tokens (one for the "unexpected", one per - "expected"). */ - int yycount = 0; - - /* There are many possibilities here to consider: - - If this state is a consistent state with a default action, then - the only way this function was invoked is if the default action - is an error action. In that case, don't check for expected - tokens because there are none. - - The only way there can be no lookahead present (in yychar) is if - this state is a consistent state with a default action. Thus, - detecting the absence of a lookahead is sufficient to determine - that there is no unexpected or expected token to report. In that - case, just report a simple "syntax error". - - Don't assume there isn't a lookahead just because this state is a - consistent state with a default action. There might have been a - previous inconsistent state, consistent state with a non-default - action, or user semantic action that manipulated yychar. - - Of course, the expected token list depends on states to have - correct lookahead information, and it depends on the parser not - to perform extra reductions after fetching a lookahead from the - scanner and before detecting a syntax error. Thus, state merging - (from LALR or IELR) and default reductions corrupt the expected - token list. However, the list is correct for canonical LR with - one exception: it will still contain any token that will not be - accepted due to an error action in a later state. - */ - if (yytoken != YYEMPTY) - { - int yyn = yypact[*yyssp]; - yyarg[yycount++] = yytname[yytoken]; - if (!yypact_value_is_default (yyn)) - { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. In other words, skip the first -YYN actions for - this state because they are default actions. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yyx; - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR - && !yytable_value_is_error (yytable[yyx + yyn])) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - break; - } - yyarg[yycount++] = yytname[yyx]; - { - YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); - if (! (yysize <= yysize1 - && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - } - } - } - - switch (yycount) - { -# define YYCASE_(N, S) \ - case N: \ - yyformat = S; \ - break - YYCASE_(0, YY_("syntax error")); - YYCASE_(1, YY_("syntax error, unexpected %s")); - YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); - YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); - YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); - YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); -# undef YYCASE_ - } - - { - YYSIZE_T yysize1 = yysize + yystrlen (yyformat); - if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) - return 2; - yysize = yysize1; - } - - if (*yymsg_alloc < yysize) - { - *yymsg_alloc = 2 * yysize; - if (! (yysize <= *yymsg_alloc - && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) - *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; - return 1; - } - - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - { - char *yyp = *yymsg; - int yyi = 0; - while ((*yyp = *yyformat) != '\0') - if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyformat += 2; - } - else - { - yyp++; - yyformat++; - } - } - return 0; -} -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -{ - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - YYUSE (yytype); - YY_IGNORE_MAYBE_UNINITIALIZED_END -} - - - - -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; - - -/*----------. -| yyparse. | -`----------*/ - -int -yyparse (void) -{ - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - - /* The stacks and their tools: - 'yyss': related to states. - 'yyvs': related to semantic values. - - Refer to the stacks through separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - YYSIZE_T yystacksize; - - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) - - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; - - yyssp = yyss = yyssa; - yyvsp = yyvs = yyvsa; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yypact_value_is_default (yyn)) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = yylex (); - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yytable_value_is_error (yyn)) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - '$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 4: -#line 186 "ppy.y" /* yacc.c:1646 */ - { pp_do_include((yyvsp[-1].cptr), 1); } -#line 1498 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 5: -#line 187 "ppy.y" /* yacc.c:1646 */ - { pp_do_include((yyvsp[-1].cptr), 0); } -#line 1504 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 6: -#line 188 "ppy.y" /* yacc.c:1646 */ - { pp_next_if_state(boolean(&(yyvsp[-1].cval))); } -#line 1510 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 7: -#line 189 "ppy.y" /* yacc.c:1646 */ - { pp_next_if_state(pplookup((yyvsp[-1].cptr)) != NULL); free((yyvsp[-1].cptr)); } -#line 1516 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 8: -#line 190 "ppy.y" /* yacc.c:1646 */ - { - int t = pplookup((yyvsp[-1].cptr)) == NULL; - if(pp_incl_state.state == 0 && t && !pp_incl_state.seen_junk) - { - pp_incl_state.state = 1; - pp_incl_state.ppp = (yyvsp[-1].cptr); - pp_incl_state.ifdepth = pp_get_if_depth(); - } - else if(pp_incl_state.state != 1) - { - pp_incl_state.state = -1; - free((yyvsp[-1].cptr)); - } - else - free((yyvsp[-1].cptr)); - pp_next_if_state(t); - if(pp_status.debug) - fprintf(stderr, "tIFNDEF: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n", - pp_status.input, pp_status.line_number, pp_incl_state.state, pp_incl_state.ppp, pp_incl_state.ifdepth); - } -#line 1541 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 9: -#line 210 "ppy.y" /* yacc.c:1646 */ - { - pp_if_state_t s = pp_pop_if(); - switch(s) - { - case if_true: - case if_elif: - pp_push_if(if_elif); - break; - case if_false: - pp_push_if(boolean(&(yyvsp[-1].cval)) ? if_true : if_false); - break; - case if_ignore: - pp_push_if(if_ignore); - break; - case if_elsetrue: - case if_elsefalse: - ppy_error("#elif cannot follow #else"); - break; - case if_error: - break; - default: - pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d) in #elif directive", s); - } - } -#line 1570 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 10: -#line 234 "ppy.y" /* yacc.c:1646 */ - { - pp_if_state_t s = pp_pop_if(); - switch(s) - { - case if_true: - pp_push_if(if_elsefalse); - break; - case if_elif: - pp_push_if(if_elif); - break; - case if_false: - pp_push_if(if_elsetrue); - break; - case if_ignore: - pp_push_if(if_ignore); - break; - case if_elsetrue: - case if_elsefalse: - ppy_error("#else clause already defined"); - break; - case if_error: - break; - default: - pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d) in #else directive", s); - } - } -#line 1601 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 11: -#line 260 "ppy.y" /* yacc.c:1646 */ - { - if(pp_pop_if() != if_error) - { - if(pp_incl_state.ifdepth == pp_get_if_depth() && pp_incl_state.state == 1) - { - pp_incl_state.state = 2; - pp_incl_state.seen_junk = 0; - } - else if(pp_incl_state.state != 1) - { - pp_incl_state.state = -1; - } - if(pp_status.debug) - fprintf(stderr, "tENDIF: %s:%d: include_state=%d, include_ppp='%s', include_ifdepth=%d\n", - pp_status.input, pp_status.line_number, pp_incl_state.state, pp_incl_state.ppp, pp_incl_state.ifdepth); - } - } -#line 1623 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 12: -#line 277 "ppy.y" /* yacc.c:1646 */ - { pp_del_define((yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1629 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 13: -#line 278 "ppy.y" /* yacc.c:1646 */ - { pp_add_define((yyvsp[-2].cptr), (yyvsp[-1].cptr)); free((yyvsp[-2].cptr)); free((yyvsp[-1].cptr)); } -#line 1635 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 14: -#line 279 "ppy.y" /* yacc.c:1646 */ - { - pp_add_macro((yyvsp[-5].cptr), macro_args, nmacro_args, (yyvsp[-1].mtext)); - } -#line 1643 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 15: -#line 282 "ppy.y" /* yacc.c:1646 */ - { if((yyvsp[-1].cptr)) pp_writestring("# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1649 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 16: -#line 283 "ppy.y" /* yacc.c:1646 */ - { if((yyvsp[-1].cptr)) pp_writestring("# %d %s\n", (yyvsp[-2].sint) , (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1655 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 17: -#line 285 "ppy.y" /* yacc.c:1646 */ - { if((yyvsp[-2].cptr)) pp_writestring("# %d %s %d\n", (yyvsp[-3].sint), (yyvsp[-2].cptr), (yyvsp[-1].sint)); free((yyvsp[-2].cptr)); } -#line 1661 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 18: -#line 287 "ppy.y" /* yacc.c:1646 */ - { 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)); } -#line 1667 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 19: -#line 289 "ppy.y" /* yacc.c:1646 */ - { 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)); } -#line 1673 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 20: -#line 291 "ppy.y" /* yacc.c:1646 */ - { 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)); } -#line 1679 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 22: -#line 293 "ppy.y" /* yacc.c:1646 */ - { ppy_error("#error directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1685 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 23: -#line 294 "ppy.y" /* yacc.c:1646 */ - { ppy_warning("#warning directive: '%s'", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1691 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 24: -#line 295 "ppy.y" /* yacc.c:1646 */ - { pp_writestring("#pragma %s\n", (yyvsp[-1].cptr) ? (yyvsp[-1].cptr) : ""); free((yyvsp[-1].cptr)); } -#line 1697 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 25: -#line 296 "ppy.y" /* yacc.c:1646 */ - { if(pp_status.pedantic) ppy_warning("#ident ignored (arg: '%s')", (yyvsp[-1].cptr)); free((yyvsp[-1].cptr)); } -#line 1703 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 26: -#line 297 "ppy.y" /* yacc.c:1646 */ - { - if((yyvsp[0].cptr)) - { - int nl=strlen((yyvsp[0].cptr)) +3; - char *fn=pp_xmalloc(nl); - if(fn) - { - sprintf(fn,"\"%s\"",(yyvsp[0].cptr)); - pp_do_include(fn,1); - } - free((yyvsp[0].cptr)); - } - } -#line 1721 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 27: -#line 310 "ppy.y" /* yacc.c:1646 */ - { - pp_do_include((yyvsp[0].cptr),1); - } -#line 1729 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 28: -#line 316 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = NULL; } -#line 1735 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 29: -#line 317 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1741 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 30: -#line 320 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1747 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 31: -#line 321 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1753 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 32: -#line 322 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = (yyvsp[0].cptr); } -#line 1759 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 33: -#line 323 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1765 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 34: -#line 324 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1771 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 35: -#line 325 "ppy.y" /* yacc.c:1646 */ - { (yyval.cptr) = merge_text((yyvsp[-1].cptr), (yyvsp[0].cptr)); } -#line 1777 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 36: -#line 328 "ppy.y" /* yacc.c:1646 */ - { macro_args = NULL; nmacro_args = 0; } -#line 1783 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 37: -#line 331 "ppy.y" /* yacc.c:1646 */ - { (yyval.sint) = 0; macro_args = NULL; nmacro_args = 0; } -#line 1789 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 38: -#line 332 "ppy.y" /* yacc.c:1646 */ - { (yyval.sint) = nmacro_args; } -#line 1795 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 39: -#line 335 "ppy.y" /* yacc.c:1646 */ - { (yyval.marg) = (yyvsp[0].marg); } -#line 1801 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 40: -#line 336 "ppy.y" /* yacc.c:1646 */ - { (yyval.marg) = add_new_marg(NULL, arg_list); nmacro_args *= -1; } -#line 1807 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 41: -#line 339 "ppy.y" /* yacc.c:1646 */ - { (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); } -#line 1813 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 42: -#line 340 "ppy.y" /* yacc.c:1646 */ - { (yyval.marg) = add_new_marg((yyvsp[0].cptr), arg_single); } -#line 1819 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 43: -#line 344 "ppy.y" /* yacc.c:1646 */ - { (yyval.mtext) = NULL; } -#line 1825 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 44: -#line 345 "ppy.y" /* yacc.c:1646 */ - { - for((yyval.mtext) = (yyvsp[0].mtext); (yyval.mtext) && (yyval.mtext)->prev; (yyval.mtext) = (yyval.mtext)->prev) - ; - } -#line 1834 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 45: -#line 351 "ppy.y" /* yacc.c:1646 */ - { (yyval.mtext) = (yyvsp[0].mtext); } -#line 1840 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 46: -#line 352 "ppy.y" /* yacc.c:1646 */ - { (yyval.mtext) = combine_mtext((yyvsp[-1].mtext), (yyvsp[0].mtext)); } -#line 1846 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 47: -#line 355 "ppy.y" /* yacc.c:1646 */ - { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1852 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 48: -#line 356 "ppy.y" /* yacc.c:1646 */ - { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1858 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 49: -#line 357 "ppy.y" /* yacc.c:1646 */ - { (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); } -#line 1864 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 50: -#line 358 "ppy.y" /* yacc.c:1646 */ - { (yyval.mtext) = new_mtext(NULL, 0, exp_concat); } -#line 1870 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 51: -#line 359 "ppy.y" /* yacc.c:1646 */ - { - int mat = marg_index((yyvsp[0].cptr)); - if(mat < 0) - ppy_error("Stringification identifier must be an argument parameter"); - else - (yyval.mtext) = new_mtext(NULL, mat, exp_stringize); - } -#line 1882 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 52: -#line 366 "ppy.y" /* yacc.c:1646 */ - { - int mat = marg_index((yyvsp[0].cptr)); - if(mat >= 0) - (yyval.mtext) = new_mtext(NULL, mat, exp_subst); - else if((yyvsp[0].cptr)) - (yyval.mtext) = new_mtext((yyvsp[0].cptr), 0, exp_text); - } -#line 1894 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 53: -#line 375 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = (yyvsp[0].sint); } -#line 1900 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 54: -#line 376 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_uint; (yyval.cval).val.ui = (yyvsp[0].uint); } -#line 1906 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 55: -#line 377 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_slong; (yyval.cval).val.sl = (yyvsp[0].slong); } -#line 1912 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 56: -#line 378 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_ulong; (yyval.cval).val.ul = (yyvsp[0].ulong); } -#line 1918 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 57: -#line 379 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sll; (yyval.cval).val.sll = (yyvsp[0].sll); } -#line 1924 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 58: -#line 380 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_ull; (yyval.cval).val.ull = (yyvsp[0].ull); } -#line 1930 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 59: -#line 381 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[0].cptr)) != NULL; } -#line 1936 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 60: -#line 382 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = pplookup((yyvsp[-1].cptr)) != NULL; } -#line 1942 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 61: -#line 383 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = 0; } -#line 1948 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 62: -#line 384 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) || boolean(&(yyvsp[0].cval)); } -#line 1954 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 63: -#line 385 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = boolean(&(yyvsp[-2].cval)) && boolean(&(yyvsp[0].cval)); } -#line 1960 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 64: -#line 386 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ==); } -#line 1966 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 65: -#line 387 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), !=); } -#line 1972 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 66: -#line 388 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <); } -#line 1978 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 67: -#line 389 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >); } -#line 1984 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 68: -#line 390 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <=); } -#line 1990 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 69: -#line 391 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >=); } -#line 1996 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 70: -#line 392 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), +); } -#line 2002 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 71: -#line 393 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), -); } -#line 2008 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 72: -#line 394 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), ^); } -#line 2014 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 73: -#line 395 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), &); } -#line 2020 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 74: -#line 396 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), |); } -#line 2026 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 75: -#line 397 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), *); } -#line 2032 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 76: -#line 398 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), /); } -#line 2038 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 77: -#line 399 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), <<); } -#line 2044 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 78: -#line 400 "ppy.y" /* yacc.c:1646 */ - { promote_equal_size(&(yyvsp[-2].cval), &(yyvsp[0].cval)); BIN_OP((yyval.cval), (yyvsp[-2].cval), (yyvsp[0].cval), >>); } -#line 2050 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 79: -#line 401 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval) = (yyvsp[0].cval); } -#line 2056 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 80: -#line 402 "ppy.y" /* yacc.c:1646 */ - { UNARY_OP((yyval.cval), (yyvsp[0].cval), -); } -#line 2062 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 81: -#line 403 "ppy.y" /* yacc.c:1646 */ - { UNARY_OP((yyval.cval), (yyvsp[0].cval), ~); } -#line 2068 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 82: -#line 404 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval).type = cv_sint; (yyval.cval).val.si = !boolean(&(yyvsp[0].cval)); } -#line 2074 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 83: -#line 405 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval) = (yyvsp[-1].cval); } -#line 2080 "ppy.tab.c" /* yacc.c:1646 */ - break; - - case 84: -#line 406 "ppy.y" /* yacc.c:1646 */ - { (yyval.cval) = boolean(&(yyvsp[-4].cval)) ? (yyvsp[-2].cval) : (yyvsp[0].cval); } -#line 2086 "ppy.tab.c" /* yacc.c:1646 */ - break; - - -#line 2090 "ppy.tab.c" /* yacc.c:1646 */ - default: break; - } - /* User semantic actions sometimes alter yychar, and that requires - that yytoken be updated with the new translation. We take the - approach of translating immediately before every use of yytoken. - One alternative is translating here after every semantic action, - but that translation would be missed if the semantic action invokes - YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or - if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an - incorrect destructor might then be invoked immediately. In the - case of YYERROR or YYBACKUP, subsequent parser actions might lead - to an incorrect destructor call or verbose syntax error message - before the lookahead is translated. */ - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now 'shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*--------------------------------------. -| yyerrlab -- here on detecting error. | -`--------------------------------------*/ -yyerrlab: - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); - - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else -# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ - yyssp, yytoken) - { - char const *yymsgp = YY_("syntax error"); - int yysyntax_error_status; - yysyntax_error_status = YYSYNTAX_ERROR; - if (yysyntax_error_status == 0) - yymsgp = yymsg; - else if (yysyntax_error_status == 1) - { - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); - if (!yymsg) - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - yysyntax_error_status = 2; - } - else - { - yysyntax_error_status = YYSYNTAX_ERROR; - yymsgp = yymsg; - } - } - yyerror (yymsgp); - if (yysyntax_error_status == 2) - goto yyexhaustedlab; - } -# undef YYSYNTAX_ERROR -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule whose action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (!yypact_value_is_default (yyn)) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN - *++yyvsp = yylval; - YY_IGNORE_MAYBE_UNINITIALIZED_END - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined yyoverflow || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - { - /* Make sure we have latest lookahead translation. See comments at - user semantic actions for why this is necessary. */ - yytoken = YYTRANSLATE (yychar); - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - } - /* Do not reclaim the symbols of the rule whose action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - return yyresult; -} -#line 409 "ppy.y" /* yacc.c:1906 */ - - -/* - ************************************************************************** - * Support functions - ************************************************************************** - */ - -static void cast_to_sint(cval_t *v) -{ - switch(v->type) - { - case cv_sint: break; - case cv_uint: break; - case cv_slong: v->val.si = v->val.sl; break; - case cv_ulong: v->val.si = v->val.ul; break; - case cv_sll: v->val.si = v->val.sll; break; - case cv_ull: v->val.si = v->val.ull; break; - } - v->type = cv_sint; -} - -static void cast_to_uint(cval_t *v) -{ - switch(v->type) - { - case cv_sint: break; - case cv_uint: break; - case cv_slong: v->val.ui = v->val.sl; break; - case cv_ulong: v->val.ui = v->val.ul; break; - case cv_sll: v->val.ui = v->val.sll; break; - case cv_ull: v->val.ui = v->val.ull; break; - } - v->type = cv_uint; -} - -static void cast_to_slong(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.sl = v->val.si; break; - case cv_uint: v->val.sl = v->val.ui; break; - case cv_slong: break; - case cv_ulong: break; - case cv_sll: v->val.sl = v->val.sll; break; - case cv_ull: v->val.sl = v->val.ull; break; - } - v->type = cv_slong; -} - -static void cast_to_ulong(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.ul = v->val.si; break; - case cv_uint: v->val.ul = v->val.ui; break; - case cv_slong: break; - case cv_ulong: break; - case cv_sll: v->val.ul = v->val.sll; break; - case cv_ull: v->val.ul = v->val.ull; break; - } - v->type = cv_ulong; -} - -static void cast_to_sll(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.sll = v->val.si; break; - case cv_uint: v->val.sll = v->val.ui; break; - case cv_slong: v->val.sll = v->val.sl; break; - case cv_ulong: v->val.sll = v->val.ul; break; - case cv_sll: break; - case cv_ull: break; - } - v->type = cv_sll; -} - -static void cast_to_ull(cval_t *v) -{ - switch(v->type) - { - case cv_sint: v->val.ull = v->val.si; break; - case cv_uint: v->val.ull = v->val.ui; break; - case cv_slong: v->val.ull = v->val.sl; break; - case cv_ulong: v->val.ull = v->val.ul; break; - case cv_sll: break; - case cv_ull: break; - } - v->type = cv_ull; -} - - -static void promote_equal_size(cval_t *v1, cval_t *v2) -{ -#define cv_sizeof(v) ((int)(v->type & SIZE_MASK)) - int s1 = cv_sizeof(v1); - int s2 = cv_sizeof(v2); -#undef cv_sizeof - - if(s1 == s2) - return; - else if(s1 > s2) - { - switch(v1->type) - { - case cv_sint: cast_to_sint(v2); break; - case cv_uint: cast_to_uint(v2); break; - case cv_slong: cast_to_slong(v2); break; - case cv_ulong: cast_to_ulong(v2); break; - case cv_sll: cast_to_sll(v2); break; - case cv_ull: cast_to_ull(v2); break; - } - } - else - { - switch(v2->type) - { - case cv_sint: cast_to_sint(v1); break; - case cv_uint: cast_to_uint(v1); break; - case cv_slong: cast_to_slong(v1); break; - case cv_ulong: cast_to_ulong(v1); break; - case cv_sll: cast_to_sll(v1); break; - case cv_ull: cast_to_ull(v1); break; - } - } -} - - -static int boolean(cval_t *v) -{ - switch(v->type) - { - case cv_sint: return v->val.si != (int)0; - case cv_uint: return v->val.ui != (unsigned int)0; - case cv_slong: return v->val.sl != (long)0; - case cv_ulong: return v->val.ul != (unsigned long)0; - case cv_sll: return v->val.sll != (wrc_sll_t)0; - case cv_ull: return v->val.ull != (wrc_ull_t)0; - } - return 0; -} - -static marg_t *new_marg(char *str, def_arg_t type) -{ - marg_t *ma = pp_xmalloc(sizeof(marg_t)); - if(!ma) - return NULL; - ma->arg = str; - ma->type = type; - ma->nnl = 0; - return ma; -} - -static marg_t *add_new_marg(char *str, def_arg_t type) -{ - marg_t **new_macro_args; - marg_t *ma; - if(!str) - return NULL; - new_macro_args = pp_xrealloc(macro_args, (nmacro_args+1) * sizeof(macro_args[0])); - if(!new_macro_args) - return NULL; - macro_args = new_macro_args; - ma = new_marg(str, type); - if(!ma) - return NULL; - macro_args[nmacro_args] = ma; - nmacro_args++; - return ma; -} - -static int marg_index(char *id) -{ - int t; - if(!id) - return -1; - for(t = 0; t < nmacro_args; t++) - { - if(!strcmp(id, macro_args[t]->arg)) - break; - } - return t < nmacro_args ? t : -1; -} - -static mtext_t *new_mtext(char *str, int idx, def_exp_t type) -{ - mtext_t *mt = pp_xmalloc(sizeof(mtext_t)); - if(!mt) - return NULL; - if(str == NULL) - mt->subst.argidx = idx; - else - mt->subst.text = str; - mt->type = type; - mt->next = mt->prev = NULL; - return mt; -} - -static mtext_t *combine_mtext(mtext_t *tail, mtext_t *mtp) -{ - if(!tail) - return mtp; - - if(!mtp) - return tail; - - if(tail->type == exp_text && mtp->type == exp_text) - { - char *new_text; - new_text = pp_xrealloc(tail->subst.text, strlen(tail->subst.text)+strlen(mtp->subst.text)+1); - if(!new_text) - return mtp; - tail->subst.text = new_text; - strcat(tail->subst.text, mtp->subst.text); - free(mtp->subst.text); - free(mtp); - return tail; - } - - if(tail->type == exp_concat && mtp->type == exp_concat) - { - free(mtp); - return tail; - } - - if(tail->type == exp_concat && mtp->type == exp_text) - { - int len = strlen(mtp->subst.text); - while(len) - { -/* FIXME: should delete space from head of string */ - if(isspace(mtp->subst.text[len-1] & 0xff)) - mtp->subst.text[--len] = '\0'; - else - break; - } - - if(!len) - { - free(mtp->subst.text); - free(mtp); - return tail; - } - } - - if(tail->type == exp_text && mtp->type == exp_concat) - { - int len = strlen(tail->subst.text); - while(len) - { - if(isspace(tail->subst.text[len-1] & 0xff)) - tail->subst.text[--len] = '\0'; - else - break; - } - - if(!len) - { - mtp->prev = tail->prev; - mtp->next = tail->next; - if(tail->prev) - tail->prev->next = mtp; - free(tail->subst.text); - free(tail); - return mtp; - } - } - - tail->next = mtp; - mtp->prev = tail; - - return mtp; -} - -static char *merge_text(char *s1, char *s2) -{ - int l1; - int l2; - char *snew; - if(!s1) - return s2; - if(!s2) - return s1; - l1 = strlen(s1); - l2 = strlen(s2); - snew = pp_xrealloc(s1, l1+l2+1); - if(!snew) - { - free(s2); - return s1; - } - s1 = snew; - memcpy(s1+l1, s2, l2+1); - free(s2); - return s1; -} diff --git a/sdk/tools/wpp/ppy.tab.h b/sdk/tools/wpp/ppy.tab.h deleted file mode 100644 index 795c5b07327..00000000000 --- a/sdk/tools/wpp/ppy.tab.h +++ /dev/null @@ -1,124 +0,0 @@ -/* A Bison parser, made by GNU Bison 3.0.2. */ - -/* Bison interface for Yacc-like parsers in C - - Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - special exception, which will cause the skeleton and the resulting - Bison output files to be licensed under the GNU General Public - License without this special exception. - - This special exception was added by the Free Software Foundation in - version 2.2 of Bison. */ - -#ifndef YY_PPY_PPY_TAB_H_INCLUDED -# define YY_PPY_PPY_TAB_H_INCLUDED -/* Debug traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif -#if YYDEBUG -extern int ppy_debug; -#endif - -/* Token type. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - enum yytokentype - { - tRCINCLUDE = 258, - tIF = 259, - tIFDEF = 260, - tIFNDEF = 261, - tELSE = 262, - tELIF = 263, - tENDIF = 264, - tDEFINED = 265, - tNL = 266, - tINCLUDE = 267, - tLINE = 268, - tGCCLINE = 269, - tERROR = 270, - tWARNING = 271, - tPRAGMA = 272, - tPPIDENT = 273, - tUNDEF = 274, - tMACROEND = 275, - tCONCAT = 276, - tELIPSIS = 277, - tSTRINGIZE = 278, - tIDENT = 279, - tLITERAL = 280, - tMACRO = 281, - tDEFINE = 282, - tDQSTRING = 283, - tSQSTRING = 284, - tIQSTRING = 285, - tUINT = 286, - tSINT = 287, - tULONG = 288, - tSLONG = 289, - tULONGLONG = 290, - tSLONGLONG = 291, - tRCINCLUDEPATH = 292, - tLOGOR = 293, - tLOGAND = 294, - tEQ = 295, - tNE = 296, - tLTE = 297, - tGTE = 298, - tLSHIFT = 299, - tRSHIFT = 300 - }; -#endif - -/* Value type. */ -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE YYSTYPE; -union YYSTYPE -{ -#line 126 "ppy.y" /* yacc.c:1909 */ - - int sint; - unsigned int uint; - long slong; - unsigned long ulong; - wrc_sll_t sll; - wrc_ull_t ull; - int *iptr; - char *cptr; - cval_t cval; - marg_t *marg; - mtext_t *mtext; - -#line 114 "ppy.tab.h" /* yacc.c:1909 */ -}; -# define YYSTYPE_IS_TRIVIAL 1 -# define YYSTYPE_IS_DECLARED 1 -#endif - - -extern YYSTYPE ppy_lval; - -int ppy_parse (void); - -#endif /* !YY_PPY_PPY_TAB_H_INCLUDED */