/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 <https://www.gnu.org/licenses/>. */ /* 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. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* 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, and Bison version. */ #define YYBISON … /* Bison version string. */ #define YYBISON_VERSION … /* Skeleton name. */ #define YYSKELETON_NAME … /* Pure parsers. */ #define YYPURE … /* Push parsers. */ #define YYPUSH … /* Pull parsers. */ #define YYPULL … /* First part of user prologue. */ #line 44 "MachineIndependent/glslang.y" /* Based on: ANSI C Yacc grammar In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a matching Lex specification) for the April 30, 1985 draft version of the ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that original, as mentioned in the answer to question 17.25 of the comp.lang.c FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z. I intend to keep this version as close to the current C Standard grammar as possible; please let me know if you discover discrepancies. Jutta Degener, 1995 */ #include "SymbolTable.h" #include "ParseHelper.h" #include "../Public/ShaderLang.h" #include "attribute.h" usingnamespaceglslang; #line 97 "MachineIndependent/glslang_tab.cpp" # ifndef YY_CAST # ifdef __cplusplus #define YY_CAST(Type, Val) … #define YY_REINTERPRET_CAST(Type, Val) … # else #define YY_CAST … #define YY_REINTERPRET_CAST … # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus #define YY_NULLPTR … # else #define YY_NULLPTR … # endif # else #define YY_NULLPTR … # endif # endif #include "glslang_tab.cpp.h" /* Symbol kind. */ enum yysymbol_kind_t { … }; yysymbol_kind_t; /* Second part of user prologue. */ #line 111 "MachineIndependent/glslang.y" #define parseContext … #define yyerror(context, msg) … extern int yylex(YYSTYPE*, TParseContext&); #line 736 "MachineIndependent/glslang_tab.cpp" #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure <limits.h> and (if available) <stdint.h> are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include <limits.h> /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include <stdint.h> /* 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__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */ #ifdef __hpux # undef UINT_LEAST8_MAX # undef UINT_LEAST16_MAX #define UINT_LEAST8_MAX … #define UINT_LEAST16_MAX … #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ 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__ 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 … #define YYPTRDIFF_MAXIMUM … # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # endif #define YYPTRDIFF_T … #define YYPTRDIFF_MAXIMUM … # else #define YYPTRDIFF_T … #define YYPTRDIFF_MAXIMUM … # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ #define YYSIZE_T … # elif defined size_t #define YYSIZE_T … # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ #define YYSIZE_T … # else #define YYSIZE_T … # endif #endif #define YYSIZE_MAXIMUM … #define YYSIZEOF(X) … /* Stored state numbers (used for stacks). */ yy_state_t; /* State numbers in computations. */ yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ #define YY_ … # endif # endif # ifndef YY_ #define YY_(Msgid) … # endif #endif #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) #define YY_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 … # else #define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ #define YY_USE(E) … #else #define YY_USE … #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN … # else #define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN … # endif #define YY_IGNORE_MAYBE_UNINITIALIZED_END … #else #define YY_INITIAL_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 … #endif #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ #define YY_IGNORE_USELESS_CAST_BEGIN … #define YY_IGNORE_USELESS_CAST_END … #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN #define YY_IGNORE_USELESS_CAST_BEGIN #define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) … #if 1 /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ #define YYSTACK_ALLOC … # elif defined __BUILTIN_VA_ARG_INCR # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX #define YYSTACK_ALLOC … # elif defined _MSC_VER # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ #define alloca … # else #define YYSTACK_ALLOC … # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS #define EXIT_SUCCESS … # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ #define YYSTACK_FREE … # 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 … # endif # else #define YYSTACK_ALLOC … #define YYSTACK_FREE … # ifndef YYSTACK_ALLOC_MAXIMUM #define YYSTACK_ALLOC_MAXIMUM … # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS #define EXIT_SUCCESS … # endif # endif # ifndef YYMALLOC #define YYMALLOC … # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE #define YYFREE … # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* 1 */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ yyalloc; /* The size of the maximum gap between one aligned stack and the next. */ #define YYSTACK_GAP_MAXIMUM … /* The size of an array large to enough to hold all stacks, each with N elements. */ #define YYSTACK_BYTES(N) … #define YYCOPY_NEEDED … /* 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 … #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) … # else #define YYCOPY … # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL … /* YYLAST -- Last index in YYTABLE. */ #define YYLAST … /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS … /* YYNNTS -- Number of nonterminals. */ #define YYNNTS … /* YYNRULES -- Number of rules. */ #define YYNRULES … /* YYNSTATES -- Number of states. */ #define YYNSTATES … /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK … /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) … /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int16 yytranslate[] = …; #if YYDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_int16 yyrline[] = …; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) … #if 1 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = …; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { … } #endif #define YYPACT_NINF … #define yypact_value_is_default(Yyn) … #define YYTABLE_NINF … #define yytable_value_is_error(Yyn) … /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int16 yypact[] = …; /* 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[] = …; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = …; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = …; /* 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[] = …; static const yytype_int16 yycheck[] = …; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_int16 yystos[] = …; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int16 yyr1[] = …; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = …; enum { … }; #define yyerrok … #define yyclearin … #define YYACCEPT … #define YYABORT … #define YYERROR … #define YYNOMEM … #define YYRECOVERING() … #define YYBACKUP(Token, Value) … /* Backward compatibility with an undocumented macro. Use YYerror or YYUNDEF. */ #define YYERRCODE … /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ #define YYFPRINTF … # endif #define YYDPRINTF(Args) … #define YY_SYMBOL_PRINT(Title, Kind, Value, Location) … /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) { … } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, glslang::TParseContext* pParseContext) { … } /*------------------------------------------------------------------. | 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) { … } #define YY_STACK_PRINT(Bottom, Top) … /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule, glslang::TParseContext* pParseContext) { … } #define YY_REDUCE_PRINT(Rule) … /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ #define YYDPRINTF … #define YY_SYMBOL_PRINT … #define YY_STACK_PRINT … #define YY_REDUCE_PRINT … #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH #define YYINITDEPTH … #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 … #endif /* Context of a parse error. */ yypcontext_t; /* Put in YYARG at most YYARGN of the expected tokens given the current YYCTX, and return the number of tokens stored in YYARG. If YYARG is null, return the number of expected tokens (guaranteed to be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. Return 0 if there are more than YYARGN expected tokens, yet fill YYARG up to YYARGN. */ static int yypcontext_expected_tokens (const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { … } #ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H #define yystrlen(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 … # 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) { … } #endif static int yy_syntax_error_arguments (const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { … } /* 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 YYENOMEM if the required number of bytes is too large to store. */ static int yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx) { … } /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep, glslang::TParseContext* pParseContext) { … } /*----------. | yyparse. | `----------*/ int yyparse (glslang::TParseContext* pParseContext) { … }#line 4454 "MachineIndependent/glslang.y"