Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 1 | |
| 2 | /* A Bison parser, made by GNU Bison 2.4.1. */ |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3 | |
| 4 | /* Skeleton implementation for Bison's Yacc-like parsers in C |
| 5 | |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 6 | Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 |
| 7 | Free Software Foundation, Inc. |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 8 | |
| 9 | This program is free software: you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by |
| 11 | the Free Software Foundation, either version 3 of the License, or |
| 12 | (at your option) any later version. |
| 13 | |
| 14 | This program is distributed in the hope that it will be useful, |
| 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | GNU General Public License for more details. |
| 18 | |
| 19 | You should have received a copy of the GNU General Public License |
| 20 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
| 21 | |
| 22 | /* As a special exception, you may create a larger work that contains |
| 23 | part or all of the Bison parser skeleton and distribute that work |
| 24 | under terms of your choice, so long as that work isn't itself a |
| 25 | parser generator using the skeleton or a modified version thereof |
| 26 | as a parser skeleton. Alternatively, if you modify or redistribute |
| 27 | the parser skeleton itself, you may (at your option) remove this |
| 28 | special exception, which will cause the skeleton and the resulting |
| 29 | Bison output files to be licensed under the GNU General Public |
| 30 | License without this special exception. |
| 31 | |
| 32 | This special exception was added by the Free Software Foundation in |
| 33 | version 2.2 of Bison. */ |
| 34 | |
| 35 | /* C LALR(1) parser skeleton written by Richard Stallman, by |
| 36 | simplifying the original so-called "semantic" parser. */ |
| 37 | |
| 38 | /* All symbols defined below should begin with yy or YY, to avoid |
| 39 | infringing on user name space. This should be done even for local |
| 40 | variables, as they might otherwise be expanded by user macros. |
| 41 | There are some unavoidable exceptions within include files to |
| 42 | define necessary library symbols; they are noted "INFRINGES ON |
| 43 | USER NAME SPACE" below. */ |
| 44 | |
| 45 | /* Identify Bison output. */ |
| 46 | #define YYBISON 1 |
| 47 | |
| 48 | /* Bison version. */ |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 49 | #define YYBISON_VERSION "2.4.1" |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 50 | |
| 51 | /* Skeleton name. */ |
| 52 | #define YYSKELETON_NAME "yacc.c" |
| 53 | |
| 54 | /* Pure parsers. */ |
| 55 | #define YYPURE 1 |
| 56 | |
| 57 | /* Push parsers. */ |
| 58 | #define YYPUSH 0 |
| 59 | |
| 60 | /* Pull parsers. */ |
| 61 | #define YYPULL 1 |
| 62 | |
| 63 | /* Using locations. */ |
| 64 | #define YYLSP_NEEDED 0 |
| 65 | |
| 66 | |
| 67 | |
| 68 | /* Copy the first part of user declarations. */ |
| 69 | |
| 70 | |
| 71 | // |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 72 | // Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved. |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 73 | // Use of this source code is governed by a BSD-style license that can be |
| 74 | // found in the LICENSE file. |
| 75 | // |
| 76 | |
| 77 | // This file is auto-generated by generate_parser.sh. DO NOT EDIT! |
| 78 | |
| 79 | // Ignore errors in auto-generated code. |
| 80 | #if defined(__GNUC__) |
| 81 | #pragma GCC diagnostic ignored "-Wunused-function" |
| 82 | #pragma GCC diagnostic ignored "-Wunused-variable" |
| 83 | #pragma GCC diagnostic ignored "-Wswitch-enum" |
| 84 | #elif defined(_MSC_VER) |
| 85 | #pragma warning(disable: 4065) |
| 86 | #pragma warning(disable: 4189) |
| 87 | #pragma warning(disable: 4505) |
| 88 | #pragma warning(disable: 4701) |
| 89 | #endif |
| 90 | |
Nicolas Capens | cc863da | 2015-01-21 15:50:55 -0500 | [diff] [blame] | 91 | #include "SymbolTable.h" |
| 92 | #include "ParseHelper.h" |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 93 | |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 94 | #define YYENABLE_NLS 0 |
| 95 | #define YYLTYPE_IS_TRIVIAL 1 |
| 96 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 97 | #define YYLEX_PARAM context->scanner |
| 98 | |
| 99 | |
| 100 | |
| 101 | /* Enabling traces. */ |
| 102 | #ifndef YYDEBUG |
| 103 | # define YYDEBUG 0 |
| 104 | #endif |
| 105 | |
| 106 | /* Enabling verbose error messages. */ |
| 107 | #ifdef YYERROR_VERBOSE |
| 108 | # undef YYERROR_VERBOSE |
| 109 | # define YYERROR_VERBOSE 1 |
| 110 | #else |
| 111 | # define YYERROR_VERBOSE 0 |
| 112 | #endif |
| 113 | |
| 114 | /* Enabling the token table. */ |
| 115 | #ifndef YYTOKEN_TABLE |
| 116 | # define YYTOKEN_TABLE 0 |
| 117 | #endif |
| 118 | |
| 119 | |
| 120 | /* Tokens. */ |
| 121 | #ifndef YYTOKENTYPE |
| 122 | # define YYTOKENTYPE |
| 123 | /* Put the tokens into the symbol table, so that GDB and other debuggers |
| 124 | know about them. */ |
| 125 | enum yytokentype { |
| 126 | INVARIANT = 258, |
| 127 | HIGH_PRECISION = 259, |
| 128 | MEDIUM_PRECISION = 260, |
| 129 | LOW_PRECISION = 261, |
| 130 | PRECISION = 262, |
| 131 | ATTRIBUTE = 263, |
| 132 | CONST_QUAL = 264, |
| 133 | BOOL_TYPE = 265, |
| 134 | FLOAT_TYPE = 266, |
| 135 | INT_TYPE = 267, |
Nicolas Capens | 3c20f80 | 2015-02-17 17:17:20 -0500 | [diff] [blame] | 136 | UINT_TYPE = 268, |
| 137 | BREAK = 269, |
| 138 | CONTINUE = 270, |
| 139 | DO = 271, |
| 140 | ELSE = 272, |
| 141 | FOR = 273, |
| 142 | IF = 274, |
| 143 | DISCARD = 275, |
| 144 | RETURN = 276, |
| 145 | SWITCH = 277, |
| 146 | CASE = 278, |
| 147 | DEFAULT = 279, |
| 148 | BVEC2 = 280, |
| 149 | BVEC3 = 281, |
| 150 | BVEC4 = 282, |
| 151 | IVEC2 = 283, |
| 152 | IVEC3 = 284, |
| 153 | IVEC4 = 285, |
| 154 | VEC2 = 286, |
| 155 | VEC3 = 287, |
| 156 | VEC4 = 288, |
Nicolas Capens | e4b1b1d | 2015-02-17 17:26:01 -0500 | [diff] [blame] | 157 | UVEC2 = 289, |
| 158 | UVEC3 = 290, |
| 159 | UVEC4 = 291, |
| 160 | MATRIX2 = 292, |
| 161 | MATRIX3 = 293, |
| 162 | MATRIX4 = 294, |
| 163 | IN_QUAL = 295, |
| 164 | OUT_QUAL = 296, |
| 165 | INOUT_QUAL = 297, |
| 166 | UNIFORM = 298, |
| 167 | VARYING = 299, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 168 | MATRIX2x3 = 300, |
| 169 | MATRIX3x2 = 301, |
| 170 | MATRIX2x4 = 302, |
| 171 | MATRIX4x2 = 303, |
| 172 | MATRIX3x4 = 304, |
| 173 | MATRIX4x3 = 305, |
| 174 | CENTROID = 306, |
| 175 | FLAT = 307, |
| 176 | SMOOTH = 308, |
| 177 | STRUCT = 309, |
| 178 | VOID_TYPE = 310, |
| 179 | WHILE = 311, |
| 180 | SAMPLER2D = 312, |
| 181 | SAMPLERCUBE = 313, |
| 182 | SAMPLER_EXTERNAL_OES = 314, |
| 183 | SAMPLER2DRECT = 315, |
| 184 | SAMPLER2DARRAY = 316, |
| 185 | ISAMPLER2D = 317, |
| 186 | ISAMPLER3D = 318, |
| 187 | ISAMPLERCUBE = 319, |
| 188 | ISAMPLER2DARRAY = 320, |
| 189 | USAMPLER2D = 321, |
| 190 | USAMPLER3D = 322, |
| 191 | USAMPLERCUBE = 323, |
| 192 | USAMPLER2DARRAY = 324, |
| 193 | SAMPLER3D = 325, |
| 194 | SAMPLER3DRECT = 326, |
| 195 | SAMPLER2DSHADOW = 327, |
| 196 | SAMPLERCUBESHADOW = 328, |
| 197 | SAMPLER2DARRAYSHADOW = 329, |
| 198 | LAYOUT = 330, |
| 199 | IDENTIFIER = 331, |
| 200 | TYPE_NAME = 332, |
| 201 | FLOATCONSTANT = 333, |
| 202 | INTCONSTANT = 334, |
| 203 | UINTCONSTANT = 335, |
| 204 | BOOLCONSTANT = 336, |
| 205 | FIELD_SELECTION = 337, |
| 206 | LEFT_OP = 338, |
| 207 | RIGHT_OP = 339, |
| 208 | INC_OP = 340, |
| 209 | DEC_OP = 341, |
| 210 | LE_OP = 342, |
| 211 | GE_OP = 343, |
| 212 | EQ_OP = 344, |
| 213 | NE_OP = 345, |
| 214 | AND_OP = 346, |
| 215 | OR_OP = 347, |
| 216 | XOR_OP = 348, |
| 217 | MUL_ASSIGN = 349, |
| 218 | DIV_ASSIGN = 350, |
| 219 | ADD_ASSIGN = 351, |
| 220 | MOD_ASSIGN = 352, |
| 221 | LEFT_ASSIGN = 353, |
| 222 | RIGHT_ASSIGN = 354, |
| 223 | AND_ASSIGN = 355, |
| 224 | XOR_ASSIGN = 356, |
| 225 | OR_ASSIGN = 357, |
| 226 | SUB_ASSIGN = 358, |
| 227 | LEFT_PAREN = 359, |
| 228 | RIGHT_PAREN = 360, |
| 229 | LEFT_BRACKET = 361, |
| 230 | RIGHT_BRACKET = 362, |
| 231 | LEFT_BRACE = 363, |
| 232 | RIGHT_BRACE = 364, |
| 233 | DOT = 365, |
| 234 | COMMA = 366, |
| 235 | COLON = 367, |
| 236 | EQUAL = 368, |
| 237 | SEMICOLON = 369, |
| 238 | BANG = 370, |
| 239 | DASH = 371, |
| 240 | TILDE = 372, |
| 241 | PLUS = 373, |
| 242 | STAR = 374, |
| 243 | SLASH = 375, |
| 244 | PERCENT = 376, |
| 245 | LEFT_ANGLE = 377, |
| 246 | RIGHT_ANGLE = 378, |
| 247 | VERTICAL_BAR = 379, |
| 248 | CARET = 380, |
| 249 | AMPERSAND = 381, |
| 250 | QUESTION = 382 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 251 | }; |
| 252 | #endif |
| 253 | |
| 254 | |
| 255 | |
| 256 | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
| 257 | typedef union YYSTYPE |
| 258 | { |
| 259 | |
| 260 | |
| 261 | struct { |
| 262 | TSourceLoc line; |
| 263 | union { |
| 264 | TString *string; |
| 265 | float f; |
| 266 | int i; |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 267 | unsigned int u; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 268 | bool b; |
| 269 | }; |
| 270 | TSymbol* symbol; |
| 271 | } lex; |
| 272 | struct { |
| 273 | TSourceLoc line; |
| 274 | TOperator op; |
| 275 | union { |
| 276 | TIntermNode* intermNode; |
| 277 | TIntermNodePair nodePair; |
| 278 | TIntermTyped* intermTypedNode; |
| 279 | TIntermAggregate* intermAggregate; |
| 280 | }; |
| 281 | union { |
| 282 | TPublicType type; |
| 283 | TPrecision precision; |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 284 | TLayoutQualifier layoutQualifier; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 285 | TQualifier qualifier; |
| 286 | TFunction* function; |
| 287 | TParameter param; |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 288 | TField* field; |
| 289 | TFieldList* fieldList; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 290 | }; |
| 291 | } interm; |
| 292 | |
| 293 | |
| 294 | |
| 295 | } YYSTYPE; |
| 296 | # define YYSTYPE_IS_TRIVIAL 1 |
| 297 | # define yystype YYSTYPE /* obsolescent; will be withdrawn */ |
| 298 | # define YYSTYPE_IS_DECLARED 1 |
| 299 | #endif |
| 300 | |
| 301 | |
| 302 | /* Copy the second part of user declarations. */ |
| 303 | |
| 304 | |
| 305 | extern int yylex(YYSTYPE* yylval_param, void* yyscanner); |
| 306 | extern void yyerror(TParseContext* context, const char* reason); |
| 307 | |
| 308 | #define FRAG_VERT_ONLY(S, L) { \ |
Nicolas Capens | 08ca3c6 | 2015-02-13 16:06:45 -0500 | [diff] [blame] | 309 | if (context->shaderType != GL_FRAGMENT_SHADER && \ |
| 310 | context->shaderType != GL_VERTEX_SHADER) { \ |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 311 | context->error(L, " supported in vertex/fragment shaders only ", S); \ |
| 312 | context->recover(); \ |
| 313 | } \ |
| 314 | } |
| 315 | |
| 316 | #define VERTEX_ONLY(S, L) { \ |
Nicolas Capens | 08ca3c6 | 2015-02-13 16:06:45 -0500 | [diff] [blame] | 317 | if (context->shaderType != GL_VERTEX_SHADER) { \ |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 318 | context->error(L, " supported in vertex shaders only ", S); \ |
| 319 | context->recover(); \ |
| 320 | } \ |
| 321 | } |
| 322 | |
| 323 | #define FRAG_ONLY(S, L) { \ |
Nicolas Capens | 08ca3c6 | 2015-02-13 16:06:45 -0500 | [diff] [blame] | 324 | if (context->shaderType != GL_FRAGMENT_SHADER) { \ |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 325 | context->error(L, " supported in fragment shaders only ", S); \ |
| 326 | context->recover(); \ |
| 327 | } \ |
| 328 | } |
| 329 | |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame] | 330 | #define ES2_ONLY(S, L) { \ |
| 331 | if (context->shaderVersion != 100) { \ |
| 332 | context->error(L, " supported in GLSL ES 1.00 only ", S); \ |
| 333 | context->recover(); \ |
| 334 | } \ |
| 335 | } |
| 336 | |
| 337 | #define ES3_ONLY(S, L) { \ |
| 338 | if (context->shaderVersion != 300) { \ |
| 339 | context->error(L, " supported in GLSL ES 3.00 only ", S); \ |
| 340 | context->recover(); \ |
| 341 | } \ |
| 342 | } |
| 343 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 344 | |
| 345 | |
| 346 | #ifdef short |
| 347 | # undef short |
| 348 | #endif |
| 349 | |
| 350 | #ifdef YYTYPE_UINT8 |
| 351 | typedef YYTYPE_UINT8 yytype_uint8; |
| 352 | #else |
| 353 | typedef unsigned char yytype_uint8; |
| 354 | #endif |
| 355 | |
| 356 | #ifdef YYTYPE_INT8 |
| 357 | typedef YYTYPE_INT8 yytype_int8; |
| 358 | #elif (defined __STDC__ || defined __C99__FUNC__ \ |
| 359 | || defined __cplusplus || defined _MSC_VER) |
| 360 | typedef signed char yytype_int8; |
| 361 | #else |
| 362 | typedef short int yytype_int8; |
| 363 | #endif |
| 364 | |
| 365 | #ifdef YYTYPE_UINT16 |
| 366 | typedef YYTYPE_UINT16 yytype_uint16; |
| 367 | #else |
| 368 | typedef unsigned short int yytype_uint16; |
| 369 | #endif |
| 370 | |
| 371 | #ifdef YYTYPE_INT16 |
| 372 | typedef YYTYPE_INT16 yytype_int16; |
| 373 | #else |
| 374 | typedef short int yytype_int16; |
| 375 | #endif |
| 376 | |
| 377 | #ifndef YYSIZE_T |
| 378 | # ifdef __SIZE_TYPE__ |
| 379 | # define YYSIZE_T __SIZE_TYPE__ |
| 380 | # elif defined size_t |
| 381 | # define YYSIZE_T size_t |
| 382 | # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ |
| 383 | || defined __cplusplus || defined _MSC_VER) |
| 384 | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
| 385 | # define YYSIZE_T size_t |
| 386 | # else |
| 387 | # define YYSIZE_T unsigned int |
| 388 | # endif |
| 389 | #endif |
| 390 | |
| 391 | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
| 392 | |
| 393 | #ifndef YY_ |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 394 | # if YYENABLE_NLS |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 395 | # if ENABLE_NLS |
| 396 | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
| 397 | # define YY_(msgid) dgettext ("bison-runtime", msgid) |
| 398 | # endif |
| 399 | # endif |
| 400 | # ifndef YY_ |
| 401 | # define YY_(msgid) msgid |
| 402 | # endif |
| 403 | #endif |
| 404 | |
| 405 | /* Suppress unused-variable warnings by "using" E. */ |
| 406 | #if ! defined lint || defined __GNUC__ |
| 407 | # define YYUSE(e) ((void) (e)) |
| 408 | #else |
| 409 | # define YYUSE(e) /* empty */ |
| 410 | #endif |
| 411 | |
| 412 | /* Identity function, used to suppress warnings about constant conditions. */ |
| 413 | #ifndef lint |
| 414 | # define YYID(n) (n) |
| 415 | #else |
| 416 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 417 | || defined __cplusplus || defined _MSC_VER) |
| 418 | static int |
| 419 | YYID (int yyi) |
| 420 | #else |
| 421 | static int |
| 422 | YYID (yyi) |
| 423 | int yyi; |
| 424 | #endif |
| 425 | { |
| 426 | return yyi; |
| 427 | } |
| 428 | #endif |
| 429 | |
| 430 | #if ! defined yyoverflow || YYERROR_VERBOSE |
| 431 | |
| 432 | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
| 433 | |
| 434 | # ifdef YYSTACK_USE_ALLOCA |
| 435 | # if YYSTACK_USE_ALLOCA |
| 436 | # ifdef __GNUC__ |
| 437 | # define YYSTACK_ALLOC __builtin_alloca |
| 438 | # elif defined __BUILTIN_VA_ARG_INCR |
| 439 | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
| 440 | # elif defined _AIX |
| 441 | # define YYSTACK_ALLOC __alloca |
| 442 | # elif defined _MSC_VER |
| 443 | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
| 444 | # define alloca _alloca |
| 445 | # else |
| 446 | # define YYSTACK_ALLOC alloca |
| 447 | # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
| 448 | || defined __cplusplus || defined _MSC_VER) |
| 449 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
| 450 | # ifndef _STDLIB_H |
| 451 | # define _STDLIB_H 1 |
| 452 | # endif |
| 453 | # endif |
| 454 | # endif |
| 455 | # endif |
| 456 | # endif |
| 457 | |
| 458 | # ifdef YYSTACK_ALLOC |
| 459 | /* Pacify GCC's `empty if-body' warning. */ |
| 460 | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) |
| 461 | # ifndef YYSTACK_ALLOC_MAXIMUM |
| 462 | /* The OS might guarantee only one guard page at the bottom of the stack, |
| 463 | and a page size can be as small as 4096 bytes. So we cannot safely |
| 464 | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
| 465 | to allow for a few compiler-allocated temporary stack slots. */ |
| 466 | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
| 467 | # endif |
| 468 | # else |
| 469 | # define YYSTACK_ALLOC YYMALLOC |
| 470 | # define YYSTACK_FREE YYFREE |
| 471 | # ifndef YYSTACK_ALLOC_MAXIMUM |
| 472 | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
| 473 | # endif |
| 474 | # if (defined __cplusplus && ! defined _STDLIB_H \ |
| 475 | && ! ((defined YYMALLOC || defined malloc) \ |
| 476 | && (defined YYFREE || defined free))) |
| 477 | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
| 478 | # ifndef _STDLIB_H |
| 479 | # define _STDLIB_H 1 |
| 480 | # endif |
| 481 | # endif |
| 482 | # ifndef YYMALLOC |
| 483 | # define YYMALLOC malloc |
| 484 | # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
| 485 | || defined __cplusplus || defined _MSC_VER) |
| 486 | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
| 487 | # endif |
| 488 | # endif |
| 489 | # ifndef YYFREE |
| 490 | # define YYFREE free |
| 491 | # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ |
| 492 | || defined __cplusplus || defined _MSC_VER) |
| 493 | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
| 494 | # endif |
| 495 | # endif |
| 496 | # endif |
| 497 | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
| 498 | |
| 499 | |
| 500 | #if (! defined yyoverflow \ |
| 501 | && (! defined __cplusplus \ |
| 502 | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
| 503 | |
| 504 | /* A type that is properly aligned for any stack member. */ |
| 505 | union yyalloc |
| 506 | { |
| 507 | yytype_int16 yyss_alloc; |
| 508 | YYSTYPE yyvs_alloc; |
| 509 | }; |
| 510 | |
| 511 | /* The size of the maximum gap between one aligned stack and the next. */ |
| 512 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
| 513 | |
| 514 | /* The size of an array large to enough to hold all stacks, each with |
| 515 | N elements. */ |
| 516 | # define YYSTACK_BYTES(N) \ |
| 517 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
| 518 | + YYSTACK_GAP_MAXIMUM) |
| 519 | |
| 520 | /* Copy COUNT objects from FROM to TO. The source and destination do |
| 521 | not overlap. */ |
| 522 | # ifndef YYCOPY |
| 523 | # if defined __GNUC__ && 1 < __GNUC__ |
| 524 | # define YYCOPY(To, From, Count) \ |
| 525 | __builtin_memcpy (To, From, (Count) * sizeof (*(From))) |
| 526 | # else |
| 527 | # define YYCOPY(To, From, Count) \ |
| 528 | do \ |
| 529 | { \ |
| 530 | YYSIZE_T yyi; \ |
| 531 | for (yyi = 0; yyi < (Count); yyi++) \ |
| 532 | (To)[yyi] = (From)[yyi]; \ |
| 533 | } \ |
| 534 | while (YYID (0)) |
| 535 | # endif |
| 536 | # endif |
| 537 | |
| 538 | /* Relocate STACK from its old location to the new one. The |
| 539 | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
| 540 | elements in the stack, and YYPTR gives the new location of the |
| 541 | stack. Advance YYPTR to a properly aligned location for the next |
| 542 | stack. */ |
| 543 | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
| 544 | do \ |
| 545 | { \ |
| 546 | YYSIZE_T yynewbytes; \ |
| 547 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
| 548 | Stack = &yyptr->Stack_alloc; \ |
| 549 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
| 550 | yyptr += yynewbytes / sizeof (*yyptr); \ |
| 551 | } \ |
| 552 | while (YYID (0)) |
| 553 | |
| 554 | #endif |
| 555 | |
| 556 | /* YYFINAL -- State number of the termination state. */ |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 557 | #define YYFINAL 110 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 558 | /* YYLAST -- Last index in YYTABLE. */ |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 559 | #define YYLAST 2377 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 560 | |
| 561 | /* YYNTOKENS -- Number of terminals. */ |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 562 | #define YYNTOKENS 128 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 563 | /* YYNNTS -- Number of nonterminals. */ |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 564 | #define YYNNTS 90 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 565 | /* YYNRULES -- Number of rules. */ |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 566 | #define YYNRULES 263 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 567 | /* YYNRULES -- Number of states. */ |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 568 | #define YYNSTATES 396 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 569 | |
| 570 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
| 571 | #define YYUNDEFTOK 2 |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 572 | #define YYMAXUTOK 382 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 573 | |
| 574 | #define YYTRANSLATE(YYX) \ |
| 575 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| 576 | |
| 577 | /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ |
| 578 | static const yytype_uint8 yytranslate[] = |
| 579 | { |
| 580 | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 581 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 582 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 583 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 584 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 585 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 586 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 587 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 588 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 589 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 590 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 591 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 592 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 593 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 594 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 595 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 596 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 597 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 598 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 599 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 600 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 601 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 602 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 603 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 604 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
| 605 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 606 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 607 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 608 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
| 609 | 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, |
| 610 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 611 | 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, |
| 612 | 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, |
| 613 | 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, |
Alexis Hetu | b027aa9 | 2015-01-19 15:56:12 -0500 | [diff] [blame] | 614 | 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, |
Nicolas Capens | 3c20f80 | 2015-02-17 17:17:20 -0500 | [diff] [blame] | 615 | 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 616 | 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, |
| 617 | 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, |
| 618 | 125, 126, 127 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 619 | }; |
| 620 | |
| 621 | #if YYDEBUG |
| 622 | /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in |
| 623 | YYRHS. */ |
| 624 | static const yytype_uint16 yyprhs[] = |
| 625 | { |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 626 | 0, 0, 3, 5, 7, 9, 11, 13, 15, 19, |
| 627 | 21, 26, 28, 32, 35, 38, 40, 42, 44, 48, |
| 628 | 51, 54, 57, 59, 62, 66, 69, 71, 73, 75, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 629 | 77, 80, 83, 86, 88, 90, 92, 94, 96, 100, |
| 630 | 104, 108, 110, 114, 118, 120, 124, 128, 130, 134, |
| 631 | 138, 142, 146, 148, 152, 156, 158, 162, 164, 168, |
| 632 | 170, 174, 176, 180, 182, 186, 188, 192, 194, 200, |
| 633 | 202, 206, 208, 210, 212, 214, 216, 218, 220, 222, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 634 | 224, 226, 228, 230, 234, 236, 239, 242, 245, 250, |
| 635 | 256, 263, 273, 276, 279, 281, 283, 286, 290, 294, |
| 636 | 297, 303, 307, 310, 314, 317, 318, 320, 322, 324, |
| 637 | 326, 328, 332, 339, 347, 356, 362, 364, 367, 373, |
| 638 | 380, 388, 393, 396, 398, 401, 403, 405, 407, 409, |
| 639 | 411, 414, 416, 419, 421, 423, 426, 428, 430, 432, |
| 640 | 435, 438, 440, 442, 445, 447, 449, 451, 456, 458, |
| 641 | 462, 464, 468, 472, 474, 479, 481, 483, 485, 487, |
| 642 | 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, |
| 643 | 509, 511, 513, 515, 517, 519, 521, 523, 525, 527, |
| 644 | 529, 531, 533, 535, 537, 539, 541, 543, 545, 547, |
| 645 | 549, 551, 553, 555, 557, 559, 561, 563, 565, 567, |
| 646 | 568, 575, 576, 582, 584, 587, 591, 596, 598, 602, |
| 647 | 604, 609, 611, 613, 615, 617, 619, 621, 623, 625, |
| 648 | 627, 630, 631, 632, 638, 640, 642, 643, 646, 647, |
| 649 | 650, 653, 657, 659, 662, 664, 667, 673, 677, 679, |
| 650 | 681, 686, 687, 694, 695, 704, 705, 713, 715, 717, |
| 651 | 719, 720, 723, 727, 730, 733, 736, 740, 743, 745, |
| 652 | 748, 750, 752, 753 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 653 | }; |
| 654 | |
| 655 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
| 656 | static const yytype_int16 yyrhs[] = |
| 657 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 658 | 214, 0, -1, 76, -1, 129, -1, 79, -1, 80, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 659 | -1, 78, -1, 81, -1, 104, 156, 105, -1, 130, |
| 660 | -1, 131, 106, 132, 107, -1, 133, -1, 131, 110, |
| 661 | 82, -1, 131, 85, -1, 131, 86, -1, 156, -1, |
| 662 | 134, -1, 135, -1, 131, 110, 135, -1, 137, 105, |
| 663 | -1, 136, 105, -1, 138, 55, -1, 138, -1, 138, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 664 | 154, -1, 137, 111, 154, -1, 139, 104, -1, 181, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 665 | -1, 76, -1, 82, -1, 131, -1, 85, 140, -1, |
| 666 | 86, 140, -1, 141, 140, -1, 118, -1, 116, -1, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 667 | 115, -1, 117, -1, 140, -1, 142, 119, 140, -1, |
| 668 | 142, 120, 140, -1, 142, 121, 140, -1, 142, -1, |
| 669 | 143, 118, 142, -1, 143, 116, 142, -1, 143, -1, |
| 670 | 144, 83, 143, -1, 144, 84, 143, -1, 144, -1, |
| 671 | 145, 122, 144, -1, 145, 123, 144, -1, 145, 87, |
| 672 | 144, -1, 145, 88, 144, -1, 145, -1, 146, 89, |
| 673 | 145, -1, 146, 90, 145, -1, 146, -1, 147, 126, |
| 674 | 146, -1, 147, -1, 148, 125, 147, -1, 148, -1, |
| 675 | 149, 124, 148, -1, 149, -1, 150, 91, 149, -1, |
| 676 | 150, -1, 151, 93, 150, -1, 151, -1, 152, 92, |
| 677 | 151, -1, 152, -1, 152, 127, 156, 112, 154, -1, |
| 678 | 153, -1, 140, 155, 154, -1, 113, -1, 94, -1, |
| 679 | 95, -1, 97, -1, 96, -1, 103, -1, 98, -1, |
| 680 | 99, -1, 100, -1, 101, -1, 102, -1, 154, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 681 | 156, 111, 154, -1, 153, -1, 76, 108, -1, 160, |
| 682 | 114, -1, 168, 114, -1, 7, 176, 180, 114, -1, |
| 683 | 173, 158, 185, 109, 114, -1, 173, 158, 185, 109, |
| 684 | 76, 114, -1, 173, 158, 185, 109, 76, 106, 157, |
| 685 | 107, 114, -1, 173, 114, -1, 161, 105, -1, 163, |
| 686 | -1, 162, -1, 163, 165, -1, 162, 111, 165, -1, |
| 687 | 170, 76, 104, -1, 175, 76, -1, 175, 76, 106, |
| 688 | 157, 107, -1, 172, 166, 164, -1, 166, 164, -1, |
| 689 | 172, 166, 167, -1, 166, 167, -1, -1, 40, -1, |
| 690 | 41, -1, 42, -1, 175, -1, 169, -1, 168, 111, |
| 691 | 76, -1, 168, 111, 76, 106, 157, 107, -1, 168, |
| 692 | 111, 76, 106, 107, 113, 189, -1, 168, 111, 76, |
| 693 | 106, 157, 107, 113, 189, -1, 168, 111, 76, 113, |
| 694 | 189, -1, 170, -1, 170, 76, -1, 170, 76, 106, |
| 695 | 157, 107, -1, 170, 76, 106, 107, 113, 189, -1, |
| 696 | 170, 76, 106, 157, 107, 113, 189, -1, 170, 76, |
| 697 | 113, 189, -1, 3, 76, -1, 175, -1, 173, 175, |
| 698 | -1, 53, -1, 52, -1, 9, -1, 8, -1, 44, |
| 699 | -1, 3, 44, -1, 174, -1, 171, 174, -1, 171, |
| 700 | -1, 177, -1, 177, 174, -1, 9, -1, 40, -1, |
| 701 | 41, -1, 51, 40, -1, 51, 41, -1, 43, -1, |
| 702 | 180, -1, 176, 180, -1, 4, -1, 5, -1, 6, |
| 703 | -1, 75, 104, 178, 105, -1, 179, -1, 178, 111, |
| 704 | 179, -1, 76, -1, 76, 113, 79, -1, 76, 113, |
| 705 | 80, -1, 181, -1, 181, 106, 157, 107, -1, 55, |
| 706 | -1, 11, -1, 12, -1, 13, -1, 10, -1, 31, |
| 707 | -1, 32, -1, 33, -1, 25, -1, 26, -1, 27, |
| 708 | -1, 28, -1, 29, -1, 30, -1, 34, -1, 35, |
| 709 | -1, 36, -1, 37, -1, 38, -1, 39, -1, 45, |
| 710 | -1, 46, -1, 47, -1, 48, -1, 49, -1, 50, |
| 711 | -1, 57, -1, 58, -1, 59, -1, 70, -1, 61, |
| 712 | -1, 62, -1, 63, -1, 64, -1, 65, -1, 66, |
| 713 | -1, 67, -1, 68, -1, 69, -1, 72, -1, 73, |
| 714 | -1, 74, -1, 182, -1, 77, -1, -1, 54, 76, |
| 715 | 108, 183, 185, 109, -1, -1, 54, 108, 184, 185, |
| 716 | 109, -1, 186, -1, 185, 186, -1, 175, 187, 114, |
| 717 | -1, 173, 175, 187, 114, -1, 188, -1, 187, 111, |
| 718 | 188, -1, 76, -1, 76, 106, 157, 107, -1, 154, |
| 719 | -1, 159, -1, 193, -1, 192, -1, 190, -1, 202, |
| 720 | -1, 203, -1, 206, -1, 213, -1, 108, 109, -1, |
| 721 | -1, -1, 108, 194, 201, 195, 109, -1, 200, -1, |
| 722 | 192, -1, -1, 198, 200, -1, -1, 199, 192, -1, |
| 723 | 108, 109, -1, 108, 201, 109, -1, 191, -1, 201, |
| 724 | 191, -1, 114, -1, 156, 114, -1, 19, 104, 156, |
| 725 | 105, 204, -1, 197, 17, 197, -1, 197, -1, 156, |
| 726 | -1, 170, 76, 113, 189, -1, -1, 56, 104, 207, |
| 727 | 205, 105, 196, -1, -1, 16, 208, 197, 56, 104, |
| 728 | 156, 105, 114, -1, -1, 18, 104, 209, 210, 212, |
| 729 | 105, 196, -1, 202, -1, 190, -1, 205, -1, -1, |
| 730 | 211, 114, -1, 211, 114, 156, -1, 15, 114, -1, |
| 731 | 14, 114, -1, 21, 114, -1, 21, 156, 114, -1, |
| 732 | 20, 114, -1, 215, -1, 214, 215, -1, 216, -1, |
| 733 | 159, -1, -1, 160, 217, 200, -1 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 734 | }; |
| 735 | |
| 736 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
| 737 | static const yytype_uint16 yyrline[] = |
| 738 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 739 | 0, 192, 192, 227, 230, 235, 240, 245, 250, 256, |
| 740 | 259, 262, 265, 268, 271, 277, 285, 385, 388, 396, |
| 741 | 400, 407, 411, 418, 424, 433, 441, 518, 525, 535, |
| 742 | 538, 548, 558, 580, 581, 582, 583, 591, 592, 601, |
| 743 | 610, 623, 624, 632, 643, 644, 653, 665, 666, 676, |
| 744 | 686, 696, 709, 710, 720, 733, 734, 748, 749, 763, |
| 745 | 764, 778, 779, 792, 793, 806, 807, 820, 821, 838, |
| 746 | 839, 852, 853, 854, 855, 857, 858, 859, 861, 863, |
| 747 | 865, 867, 872, 875, 886, 894, 902, 929, 935, 942, |
| 748 | 946, 950, 954, 961, 999, 1002, 1009, 1017, 1038, 1059, |
| 749 | 1070, 1099, 1104, 1114, 1119, 1129, 1132, 1135, 1138, 1144, |
| 750 | 1151, 1154, 1158, 1162, 1167, 1172, 1179, 1183, 1187, 1191, |
| 751 | 1196, 1201, 1205, 1281, 1291, 1297, 1300, 1306, 1312, 1319, |
| 752 | 1328, 1337, 1340, 1343, 1350, 1354, 1361, 1365, 1370, 1375, |
| 753 | 1385, 1395, 1404, 1414, 1421, 1424, 1427, 1433, 1440, 1443, |
| 754 | 1449, 1452, 1455, 1461, 1464, 1479, 1483, 1487, 1491, 1495, |
| 755 | 1499, 1504, 1509, 1514, 1519, 1524, 1529, 1534, 1539, 1544, |
| 756 | 1549, 1554, 1559, 1565, 1571, 1577, 1583, 1589, 1595, 1601, |
| 757 | 1607, 1613, 1618, 1623, 1632, 1637, 1642, 1647, 1652, 1657, |
| 758 | 1662, 1667, 1672, 1677, 1682, 1687, 1692, 1697, 1702, 1715, |
| 759 | 1715, 1718, 1718, 1724, 1727, 1743, 1746, 1755, 1759, 1765, |
| 760 | 1772, 1787, 1791, 1795, 1796, 1802, 1803, 1804, 1805, 1806, |
| 761 | 1810, 1811, 1811, 1811, 1821, 1822, 1826, 1826, 1827, 1827, |
| 762 | 1832, 1835, 1845, 1848, 1854, 1855, 1859, 1867, 1871, 1881, |
| 763 | 1886, 1903, 1903, 1908, 1908, 1915, 1915, 1923, 1926, 1932, |
| 764 | 1935, 1941, 1945, 1952, 1959, 1966, 1973, 1984, 1993, 1997, |
| 765 | 2004, 2007, 2013, 2013 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 766 | }; |
| 767 | #endif |
| 768 | |
| 769 | #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE |
| 770 | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
| 771 | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
| 772 | static const char *const yytname[] = |
| 773 | { |
| 774 | "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION", |
| 775 | "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE", |
Nicolas Capens | 3c20f80 | 2015-02-17 17:17:20 -0500 | [diff] [blame] | 776 | "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE", |
| 777 | "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", |
| 778 | "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", |
Nicolas Capens | e4b1b1d | 2015-02-17 17:26:01 -0500 | [diff] [blame] | 779 | "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2", |
| 780 | "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM", |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 781 | "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2", |
| 782 | "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT", |
| 783 | "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES", |
| 784 | "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D", |
| 785 | "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D", |
| 786 | "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT", |
| 787 | "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT", |
| 788 | "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT", |
| 789 | "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP", |
| 790 | "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", |
| 791 | "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", |
| 792 | "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", |
| 793 | "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET", |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 794 | "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON", |
| 795 | "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH", |
| 796 | "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", |
| 797 | "AMPERSAND", "QUESTION", "$accept", "variable_identifier", |
| 798 | "primary_expression", "postfix_expression", "integer_expression", |
| 799 | "function_call", "function_call_or_method", "function_call_generic", |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 800 | "function_call_header_no_parameters", |
| 801 | "function_call_header_with_parameters", "function_call_header", |
| 802 | "function_identifier", "unary_expression", "unary_operator", |
| 803 | "multiplicative_expression", "additive_expression", "shift_expression", |
| 804 | "relational_expression", "equality_expression", "and_expression", |
| 805 | "exclusive_or_expression", "inclusive_or_expression", |
| 806 | "logical_and_expression", "logical_xor_expression", |
| 807 | "logical_or_expression", "conditional_expression", |
| 808 | "assignment_expression", "assignment_operator", "expression", |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 809 | "constant_expression", "enter_struct", "declaration", |
| 810 | "function_prototype", "function_declarator", |
| 811 | "function_header_with_parameters", "function_header", |
| 812 | "parameter_declarator", "parameter_declaration", "parameter_qualifier", |
| 813 | "parameter_type_specifier", "init_declarator_list", "single_declaration", |
| 814 | "fully_specified_type", "interpolation_qualifier", |
| 815 | "parameter_type_qualifier", "type_qualifier", "storage_qualifier", |
| 816 | "type_specifier", "precision_qualifier", "layout_qualifier", |
| 817 | "layout_qualifier_id_list", "layout_qualifier_id", |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 818 | "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier", |
| 819 | "$@1", "$@2", "struct_declaration_list", "struct_declaration", |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 820 | "struct_declarator_list", "struct_declarator", "initializer", |
| 821 | "declaration_statement", "statement", "simple_statement", |
| 822 | "compound_statement", "$@3", "$@4", "statement_no_new_scope", |
| 823 | "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope", |
| 824 | "statement_list", "expression_statement", "selection_statement", |
| 825 | "selection_rest_statement", "condition", "iteration_statement", "$@7", |
| 826 | "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement", |
| 827 | "jump_statement", "translation_unit", "external_declaration", |
| 828 | "function_definition", "$@10", 0 |
| 829 | }; |
| 830 | #endif |
| 831 | |
| 832 | # ifdef YYPRINT |
| 833 | /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to |
| 834 | token YYLEX-NUM. */ |
| 835 | static const yytype_uint16 yytoknum[] = |
| 836 | { |
| 837 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 838 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
| 839 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
| 840 | 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, |
| 841 | 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, |
| 842 | 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, |
| 843 | 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, |
| 844 | 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, |
| 845 | 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame] | 846 | 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 847 | 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 848 | 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, |
| 849 | 375, 376, 377, 378, 379, 380, 381, 382 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 850 | }; |
| 851 | # endif |
| 852 | |
| 853 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
| 854 | static const yytype_uint8 yyr1[] = |
| 855 | { |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 856 | 0, 128, 129, 130, 130, 130, 130, 130, 130, 131, |
| 857 | 131, 131, 131, 131, 131, 132, 133, 134, 134, 135, |
| 858 | 135, 136, 136, 137, 137, 138, 139, 139, 139, 140, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 859 | 140, 140, 140, 141, 141, 141, 141, 142, 142, 142, |
| 860 | 142, 143, 143, 143, 144, 144, 144, 145, 145, 145, |
| 861 | 145, 145, 146, 146, 146, 147, 147, 148, 148, 149, |
| 862 | 149, 150, 150, 151, 151, 152, 152, 153, 153, 154, |
| 863 | 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 864 | 155, 155, 156, 156, 157, 158, 159, 159, 159, 159, |
| 865 | 159, 159, 159, 160, 161, 161, 162, 162, 163, 164, |
| 866 | 164, 165, 165, 165, 165, 166, 166, 166, 166, 167, |
| 867 | 168, 168, 168, 168, 168, 168, 169, 169, 169, 169, |
| 868 | 169, 169, 169, 170, 170, 171, 171, 172, 173, 173, |
| 869 | 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, |
| 870 | 174, 174, 175, 175, 176, 176, 176, 177, 178, 178, |
| 871 | 179, 179, 179, 180, 180, 181, 181, 181, 181, 181, |
| 872 | 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, |
| 873 | 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, |
| 874 | 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, |
| 875 | 181, 181, 181, 181, 181, 181, 181, 181, 181, 183, |
| 876 | 182, 184, 182, 185, 185, 186, 186, 187, 187, 188, |
| 877 | 188, 189, 190, 191, 191, 192, 192, 192, 192, 192, |
| 878 | 193, 194, 195, 193, 196, 196, 198, 197, 199, 197, |
| 879 | 200, 200, 201, 201, 202, 202, 203, 204, 204, 205, |
| 880 | 205, 207, 206, 208, 206, 209, 206, 210, 210, 211, |
| 881 | 211, 212, 212, 213, 213, 213, 213, 213, 214, 214, |
| 882 | 215, 215, 217, 216 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 883 | }; |
| 884 | |
| 885 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
| 886 | static const yytype_uint8 yyr2[] = |
| 887 | { |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 888 | 0, 2, 1, 1, 1, 1, 1, 1, 3, 1, |
| 889 | 4, 1, 3, 2, 2, 1, 1, 1, 3, 2, |
| 890 | 2, 2, 1, 2, 3, 2, 1, 1, 1, 1, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 891 | 2, 2, 2, 1, 1, 1, 1, 1, 3, 3, |
| 892 | 3, 1, 3, 3, 1, 3, 3, 1, 3, 3, |
| 893 | 3, 3, 1, 3, 3, 1, 3, 1, 3, 1, |
| 894 | 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, |
| 895 | 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 896 | 1, 1, 1, 3, 1, 2, 2, 2, 4, 5, |
| 897 | 6, 9, 2, 2, 1, 1, 2, 3, 3, 2, |
| 898 | 5, 3, 2, 3, 2, 0, 1, 1, 1, 1, |
| 899 | 1, 3, 6, 7, 8, 5, 1, 2, 5, 6, |
| 900 | 7, 4, 2, 1, 2, 1, 1, 1, 1, 1, |
| 901 | 2, 1, 2, 1, 1, 2, 1, 1, 1, 2, |
| 902 | 2, 1, 1, 2, 1, 1, 1, 4, 1, 3, |
| 903 | 1, 3, 3, 1, 4, 1, 1, 1, 1, 1, |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 904 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 905 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 906 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 907 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, |
| 908 | 6, 0, 5, 1, 2, 3, 4, 1, 3, 1, |
| 909 | 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
| 910 | 2, 0, 0, 5, 1, 1, 0, 2, 0, 2, |
| 911 | 2, 3, 1, 2, 1, 2, 5, 3, 1, 1, |
| 912 | 4, 0, 6, 0, 8, 0, 7, 1, 1, 1, |
| 913 | 0, 2, 3, 2, 2, 2, 3, 2, 1, 2, |
| 914 | 1, 1, 0, 3 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 915 | }; |
| 916 | |
| 917 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
| 918 | STATE-NUM when YYTABLE doesn't specify something else to do. Zero |
| 919 | means the default is an error. */ |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 920 | static const yytype_uint16 yydefact[] = |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 921 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 922 | 0, 0, 144, 145, 146, 0, 128, 136, 159, 156, |
| 923 | 157, 158, 163, 164, 165, 166, 167, 168, 160, 161, |
| 924 | 162, 169, 170, 171, 172, 173, 174, 137, 138, 141, |
| 925 | 129, 175, 176, 177, 178, 179, 180, 0, 126, 125, |
| 926 | 0, 155, 181, 182, 183, 185, 186, 187, 188, 189, |
| 927 | 190, 191, 192, 193, 184, 194, 195, 196, 0, 198, |
| 928 | 261, 262, 0, 95, 105, 0, 110, 116, 133, 0, |
| 929 | 131, 123, 0, 134, 142, 153, 197, 0, 258, 260, |
| 930 | 130, 122, 0, 139, 140, 0, 201, 0, 86, 0, |
| 931 | 93, 105, 127, 106, 107, 108, 96, 0, 105, 0, |
| 932 | 87, 117, 132, 0, 92, 0, 124, 143, 135, 0, |
| 933 | 1, 259, 0, 199, 0, 150, 0, 148, 0, 263, |
| 934 | 97, 102, 104, 109, 0, 111, 98, 0, 0, 85, |
| 935 | 0, 0, 0, 0, 203, 2, 6, 4, 5, 7, |
| 936 | 28, 0, 0, 0, 35, 34, 36, 33, 3, 9, |
| 937 | 29, 11, 16, 17, 0, 0, 22, 0, 37, 0, |
| 938 | 41, 44, 47, 52, 55, 57, 59, 61, 63, 65, |
| 939 | 67, 84, 0, 26, 88, 0, 0, 0, 147, 0, |
| 940 | 0, 0, 243, 0, 0, 0, 0, 0, 221, 230, |
| 941 | 234, 37, 69, 82, 0, 212, 0, 153, 215, 232, |
| 942 | 214, 213, 0, 216, 217, 218, 219, 99, 101, 103, |
| 943 | 0, 0, 0, 0, 211, 121, 0, 209, 0, 207, |
| 944 | 0, 204, 30, 31, 0, 13, 14, 0, 0, 20, |
| 945 | 19, 0, 21, 23, 25, 32, 0, 0, 0, 0, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 946 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 947 | 0, 0, 0, 0, 0, 0, 154, 0, 202, 151, |
| 948 | 152, 149, 254, 253, 228, 245, 0, 257, 255, 0, |
| 949 | 241, 220, 0, 72, 73, 75, 74, 77, 78, 79, |
| 950 | 80, 81, 76, 71, 0, 0, 235, 231, 233, 0, |
| 951 | 0, 0, 115, 0, 118, 0, 0, 0, 205, 0, |
| 952 | 89, 8, 0, 15, 27, 12, 18, 24, 38, 39, |
| 953 | 40, 43, 42, 45, 46, 50, 51, 48, 49, 53, |
| 954 | 54, 56, 58, 60, 62, 64, 66, 0, 200, 0, |
| 955 | 0, 0, 0, 0, 256, 0, 222, 70, 83, 0, |
| 956 | 0, 112, 119, 0, 206, 0, 208, 0, 90, 10, |
| 957 | 0, 0, 227, 229, 248, 247, 250, 228, 239, 0, |
| 958 | 0, 0, 0, 100, 113, 0, 120, 210, 0, 68, |
| 959 | 0, 249, 0, 0, 238, 236, 0, 0, 223, 114, |
| 960 | 0, 0, 251, 0, 228, 0, 225, 242, 224, 91, |
| 961 | 0, 252, 246, 237, 240, 244 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 962 | }; |
| 963 | |
| 964 | /* YYDEFGOTO[NTERM-NUM]. */ |
| 965 | static const yytype_int16 yydefgoto[] = |
| 966 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 967 | -1, 148, 149, 150, 302, 151, 152, 153, 154, 155, |
| 968 | 156, 157, 191, 159, 160, 161, 162, 163, 164, 165, |
| 969 | 166, 167, 168, 169, 170, 192, 193, 284, 194, 172, |
| 970 | 105, 195, 196, 62, 63, 64, 121, 96, 97, 122, |
| 971 | 65, 66, 67, 68, 98, 69, 70, 71, 72, 73, |
| 972 | 116, 117, 74, 173, 76, 175, 114, 133, 134, 218, |
| 973 | 219, 215, 198, 199, 200, 201, 272, 362, 387, 329, |
| 974 | 330, 331, 388, 202, 203, 204, 375, 361, 205, 335, |
| 975 | 264, 332, 356, 372, 373, 206, 77, 78, 79, 89 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 976 | }; |
| 977 | |
| 978 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
| 979 | STATE-NUM. */ |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 980 | #define YYPACT_NINF -338 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 981 | static const yytype_int16 yypact[] = |
| 982 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 983 | 2015, -27, -338, -338, -338, 137, -338, -338, -338, -338, |
| 984 | -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, |
| 985 | -338, -338, -338, -338, -338, -338, -338, -338, -338, -338, |
| 986 | -338, -338, -338, -338, -338, -338, -338, 59, -338, -338, |
| 987 | -57, -338, -338, -338, -338, -338, -338, -338, -338, -338, |
| 988 | -338, -338, -338, -338, -338, -338, -338, -338, -80, -338, |
| 989 | -338, -64, -32, -26, 17, -50, -338, 44, 27, 1132, |
| 990 | -338, -338, 2300, 27, -338, 61, -338, 1940, -338, -338, |
| 991 | -338, -338, 2300, -338, -338, 63, -338, 78, -338, 66, |
| 992 | -338, 62, -338, -338, -338, -338, -338, 2164, 107, 93, |
| 993 | -338, -79, -338, 72, -338, 2090, -338, -338, -338, 1493, |
| 994 | -338, -338, 68, -338, 2090, 70, -83, -338, 360, -338, |
| 995 | -338, -338, -338, 108, 2164, -51, -338, 1202, 1493, -338, |
| 996 | 141, 2164, 111, 1685, -338, 82, -338, -338, -338, -338, |
| 997 | -338, 1493, 1493, 1493, -338, -338, -338, -338, -338, -338, |
| 998 | 9, -338, -338, -338, 83, -21, 1588, 86, -338, 1493, |
| 999 | 31, -35, 51, -43, 48, 67, 69, 71, 100, 104, |
| 1000 | -74, -338, 91, -338, -338, 2090, 1770, 65, -338, 78, |
| 1001 | 89, 102, -338, 96, 113, 105, 1300, 116, 112, -338, |
| 1002 | -338, 110, -338, -338, -2, -338, -64, 49, -338, -338, |
| 1003 | -338, -338, 476, -338, -338, -338, -338, 118, -338, -338, |
| 1004 | 1395, 1493, 101, 119, -338, -338, 111, 121, 12, -338, |
| 1005 | -60, -338, -338, -338, -13, -338, -338, 1493, 2232, -338, |
| 1006 | -338, 1493, 125, -338, -338, -338, 1493, 1493, 1493, 1493, |
| 1007 | 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493, 1493, |
| 1008 | 1493, 1493, 1493, 1493, 1493, 1493, -338, 1855, -338, -338, |
| 1009 | -338, -338, -338, -338, 122, -338, 1493, -338, -338, 14, |
| 1010 | -338, -338, 592, -338, -338, -338, -338, -338, -338, -338, |
| 1011 | -338, -338, -338, -338, 1493, 1493, -338, -338, -338, 1493, |
| 1012 | 120, 124, -338, 1493, 126, 16, 1493, 111, -338, -71, |
| 1013 | -338, -338, 128, 127, -338, 133, -338, -338, -338, -338, |
| 1014 | -338, 31, 31, -35, -35, 51, 51, 51, 51, -43, |
| 1015 | -43, 48, 67, 69, 71, 100, 104, 46, -338, 176, |
| 1016 | 66, 824, 940, 5, -338, 1037, 592, -338, -338, 134, |
| 1017 | 1493, 129, -338, 1493, -338, 138, -338, 1493, -338, -338, |
| 1018 | 1493, 140, -338, -338, -338, -338, 1037, 122, 127, 170, |
| 1019 | 2164, 144, 142, -338, -338, 1493, -338, -338, 145, -338, |
| 1020 | 1493, -338, 139, 149, 239, -338, 146, 708, -338, -338, |
| 1021 | 147, 6, 1493, 708, 122, 1493, -338, -338, -338, -338, |
| 1022 | 148, 127, -338, -338, -338, -338 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1023 | }; |
| 1024 | |
| 1025 | /* YYPGOTO[NTERM-NUM]. */ |
| 1026 | static const yytype_int16 yypgoto[] = |
| 1027 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1028 | -338, -338, -338, -338, -338, -338, -338, 30, -338, -338, |
| 1029 | -338, -338, 37, -338, -77, -76, -205, -75, 15, 13, |
| 1030 | 18, 19, 40, 41, -338, -97, -125, -338, -134, -119, |
| 1031 | -338, 10, 11, -338, -338, -338, 143, 174, 168, 172, |
| 1032 | -338, -338, -314, -338, -338, -101, 28, -68, 263, -338, |
| 1033 | -338, 115, -49, 0, -338, -338, -338, -99, -128, 54, |
| 1034 | 1, -204, -33, -196, -317, -338, -338, -338, -86, -337, |
| 1035 | -338, -338, -87, 29, -30, -338, -338, -56, -338, -338, |
| 1036 | -338, -338, -338, -338, -338, -338, -338, 226, -338, -338 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1037 | }; |
| 1038 | |
| 1039 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
| 1040 | positive, shift that token. If negative, reduce the rule which |
| 1041 | number is the opposite. If zero, do what YYDEFACT says. |
| 1042 | If YYTABLE_NINF, syntax error. */ |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1043 | #define YYTABLE_NINF -227 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1044 | static const yytype_int16 yytable[] = |
| 1045 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1046 | 75, 106, 119, 214, 131, 221, 288, 292, 213, 224, |
| 1047 | 60, 61, 171, 131, 353, 176, 299, 80, 254, 85, |
| 1048 | 374, 359, 178, 107, 87, 126, 92, 127, 179, 123, |
| 1049 | 171, 233, 131, 112, 128, 347, 7, 132, 315, 316, |
| 1050 | 317, 318, 359, 348, 243, 244, 132, 393, 221, 81, |
| 1051 | 88, 86, 269, 255, 300, 210, 123, 93, 94, 95, |
| 1052 | 386, 99, 211, 216, 100, 132, 386, 27, 28, 75, |
| 1053 | 29, 92, 75, 90, 131, 131, 257, 75, 37, 245, |
| 1054 | 246, 239, 75, 240, 230, 91, 214, 60, 61, 342, |
| 1055 | 231, 291, 301, 303, 225, 226, 102, 75, 285, 83, |
| 1056 | 84, 108, 93, 94, 95, 75, 307, 132, 132, 285, |
| 1057 | 357, 390, 286, 171, 75, 227, 285, 285, 197, 228, |
| 1058 | 101, 327, -94, 297, 75, 285, 298, 297, 334, 221, |
| 1059 | 344, 75, 333, 75, 241, 242, 364, 247, 248, 366, |
| 1060 | 288, 2, 3, 4, 259, 260, 158, 93, 94, 95, |
| 1061 | 236, 237, 238, -26, 115, 109, 131, 285, 350, 337, |
| 1062 | 338, 379, 311, 312, 158, 313, 314, 109, 214, 125, |
| 1063 | 339, 113, 319, 320, 118, 75, 75, 345, 222, 223, |
| 1064 | 129, 394, 174, 177, 207, 80, -27, 217, 229, 132, |
| 1065 | 234, 252, 171, 249, 250, 251, 235, 253, 256, 171, |
| 1066 | 265, 358, 197, 262, 273, 274, 275, 276, 277, 278, |
| 1067 | 279, 280, 281, 282, 293, 214, 263, 266, 214, 267, |
| 1068 | 270, 271, 358, 283, 289, 369, 294, 296, 368, -155, |
| 1069 | -226, 341, 351, 340, 360, 349, 381, -28, 285, 343, |
| 1070 | 214, 363, 365, 352, 370, 367, 376, 158, 391, 377, |
| 1071 | 171, 378, 380, 382, 383, 360, 384, 75, 306, 385, |
| 1072 | 214, 389, 395, 322, 321, 120, 124, 208, 82, 323, |
| 1073 | 295, 324, 197, 308, 309, 310, 158, 158, 158, 158, |
| 1074 | 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, |
| 1075 | 158, 158, 106, 325, 261, 326, 209, 392, 346, 354, |
| 1076 | 371, 336, 355, 111, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1077 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1078 | 0, 0, 0, 0, 0, 0, 158, 0, 0, 0, |
| 1079 | 0, 197, 197, 158, 0, 197, 197, 0, 0, 0, |
| 1080 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1081 | 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, |
| 1082 | 75, 0, 0, 1, 2, 3, 4, 5, 6, 7, |
| 1083 | 8, 9, 10, 11, 180, 181, 182, 197, 183, 184, |
| 1084 | 185, 186, 0, 197, 158, 12, 13, 14, 15, 16, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1085 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 1086 | 27, 28, 0, 29, 30, 31, 32, 33, 34, 35, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1087 | 36, 37, 38, 39, 40, 41, 187, 42, 43, 44, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1088 | 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1089 | 54, 0, 55, 56, 57, 58, 135, 59, 136, 137, |
| 1090 | 138, 139, 140, 0, 0, 141, 142, 0, 0, 0, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1091 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1092 | 0, 0, 0, 0, 143, 0, 0, 0, 188, 189, |
| 1093 | 0, 0, 0, 0, 190, 144, 145, 146, 147, 1, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1094 | 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1095 | 180, 181, 182, 0, 183, 184, 185, 186, 0, 0, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1096 | 0, 12, 13, 14, 15, 16, 17, 18, 19, 20, |
| 1097 | 21, 22, 23, 24, 25, 26, 27, 28, 0, 29, |
| 1098 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1099 | 40, 41, 187, 42, 43, 44, 0, 45, 46, 47, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1100 | 48, 49, 50, 51, 52, 53, 54, 0, 55, 56, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1101 | 57, 58, 135, 59, 136, 137, 138, 139, 140, 0, |
| 1102 | 0, 141, 142, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1103 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1104 | 143, 0, 0, 0, 188, 287, 0, 0, 0, 0, |
| 1105 | 190, 144, 145, 146, 147, 1, 2, 3, 4, 5, |
| 1106 | 6, 7, 8, 9, 10, 11, 180, 181, 182, 0, |
| 1107 | 183, 184, 185, 186, 0, 0, 0, 12, 13, 14, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1108 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1109 | 25, 26, 27, 28, 0, 29, 30, 31, 32, 33, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1110 | 34, 35, 36, 37, 38, 39, 40, 41, 187, 42, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1111 | 43, 44, 0, 45, 46, 47, 48, 49, 50, 51, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1112 | 52, 53, 54, 0, 55, 56, 57, 58, 135, 59, |
| 1113 | 136, 137, 138, 139, 140, 0, 0, 141, 142, 0, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1114 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1115 | 0, 0, 0, 0, 0, 0, 143, 0, 0, 0, |
| 1116 | 188, 0, 0, 0, 0, 0, 190, 144, 145, 146, |
| 1117 | 147, 1, 2, 3, 4, 5, 6, 7, 8, 9, |
| 1118 | 10, 11, 180, 181, 182, 0, 183, 184, 185, 186, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1119 | 0, 0, 0, 12, 13, 14, 15, 16, 17, 18, |
| 1120 | 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, |
| 1121 | 0, 29, 30, 31, 32, 33, 34, 35, 36, 37, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1122 | 38, 39, 40, 41, 187, 42, 43, 44, 0, 45, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1123 | 46, 47, 48, 49, 50, 51, 52, 53, 54, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1124 | 55, 56, 57, 58, 135, 59, 136, 137, 138, 139, |
| 1125 | 140, 0, 0, 141, 142, 0, 0, 0, 0, 0, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1126 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1127 | 0, 0, 143, 0, 0, 0, 118, 0, 0, 0, |
| 1128 | 0, 0, 190, 144, 145, 146, 147, 1, 2, 3, |
| 1129 | 4, 5, 6, 7, 8, 9, 10, 11, 180, 181, |
| 1130 | 182, 0, 183, 184, 185, 186, 0, 0, 0, 12, |
| 1131 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
| 1132 | 23, 24, 25, 26, 27, 28, 0, 29, 30, 31, |
| 1133 | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, |
| 1134 | 187, 42, 43, 44, 0, 45, 46, 47, 48, 49, |
| 1135 | 50, 51, 52, 53, 54, 0, 55, 56, 57, 58, |
| 1136 | 135, 59, 136, 137, 138, 139, 140, 0, 0, 141, |
| 1137 | 142, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1138 | 0, 0, 0, 0, 0, 0, 0, 0, 143, 0, |
| 1139 | 0, 0, 0, 0, 0, 0, 0, 0, 190, 144, |
| 1140 | 145, 146, 147, 1, 2, 3, 4, 5, 6, 7, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1141 | 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, |
| 1142 | 0, 0, 0, 0, 0, 12, 13, 14, 15, 16, |
| 1143 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 1144 | 27, 28, 0, 29, 30, 31, 32, 33, 34, 35, |
| 1145 | 36, 37, 38, 39, 40, 41, 0, 42, 43, 44, |
| 1146 | 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1147 | 54, 0, 55, 56, 57, 58, 135, 59, 136, 137, |
| 1148 | 138, 139, 140, 0, 0, 141, 142, 0, 0, 0, |
| 1149 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1150 | 130, 2, 3, 4, 143, 6, 7, 8, 9, 10, |
| 1151 | 11, 0, 0, 0, 190, 144, 145, 146, 147, 0, |
| 1152 | 0, 0, 12, 13, 14, 15, 16, 17, 18, 19, |
| 1153 | 20, 21, 22, 23, 24, 25, 26, 27, 28, 0, |
| 1154 | 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, |
| 1155 | 39, 40, 41, 0, 42, 43, 44, 0, 45, 46, |
| 1156 | 47, 48, 49, 50, 51, 52, 53, 54, 0, 55, |
| 1157 | 56, 57, 58, 135, 59, 136, 137, 138, 139, 140, |
| 1158 | 0, 0, 141, 142, 0, 0, 0, 0, 0, 0, |
| 1159 | 0, 0, 0, 0, 0, 0, 2, 3, 4, 0, |
| 1160 | 0, 143, 8, 9, 10, 11, 0, 0, 0, 0, |
| 1161 | 0, 0, 144, 145, 146, 147, 0, 12, 13, 14, |
| 1162 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 1163 | 25, 26, 0, 0, 0, 0, 0, 31, 32, 33, |
| 1164 | 34, 35, 36, 0, 0, 0, 40, 41, 0, 42, |
| 1165 | 43, 44, 0, 45, 46, 47, 48, 49, 50, 51, |
| 1166 | 52, 53, 54, 0, 55, 56, 57, 0, 103, 59, |
| 1167 | 0, 0, 8, 9, 10, 11, 0, 0, 0, 0, |
| 1168 | 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, |
| 1169 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 1170 | 25, 26, 0, 0, 0, 0, 104, 31, 32, 33, |
| 1171 | 34, 35, 36, 0, 0, 0, 40, 41, 0, 42, |
| 1172 | 43, 44, 0, 45, 46, 47, 48, 49, 50, 51, |
| 1173 | 52, 53, 54, 0, 55, 56, 57, 0, 135, 59, |
| 1174 | 136, 137, 138, 139, 140, 0, 0, 141, 142, 0, |
| 1175 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1176 | 0, 0, 0, 0, 0, 0, 143, 0, 0, 212, |
| 1177 | 8, 9, 10, 11, 0, 0, 0, 144, 145, 146, |
| 1178 | 147, 0, 0, 0, 0, 12, 13, 14, 15, 16, |
| 1179 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 1180 | 0, 0, 0, 0, 0, 31, 32, 33, 34, 35, |
| 1181 | 36, 0, 0, 0, 40, 41, 0, 42, 43, 44, |
| 1182 | 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 1183 | 54, 0, 55, 56, 57, 0, 135, 59, 136, 137, |
| 1184 | 138, 139, 140, 0, 0, 141, 142, 0, 0, 0, |
| 1185 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1186 | 0, 0, 0, 0, 143, 8, 9, 10, 11, 0, |
| 1187 | 0, 0, 0, 0, 268, 144, 145, 146, 147, 0, |
| 1188 | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
| 1189 | 22, 23, 24, 25, 26, 0, 0, 0, 0, 0, |
| 1190 | 31, 32, 33, 34, 35, 36, 0, 0, 0, 40, |
| 1191 | 41, 0, 42, 43, 44, 0, 45, 46, 47, 48, |
| 1192 | 49, 50, 51, 52, 53, 54, 0, 55, 56, 57, |
| 1193 | 0, 135, 59, 136, 137, 138, 139, 140, 0, 0, |
| 1194 | 141, 142, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1195 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 143, |
| 1196 | 0, 0, 290, 8, 9, 10, 11, 0, 0, 0, |
| 1197 | 144, 145, 146, 147, 0, 0, 0, 0, 12, 13, |
| 1198 | 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, |
| 1199 | 24, 25, 26, 0, 0, 0, 0, 0, 31, 32, |
| 1200 | 33, 34, 35, 36, 0, 0, 0, 40, 41, 0, |
| 1201 | 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, |
| 1202 | 51, 52, 53, 54, 0, 55, 56, 57, 0, 135, |
| 1203 | 59, 136, 137, 138, 139, 140, 0, 0, 141, 142, |
| 1204 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 1205 | 0, 0, 0, 0, 0, 0, 0, 143, 8, 9, |
| 1206 | 10, 11, 0, 0, 0, 0, 0, 0, 144, 145, |
| 1207 | 146, 147, 0, 12, 13, 14, 15, 16, 17, 18, |
| 1208 | 19, 20, 21, 22, 23, 24, 25, 26, 0, 0, |
| 1209 | 0, 0, 0, 31, 32, 33, 34, 35, 36, 0, |
| 1210 | 0, 0, 40, 232, 0, 42, 43, 44, 0, 45, |
| 1211 | 46, 47, 48, 49, 50, 51, 52, 53, 54, 0, |
| 1212 | 55, 56, 57, 0, 135, 59, 136, 137, 138, 139, |
| 1213 | 140, 0, 0, 141, 142, 0, 0, 0, 0, 0, |
| 1214 | 0, 0, 0, 0, 0, 0, 0, 0, 130, 2, |
| 1215 | 3, 4, 143, 6, 7, 8, 9, 10, 11, 0, |
| 1216 | 0, 0, 0, 144, 145, 146, 147, 0, 0, 0, |
| 1217 | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
| 1218 | 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, |
| 1219 | 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, |
| 1220 | 41, 0, 42, 43, 44, 0, 45, 46, 47, 48, |
| 1221 | 49, 50, 51, 52, 53, 54, 0, 55, 56, 57, |
| 1222 | 58, 0, 59, 0, 0, 0, 0, 0, 0, 0, |
| 1223 | 0, 0, 0, 130, 2, 3, 4, 0, 6, 7, |
| 1224 | 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, |
| 1225 | 0, 0, 0, 0, 220, 12, 13, 14, 15, 16, |
| 1226 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 1227 | 27, 28, 0, 29, 30, 31, 32, 33, 34, 35, |
| 1228 | 36, 37, 38, 39, 40, 41, 0, 42, 43, 44, |
| 1229 | 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 1230 | 54, 0, 55, 56, 57, 58, 0, 59, 0, 0, |
| 1231 | 0, 0, 0, 0, 0, 0, 0, 0, 130, 2, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1232 | 3, 4, 0, 6, 7, 8, 9, 10, 11, 0, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1233 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 258, |
| 1234 | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
| 1235 | 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, |
| 1236 | 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, |
| 1237 | 41, 0, 42, 43, 44, 0, 45, 46, 47, 48, |
| 1238 | 49, 50, 51, 52, 53, 54, 0, 55, 56, 57, |
| 1239 | 58, 0, 59, 0, 0, 0, 0, 0, 0, 0, |
| 1240 | 110, 0, 0, 1, 2, 3, 4, 5, 6, 7, |
| 1241 | 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, |
| 1242 | 0, 0, 0, 0, 328, 12, 13, 14, 15, 16, |
| 1243 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 1244 | 27, 28, 0, 29, 30, 31, 32, 33, 34, 35, |
| 1245 | 36, 37, 38, 39, 40, 41, 0, 42, 43, 44, |
| 1246 | 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 1247 | 54, 0, 55, 56, 57, 58, 0, 59, 1, 2, |
| 1248 | 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1249 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1250 | 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, |
| 1251 | 22, 23, 24, 25, 26, 27, 28, 0, 29, 30, |
| 1252 | 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, |
| 1253 | 41, 0, 42, 43, 44, 0, 45, 46, 47, 48, |
| 1254 | 49, 50, 51, 52, 53, 54, 0, 55, 56, 57, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1255 | 58, 0, 59, 130, 2, 3, 4, 0, 6, 7, |
| 1256 | 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, |
| 1257 | 0, 0, 0, 0, 0, 12, 13, 14, 15, 16, |
| 1258 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 1259 | 27, 28, 0, 29, 30, 31, 32, 33, 34, 35, |
| 1260 | 36, 37, 38, 39, 40, 41, 0, 42, 43, 44, |
| 1261 | 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 1262 | 54, 0, 55, 56, 57, 58, 0, 59, 2, 3, |
| 1263 | 4, 0, 0, 0, 8, 9, 10, 11, 0, 0, |
| 1264 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, |
| 1265 | 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
| 1266 | 23, 24, 25, 26, 0, 0, 0, 0, 0, 31, |
| 1267 | 32, 33, 34, 35, 36, 0, 0, 0, 40, 41, |
| 1268 | 0, 42, 43, 44, 0, 45, 46, 47, 48, 49, |
| 1269 | 50, 51, 52, 53, 54, 0, 55, 56, 57, 0, |
| 1270 | 0, 59, 8, 9, 10, 11, 0, 0, 0, 0, |
| 1271 | 0, 0, 0, 0, 0, 0, 0, 12, 13, 14, |
| 1272 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 1273 | 25, 26, 0, 0, 0, 0, 0, 31, 32, 33, |
| 1274 | 34, 35, 36, 0, 0, 0, 40, 41, 0, 42, |
| 1275 | 43, 44, 0, 45, 46, 47, 48, 49, 50, 51, |
| 1276 | 52, 53, 54, 0, 55, 56, 57, 0, 304, 59, |
| 1277 | 8, 9, 10, 11, 305, 0, 0, 0, 0, 0, |
| 1278 | 0, 0, 0, 0, 0, 12, 13, 14, 15, 16, |
| 1279 | 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, |
| 1280 | 0, 0, 0, 0, 0, 31, 32, 33, 34, 35, |
| 1281 | 36, 0, 0, 0, 40, 41, 0, 42, 43, 44, |
| 1282 | 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 1283 | 54, 0, 55, 56, 57, 0, 0, 59 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1284 | }; |
| 1285 | |
| 1286 | static const yytype_int16 yycheck[] = |
| 1287 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1288 | 0, 69, 89, 128, 105, 133, 202, 211, 127, 143, |
| 1289 | 0, 0, 109, 114, 331, 114, 76, 44, 92, 76, |
| 1290 | 357, 335, 105, 72, 104, 104, 9, 106, 111, 97, |
| 1291 | 127, 156, 133, 82, 113, 106, 9, 105, 243, 244, |
| 1292 | 245, 246, 356, 114, 87, 88, 114, 384, 176, 76, |
| 1293 | 114, 108, 186, 127, 114, 106, 124, 40, 41, 42, |
| 1294 | 377, 111, 113, 131, 114, 133, 383, 40, 41, 69, |
| 1295 | 43, 9, 72, 105, 175, 176, 175, 77, 51, 122, |
| 1296 | 123, 116, 82, 118, 105, 111, 211, 77, 77, 293, |
| 1297 | 111, 210, 105, 227, 85, 86, 68, 97, 111, 40, |
| 1298 | 41, 73, 40, 41, 42, 105, 231, 175, 176, 111, |
| 1299 | 105, 105, 114, 210, 114, 106, 111, 111, 118, 110, |
| 1300 | 76, 255, 105, 111, 124, 111, 114, 111, 114, 257, |
| 1301 | 114, 131, 266, 133, 83, 84, 340, 89, 90, 343, |
| 1302 | 336, 4, 5, 6, 79, 80, 109, 40, 41, 42, |
| 1303 | 119, 120, 121, 104, 76, 106, 257, 111, 112, 284, |
| 1304 | 285, 365, 239, 240, 127, 241, 242, 106, 293, 76, |
| 1305 | 289, 108, 247, 248, 108, 175, 176, 296, 141, 142, |
| 1306 | 108, 385, 114, 113, 76, 44, 104, 76, 105, 257, |
| 1307 | 104, 91, 289, 126, 125, 124, 159, 93, 107, 296, |
| 1308 | 104, 335, 202, 114, 94, 95, 96, 97, 98, 99, |
| 1309 | 100, 101, 102, 103, 113, 340, 114, 104, 343, 114, |
| 1310 | 104, 109, 356, 113, 106, 350, 107, 106, 347, 104, |
| 1311 | 108, 107, 56, 113, 335, 107, 370, 104, 111, 113, |
| 1312 | 365, 107, 113, 330, 104, 107, 76, 210, 382, 105, |
| 1313 | 347, 109, 107, 114, 105, 356, 17, 257, 228, 113, |
| 1314 | 385, 114, 114, 250, 249, 91, 98, 124, 5, 251, |
| 1315 | 216, 252, 272, 236, 237, 238, 239, 240, 241, 242, |
| 1316 | 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, |
| 1317 | 253, 254, 360, 253, 179, 254, 124, 383, 297, 332, |
| 1318 | 356, 272, 332, 77, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1319 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1320 | -1, -1, -1, -1, -1, -1, 289, -1, -1, -1, |
| 1321 | -1, 331, 332, 296, -1, 335, 336, -1, -1, -1, |
| 1322 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1323 | -1, -1, -1, -1, -1, -1, 356, -1, -1, -1, |
| 1324 | 360, -1, -1, 3, 4, 5, 6, 7, 8, 9, |
| 1325 | 10, 11, 12, 13, 14, 15, 16, 377, 18, 19, |
| 1326 | 20, 21, -1, 383, 347, 25, 26, 27, 28, 29, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1327 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
| 1328 | 40, 41, -1, 43, 44, 45, 46, 47, 48, 49, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1329 | 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1330 | -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
| 1331 | 70, -1, 72, 73, 74, 75, 76, 77, 78, 79, |
| 1332 | 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, |
| 1333 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1334 | -1, -1, -1, -1, 104, -1, -1, -1, 108, 109, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1335 | -1, -1, -1, -1, 114, 115, 116, 117, 118, 3, |
| 1336 | 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, |
| 1337 | 14, 15, 16, -1, 18, 19, 20, 21, -1, -1, |
| 1338 | -1, 25, 26, 27, 28, 29, 30, 31, 32, 33, |
| 1339 | 34, 35, 36, 37, 38, 39, 40, 41, -1, 43, |
| 1340 | 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 1341 | 54, 55, 56, 57, 58, 59, -1, 61, 62, 63, |
| 1342 | 64, 65, 66, 67, 68, 69, 70, -1, 72, 73, |
| 1343 | 74, 75, 76, 77, 78, 79, 80, 81, 82, -1, |
| 1344 | -1, 85, 86, -1, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1345 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1346 | 104, -1, -1, -1, 108, 109, -1, -1, -1, -1, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1347 | 114, 115, 116, 117, 118, 3, 4, 5, 6, 7, |
| 1348 | 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, |
| 1349 | 18, 19, 20, 21, -1, -1, -1, 25, 26, 27, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1350 | 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1351 | 38, 39, 40, 41, -1, 43, 44, 45, 46, 47, |
| 1352 | 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1353 | 58, 59, -1, 61, 62, 63, 64, 65, 66, 67, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1354 | 68, 69, 70, -1, 72, 73, 74, 75, 76, 77, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1355 | 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, |
| 1356 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1357 | -1, -1, -1, -1, -1, -1, 104, -1, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1358 | 108, -1, -1, -1, -1, -1, 114, 115, 116, 117, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1359 | 118, 3, 4, 5, 6, 7, 8, 9, 10, 11, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1360 | 12, 13, 14, 15, 16, -1, 18, 19, 20, 21, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1361 | -1, -1, -1, 25, 26, 27, 28, 29, 30, 31, |
| 1362 | 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, |
| 1363 | -1, 43, 44, 45, 46, 47, 48, 49, 50, 51, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1364 | 52, 53, 54, 55, 56, 57, 58, 59, -1, 61, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1365 | 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, |
| 1366 | 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, |
| 1367 | 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1368 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1369 | -1, -1, 104, -1, -1, -1, 108, -1, -1, -1, |
| 1370 | -1, -1, 114, 115, 116, 117, 118, 3, 4, 5, |
| 1371 | 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, |
| 1372 | 16, -1, 18, 19, 20, 21, -1, -1, -1, 25, |
| 1373 | 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, |
| 1374 | 36, 37, 38, 39, 40, 41, -1, 43, 44, 45, |
| 1375 | 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, |
| 1376 | 56, 57, 58, 59, -1, 61, 62, 63, 64, 65, |
| 1377 | 66, 67, 68, 69, 70, -1, 72, 73, 74, 75, |
| 1378 | 76, 77, 78, 79, 80, 81, 82, -1, -1, 85, |
| 1379 | 86, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1380 | -1, -1, -1, -1, -1, -1, -1, -1, 104, -1, |
| 1381 | -1, -1, -1, -1, -1, -1, -1, -1, 114, 115, |
| 1382 | 116, 117, 118, 3, 4, 5, 6, 7, 8, 9, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1383 | 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1384 | -1, -1, -1, -1, -1, 25, 26, 27, 28, 29, |
| 1385 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
| 1386 | 40, 41, -1, 43, 44, 45, 46, 47, 48, 49, |
| 1387 | 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, |
| 1388 | -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
| 1389 | 70, -1, 72, 73, 74, 75, 76, 77, 78, 79, |
| 1390 | 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, |
| 1391 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1392 | 3, 4, 5, 6, 104, 8, 9, 10, 11, 12, |
| 1393 | 13, -1, -1, -1, 114, 115, 116, 117, 118, -1, |
| 1394 | -1, -1, 25, 26, 27, 28, 29, 30, 31, 32, |
| 1395 | 33, 34, 35, 36, 37, 38, 39, 40, 41, -1, |
| 1396 | 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, |
| 1397 | 53, 54, 55, -1, 57, 58, 59, -1, 61, 62, |
| 1398 | 63, 64, 65, 66, 67, 68, 69, 70, -1, 72, |
| 1399 | 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, |
| 1400 | -1, -1, 85, 86, -1, -1, -1, -1, -1, -1, |
| 1401 | -1, -1, -1, -1, -1, -1, 4, 5, 6, -1, |
| 1402 | -1, 104, 10, 11, 12, 13, -1, -1, -1, -1, |
| 1403 | -1, -1, 115, 116, 117, 118, -1, 25, 26, 27, |
| 1404 | 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, |
| 1405 | 38, 39, -1, -1, -1, -1, -1, 45, 46, 47, |
| 1406 | 48, 49, 50, -1, -1, -1, 54, 55, -1, 57, |
| 1407 | 58, 59, -1, 61, 62, 63, 64, 65, 66, 67, |
| 1408 | 68, 69, 70, -1, 72, 73, 74, -1, 76, 77, |
| 1409 | -1, -1, 10, 11, 12, 13, -1, -1, -1, -1, |
| 1410 | -1, -1, -1, -1, -1, -1, -1, 25, 26, 27, |
| 1411 | 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, |
| 1412 | 38, 39, -1, -1, -1, -1, 114, 45, 46, 47, |
| 1413 | 48, 49, 50, -1, -1, -1, 54, 55, -1, 57, |
| 1414 | 58, 59, -1, 61, 62, 63, 64, 65, 66, 67, |
| 1415 | 68, 69, 70, -1, 72, 73, 74, -1, 76, 77, |
| 1416 | 78, 79, 80, 81, 82, -1, -1, 85, 86, -1, |
| 1417 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1418 | -1, -1, -1, -1, -1, -1, 104, -1, -1, 107, |
| 1419 | 10, 11, 12, 13, -1, -1, -1, 115, 116, 117, |
| 1420 | 118, -1, -1, -1, -1, 25, 26, 27, 28, 29, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1421 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
| 1422 | -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, |
| 1423 | 50, -1, -1, -1, 54, 55, -1, 57, 58, 59, |
| 1424 | -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
| 1425 | 70, -1, 72, 73, 74, -1, 76, 77, 78, 79, |
| 1426 | 80, 81, 82, -1, -1, 85, 86, -1, -1, -1, |
| 1427 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1428 | -1, -1, -1, -1, 104, 10, 11, 12, 13, -1, |
| 1429 | -1, -1, -1, -1, 114, 115, 116, 117, 118, -1, |
| 1430 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
| 1431 | 35, 36, 37, 38, 39, -1, -1, -1, -1, -1, |
| 1432 | 45, 46, 47, 48, 49, 50, -1, -1, -1, 54, |
| 1433 | 55, -1, 57, 58, 59, -1, 61, 62, 63, 64, |
| 1434 | 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, |
| 1435 | -1, 76, 77, 78, 79, 80, 81, 82, -1, -1, |
| 1436 | 85, 86, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1437 | -1, -1, -1, -1, -1, -1, -1, -1, -1, 104, |
| 1438 | -1, -1, 107, 10, 11, 12, 13, -1, -1, -1, |
| 1439 | 115, 116, 117, 118, -1, -1, -1, -1, 25, 26, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 1440 | 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1441 | 37, 38, 39, -1, -1, -1, -1, -1, 45, 46, |
| 1442 | 47, 48, 49, 50, -1, -1, -1, 54, 55, -1, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 1443 | 57, 58, 59, -1, 61, 62, 63, 64, 65, 66, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1444 | 67, 68, 69, 70, -1, 72, 73, 74, -1, 76, |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 1445 | 77, 78, 79, 80, 81, 82, -1, -1, 85, 86, |
| 1446 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1447 | -1, -1, -1, -1, -1, -1, -1, 104, 10, 11, |
| 1448 | 12, 13, -1, -1, -1, -1, -1, -1, 115, 116, |
| 1449 | 117, 118, -1, 25, 26, 27, 28, 29, 30, 31, |
| 1450 | 32, 33, 34, 35, 36, 37, 38, 39, -1, -1, |
| 1451 | -1, -1, -1, 45, 46, 47, 48, 49, 50, -1, |
| 1452 | -1, -1, 54, 55, -1, 57, 58, 59, -1, 61, |
| 1453 | 62, 63, 64, 65, 66, 67, 68, 69, 70, -1, |
| 1454 | 72, 73, 74, -1, 76, 77, 78, 79, 80, 81, |
| 1455 | 82, -1, -1, 85, 86, -1, -1, -1, -1, -1, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1456 | -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, |
| 1457 | 5, 6, 104, 8, 9, 10, 11, 12, 13, -1, |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 1458 | -1, -1, -1, 115, 116, 117, 118, -1, -1, -1, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1459 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
| 1460 | 35, 36, 37, 38, 39, 40, 41, -1, 43, 44, |
| 1461 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 1462 | 55, -1, 57, 58, 59, -1, 61, 62, 63, 64, |
| 1463 | 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, |
| 1464 | 75, -1, 77, -1, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1465 | -1, -1, -1, 3, 4, 5, 6, -1, 8, 9, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1466 | 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, |
| 1467 | -1, -1, -1, -1, 109, 25, 26, 27, 28, 29, |
| 1468 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
| 1469 | 40, 41, -1, 43, 44, 45, 46, 47, 48, 49, |
| 1470 | 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, |
| 1471 | -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1472 | 70, -1, 72, 73, 74, 75, -1, 77, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1473 | -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, |
| 1474 | 5, 6, -1, 8, 9, 10, 11, 12, 13, -1, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1475 | -1, -1, -1, -1, -1, -1, -1, -1, -1, 109, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1476 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
| 1477 | 35, 36, 37, 38, 39, 40, 41, -1, 43, 44, |
| 1478 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 1479 | 55, -1, 57, 58, 59, -1, 61, 62, 63, 64, |
| 1480 | 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1481 | 75, -1, 77, -1, -1, -1, -1, -1, -1, -1, |
| 1482 | 0, -1, -1, 3, 4, 5, 6, 7, 8, 9, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1483 | 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1484 | -1, -1, -1, -1, 109, 25, 26, 27, 28, 29, |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 1485 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
| 1486 | 40, 41, -1, 43, 44, 45, 46, 47, 48, 49, |
| 1487 | 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, |
| 1488 | -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1489 | 70, -1, 72, 73, 74, 75, -1, 77, 3, 4, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1490 | 5, 6, 7, 8, 9, 10, 11, 12, 13, -1, |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 1491 | -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, |
| 1492 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
| 1493 | 35, 36, 37, 38, 39, 40, 41, -1, 43, 44, |
| 1494 | 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, |
| 1495 | 55, -1, 57, 58, 59, -1, 61, 62, 63, 64, |
| 1496 | 65, 66, 67, 68, 69, 70, -1, 72, 73, 74, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1497 | 75, -1, 77, 3, 4, 5, 6, -1, 8, 9, |
| 1498 | 10, 11, 12, 13, -1, -1, -1, -1, -1, -1, |
| 1499 | -1, -1, -1, -1, -1, 25, 26, 27, 28, 29, |
| 1500 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
| 1501 | 40, 41, -1, 43, 44, 45, 46, 47, 48, 49, |
| 1502 | 50, 51, 52, 53, 54, 55, -1, 57, 58, 59, |
| 1503 | -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
| 1504 | 70, -1, 72, 73, 74, 75, -1, 77, 4, 5, |
| 1505 | 6, -1, -1, -1, 10, 11, 12, 13, -1, -1, |
| 1506 | -1, -1, -1, -1, -1, -1, -1, -1, -1, 25, |
| 1507 | 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, |
| 1508 | 36, 37, 38, 39, -1, -1, -1, -1, -1, 45, |
| 1509 | 46, 47, 48, 49, 50, -1, -1, -1, 54, 55, |
| 1510 | -1, 57, 58, 59, -1, 61, 62, 63, 64, 65, |
| 1511 | 66, 67, 68, 69, 70, -1, 72, 73, 74, -1, |
| 1512 | -1, 77, 10, 11, 12, 13, -1, -1, -1, -1, |
| 1513 | -1, -1, -1, -1, -1, -1, -1, 25, 26, 27, |
| 1514 | 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, |
| 1515 | 38, 39, -1, -1, -1, -1, -1, 45, 46, 47, |
| 1516 | 48, 49, 50, -1, -1, -1, 54, 55, -1, 57, |
| 1517 | 58, 59, -1, 61, 62, 63, 64, 65, 66, 67, |
| 1518 | 68, 69, 70, -1, 72, 73, 74, -1, 76, 77, |
| 1519 | 10, 11, 12, 13, 82, -1, -1, -1, -1, -1, |
| 1520 | -1, -1, -1, -1, -1, 25, 26, 27, 28, 29, |
| 1521 | 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, |
| 1522 | -1, -1, -1, -1, -1, 45, 46, 47, 48, 49, |
| 1523 | 50, -1, -1, -1, 54, 55, -1, 57, 58, 59, |
| 1524 | -1, 61, 62, 63, 64, 65, 66, 67, 68, 69, |
| 1525 | 70, -1, 72, 73, 74, -1, -1, 77 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1526 | }; |
| 1527 | |
| 1528 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
| 1529 | symbol of state STATE-NUM. */ |
| 1530 | static const yytype_uint8 yystos[] = |
| 1531 | { |
| 1532 | 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, |
Nicolas Capens | 3c20f80 | 2015-02-17 17:17:20 -0500 | [diff] [blame] | 1533 | 12, 13, 25, 26, 27, 28, 29, 30, 31, 32, |
Nicolas Capens | e4b1b1d | 2015-02-17 17:26:01 -0500 | [diff] [blame] | 1534 | 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 1535 | 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, |
| 1536 | 54, 55, 57, 58, 59, 61, 62, 63, 64, 65, |
| 1537 | 66, 67, 68, 69, 70, 72, 73, 74, 75, 77, |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 1538 | 159, 160, 161, 162, 163, 168, 169, 170, 171, 173, |
| 1539 | 174, 175, 176, 177, 180, 181, 182, 214, 215, 216, |
| 1540 | 44, 76, 176, 40, 41, 76, 108, 104, 114, 217, |
| 1541 | 105, 111, 9, 40, 41, 42, 165, 166, 172, 111, |
| 1542 | 114, 76, 174, 76, 114, 158, 175, 180, 174, 106, |
| 1543 | 0, 215, 180, 108, 184, 76, 178, 179, 108, 200, |
| 1544 | 165, 164, 167, 175, 166, 76, 104, 106, 113, 108, |
| 1545 | 3, 173, 175, 185, 186, 76, 78, 79, 80, 81, |
| 1546 | 82, 85, 86, 104, 115, 116, 117, 118, 129, 130, |
| 1547 | 131, 133, 134, 135, 136, 137, 138, 139, 140, 141, |
| 1548 | 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, |
| 1549 | 152, 153, 157, 181, 114, 183, 185, 113, 105, 111, |
| 1550 | 14, 15, 16, 18, 19, 20, 21, 56, 108, 109, |
| 1551 | 114, 140, 153, 154, 156, 159, 160, 181, 190, 191, |
| 1552 | 192, 193, 201, 202, 203, 206, 213, 76, 164, 167, |
| 1553 | 106, 113, 107, 157, 154, 189, 175, 76, 187, 188, |
| 1554 | 109, 186, 140, 140, 156, 85, 86, 106, 110, 105, |
| 1555 | 105, 111, 55, 154, 104, 140, 119, 120, 121, 116, |
| 1556 | 118, 83, 84, 87, 88, 122, 123, 89, 90, 126, |
| 1557 | 125, 124, 91, 93, 92, 127, 107, 185, 109, 79, |
| 1558 | 80, 179, 114, 114, 208, 104, 104, 114, 114, 156, |
| 1559 | 104, 109, 194, 94, 95, 96, 97, 98, 99, 100, |
| 1560 | 101, 102, 103, 113, 155, 111, 114, 109, 191, 106, |
| 1561 | 107, 157, 189, 113, 107, 187, 106, 111, 114, 76, |
| 1562 | 114, 105, 132, 156, 76, 82, 135, 154, 140, 140, |
| 1563 | 140, 142, 142, 143, 143, 144, 144, 144, 144, 145, |
| 1564 | 145, 146, 147, 148, 149, 150, 151, 156, 109, 197, |
| 1565 | 198, 199, 209, 156, 114, 207, 201, 154, 154, 157, |
| 1566 | 113, 107, 189, 113, 114, 157, 188, 106, 114, 107, |
| 1567 | 112, 56, 200, 192, 190, 202, 210, 105, 156, 170, |
| 1568 | 173, 205, 195, 107, 189, 113, 189, 107, 157, 154, |
| 1569 | 104, 205, 211, 212, 197, 204, 76, 105, 109, 189, |
| 1570 | 107, 156, 114, 105, 17, 113, 192, 196, 200, 114, |
| 1571 | 105, 156, 196, 197, 189, 114 |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1572 | }; |
| 1573 | |
| 1574 | #define yyerrok (yyerrstatus = 0) |
| 1575 | #define yyclearin (yychar = YYEMPTY) |
| 1576 | #define YYEMPTY (-2) |
| 1577 | #define YYEOF 0 |
| 1578 | |
| 1579 | #define YYACCEPT goto yyacceptlab |
| 1580 | #define YYABORT goto yyabortlab |
| 1581 | #define YYERROR goto yyerrorlab |
| 1582 | |
| 1583 | |
| 1584 | /* Like YYERROR except do call yyerror. This remains here temporarily |
| 1585 | to ease the transition to the new meaning of YYERROR, for GCC. |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 1586 | Once GCC version 2 has supplanted version 1, this can go. */ |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1587 | |
| 1588 | #define YYFAIL goto yyerrlab |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1589 | |
| 1590 | #define YYRECOVERING() (!!yyerrstatus) |
| 1591 | |
| 1592 | #define YYBACKUP(Token, Value) \ |
| 1593 | do \ |
| 1594 | if (yychar == YYEMPTY && yylen == 1) \ |
| 1595 | { \ |
| 1596 | yychar = (Token); \ |
| 1597 | yylval = (Value); \ |
| 1598 | yytoken = YYTRANSLATE (yychar); \ |
| 1599 | YYPOPSTACK (1); \ |
| 1600 | goto yybackup; \ |
| 1601 | } \ |
| 1602 | else \ |
| 1603 | { \ |
| 1604 | yyerror (context, YY_("syntax error: cannot back up")); \ |
| 1605 | YYERROR; \ |
| 1606 | } \ |
| 1607 | while (YYID (0)) |
| 1608 | |
| 1609 | |
| 1610 | #define YYTERROR 1 |
| 1611 | #define YYERRCODE 256 |
| 1612 | |
| 1613 | |
| 1614 | /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. |
| 1615 | If N is 0, then set CURRENT to the empty location which ends |
| 1616 | the previous symbol: RHS[0] (always defined). */ |
| 1617 | |
| 1618 | #define YYRHSLOC(Rhs, K) ((Rhs)[K]) |
| 1619 | #ifndef YYLLOC_DEFAULT |
| 1620 | # define YYLLOC_DEFAULT(Current, Rhs, N) \ |
| 1621 | do \ |
| 1622 | if (YYID (N)) \ |
| 1623 | { \ |
| 1624 | (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ |
| 1625 | (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ |
| 1626 | (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ |
| 1627 | (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ |
| 1628 | } \ |
| 1629 | else \ |
| 1630 | { \ |
| 1631 | (Current).first_line = (Current).last_line = \ |
| 1632 | YYRHSLOC (Rhs, 0).last_line; \ |
| 1633 | (Current).first_column = (Current).last_column = \ |
| 1634 | YYRHSLOC (Rhs, 0).last_column; \ |
| 1635 | } \ |
| 1636 | while (YYID (0)) |
| 1637 | #endif |
| 1638 | |
| 1639 | |
| 1640 | /* YY_LOCATION_PRINT -- Print the location on the stream. |
| 1641 | This macro was not mandated originally: define only if we know |
| 1642 | we won't break user code: when these are the locations we know. */ |
| 1643 | |
| 1644 | #ifndef YY_LOCATION_PRINT |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 1645 | # if YYLTYPE_IS_TRIVIAL |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 1646 | # define YY_LOCATION_PRINT(File, Loc) \ |
| 1647 | fprintf (File, "%d.%d-%d.%d", \ |
| 1648 | (Loc).first_line, (Loc).first_column, \ |
| 1649 | (Loc).last_line, (Loc).last_column) |
| 1650 | # else |
| 1651 | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
| 1652 | # endif |
| 1653 | #endif |
| 1654 | |
| 1655 | |
| 1656 | /* YYLEX -- calling `yylex' with the right arguments. */ |
| 1657 | |
| 1658 | #ifdef YYLEX_PARAM |
| 1659 | # define YYLEX yylex (&yylval, YYLEX_PARAM) |
| 1660 | #else |
| 1661 | # define YYLEX yylex (&yylval) |
| 1662 | #endif |
| 1663 | |
| 1664 | /* Enable debugging if requested. */ |
| 1665 | #if YYDEBUG |
| 1666 | |
| 1667 | # ifndef YYFPRINTF |
| 1668 | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
| 1669 | # define YYFPRINTF fprintf |
| 1670 | # endif |
| 1671 | |
| 1672 | # define YYDPRINTF(Args) \ |
| 1673 | do { \ |
| 1674 | if (yydebug) \ |
| 1675 | YYFPRINTF Args; \ |
| 1676 | } while (YYID (0)) |
| 1677 | |
| 1678 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
| 1679 | do { \ |
| 1680 | if (yydebug) \ |
| 1681 | { \ |
| 1682 | YYFPRINTF (stderr, "%s ", Title); \ |
| 1683 | yy_symbol_print (stderr, \ |
| 1684 | Type, Value, context); \ |
| 1685 | YYFPRINTF (stderr, "\n"); \ |
| 1686 | } \ |
| 1687 | } while (YYID (0)) |
| 1688 | |
| 1689 | |
| 1690 | /*--------------------------------. |
| 1691 | | Print this symbol on YYOUTPUT. | |
| 1692 | `--------------------------------*/ |
| 1693 | |
| 1694 | /*ARGSUSED*/ |
| 1695 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1696 | || defined __cplusplus || defined _MSC_VER) |
| 1697 | static void |
| 1698 | yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context) |
| 1699 | #else |
| 1700 | static void |
| 1701 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, context) |
| 1702 | FILE *yyoutput; |
| 1703 | int yytype; |
| 1704 | YYSTYPE const * const yyvaluep; |
| 1705 | TParseContext* context; |
| 1706 | #endif |
| 1707 | { |
| 1708 | if (!yyvaluep) |
| 1709 | return; |
| 1710 | YYUSE (context); |
| 1711 | # ifdef YYPRINT |
| 1712 | if (yytype < YYNTOKENS) |
| 1713 | YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); |
| 1714 | # else |
| 1715 | YYUSE (yyoutput); |
| 1716 | # endif |
| 1717 | switch (yytype) |
| 1718 | { |
| 1719 | default: |
| 1720 | break; |
| 1721 | } |
| 1722 | } |
| 1723 | |
| 1724 | |
| 1725 | /*--------------------------------. |
| 1726 | | Print this symbol on YYOUTPUT. | |
| 1727 | `--------------------------------*/ |
| 1728 | |
| 1729 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1730 | || defined __cplusplus || defined _MSC_VER) |
| 1731 | static void |
| 1732 | yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context) |
| 1733 | #else |
| 1734 | static void |
| 1735 | yy_symbol_print (yyoutput, yytype, yyvaluep, context) |
| 1736 | FILE *yyoutput; |
| 1737 | int yytype; |
| 1738 | YYSTYPE const * const yyvaluep; |
| 1739 | TParseContext* context; |
| 1740 | #endif |
| 1741 | { |
| 1742 | if (yytype < YYNTOKENS) |
| 1743 | YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); |
| 1744 | else |
| 1745 | YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); |
| 1746 | |
| 1747 | yy_symbol_value_print (yyoutput, yytype, yyvaluep, context); |
| 1748 | YYFPRINTF (yyoutput, ")"); |
| 1749 | } |
| 1750 | |
| 1751 | /*------------------------------------------------------------------. |
| 1752 | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
| 1753 | | TOP (included). | |
| 1754 | `------------------------------------------------------------------*/ |
| 1755 | |
| 1756 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1757 | || defined __cplusplus || defined _MSC_VER) |
| 1758 | static void |
| 1759 | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
| 1760 | #else |
| 1761 | static void |
| 1762 | yy_stack_print (yybottom, yytop) |
| 1763 | yytype_int16 *yybottom; |
| 1764 | yytype_int16 *yytop; |
| 1765 | #endif |
| 1766 | { |
| 1767 | YYFPRINTF (stderr, "Stack now"); |
| 1768 | for (; yybottom <= yytop; yybottom++) |
| 1769 | { |
| 1770 | int yybot = *yybottom; |
| 1771 | YYFPRINTF (stderr, " %d", yybot); |
| 1772 | } |
| 1773 | YYFPRINTF (stderr, "\n"); |
| 1774 | } |
| 1775 | |
| 1776 | # define YY_STACK_PRINT(Bottom, Top) \ |
| 1777 | do { \ |
| 1778 | if (yydebug) \ |
| 1779 | yy_stack_print ((Bottom), (Top)); \ |
| 1780 | } while (YYID (0)) |
| 1781 | |
| 1782 | |
| 1783 | /*------------------------------------------------. |
| 1784 | | Report that the YYRULE is going to be reduced. | |
| 1785 | `------------------------------------------------*/ |
| 1786 | |
| 1787 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1788 | || defined __cplusplus || defined _MSC_VER) |
| 1789 | static void |
| 1790 | yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context) |
| 1791 | #else |
| 1792 | static void |
| 1793 | yy_reduce_print (yyvsp, yyrule, context) |
| 1794 | YYSTYPE *yyvsp; |
| 1795 | int yyrule; |
| 1796 | TParseContext* context; |
| 1797 | #endif |
| 1798 | { |
| 1799 | int yynrhs = yyr2[yyrule]; |
| 1800 | int yyi; |
| 1801 | unsigned long int yylno = yyrline[yyrule]; |
| 1802 | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
| 1803 | yyrule - 1, yylno); |
| 1804 | /* The symbols being reduced. */ |
| 1805 | for (yyi = 0; yyi < yynrhs; yyi++) |
| 1806 | { |
| 1807 | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
| 1808 | yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], |
| 1809 | &(yyvsp[(yyi + 1) - (yynrhs)]) |
| 1810 | , context); |
| 1811 | YYFPRINTF (stderr, "\n"); |
| 1812 | } |
| 1813 | } |
| 1814 | |
| 1815 | # define YY_REDUCE_PRINT(Rule) \ |
| 1816 | do { \ |
| 1817 | if (yydebug) \ |
| 1818 | yy_reduce_print (yyvsp, Rule, context); \ |
| 1819 | } while (YYID (0)) |
| 1820 | |
| 1821 | /* Nonzero means print parse trace. It is left uninitialized so that |
| 1822 | multiple parsers can coexist. */ |
| 1823 | int yydebug; |
| 1824 | #else /* !YYDEBUG */ |
| 1825 | # define YYDPRINTF(Args) |
| 1826 | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
| 1827 | # define YY_STACK_PRINT(Bottom, Top) |
| 1828 | # define YY_REDUCE_PRINT(Rule) |
| 1829 | #endif /* !YYDEBUG */ |
| 1830 | |
| 1831 | |
| 1832 | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
| 1833 | #ifndef YYINITDEPTH |
| 1834 | # define YYINITDEPTH 200 |
| 1835 | #endif |
| 1836 | |
| 1837 | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
| 1838 | if the built-in stack extension method is used). |
| 1839 | |
| 1840 | Do not make this value too large; the results are undefined if |
| 1841 | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
| 1842 | evaluated with infinite-precision integer arithmetic. */ |
| 1843 | |
| 1844 | #ifndef YYMAXDEPTH |
| 1845 | # define YYMAXDEPTH 10000 |
| 1846 | #endif |
| 1847 | |
| 1848 | |
| 1849 | |
| 1850 | #if YYERROR_VERBOSE |
| 1851 | |
| 1852 | # ifndef yystrlen |
| 1853 | # if defined __GLIBC__ && defined _STRING_H |
| 1854 | # define yystrlen strlen |
| 1855 | # else |
| 1856 | /* Return the length of YYSTR. */ |
| 1857 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1858 | || defined __cplusplus || defined _MSC_VER) |
| 1859 | static YYSIZE_T |
| 1860 | yystrlen (const char *yystr) |
| 1861 | #else |
| 1862 | static YYSIZE_T |
| 1863 | yystrlen (yystr) |
| 1864 | const char *yystr; |
| 1865 | #endif |
| 1866 | { |
| 1867 | YYSIZE_T yylen; |
| 1868 | for (yylen = 0; yystr[yylen]; yylen++) |
| 1869 | continue; |
| 1870 | return yylen; |
| 1871 | } |
| 1872 | # endif |
| 1873 | # endif |
| 1874 | |
| 1875 | # ifndef yystpcpy |
| 1876 | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
| 1877 | # define yystpcpy stpcpy |
| 1878 | # else |
| 1879 | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
| 1880 | YYDEST. */ |
| 1881 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 1882 | || defined __cplusplus || defined _MSC_VER) |
| 1883 | static char * |
| 1884 | yystpcpy (char *yydest, const char *yysrc) |
| 1885 | #else |
| 1886 | static char * |
| 1887 | yystpcpy (yydest, yysrc) |
| 1888 | char *yydest; |
| 1889 | const char *yysrc; |
| 1890 | #endif |
| 1891 | { |
| 1892 | char *yyd = yydest; |
| 1893 | const char *yys = yysrc; |
| 1894 | |
| 1895 | while ((*yyd++ = *yys++) != '\0') |
| 1896 | continue; |
| 1897 | |
| 1898 | return yyd - 1; |
| 1899 | } |
| 1900 | # endif |
| 1901 | # endif |
| 1902 | |
| 1903 | # ifndef yytnamerr |
| 1904 | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
| 1905 | quotes and backslashes, so that it's suitable for yyerror. The |
| 1906 | heuristic is that double-quoting is unnecessary unless the string |
| 1907 | contains an apostrophe, a comma, or backslash (other than |
| 1908 | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
| 1909 | null, do not copy; instead, return the length of what the result |
| 1910 | would have been. */ |
| 1911 | static YYSIZE_T |
| 1912 | yytnamerr (char *yyres, const char *yystr) |
| 1913 | { |
| 1914 | if (*yystr == '"') |
| 1915 | { |
| 1916 | YYSIZE_T yyn = 0; |
| 1917 | char const *yyp = yystr; |
| 1918 | |
| 1919 | for (;;) |
| 1920 | switch (*++yyp) |
| 1921 | { |
| 1922 | case '\'': |
| 1923 | case ',': |
| 1924 | goto do_not_strip_quotes; |
| 1925 | |
| 1926 | case '\\': |
| 1927 | if (*++yyp != '\\') |
| 1928 | goto do_not_strip_quotes; |
| 1929 | /* Fall through. */ |
| 1930 | default: |
| 1931 | if (yyres) |
| 1932 | yyres[yyn] = *yyp; |
| 1933 | yyn++; |
| 1934 | break; |
| 1935 | |
| 1936 | case '"': |
| 1937 | if (yyres) |
| 1938 | yyres[yyn] = '\0'; |
| 1939 | return yyn; |
| 1940 | } |
| 1941 | do_not_strip_quotes: ; |
| 1942 | } |
| 1943 | |
| 1944 | if (! yyres) |
| 1945 | return yystrlen (yystr); |
| 1946 | |
| 1947 | return yystpcpy (yyres, yystr) - yyres; |
| 1948 | } |
| 1949 | # endif |
| 1950 | |
| 1951 | /* Copy into YYRESULT an error message about the unexpected token |
| 1952 | YYCHAR while in state YYSTATE. Return the number of bytes copied, |
| 1953 | including the terminating null byte. If YYRESULT is null, do not |
| 1954 | copy anything; just return the number of bytes that would be |
| 1955 | copied. As a special case, return 0 if an ordinary "syntax error" |
| 1956 | message will do. Return YYSIZE_MAXIMUM if overflow occurs during |
| 1957 | size calculation. */ |
| 1958 | static YYSIZE_T |
| 1959 | yysyntax_error (char *yyresult, int yystate, int yychar) |
| 1960 | { |
| 1961 | int yyn = yypact[yystate]; |
| 1962 | |
| 1963 | if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) |
| 1964 | return 0; |
| 1965 | else |
| 1966 | { |
| 1967 | int yytype = YYTRANSLATE (yychar); |
| 1968 | YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); |
| 1969 | YYSIZE_T yysize = yysize0; |
| 1970 | YYSIZE_T yysize1; |
| 1971 | int yysize_overflow = 0; |
| 1972 | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
| 1973 | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
| 1974 | int yyx; |
| 1975 | |
| 1976 | # if 0 |
| 1977 | /* This is so xgettext sees the translatable formats that are |
| 1978 | constructed on the fly. */ |
| 1979 | YY_("syntax error, unexpected %s"); |
| 1980 | YY_("syntax error, unexpected %s, expecting %s"); |
| 1981 | YY_("syntax error, unexpected %s, expecting %s or %s"); |
| 1982 | YY_("syntax error, unexpected %s, expecting %s or %s or %s"); |
| 1983 | YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); |
| 1984 | # endif |
| 1985 | char *yyfmt; |
| 1986 | char const *yyf; |
| 1987 | static char const yyunexpected[] = "syntax error, unexpected %s"; |
| 1988 | static char const yyexpecting[] = ", expecting %s"; |
| 1989 | static char const yyor[] = " or %s"; |
| 1990 | char yyformat[sizeof yyunexpected |
| 1991 | + sizeof yyexpecting - 1 |
| 1992 | + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) |
| 1993 | * (sizeof yyor - 1))]; |
| 1994 | char const *yyprefix = yyexpecting; |
| 1995 | |
| 1996 | /* Start YYX at -YYN if negative to avoid negative indexes in |
| 1997 | YYCHECK. */ |
| 1998 | int yyxbegin = yyn < 0 ? -yyn : 0; |
| 1999 | |
| 2000 | /* Stay within bounds of both yycheck and yytname. */ |
| 2001 | int yychecklim = YYLAST - yyn + 1; |
| 2002 | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
| 2003 | int yycount = 1; |
| 2004 | |
| 2005 | yyarg[0] = yytname[yytype]; |
| 2006 | yyfmt = yystpcpy (yyformat, yyunexpected); |
| 2007 | |
| 2008 | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
| 2009 | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) |
| 2010 | { |
| 2011 | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
| 2012 | { |
| 2013 | yycount = 1; |
| 2014 | yysize = yysize0; |
| 2015 | yyformat[sizeof yyunexpected - 1] = '\0'; |
| 2016 | break; |
| 2017 | } |
| 2018 | yyarg[yycount++] = yytname[yyx]; |
| 2019 | yysize1 = yysize + yytnamerr (0, yytname[yyx]); |
| 2020 | yysize_overflow |= (yysize1 < yysize); |
| 2021 | yysize = yysize1; |
| 2022 | yyfmt = yystpcpy (yyfmt, yyprefix); |
| 2023 | yyprefix = yyor; |
| 2024 | } |
| 2025 | |
| 2026 | yyf = YY_(yyformat); |
| 2027 | yysize1 = yysize + yystrlen (yyf); |
| 2028 | yysize_overflow |= (yysize1 < yysize); |
| 2029 | yysize = yysize1; |
| 2030 | |
| 2031 | if (yysize_overflow) |
| 2032 | return YYSIZE_MAXIMUM; |
| 2033 | |
| 2034 | if (yyresult) |
| 2035 | { |
| 2036 | /* Avoid sprintf, as that infringes on the user's name space. |
| 2037 | Don't have undefined behavior even if the translation |
| 2038 | produced a string with the wrong number of "%s"s. */ |
| 2039 | char *yyp = yyresult; |
| 2040 | int yyi = 0; |
| 2041 | while ((*yyp = *yyf) != '\0') |
| 2042 | { |
| 2043 | if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) |
| 2044 | { |
| 2045 | yyp += yytnamerr (yyp, yyarg[yyi++]); |
| 2046 | yyf += 2; |
| 2047 | } |
| 2048 | else |
| 2049 | { |
| 2050 | yyp++; |
| 2051 | yyf++; |
| 2052 | } |
| 2053 | } |
| 2054 | } |
| 2055 | return yysize; |
| 2056 | } |
| 2057 | } |
| 2058 | #endif /* YYERROR_VERBOSE */ |
| 2059 | |
| 2060 | |
| 2061 | /*-----------------------------------------------. |
| 2062 | | Release the memory associated to this symbol. | |
| 2063 | `-----------------------------------------------*/ |
| 2064 | |
| 2065 | /*ARGSUSED*/ |
| 2066 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 2067 | || defined __cplusplus || defined _MSC_VER) |
| 2068 | static void |
| 2069 | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context) |
| 2070 | #else |
| 2071 | static void |
| 2072 | yydestruct (yymsg, yytype, yyvaluep, context) |
| 2073 | const char *yymsg; |
| 2074 | int yytype; |
| 2075 | YYSTYPE *yyvaluep; |
| 2076 | TParseContext* context; |
| 2077 | #endif |
| 2078 | { |
| 2079 | YYUSE (yyvaluep); |
| 2080 | YYUSE (context); |
| 2081 | |
| 2082 | if (!yymsg) |
| 2083 | yymsg = "Deleting"; |
| 2084 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
| 2085 | |
| 2086 | switch (yytype) |
| 2087 | { |
| 2088 | |
| 2089 | default: |
| 2090 | break; |
| 2091 | } |
| 2092 | } |
| 2093 | |
| 2094 | /* Prevent warnings from -Wmissing-prototypes. */ |
| 2095 | #ifdef YYPARSE_PARAM |
| 2096 | #if defined __STDC__ || defined __cplusplus |
| 2097 | int yyparse (void *YYPARSE_PARAM); |
| 2098 | #else |
| 2099 | int yyparse (); |
| 2100 | #endif |
| 2101 | #else /* ! YYPARSE_PARAM */ |
| 2102 | #if defined __STDC__ || defined __cplusplus |
| 2103 | int yyparse (TParseContext* context); |
| 2104 | #else |
| 2105 | int yyparse (); |
| 2106 | #endif |
| 2107 | #endif /* ! YYPARSE_PARAM */ |
| 2108 | |
| 2109 | |
| 2110 | |
| 2111 | |
| 2112 | |
| 2113 | /*-------------------------. |
| 2114 | | yyparse or yypush_parse. | |
| 2115 | `-------------------------*/ |
| 2116 | |
| 2117 | #ifdef YYPARSE_PARAM |
| 2118 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 2119 | || defined __cplusplus || defined _MSC_VER) |
| 2120 | int |
| 2121 | yyparse (void *YYPARSE_PARAM) |
| 2122 | #else |
| 2123 | int |
| 2124 | yyparse (YYPARSE_PARAM) |
| 2125 | void *YYPARSE_PARAM; |
| 2126 | #endif |
| 2127 | #else /* ! YYPARSE_PARAM */ |
| 2128 | #if (defined __STDC__ || defined __C99__FUNC__ \ |
| 2129 | || defined __cplusplus || defined _MSC_VER) |
| 2130 | int |
| 2131 | yyparse (TParseContext* context) |
| 2132 | #else |
| 2133 | int |
| 2134 | yyparse (context) |
| 2135 | TParseContext* context; |
| 2136 | #endif |
| 2137 | #endif |
| 2138 | { |
| 2139 | /* The lookahead symbol. */ |
| 2140 | int yychar; |
| 2141 | |
| 2142 | /* The semantic value of the lookahead symbol. */ |
| 2143 | YYSTYPE yylval; |
| 2144 | |
| 2145 | /* Number of syntax errors so far. */ |
| 2146 | int yynerrs; |
| 2147 | |
| 2148 | int yystate; |
| 2149 | /* Number of tokens to shift before error messages enabled. */ |
| 2150 | int yyerrstatus; |
| 2151 | |
| 2152 | /* The stacks and their tools: |
| 2153 | `yyss': related to states. |
| 2154 | `yyvs': related to semantic values. |
| 2155 | |
| 2156 | Refer to the stacks thru separate pointers, to allow yyoverflow |
| 2157 | to reallocate them elsewhere. */ |
| 2158 | |
| 2159 | /* The state stack. */ |
| 2160 | yytype_int16 yyssa[YYINITDEPTH]; |
| 2161 | yytype_int16 *yyss; |
| 2162 | yytype_int16 *yyssp; |
| 2163 | |
| 2164 | /* The semantic value stack. */ |
| 2165 | YYSTYPE yyvsa[YYINITDEPTH]; |
| 2166 | YYSTYPE *yyvs; |
| 2167 | YYSTYPE *yyvsp; |
| 2168 | |
| 2169 | YYSIZE_T yystacksize; |
| 2170 | |
| 2171 | int yyn; |
| 2172 | int yyresult; |
| 2173 | /* Lookahead token as an internal (translated) token number. */ |
| 2174 | int yytoken; |
| 2175 | /* The variables used to return semantic value and location from the |
| 2176 | action routines. */ |
| 2177 | YYSTYPE yyval; |
| 2178 | |
| 2179 | #if YYERROR_VERBOSE |
| 2180 | /* Buffer for error messages, and its allocated size. */ |
| 2181 | char yymsgbuf[128]; |
| 2182 | char *yymsg = yymsgbuf; |
| 2183 | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
| 2184 | #endif |
| 2185 | |
| 2186 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
| 2187 | |
| 2188 | /* The number of symbols on the RHS of the reduced rule. |
| 2189 | Keep to zero when no symbol should be popped. */ |
| 2190 | int yylen = 0; |
| 2191 | |
| 2192 | yytoken = 0; |
| 2193 | yyss = yyssa; |
| 2194 | yyvs = yyvsa; |
| 2195 | yystacksize = YYINITDEPTH; |
| 2196 | |
| 2197 | YYDPRINTF ((stderr, "Starting parse\n")); |
| 2198 | |
| 2199 | yystate = 0; |
| 2200 | yyerrstatus = 0; |
| 2201 | yynerrs = 0; |
| 2202 | yychar = YYEMPTY; /* Cause a token to be read. */ |
| 2203 | |
| 2204 | /* Initialize stack pointers. |
| 2205 | Waste one element of value and location stack |
| 2206 | so that they stay on the same level as the state stack. |
| 2207 | The wasted elements are never initialized. */ |
| 2208 | yyssp = yyss; |
| 2209 | yyvsp = yyvs; |
| 2210 | |
| 2211 | goto yysetstate; |
| 2212 | |
| 2213 | /*------------------------------------------------------------. |
| 2214 | | yynewstate -- Push a new state, which is found in yystate. | |
| 2215 | `------------------------------------------------------------*/ |
| 2216 | yynewstate: |
| 2217 | /* In all cases, when you get here, the value and location stacks |
| 2218 | have just been pushed. So pushing a state here evens the stacks. */ |
| 2219 | yyssp++; |
| 2220 | |
| 2221 | yysetstate: |
| 2222 | *yyssp = yystate; |
| 2223 | |
| 2224 | if (yyss + yystacksize - 1 <= yyssp) |
| 2225 | { |
| 2226 | /* Get the current used size of the three stacks, in elements. */ |
| 2227 | YYSIZE_T yysize = yyssp - yyss + 1; |
| 2228 | |
| 2229 | #ifdef yyoverflow |
| 2230 | { |
| 2231 | /* Give user a chance to reallocate the stack. Use copies of |
| 2232 | these so that the &'s don't force the real ones into |
| 2233 | memory. */ |
| 2234 | YYSTYPE *yyvs1 = yyvs; |
| 2235 | yytype_int16 *yyss1 = yyss; |
| 2236 | |
| 2237 | /* Each stack pointer address is followed by the size of the |
| 2238 | data in use in that stack, in bytes. This used to be a |
| 2239 | conditional around just the two extra args, but that might |
| 2240 | be undefined if yyoverflow is a macro. */ |
| 2241 | yyoverflow (YY_("memory exhausted"), |
| 2242 | &yyss1, yysize * sizeof (*yyssp), |
| 2243 | &yyvs1, yysize * sizeof (*yyvsp), |
| 2244 | &yystacksize); |
| 2245 | |
| 2246 | yyss = yyss1; |
| 2247 | yyvs = yyvs1; |
| 2248 | } |
| 2249 | #else /* no yyoverflow */ |
| 2250 | # ifndef YYSTACK_RELOCATE |
| 2251 | goto yyexhaustedlab; |
| 2252 | # else |
| 2253 | /* Extend the stack our own way. */ |
| 2254 | if (YYMAXDEPTH <= yystacksize) |
| 2255 | goto yyexhaustedlab; |
| 2256 | yystacksize *= 2; |
| 2257 | if (YYMAXDEPTH < yystacksize) |
| 2258 | yystacksize = YYMAXDEPTH; |
| 2259 | |
| 2260 | { |
| 2261 | yytype_int16 *yyss1 = yyss; |
| 2262 | union yyalloc *yyptr = |
| 2263 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
| 2264 | if (! yyptr) |
| 2265 | goto yyexhaustedlab; |
| 2266 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
| 2267 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
| 2268 | # undef YYSTACK_RELOCATE |
| 2269 | if (yyss1 != yyssa) |
| 2270 | YYSTACK_FREE (yyss1); |
| 2271 | } |
| 2272 | # endif |
| 2273 | #endif /* no yyoverflow */ |
| 2274 | |
| 2275 | yyssp = yyss + yysize - 1; |
| 2276 | yyvsp = yyvs + yysize - 1; |
| 2277 | |
| 2278 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
| 2279 | (unsigned long int) yystacksize)); |
| 2280 | |
| 2281 | if (yyss + yystacksize - 1 <= yyssp) |
| 2282 | YYABORT; |
| 2283 | } |
| 2284 | |
| 2285 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
| 2286 | |
| 2287 | if (yystate == YYFINAL) |
| 2288 | YYACCEPT; |
| 2289 | |
| 2290 | goto yybackup; |
| 2291 | |
| 2292 | /*-----------. |
| 2293 | | yybackup. | |
| 2294 | `-----------*/ |
| 2295 | yybackup: |
| 2296 | |
| 2297 | /* Do appropriate processing given the current state. Read a |
| 2298 | lookahead token if we need one and don't already have one. */ |
| 2299 | |
| 2300 | /* First try to decide what to do without reference to lookahead token. */ |
| 2301 | yyn = yypact[yystate]; |
| 2302 | if (yyn == YYPACT_NINF) |
| 2303 | goto yydefault; |
| 2304 | |
| 2305 | /* Not known => get a lookahead token if don't already have one. */ |
| 2306 | |
| 2307 | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
| 2308 | if (yychar == YYEMPTY) |
| 2309 | { |
| 2310 | YYDPRINTF ((stderr, "Reading a token: ")); |
| 2311 | yychar = YYLEX; |
| 2312 | } |
| 2313 | |
| 2314 | if (yychar <= YYEOF) |
| 2315 | { |
| 2316 | yychar = yytoken = YYEOF; |
| 2317 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
| 2318 | } |
| 2319 | else |
| 2320 | { |
| 2321 | yytoken = YYTRANSLATE (yychar); |
| 2322 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
| 2323 | } |
| 2324 | |
| 2325 | /* If the proper action on seeing token YYTOKEN is to reduce or to |
| 2326 | detect an error, take that action. */ |
| 2327 | yyn += yytoken; |
| 2328 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
| 2329 | goto yydefault; |
| 2330 | yyn = yytable[yyn]; |
| 2331 | if (yyn <= 0) |
| 2332 | { |
| 2333 | if (yyn == 0 || yyn == YYTABLE_NINF) |
| 2334 | goto yyerrlab; |
| 2335 | yyn = -yyn; |
| 2336 | goto yyreduce; |
| 2337 | } |
| 2338 | |
| 2339 | /* Count tokens shifted since error; after three, turn off error |
| 2340 | status. */ |
| 2341 | if (yyerrstatus) |
| 2342 | yyerrstatus--; |
| 2343 | |
| 2344 | /* Shift the lookahead token. */ |
| 2345 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
| 2346 | |
| 2347 | /* Discard the shifted token. */ |
| 2348 | yychar = YYEMPTY; |
| 2349 | |
| 2350 | yystate = yyn; |
| 2351 | *++yyvsp = yylval; |
| 2352 | |
| 2353 | goto yynewstate; |
| 2354 | |
| 2355 | |
| 2356 | /*-----------------------------------------------------------. |
| 2357 | | yydefault -- do the default action for the current state. | |
| 2358 | `-----------------------------------------------------------*/ |
| 2359 | yydefault: |
| 2360 | yyn = yydefact[yystate]; |
| 2361 | if (yyn == 0) |
| 2362 | goto yyerrlab; |
| 2363 | goto yyreduce; |
| 2364 | |
| 2365 | |
| 2366 | /*-----------------------------. |
| 2367 | | yyreduce -- Do a reduction. | |
| 2368 | `-----------------------------*/ |
| 2369 | yyreduce: |
| 2370 | /* yyn is the number of a rule to reduce with. */ |
| 2371 | yylen = yyr2[yyn]; |
| 2372 | |
| 2373 | /* If YYLEN is nonzero, implement the default value of the action: |
| 2374 | `$$ = $1'. |
| 2375 | |
| 2376 | Otherwise, the following line sets YYVAL to garbage. |
| 2377 | This behavior is undocumented and Bison |
| 2378 | users should not rely upon it. Assigning to YYVAL |
| 2379 | unconditionally makes the parser a bit smaller, and it avoids a |
| 2380 | GCC warning that YYVAL may be used uninitialized. */ |
| 2381 | yyval = yyvsp[1-yylen]; |
| 2382 | |
| 2383 | |
| 2384 | YY_REDUCE_PRINT (yyn); |
| 2385 | switch (yyn) |
| 2386 | { |
| 2387 | case 2: |
| 2388 | |
| 2389 | { |
| 2390 | // The symbol table search was done in the lexical phase |
| 2391 | const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol; |
| 2392 | const TVariable* variable; |
| 2393 | if (symbol == 0) { |
| 2394 | context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str()); |
| 2395 | context->recover(); |
| 2396 | TType type(EbtFloat, EbpUndefined); |
| 2397 | TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type); |
Nicolas Capens | d603ecd | 2015-02-18 14:52:21 -0500 | [diff] [blame] | 2398 | context->symbolTable.declare(*fakeVariable); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2399 | variable = fakeVariable; |
| 2400 | } else { |
| 2401 | // This identifier can only be a variable type symbol |
| 2402 | if (! symbol->isVariable()) { |
| 2403 | context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str()); |
| 2404 | context->recover(); |
| 2405 | } |
| 2406 | variable = static_cast<const TVariable*>(symbol); |
| 2407 | } |
| 2408 | |
| 2409 | // don't delete $1.string, it's used by error recovery, and the pool |
| 2410 | // pop will reclaim the memory |
| 2411 | |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 2412 | if (variable->getType().getQualifier() == EvqConstExpr ) { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2413 | ConstantUnion* constArray = variable->getConstPointer(); |
| 2414 | TType t(variable->getType()); |
| 2415 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line); |
| 2416 | } else |
| 2417 | (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(), |
| 2418 | variable->getName(), |
| 2419 | variable->getType(), (yyvsp[(1) - (1)].lex).line); |
| 2420 | } |
| 2421 | break; |
| 2422 | |
| 2423 | case 3: |
| 2424 | |
| 2425 | { |
| 2426 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 2427 | } |
| 2428 | break; |
| 2429 | |
| 2430 | case 4: |
| 2431 | |
| 2432 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2433 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 2434 | unionArray->setIConst((yyvsp[(1) - (1)].lex).i); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 2435 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2436 | } |
| 2437 | break; |
| 2438 | |
| 2439 | case 5: |
| 2440 | |
| 2441 | { |
| 2442 | ConstantUnion *unionArray = new ConstantUnion[1]; |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2443 | unionArray->setUConst((yyvsp[(1) - (1)].lex).u); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 2444 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line); |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2445 | } |
| 2446 | break; |
| 2447 | |
| 2448 | case 6: |
| 2449 | |
| 2450 | { |
| 2451 | ConstantUnion *unionArray = new ConstantUnion[1]; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2452 | unionArray->setFConst((yyvsp[(1) - (1)].lex).f); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 2453 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2454 | } |
| 2455 | break; |
| 2456 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2457 | case 7: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2458 | |
| 2459 | { |
| 2460 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 2461 | unionArray->setBConst((yyvsp[(1) - (1)].lex).b); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 2462 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2463 | } |
| 2464 | break; |
| 2465 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2466 | case 8: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2467 | |
| 2468 | { |
| 2469 | (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); |
| 2470 | } |
| 2471 | break; |
| 2472 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2473 | case 9: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2474 | |
| 2475 | { |
| 2476 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 2477 | } |
| 2478 | break; |
| 2479 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2480 | case 10: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2481 | |
| 2482 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 2483 | (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2484 | } |
| 2485 | break; |
| 2486 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2487 | case 11: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2488 | |
| 2489 | { |
| 2490 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 2491 | } |
| 2492 | break; |
| 2493 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2494 | case 12: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2495 | |
| 2496 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 2497 | (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2498 | } |
| 2499 | break; |
| 2500 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2501 | case 13: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2502 | |
| 2503 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 2504 | (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2505 | } |
| 2506 | break; |
| 2507 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2508 | case 14: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2509 | |
| 2510 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 2511 | (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2512 | } |
| 2513 | break; |
| 2514 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2515 | case 15: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2516 | |
| 2517 | { |
| 2518 | if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]")) |
| 2519 | context->recover(); |
| 2520 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 2521 | } |
| 2522 | break; |
| 2523 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2524 | case 16: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2525 | |
| 2526 | { |
| 2527 | TFunction* fnCall = (yyvsp[(1) - (1)].interm).function; |
| 2528 | TOperator op = fnCall->getBuiltInOp(); |
| 2529 | |
| 2530 | if (op != EOpNull) |
| 2531 | { |
| 2532 | // |
| 2533 | // Then this should be a constructor. |
| 2534 | // Don't go through the symbol table for constructors. |
| 2535 | // Their parameters will be verified algorithmically. |
| 2536 | // |
| 2537 | TType type(EbtVoid, EbpUndefined); // use this to get the type back |
| 2538 | if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) { |
| 2539 | (yyval.interm.intermTypedNode) = 0; |
| 2540 | } else { |
| 2541 | // |
| 2542 | // It's a constructor, of type 'type'. |
| 2543 | // |
| 2544 | (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line); |
| 2545 | } |
| 2546 | |
| 2547 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2548 | context->recover(); |
| 2549 | (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line); |
| 2550 | } |
| 2551 | (yyval.interm.intermTypedNode)->setType(type); |
| 2552 | } else { |
| 2553 | // |
| 2554 | // Not a constructor. Find it in the symbol table. |
| 2555 | // |
| 2556 | const TFunction* fnCandidate; |
| 2557 | bool builtIn; |
| 2558 | fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn); |
| 2559 | if (fnCandidate) { |
| 2560 | // |
| 2561 | // A declared function. |
| 2562 | // |
| 2563 | if (builtIn && !fnCandidate->getExtension().empty() && |
| 2564 | context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) { |
| 2565 | context->recover(); |
| 2566 | } |
| 2567 | op = fnCandidate->getBuiltInOp(); |
| 2568 | if (builtIn && op != EOpNull) { |
| 2569 | // |
| 2570 | // A function call mapped to a built-in operation. |
| 2571 | // |
| 2572 | if (fnCandidate->getParamCount() == 1) { |
| 2573 | // |
| 2574 | // Treat it like a built-in unary operator. |
| 2575 | // |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2576 | (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2577 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2578 | std::stringstream extraInfoStream; |
| 2579 | extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString(); |
| 2580 | std::string extraInfo = extraInfoStream.str(); |
| 2581 | context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str()); |
| 2582 | YYERROR; |
| 2583 | } |
| 2584 | } else { |
| 2585 | (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line); |
| 2586 | } |
| 2587 | } else { |
| 2588 | // This is a real function call |
| 2589 | |
| 2590 | (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line); |
| 2591 | (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType()); |
| 2592 | |
| 2593 | // this is how we know whether the given function is a builtIn function or a user defined function |
| 2594 | // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also |
| 2595 | // if builtIn == true, it's definitely a builtIn function with EOpNull |
| 2596 | if (!builtIn) |
| 2597 | (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined(); |
| 2598 | (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName()); |
| 2599 | |
| 2600 | TQualifier qual; |
| 2601 | for (int i = 0; i < fnCandidate->getParamCount(); ++i) { |
| 2602 | qual = fnCandidate->getParam(i).type->getQualifier(); |
| 2603 | if (qual == EvqOut || qual == EvqInOut) { |
| 2604 | if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) { |
| 2605 | context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error"); |
| 2606 | context->recover(); |
| 2607 | } |
| 2608 | } |
| 2609 | } |
| 2610 | } |
| 2611 | (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType()); |
| 2612 | } else { |
| 2613 | // error message was put out by PaFindFunction() |
| 2614 | // Put on a dummy node for error recovery |
| 2615 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 2616 | unionArray->setFConst(0.0f); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 2617 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].interm).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2618 | context->recover(); |
| 2619 | } |
| 2620 | } |
| 2621 | delete fnCall; |
| 2622 | } |
| 2623 | break; |
| 2624 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2625 | case 17: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2626 | |
| 2627 | { |
| 2628 | (yyval.interm) = (yyvsp[(1) - (1)].interm); |
| 2629 | } |
| 2630 | break; |
| 2631 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2632 | case 18: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2633 | |
| 2634 | { |
| 2635 | context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", ""); |
| 2636 | context->recover(); |
| 2637 | (yyval.interm) = (yyvsp[(3) - (3)].interm); |
| 2638 | } |
| 2639 | break; |
| 2640 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2641 | case 19: |
| 2642 | |
| 2643 | { |
| 2644 | (yyval.interm) = (yyvsp[(1) - (2)].interm); |
| 2645 | (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; |
| 2646 | } |
| 2647 | break; |
| 2648 | |
| 2649 | case 20: |
| 2650 | |
| 2651 | { |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2652 | (yyval.interm) = (yyvsp[(1) - (2)].interm); |
| 2653 | (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; |
| 2654 | } |
| 2655 | break; |
| 2656 | |
| 2657 | case 21: |
| 2658 | |
| 2659 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2660 | (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); |
| 2661 | (yyval.interm).intermNode = 0; |
| 2662 | } |
| 2663 | break; |
| 2664 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2665 | case 22: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2666 | |
| 2667 | { |
| 2668 | (yyval.interm).function = (yyvsp[(1) - (1)].interm.function); |
| 2669 | (yyval.interm).intermNode = 0; |
| 2670 | } |
| 2671 | break; |
| 2672 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2673 | case 23: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2674 | |
| 2675 | { |
| 2676 | TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) }; |
| 2677 | (yyvsp[(1) - (2)].interm.function)->addParameter(param); |
| 2678 | (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); |
| 2679 | (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode); |
| 2680 | } |
| 2681 | break; |
| 2682 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2683 | case 24: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2684 | |
| 2685 | { |
| 2686 | TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) }; |
| 2687 | (yyvsp[(1) - (3)].interm).function->addParameter(param); |
| 2688 | (yyval.interm).function = (yyvsp[(1) - (3)].interm).function; |
| 2689 | (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 2690 | } |
| 2691 | break; |
| 2692 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2693 | case 25: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2694 | |
| 2695 | { |
| 2696 | (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function); |
| 2697 | } |
| 2698 | break; |
| 2699 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2700 | case 26: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2701 | |
| 2702 | { |
| 2703 | // |
| 2704 | // Constructor |
| 2705 | // |
| 2706 | TOperator op = EOpNull; |
| 2707 | if ((yyvsp[(1) - (1)].interm.type).userDef) { |
| 2708 | op = EOpConstructStruct; |
| 2709 | } else { |
| 2710 | switch ((yyvsp[(1) - (1)].interm.type).type) { |
| 2711 | case EbtFloat: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 2712 | switch((yyvsp[(1) - (1)].interm.type).primarySize) { |
| 2713 | case 1: |
| 2714 | op = EOpConstructFloat; break; |
| 2715 | case 2: |
| 2716 | switch((yyvsp[(1) - (1)].interm.type).secondarySize) { |
| 2717 | case 1: op = EOpConstructVec2; break; |
| 2718 | case 2: op = EOpConstructMat2; break; |
| 2719 | case 3: op = EOpConstructMat2x3; break; |
| 2720 | case 4: op = EOpConstructMat2x4; break; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2721 | } |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 2722 | break; |
| 2723 | case 3: |
| 2724 | switch((yyvsp[(1) - (1)].interm.type).secondarySize) { |
| 2725 | case 1: op = EOpConstructVec3; break; |
| 2726 | case 2: op = EOpConstructMat3x2; break; |
| 2727 | case 3: op = EOpConstructMat3; break; |
| 2728 | case 4: op = EOpConstructMat3x4; break; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2729 | } |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 2730 | break; |
| 2731 | case 4: |
| 2732 | switch((yyvsp[(1) - (1)].interm.type).secondarySize) { |
| 2733 | case 1: op = EOpConstructVec4; break; |
| 2734 | case 2: op = EOpConstructMat4x2; break; |
| 2735 | case 3: op = EOpConstructMat4x3; break; |
| 2736 | case 4: op = EOpConstructMat4; break; |
| 2737 | } |
| 2738 | break; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2739 | } |
| 2740 | break; |
| 2741 | case EbtInt: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 2742 | switch((yyvsp[(1) - (1)].interm.type).primarySize) { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2743 | case 1: op = EOpConstructInt; break; |
| 2744 | case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break; |
| 2745 | case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break; |
| 2746 | case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break; |
| 2747 | } |
| 2748 | break; |
Alexis Hetu | b7c46af | 2015-05-12 15:58:09 -0400 | [diff] [blame] | 2749 | case EbtUInt: |
| 2750 | switch((yyvsp[(1) - (1)].interm.type).primarySize) { |
| 2751 | case 1: op = EOpConstructUInt; break; |
| 2752 | case 2: FRAG_VERT_ONLY("uvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec2; break; |
| 2753 | case 3: FRAG_VERT_ONLY("uvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec3; break; |
| 2754 | case 4: FRAG_VERT_ONLY("uvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec4; break; |
| 2755 | } |
| 2756 | break; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2757 | case EbtBool: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 2758 | switch((yyvsp[(1) - (1)].interm.type).primarySize) { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2759 | case 1: op = EOpConstructBool; break; |
| 2760 | case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break; |
| 2761 | case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break; |
| 2762 | case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break; |
| 2763 | } |
| 2764 | break; |
| 2765 | default: break; |
| 2766 | } |
| 2767 | if (op == EOpNull) { |
| 2768 | context->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type)); |
| 2769 | context->recover(); |
| 2770 | (yyvsp[(1) - (1)].interm.type).type = EbtFloat; |
| 2771 | op = EOpConstructFloat; |
| 2772 | } |
| 2773 | } |
| 2774 | TString tempString; |
| 2775 | TType type((yyvsp[(1) - (1)].interm.type)); |
| 2776 | TFunction *function = new TFunction(&tempString, type, op); |
| 2777 | (yyval.interm.function) = function; |
| 2778 | } |
| 2779 | break; |
| 2780 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2781 | case 27: |
| 2782 | |
| 2783 | { |
| 2784 | if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) |
| 2785 | context->recover(); |
| 2786 | TType type(EbtVoid, EbpUndefined); |
| 2787 | TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type); |
| 2788 | (yyval.interm.function) = function; |
| 2789 | } |
| 2790 | break; |
| 2791 | |
| 2792 | case 28: |
| 2793 | |
| 2794 | { |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2795 | if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) |
| 2796 | context->recover(); |
| 2797 | TType type(EbtVoid, EbpUndefined); |
| 2798 | TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type); |
| 2799 | (yyval.interm.function) = function; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2800 | } |
| 2801 | break; |
| 2802 | |
| 2803 | case 29: |
| 2804 | |
| 2805 | { |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2806 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 2807 | } |
| 2808 | break; |
| 2809 | |
| 2810 | case 30: |
| 2811 | |
| 2812 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2813 | if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode))) |
| 2814 | context->recover(); |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2815 | (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2816 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2817 | context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); |
| 2818 | context->recover(); |
| 2819 | (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); |
| 2820 | } |
| 2821 | } |
| 2822 | break; |
| 2823 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2824 | case 31: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2825 | |
| 2826 | { |
| 2827 | if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode))) |
| 2828 | context->recover(); |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2829 | (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2830 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2831 | context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); |
| 2832 | context->recover(); |
| 2833 | (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); |
| 2834 | } |
| 2835 | } |
| 2836 | break; |
| 2837 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2838 | case 32: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2839 | |
| 2840 | { |
| 2841 | if ((yyvsp[(1) - (2)].interm).op != EOpNull) { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2842 | (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2843 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2844 | const char* errorOp = ""; |
| 2845 | switch((yyvsp[(1) - (2)].interm).op) { |
| 2846 | case EOpNegative: errorOp = "-"; break; |
| 2847 | case EOpLogicalNot: errorOp = "!"; break; |
Alexis Hetu | d061e42 | 2015-05-13 16:37:50 -0400 | [diff] [blame] | 2848 | case EOpBitwiseNot: errorOp = "~"; break; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2849 | default: break; |
| 2850 | } |
| 2851 | context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); |
| 2852 | context->recover(); |
| 2853 | (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); |
| 2854 | } |
| 2855 | } else |
| 2856 | (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); |
| 2857 | } |
| 2858 | break; |
| 2859 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2860 | case 33: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2861 | |
| 2862 | { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; } |
| 2863 | break; |
| 2864 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2865 | case 34: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2866 | |
| 2867 | { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; } |
| 2868 | break; |
| 2869 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2870 | case 35: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2871 | |
| 2872 | { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; } |
| 2873 | break; |
| 2874 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2875 | case 36: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2876 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 2877 | { |
| 2878 | ES3_ONLY("~", (yyvsp[(1) - (1)].lex).line); |
| 2879 | (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseNot; |
| 2880 | } |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2881 | break; |
| 2882 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2883 | case 37: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2884 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 2885 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 2886 | break; |
| 2887 | |
| 2888 | case 38: |
| 2889 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2890 | { |
| 2891 | FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line); |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2892 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2893 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2894 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2895 | context->recover(); |
| 2896 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 2897 | } |
| 2898 | } |
| 2899 | break; |
| 2900 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 2901 | case 39: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2902 | |
| 2903 | { |
| 2904 | FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line); |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2905 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2906 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2907 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2908 | context->recover(); |
| 2909 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 2910 | } |
| 2911 | } |
| 2912 | break; |
| 2913 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 2914 | case 40: |
| 2915 | |
| 2916 | { |
| 2917 | FRAG_VERT_ONLY("%", (yyvsp[(2) - (3)].lex).line); |
| 2918 | ES3_ONLY("%", (yyvsp[(2) - (3)].lex).line); |
| 2919 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpIMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 2920 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2921 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "%", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2922 | context->recover(); |
| 2923 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 2924 | } |
| 2925 | } |
| 2926 | break; |
| 2927 | |
| 2928 | case 41: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2929 | |
| 2930 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 2931 | break; |
| 2932 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 2933 | case 42: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2934 | |
| 2935 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2936 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2937 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2938 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2939 | context->recover(); |
| 2940 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 2941 | } |
| 2942 | } |
| 2943 | break; |
| 2944 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 2945 | case 43: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2946 | |
| 2947 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2948 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2949 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2950 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2951 | context->recover(); |
| 2952 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 2953 | } |
| 2954 | } |
| 2955 | break; |
| 2956 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 2957 | case 44: |
| 2958 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 2959 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 2960 | break; |
| 2961 | |
| 2962 | case 45: |
| 2963 | |
| 2964 | { |
| 2965 | ES3_ONLY("<<", (yyvsp[(2) - (3)].lex).line); |
| 2966 | context->intermediate.addBinaryMath(EOpBitShiftLeft, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 2967 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2968 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2969 | context->recover(); |
| 2970 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 2971 | } |
| 2972 | } |
| 2973 | break; |
| 2974 | |
| 2975 | case 46: |
| 2976 | |
| 2977 | { |
| 2978 | ES3_ONLY(">>", (yyvsp[(2) - (3)].lex).line); |
| 2979 | context->intermediate.addBinaryMath(EOpBitShiftRight, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 2980 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2981 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">>", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2982 | context->recover(); |
| 2983 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 2984 | } |
| 2985 | } |
| 2986 | break; |
| 2987 | |
| 2988 | case 47: |
| 2989 | |
| 2990 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 2991 | break; |
| 2992 | |
| 2993 | case 48: |
| 2994 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2995 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 2996 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 2997 | if ((yyval.interm.intermTypedNode) == 0) { |
| 2998 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 2999 | context->recover(); |
| 3000 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3001 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3002 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3003 | } |
| 3004 | } |
| 3005 | break; |
| 3006 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3007 | case 49: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3008 | |
| 3009 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3010 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3011 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3012 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3013 | context->recover(); |
| 3014 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3015 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3016 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3017 | } |
| 3018 | } |
| 3019 | break; |
| 3020 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3021 | case 50: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3022 | |
| 3023 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3024 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3025 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3026 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3027 | context->recover(); |
| 3028 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3029 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3030 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3031 | } |
| 3032 | } |
| 3033 | break; |
| 3034 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3035 | case 51: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3036 | |
| 3037 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3038 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3039 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3040 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3041 | context->recover(); |
| 3042 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3043 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3044 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3045 | } |
| 3046 | } |
| 3047 | break; |
| 3048 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3049 | case 52: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3050 | |
| 3051 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3052 | break; |
| 3053 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3054 | case 53: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3055 | |
| 3056 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3057 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3058 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3059 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3060 | context->recover(); |
| 3061 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3062 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3063 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3064 | } |
| 3065 | } |
| 3066 | break; |
| 3067 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3068 | case 54: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3069 | |
| 3070 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3071 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3072 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3073 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3074 | context->recover(); |
| 3075 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3076 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3077 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3078 | } |
| 3079 | } |
| 3080 | break; |
| 3081 | |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 3082 | case 55: |
| 3083 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3084 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3085 | break; |
| 3086 | |
| 3087 | case 56: |
| 3088 | |
| 3089 | { |
| 3090 | ES3_ONLY("&", (yyvsp[(2) - (3)].lex).line); |
| 3091 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 3092 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3093 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3094 | context->recover(); |
| 3095 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3096 | unionArray->setBConst(false); |
| 3097 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
| 3098 | } |
| 3099 | } |
| 3100 | break; |
| 3101 | |
| 3102 | case 57: |
| 3103 | |
| 3104 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3105 | break; |
| 3106 | |
| 3107 | case 58: |
| 3108 | |
| 3109 | { |
| 3110 | ES3_ONLY("^", (yyvsp[(2) - (3)].lex).line); |
| 3111 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 3112 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3113 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3114 | context->recover(); |
| 3115 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3116 | unionArray->setBConst(false); |
| 3117 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
| 3118 | } |
| 3119 | } |
| 3120 | break; |
| 3121 | |
| 3122 | case 59: |
| 3123 | |
| 3124 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3125 | break; |
| 3126 | |
| 3127 | case 60: |
| 3128 | |
| 3129 | { |
| 3130 | ES3_ONLY("|", (yyvsp[(2) - (3)].lex).line); |
| 3131 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 3132 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3133 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "|", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3134 | context->recover(); |
| 3135 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3136 | unionArray->setBConst(false); |
| 3137 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
| 3138 | } |
| 3139 | } |
| 3140 | break; |
| 3141 | |
| 3142 | case 61: |
| 3143 | |
| 3144 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3145 | break; |
| 3146 | |
| 3147 | case 62: |
| 3148 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3149 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3150 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3151 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3152 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3153 | context->recover(); |
| 3154 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3155 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3156 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3157 | } |
| 3158 | } |
| 3159 | break; |
| 3160 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3161 | case 63: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3162 | |
| 3163 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3164 | break; |
| 3165 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3166 | case 64: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3167 | |
| 3168 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3169 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3170 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3171 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3172 | context->recover(); |
| 3173 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3174 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3175 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3176 | } |
| 3177 | } |
| 3178 | break; |
| 3179 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3180 | case 65: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3181 | |
| 3182 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3183 | break; |
| 3184 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3185 | case 66: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3186 | |
| 3187 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3188 | (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3189 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3190 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3191 | context->recover(); |
| 3192 | ConstantUnion *unionArray = new ConstantUnion[1]; |
| 3193 | unionArray->setBConst(false); |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3194 | (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3195 | } |
| 3196 | } |
| 3197 | break; |
| 3198 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3199 | case 67: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3200 | |
| 3201 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3202 | break; |
| 3203 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3204 | case 68: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3205 | |
| 3206 | { |
| 3207 | if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode))) |
| 3208 | context->recover(); |
| 3209 | |
| 3210 | (yyval.interm.intermTypedNode) = context->intermediate.addSelection((yyvsp[(1) - (5)].interm.intermTypedNode), (yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.intermTypedNode), (yyvsp[(2) - (5)].lex).line); |
| 3211 | if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType()) |
| 3212 | (yyval.interm.intermTypedNode) = 0; |
| 3213 | |
| 3214 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3215 | context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString()); |
| 3216 | context->recover(); |
| 3217 | (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode); |
| 3218 | } |
| 3219 | } |
| 3220 | break; |
| 3221 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3222 | case 69: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3223 | |
| 3224 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
| 3225 | break; |
| 3226 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3227 | case 70: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3228 | |
| 3229 | { |
| 3230 | if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode))) |
| 3231 | context->recover(); |
| 3232 | (yyval.interm.intermTypedNode) = context->intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].interm).line); |
| 3233 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3234 | context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3235 | context->recover(); |
| 3236 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 3237 | } |
| 3238 | } |
| 3239 | break; |
| 3240 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3241 | case 71: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3242 | |
| 3243 | { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; } |
| 3244 | break; |
| 3245 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3246 | case 72: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3247 | |
| 3248 | { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; } |
| 3249 | break; |
| 3250 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3251 | case 73: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3252 | |
| 3253 | { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; } |
| 3254 | break; |
| 3255 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3256 | case 74: |
| 3257 | |
| 3258 | { ES3_ONLY("%=", (yyvsp[(1) - (1)].lex).line); |
| 3259 | FRAG_VERT_ONLY("%=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpIModAssign; } |
| 3260 | break; |
| 3261 | |
| 3262 | case 75: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3263 | |
| 3264 | { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; } |
| 3265 | break; |
| 3266 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3267 | case 76: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3268 | |
| 3269 | { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; } |
| 3270 | break; |
| 3271 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3272 | case 77: |
| 3273 | |
| 3274 | { ES3_ONLY("<<=", (yyvsp[(1) - (1)].lex).line); |
| 3275 | FRAG_VERT_ONLY("<<=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftLeftAssign; } |
| 3276 | break; |
| 3277 | |
| 3278 | case 78: |
| 3279 | |
| 3280 | { ES3_ONLY(">>=", (yyvsp[(1) - (1)].lex).line); |
| 3281 | FRAG_VERT_ONLY(">>=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftRightAssign; } |
| 3282 | break; |
| 3283 | |
| 3284 | case 79: |
| 3285 | |
| 3286 | { ES3_ONLY("&=", (yyvsp[(1) - (1)].lex).line); |
| 3287 | FRAG_VERT_ONLY("&=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseAndAssign; } |
| 3288 | break; |
| 3289 | |
| 3290 | case 80: |
| 3291 | |
| 3292 | { ES3_ONLY("^=", (yyvsp[(1) - (1)].lex).line); |
| 3293 | FRAG_VERT_ONLY("^=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseXorAssign; } |
| 3294 | break; |
| 3295 | |
| 3296 | case 81: |
| 3297 | |
| 3298 | { ES3_ONLY("|=", (yyvsp[(1) - (1)].lex).line); |
| 3299 | FRAG_VERT_ONLY("|=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseOrAssign; } |
| 3300 | break; |
| 3301 | |
| 3302 | case 82: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3303 | |
| 3304 | { |
| 3305 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 3306 | } |
| 3307 | break; |
| 3308 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3309 | case 83: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3310 | |
| 3311 | { |
| 3312 | (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); |
| 3313 | if ((yyval.interm.intermTypedNode) == 0) { |
| 3314 | context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); |
| 3315 | context->recover(); |
| 3316 | (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode); |
| 3317 | } |
| 3318 | } |
| 3319 | break; |
| 3320 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3321 | case 84: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3322 | |
| 3323 | { |
| 3324 | if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode))) |
| 3325 | context->recover(); |
| 3326 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 3327 | } |
| 3328 | break; |
| 3329 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3330 | case 85: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3331 | |
| 3332 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3333 | if (context->enterStructDeclaration((yyvsp[(1) - (2)].lex).line, *(yyvsp[(1) - (2)].lex).string)) |
| 3334 | context->recover(); |
| 3335 | (yyval.lex) = (yyvsp[(1) - (2)].lex); |
| 3336 | } |
| 3337 | break; |
| 3338 | |
| 3339 | case 86: |
| 3340 | |
| 3341 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3342 | TFunction &function = *((yyvsp[(1) - (2)].interm).function); |
| 3343 | |
| 3344 | TIntermAggregate *prototype = new TIntermAggregate; |
| 3345 | prototype->setType(function.getReturnType()); |
| 3346 | prototype->setName(function.getName()); |
| 3347 | |
| 3348 | for (int i = 0; i < function.getParamCount(); i++) |
| 3349 | { |
| 3350 | const TParameter ¶m = function.getParam(i); |
| 3351 | if (param.name != 0) |
| 3352 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3353 | TVariable variable(param.name, *param.type); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3354 | |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3355 | prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3356 | } |
| 3357 | else |
| 3358 | { |
| 3359 | prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line); |
| 3360 | } |
| 3361 | } |
| 3362 | |
| 3363 | prototype->setOp(EOpPrototype); |
| 3364 | (yyval.interm.intermNode) = prototype; |
| 3365 | |
| 3366 | context->symbolTable.pop(); |
| 3367 | } |
| 3368 | break; |
| 3369 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3370 | case 87: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3371 | |
| 3372 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3373 | TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate; |
| 3374 | if (aggNode && aggNode->getOp() == EOpNull) |
| 3375 | aggNode->setOp(EOpDeclaration); |
| 3376 | (yyval.interm.intermNode) = aggNode; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3377 | } |
| 3378 | break; |
| 3379 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3380 | case 88: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3381 | |
| 3382 | { |
John Bauman | d4ae863 | 2014-05-06 16:18:33 -0400 | [diff] [blame] | 3383 | if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) { |
| 3384 | context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type)); |
| 3385 | context->recover(); |
| 3386 | } |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3387 | (yyval.interm.intermNode) = 0; |
| 3388 | } |
| 3389 | break; |
| 3390 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3391 | case 89: |
| 3392 | |
| 3393 | { |
| 3394 | ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yyvsp[(1) - (5)].interm.type).line); |
| 3395 | (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (5)].interm.type), (yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].interm.fieldList), NULL, (yyvsp[(1) - (5)].interm.type).line, NULL, (yyvsp[(1) - (5)].interm.type).line); |
| 3396 | } |
| 3397 | break; |
| 3398 | |
| 3399 | case 90: |
| 3400 | |
| 3401 | { |
| 3402 | ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yyvsp[(1) - (6)].interm.type).line); |
| 3403 | (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (6)].interm.type), (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].interm.fieldList), (yyvsp[(5) - (6)].lex).string, (yyvsp[(5) - (6)].lex).line, NULL, (yyvsp[(1) - (6)].interm.type).line); |
| 3404 | } |
| 3405 | break; |
| 3406 | |
| 3407 | case 91: |
| 3408 | |
| 3409 | { |
| 3410 | ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yyvsp[(1) - (9)].interm.type).line); |
| 3411 | (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (9)].interm.type), (yyvsp[(2) - (9)].lex).line, *(yyvsp[(2) - (9)].lex).string, (yyvsp[(3) - (9)].interm.fieldList), (yyvsp[(5) - (9)].lex).string, (yyvsp[(5) - (9)].lex).line, (yyvsp[(7) - (9)].interm.intermTypedNode), (yyvsp[(6) - (9)].lex).line); |
| 3412 | } |
| 3413 | break; |
| 3414 | |
| 3415 | case 92: |
| 3416 | |
| 3417 | { |
| 3418 | context->parseGlobalLayoutQualifier((yyvsp[(1) - (2)].interm.type)); |
| 3419 | (yyval.interm.intermNode) = 0; |
| 3420 | } |
| 3421 | break; |
| 3422 | |
| 3423 | case 93: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3424 | |
| 3425 | { |
| 3426 | // |
| 3427 | // Multiple declarations of the same function are allowed. |
| 3428 | // |
| 3429 | // If this is a definition, the definition production code will check for redefinitions |
| 3430 | // (we don't know at this point if it's a definition or not). |
| 3431 | // |
| 3432 | // Redeclarations are allowed. But, return types and parameter qualifiers must match. |
| 3433 | // |
Nicolas Capens | 0a7f0c2 | 2015-02-18 14:47:31 -0500 | [diff] [blame] | 3434 | TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3435 | if (prevDec) { |
| 3436 | if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) { |
| 3437 | context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString()); |
| 3438 | context->recover(); |
| 3439 | } |
| 3440 | for (int i = 0; i < prevDec->getParamCount(); ++i) { |
| 3441 | if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) { |
| 3442 | context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString()); |
| 3443 | context->recover(); |
| 3444 | } |
| 3445 | } |
| 3446 | } |
| 3447 | |
| 3448 | // |
| 3449 | // If this is a redeclaration, it could also be a definition, |
| 3450 | // in which case, we want to use the variable names from this one, and not the one that's |
| 3451 | // being redeclared. So, pass back up this declaration, not the one in the symbol table. |
| 3452 | // |
| 3453 | (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); |
| 3454 | (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; |
| 3455 | |
| 3456 | // We're at the inner scope level of the function's arguments and body statement. |
| 3457 | // Add the function prototype to the surrounding scope instead. |
| 3458 | context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function); |
| 3459 | } |
| 3460 | break; |
| 3461 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3462 | case 94: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3463 | |
| 3464 | { |
| 3465 | (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); |
| 3466 | } |
| 3467 | break; |
| 3468 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3469 | case 95: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3470 | |
| 3471 | { |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 3472 | (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); |
| 3473 | } |
| 3474 | break; |
| 3475 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3476 | case 96: |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 3477 | |
| 3478 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3479 | // Add the parameter |
| 3480 | (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function); |
| 3481 | if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid) |
| 3482 | (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param); |
| 3483 | else |
| 3484 | delete (yyvsp[(2) - (2)].interm).param.type; |
| 3485 | } |
| 3486 | break; |
| 3487 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3488 | case 97: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3489 | |
| 3490 | { |
| 3491 | // |
| 3492 | // Only first parameter of one-parameter functions can be void |
| 3493 | // The check for named parameters not being void is done in parameter_declarator |
| 3494 | // |
| 3495 | if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) { |
| 3496 | // |
| 3497 | // This parameter > first is void |
| 3498 | // |
| 3499 | context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void"); |
| 3500 | context->recover(); |
| 3501 | delete (yyvsp[(3) - (3)].interm).param.type; |
| 3502 | } else { |
| 3503 | // Add the parameter |
| 3504 | (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function); |
| 3505 | (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param); |
| 3506 | } |
| 3507 | } |
| 3508 | break; |
| 3509 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3510 | case 98: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3511 | |
| 3512 | { |
| 3513 | if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) { |
| 3514 | context->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier)); |
| 3515 | context->recover(); |
| 3516 | } |
| 3517 | // make sure a sampler is not involved as well... |
| 3518 | if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type))) |
| 3519 | context->recover(); |
| 3520 | |
| 3521 | // Add the function as a prototype after parsing it (we do not support recursion) |
| 3522 | TFunction *function; |
| 3523 | TType type((yyvsp[(1) - (3)].interm.type)); |
| 3524 | function = new TFunction((yyvsp[(2) - (3)].lex).string, type); |
| 3525 | (yyval.interm.function) = function; |
| 3526 | |
| 3527 | context->symbolTable.push(); |
| 3528 | } |
| 3529 | break; |
| 3530 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3531 | case 99: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3532 | |
| 3533 | { |
| 3534 | if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) { |
| 3535 | context->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str()); |
| 3536 | context->recover(); |
| 3537 | } |
| 3538 | if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) |
| 3539 | context->recover(); |
| 3540 | TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))}; |
| 3541 | (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; |
| 3542 | (yyval.interm).param = param; |
| 3543 | } |
| 3544 | break; |
| 3545 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3546 | case 100: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3547 | |
| 3548 | { |
| 3549 | // Check that we can make an array out of this type |
| 3550 | if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type))) |
| 3551 | context->recover(); |
| 3552 | |
| 3553 | if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string)) |
| 3554 | context->recover(); |
| 3555 | |
| 3556 | int size; |
| 3557 | if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size)) |
| 3558 | context->recover(); |
| 3559 | (yyvsp[(1) - (5)].interm.type).setArray(true, size); |
| 3560 | |
| 3561 | TType* type = new TType((yyvsp[(1) - (5)].interm.type)); |
| 3562 | TParameter param = { (yyvsp[(2) - (5)].lex).string, type }; |
| 3563 | (yyval.interm).line = (yyvsp[(2) - (5)].lex).line; |
| 3564 | (yyval.interm).param = param; |
| 3565 | } |
| 3566 | break; |
| 3567 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3568 | case 101: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3569 | |
| 3570 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3571 | (yyval.interm) = (yyvsp[(3) - (3)].interm); |
| 3572 | if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type)) |
| 3573 | context->recover(); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3574 | } |
| 3575 | break; |
| 3576 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3577 | case 102: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3578 | |
| 3579 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3580 | (yyval.interm) = (yyvsp[(2) - (2)].interm); |
| 3581 | if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) |
| 3582 | context->recover(); |
| 3583 | if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) |
| 3584 | context->recover(); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3585 | } |
| 3586 | break; |
| 3587 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3588 | case 103: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3589 | |
| 3590 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3591 | (yyval.interm) = (yyvsp[(3) - (3)].interm); |
| 3592 | if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type)) |
| 3593 | context->recover(); |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 3594 | } |
| 3595 | break; |
| 3596 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 3597 | case 104: |
Nicolas Capens | 2c1239f | 2015-02-17 17:30:04 -0500 | [diff] [blame] | 3598 | |
| 3599 | { |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3600 | (yyval.interm) = (yyvsp[(2) - (2)].interm); |
| 3601 | if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) |
| 3602 | context->recover(); |
| 3603 | if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) |
| 3604 | context->recover(); |
| 3605 | } |
| 3606 | break; |
| 3607 | |
| 3608 | case 105: |
| 3609 | |
| 3610 | { |
| 3611 | (yyval.interm.qualifier) = EvqIn; |
| 3612 | } |
| 3613 | break; |
| 3614 | |
| 3615 | case 106: |
| 3616 | |
| 3617 | { |
| 3618 | (yyval.interm.qualifier) = EvqIn; |
| 3619 | } |
| 3620 | break; |
| 3621 | |
| 3622 | case 107: |
| 3623 | |
| 3624 | { |
| 3625 | (yyval.interm.qualifier) = EvqOut; |
| 3626 | } |
| 3627 | break; |
| 3628 | |
| 3629 | case 108: |
| 3630 | |
| 3631 | { |
| 3632 | (yyval.interm.qualifier) = EvqInOut; |
| 3633 | } |
| 3634 | break; |
| 3635 | |
| 3636 | case 109: |
| 3637 | |
| 3638 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3639 | TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) }; |
| 3640 | (yyval.interm).param = param; |
| 3641 | } |
| 3642 | break; |
| 3643 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3644 | case 110: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3645 | |
| 3646 | { |
| 3647 | (yyval.interm) = (yyvsp[(1) - (1)].interm); |
| 3648 | } |
| 3649 | break; |
| 3650 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3651 | case 111: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3652 | |
| 3653 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3654 | (yyval.interm) = (yyvsp[(1) - (3)].interm); |
| 3655 | (yyval.interm).intermAggregate = context->parseDeclarator((yyval.interm).type, (yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3656 | } |
| 3657 | break; |
| 3658 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3659 | case 112: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3660 | |
| 3661 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3662 | (yyval.interm) = (yyvsp[(1) - (6)].interm); |
| 3663 | (yyval.interm).intermAggregate = context->parseArrayDeclarator((yyval.interm).type, (yyvsp[(1) - (6)].interm).intermAggregate, (yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3664 | } |
| 3665 | break; |
| 3666 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3667 | case 113: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3668 | |
| 3669 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3670 | ES3_ONLY("[]", (yyvsp[(3) - (7)].lex).line); |
| 3671 | (yyval.interm) = (yyvsp[(1) - (7)].interm); |
| 3672 | (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (7)].interm).intermAggregate, (yyvsp[(3) - (7)].lex).line, *(yyvsp[(3) - (7)].lex).string, (yyvsp[(4) - (7)].lex).line, nullptr, (yyvsp[(6) - (7)].lex).line, (yyvsp[(7) - (7)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3673 | } |
| 3674 | break; |
| 3675 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3676 | case 114: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3677 | |
| 3678 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3679 | ES3_ONLY("=", (yyvsp[(7) - (8)].lex).line); |
| 3680 | (yyval.interm) = (yyvsp[(1) - (8)].interm); |
| 3681 | (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (8)].interm).intermAggregate, (yyvsp[(3) - (8)].lex).line, *(yyvsp[(3) - (8)].lex).string, (yyvsp[(4) - (8)].lex).line, (yyvsp[(5) - (8)].interm.intermTypedNode), (yyvsp[(7) - (8)].lex).line, (yyvsp[(8) - (8)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3682 | } |
| 3683 | break; |
| 3684 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3685 | case 115: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3686 | |
| 3687 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3688 | (yyval.interm) = (yyvsp[(1) - (5)].interm); |
| 3689 | (yyval.interm).intermAggregate = context->parseInitDeclarator((yyval.interm).type, (yyvsp[(1) - (5)].interm).intermAggregate, (yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(4) - (5)].lex).line, (yyvsp[(5) - (5)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3690 | } |
| 3691 | break; |
| 3692 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3693 | case 116: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3694 | |
| 3695 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3696 | (yyval.interm).type = (yyvsp[(1) - (1)].interm.type); |
| 3697 | (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yyvsp[(1) - (1)].interm.type).line, ""); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3698 | } |
| 3699 | break; |
| 3700 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3701 | case 117: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3702 | |
| 3703 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3704 | (yyval.interm).type = (yyvsp[(1) - (2)].interm.type); |
| 3705 | (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3706 | } |
| 3707 | break; |
| 3708 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3709 | case 118: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3710 | |
| 3711 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3712 | (yyval.interm).type = (yyvsp[(1) - (5)].interm.type); |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3713 | (yyval.interm).intermAggregate = context->parseSingleArrayDeclaration((yyval.interm).type, (yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3714 | } |
| 3715 | break; |
| 3716 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3717 | case 119: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3718 | |
| 3719 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3720 | ES3_ONLY("[]", (yyvsp[(3) - (6)].lex).line); |
| 3721 | (yyval.interm).type = (yyvsp[(1) - (6)].interm.type); |
| 3722 | (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].lex).line, nullptr, (yyvsp[(5) - (6)].lex).line, (yyvsp[(6) - (6)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3723 | } |
| 3724 | break; |
| 3725 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3726 | case 120: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3727 | |
| 3728 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3729 | ES3_ONLY("=", (yyvsp[(6) - (7)].lex).line); |
| 3730 | (yyval.interm).type = (yyvsp[(1) - (7)].interm.type); |
| 3731 | (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yyvsp[(2) - (7)].lex).line, *(yyvsp[(2) - (7)].lex).string, (yyvsp[(3) - (7)].lex).line, (yyvsp[(4) - (7)].interm.intermTypedNode), (yyvsp[(6) - (7)].lex).line, (yyvsp[(7) - (7)].interm.intermTypedNode)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3732 | } |
| 3733 | break; |
| 3734 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3735 | case 121: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3736 | |
| 3737 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3738 | (yyval.interm).type = (yyvsp[(1) - (4)].interm.type); |
| 3739 | (yyval.interm).intermAggregate = context->parseSingleInitDeclaration((yyval.interm).type, (yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(3) - (4)].lex).line, (yyvsp[(4) - (4)].interm.intermTypedNode)); |
| 3740 | } |
| 3741 | break; |
| 3742 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3743 | case 122: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3744 | |
| 3745 | { |
| 3746 | // $$.type is not used in invariant declarations. |
| 3747 | (yyval.interm).intermAggregate = context->parseInvariantDeclaration((yyvsp[(1) - (2)].lex).line, (yyvsp[(2) - (2)].lex).line, (yyvsp[(2) - (2)].lex).string, (yyvsp[(2) - (2)].lex).symbol); |
| 3748 | } |
| 3749 | break; |
| 3750 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3751 | case 123: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 3752 | |
| 3753 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3754 | (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); |
| 3755 | |
| 3756 | if ((yyvsp[(1) - (1)].interm.type).array) { |
Alexis Hetu | 42ff6b1 | 2015-06-03 16:03:48 -0400 | [diff] [blame] | 3757 | ES3_ONLY("[]", (yyvsp[(1) - (1)].interm.type).line); |
| 3758 | if (context->getShaderVersion() != 300) { |
| 3759 | (yyvsp[(1) - (1)].interm.type).clearArrayness(); |
| 3760 | } |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3761 | } |
| 3762 | } |
| 3763 | break; |
| 3764 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3765 | case 124: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3766 | |
| 3767 | { |
Alexis Hetu | 42ff6b1 | 2015-06-03 16:03:48 -0400 | [diff] [blame] | 3768 | (yyval.interm.type) = context->addFullySpecifiedType((yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(1) - (2)].interm.type).invariant, (yyvsp[(1) - (2)].interm.type).layoutQualifier, (yyvsp[(2) - (2)].interm.type)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3769 | } |
| 3770 | break; |
| 3771 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3772 | case 125: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3773 | |
| 3774 | { |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 3775 | (yyval.interm.type).qualifier = EvqSmooth; |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3776 | } |
| 3777 | break; |
| 3778 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3779 | case 126: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3780 | |
| 3781 | { |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 3782 | (yyval.interm.type).qualifier = EvqFlat; |
| 3783 | } |
| 3784 | break; |
| 3785 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3786 | case 127: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 3787 | |
| 3788 | { |
| 3789 | (yyval.interm.qualifier) = EvqConstReadOnly; |
| 3790 | } |
| 3791 | break; |
| 3792 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3793 | case 128: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 3794 | |
| 3795 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3796 | VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line); |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame] | 3797 | ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3798 | if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute")) |
| 3799 | context->recover(); |
| 3800 | (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line); |
| 3801 | } |
| 3802 | break; |
| 3803 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3804 | case 129: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3805 | |
| 3806 | { |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame] | 3807 | ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3808 | if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying")) |
| 3809 | context->recover(); |
Nicolas Capens | 08ca3c6 | 2015-02-13 16:06:45 -0500 | [diff] [blame] | 3810 | if (context->shaderType == GL_VERTEX_SHADER) |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3811 | (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line); |
| 3812 | else |
| 3813 | (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line); |
| 3814 | } |
| 3815 | break; |
| 3816 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3817 | case 130: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3818 | |
| 3819 | { |
Nicolas Capens | c684185 | 2015-02-15 14:25:37 -0500 | [diff] [blame] | 3820 | ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3821 | if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying")) |
| 3822 | context->recover(); |
Nicolas Capens | 08ca3c6 | 2015-02-13 16:06:45 -0500 | [diff] [blame] | 3823 | if (context->shaderType == GL_VERTEX_SHADER) |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3824 | (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line); |
| 3825 | else |
| 3826 | (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line); |
| 3827 | } |
| 3828 | break; |
| 3829 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3830 | case 131: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3831 | |
| 3832 | { |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3833 | (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yyvsp[(1) - (1)].interm.type).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3834 | } |
| 3835 | break; |
| 3836 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3837 | case 132: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 3838 | |
| 3839 | { |
| 3840 | (yyval.interm.type) = context->joinInterpolationQualifiers((yyvsp[(1) - (2)].interm.type).line, (yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line, (yyvsp[(2) - (2)].interm.type).qualifier); |
| 3841 | } |
| 3842 | break; |
| 3843 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3844 | case 133: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 3845 | |
| 3846 | { |
| 3847 | context->error((yyvsp[(1) - (1)].interm.type).line, "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getQualifierString((yyvsp[(1) - (1)].interm.type).qualifier)); |
| 3848 | context->recover(); |
| 3849 | |
| 3850 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 3851 | (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line); |
| 3852 | } |
| 3853 | break; |
| 3854 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3855 | case 134: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3856 | |
| 3857 | { |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 3858 | (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 3859 | (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier); |
| 3860 | } |
| 3861 | break; |
| 3862 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3863 | case 135: |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 3864 | |
| 3865 | { |
| 3866 | (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line); |
| 3867 | (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier); |
| 3868 | } |
| 3869 | break; |
| 3870 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3871 | case 136: |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 3872 | |
| 3873 | { |
Nicolas Capens | 31ad2aa | 2015-02-26 13:14:27 -0500 | [diff] [blame] | 3874 | (yyval.interm.type).qualifier = EvqConstExpr; |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3875 | (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line; |
| 3876 | } |
| 3877 | break; |
| 3878 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3879 | case 137: |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3880 | |
| 3881 | { |
| 3882 | ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | 42ff6b1 | 2015-06-03 16:03:48 -0400 | [diff] [blame] | 3883 | (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn; |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3884 | (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line; |
| 3885 | } |
| 3886 | break; |
| 3887 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3888 | case 138: |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3889 | |
| 3890 | { |
| 3891 | ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | 42ff6b1 | 2015-06-03 16:03:48 -0400 | [diff] [blame] | 3892 | (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut; |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3893 | (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line; |
| 3894 | } |
| 3895 | break; |
| 3896 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3897 | case 139: |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3898 | |
| 3899 | { |
Alexis Hetu | 42ff6b1 | 2015-06-03 16:03:48 -0400 | [diff] [blame] | 3900 | ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line); |
| 3901 | if (context->shaderType == GL_VERTEX_SHADER) |
| 3902 | { |
| 3903 | context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader"); |
| 3904 | context->recover(); |
| 3905 | } |
| 3906 | (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn; |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3907 | (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line; |
| 3908 | } |
| 3909 | break; |
| 3910 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3911 | case 140: |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3912 | |
| 3913 | { |
Alexis Hetu | 42ff6b1 | 2015-06-03 16:03:48 -0400 | [diff] [blame] | 3914 | ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line); |
| 3915 | if (context->shaderType == GL_FRAGMENT_SHADER) |
| 3916 | { |
| 3917 | context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader"); |
| 3918 | context->recover(); |
| 3919 | } |
| 3920 | (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut; |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3921 | (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line; |
| 3922 | } |
| 3923 | break; |
| 3924 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3925 | case 141: |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3926 | |
| 3927 | { |
| 3928 | if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform")) |
| 3929 | context->recover(); |
| 3930 | (yyval.interm.type).qualifier = EvqUniform; |
| 3931 | (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line; |
| 3932 | } |
| 3933 | break; |
| 3934 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3935 | case 142: |
Nicolas Capens | a6a79ab | 2015-02-17 12:42:14 -0500 | [diff] [blame] | 3936 | |
| 3937 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3938 | (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); |
| 3939 | |
| 3940 | if ((yyval.interm.type).precision == EbpUndefined) { |
| 3941 | (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type); |
| 3942 | if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) { |
| 3943 | context->recover(); |
| 3944 | } |
| 3945 | } |
| 3946 | } |
| 3947 | break; |
| 3948 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3949 | case 143: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3950 | |
| 3951 | { |
| 3952 | (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type); |
| 3953 | (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision); |
| 3954 | } |
| 3955 | break; |
| 3956 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3957 | case 144: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3958 | |
| 3959 | { |
| 3960 | (yyval.interm.precision) = EbpHigh; |
| 3961 | } |
| 3962 | break; |
| 3963 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3964 | case 145: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3965 | |
| 3966 | { |
| 3967 | (yyval.interm.precision) = EbpMedium; |
| 3968 | } |
| 3969 | break; |
| 3970 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3971 | case 146: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 3972 | |
| 3973 | { |
| 3974 | (yyval.interm.precision) = EbpLow; |
| 3975 | } |
| 3976 | break; |
| 3977 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3978 | case 147: |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 3979 | |
| 3980 | { |
| 3981 | ES3_ONLY("layout", (yyvsp[(1) - (4)].lex).line); |
| 3982 | (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier); |
| 3983 | } |
| 3984 | break; |
| 3985 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3986 | case 148: |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 3987 | |
| 3988 | { |
| 3989 | (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier); |
| 3990 | } |
| 3991 | break; |
| 3992 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 3993 | case 149: |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 3994 | |
| 3995 | { |
| 3996 | (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier)); |
| 3997 | } |
| 3998 | break; |
| 3999 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4000 | case 150: |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 4001 | |
| 4002 | { |
| 4003 | (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line); |
| 4004 | } |
| 4005 | break; |
| 4006 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4007 | case 151: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4008 | |
| 4009 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4010 | (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line); |
| 4011 | } |
| 4012 | break; |
| 4013 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4014 | case 152: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4015 | |
| 4016 | { |
| 4017 | (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line); |
| 4018 | } |
| 4019 | break; |
| 4020 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4021 | case 153: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4022 | |
| 4023 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4024 | (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); |
| 4025 | } |
| 4026 | break; |
| 4027 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4028 | case 154: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4029 | |
| 4030 | { |
| 4031 | (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type); |
| 4032 | |
| 4033 | if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) |
| 4034 | context->recover(); |
| 4035 | else { |
| 4036 | int size; |
| 4037 | if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size)) |
| 4038 | context->recover(); |
| 4039 | (yyval.interm.type).setArray(true, size); |
| 4040 | } |
| 4041 | } |
| 4042 | break; |
| 4043 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4044 | case 155: |
| 4045 | |
| 4046 | { |
| 4047 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4048 | (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4049 | } |
| 4050 | break; |
| 4051 | |
| 4052 | case 156: |
| 4053 | |
| 4054 | { |
| 4055 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4056 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4057 | } |
| 4058 | break; |
| 4059 | |
| 4060 | case 157: |
| 4061 | |
| 4062 | { |
| 4063 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4064 | (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4065 | } |
| 4066 | break; |
| 4067 | |
| 4068 | case 158: |
| 4069 | |
| 4070 | { |
| 4071 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4072 | (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4073 | } |
| 4074 | break; |
| 4075 | |
| 4076 | case 159: |
| 4077 | |
| 4078 | { |
| 4079 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4080 | (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4081 | } |
| 4082 | break; |
| 4083 | |
| 4084 | case 160: |
| 4085 | |
| 4086 | { |
| 4087 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4088 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4089 | (yyval.interm.type).setAggregate(2); |
| 4090 | } |
| 4091 | break; |
| 4092 | |
| 4093 | case 161: |
| 4094 | |
| 4095 | { |
| 4096 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4097 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4098 | (yyval.interm.type).setAggregate(3); |
| 4099 | } |
| 4100 | break; |
| 4101 | |
| 4102 | case 162: |
| 4103 | |
| 4104 | { |
| 4105 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4106 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4107 | (yyval.interm.type).setAggregate(4); |
| 4108 | } |
| 4109 | break; |
| 4110 | |
| 4111 | case 163: |
| 4112 | |
| 4113 | { |
| 4114 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4115 | (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); |
| 4116 | (yyval.interm.type).setAggregate(2); |
| 4117 | } |
| 4118 | break; |
| 4119 | |
| 4120 | case 164: |
| 4121 | |
| 4122 | { |
| 4123 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4124 | (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); |
| 4125 | (yyval.interm.type).setAggregate(3); |
| 4126 | } |
| 4127 | break; |
| 4128 | |
| 4129 | case 165: |
| 4130 | |
| 4131 | { |
| 4132 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4133 | (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); |
| 4134 | (yyval.interm.type).setAggregate(4); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4135 | } |
| 4136 | break; |
| 4137 | |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4138 | case 166: |
| 4139 | |
| 4140 | { |
| 4141 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4142 | (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); |
| 4143 | (yyval.interm.type).setAggregate(2); |
| 4144 | } |
| 4145 | break; |
| 4146 | |
| 4147 | case 167: |
| 4148 | |
| 4149 | { |
| 4150 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4151 | (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); |
| 4152 | (yyval.interm.type).setAggregate(3); |
| 4153 | } |
| 4154 | break; |
| 4155 | |
| 4156 | case 168: |
| 4157 | |
| 4158 | { |
| 4159 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4160 | (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); |
| 4161 | (yyval.interm.type).setAggregate(4); |
| 4162 | } |
| 4163 | break; |
| 4164 | |
| 4165 | case 169: |
| 4166 | |
| 4167 | { |
| 4168 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4169 | (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line); |
| 4170 | (yyval.interm.type).setAggregate(2); |
| 4171 | } |
| 4172 | break; |
| 4173 | |
| 4174 | case 170: |
| 4175 | |
| 4176 | { |
| 4177 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4178 | (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line); |
| 4179 | (yyval.interm.type).setAggregate(3); |
| 4180 | } |
| 4181 | break; |
| 4182 | |
| 4183 | case 171: |
| 4184 | |
| 4185 | { |
| 4186 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4187 | (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line); |
| 4188 | (yyval.interm.type).setAggregate(4); |
| 4189 | } |
| 4190 | break; |
| 4191 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4192 | case 172: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4193 | |
| 4194 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4195 | FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line); |
| 4196 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4197 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4198 | (yyval.interm.type).setMatrix(2, 2); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4199 | } |
| 4200 | break; |
| 4201 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4202 | case 173: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4203 | |
| 4204 | { |
| 4205 | FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line); |
| 4206 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4207 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4208 | (yyval.interm.type).setMatrix(3, 3); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4209 | } |
| 4210 | break; |
| 4211 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4212 | case 174: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4213 | |
| 4214 | { |
| 4215 | FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line); |
| 4216 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4217 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4218 | (yyval.interm.type).setMatrix(4, 4); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4219 | } |
| 4220 | break; |
| 4221 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4222 | case 175: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4223 | |
| 4224 | { |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4225 | FRAG_VERT_ONLY("mat2x3", (yyvsp[(1) - (1)].lex).line); |
| 4226 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4227 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4228 | (yyval.interm.type).setMatrix(2, 3); |
| 4229 | } |
| 4230 | break; |
| 4231 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4232 | case 176: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4233 | |
| 4234 | { |
| 4235 | FRAG_VERT_ONLY("mat3x2", (yyvsp[(1) - (1)].lex).line); |
| 4236 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4237 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4238 | (yyval.interm.type).setMatrix(3, 2); |
| 4239 | } |
| 4240 | break; |
| 4241 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4242 | case 177: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4243 | |
| 4244 | { |
| 4245 | FRAG_VERT_ONLY("mat2x4", (yyvsp[(1) - (1)].lex).line); |
| 4246 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4247 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4248 | (yyval.interm.type).setMatrix(2, 4); |
| 4249 | } |
| 4250 | break; |
| 4251 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4252 | case 178: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4253 | |
| 4254 | { |
| 4255 | FRAG_VERT_ONLY("mat4x2", (yyvsp[(1) - (1)].lex).line); |
| 4256 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4257 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4258 | (yyval.interm.type).setMatrix(4, 2); |
| 4259 | } |
| 4260 | break; |
| 4261 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4262 | case 179: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4263 | |
| 4264 | { |
| 4265 | FRAG_VERT_ONLY("mat3x4", (yyvsp[(1) - (1)].lex).line); |
| 4266 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4267 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4268 | (yyval.interm.type).setMatrix(3, 4); |
| 4269 | } |
| 4270 | break; |
| 4271 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4272 | case 180: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4273 | |
| 4274 | { |
| 4275 | FRAG_VERT_ONLY("mat4x3", (yyvsp[(1) - (1)].lex).line); |
| 4276 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4277 | (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); |
| 4278 | (yyval.interm.type).setMatrix(4, 3); |
| 4279 | } |
| 4280 | break; |
| 4281 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4282 | case 181: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4283 | |
| 4284 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4285 | FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line); |
| 4286 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4287 | (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line); |
| 4288 | } |
| 4289 | break; |
| 4290 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4291 | case 182: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4292 | |
| 4293 | { |
| 4294 | FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line); |
| 4295 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4296 | (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line); |
| 4297 | } |
| 4298 | break; |
| 4299 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4300 | case 183: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4301 | |
| 4302 | { |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 4303 | if (!context->supportsExtension("GL_OES_EGL_image_external")) { |
| 4304 | context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES", ""); |
| 4305 | context->recover(); |
| 4306 | } |
| 4307 | FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line); |
| 4308 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4309 | (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line); |
| 4310 | } |
| 4311 | break; |
| 4312 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4313 | case 184: |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 4314 | |
| 4315 | { |
Alexis Hetu | b027aa9 | 2015-01-19 15:56:12 -0500 | [diff] [blame] | 4316 | FRAG_VERT_ONLY("sampler3D", (yyvsp[(1) - (1)].lex).line); |
| 4317 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4318 | (yyval.interm.type).setBasic(EbtSampler3D, qual, (yyvsp[(1) - (1)].lex).line); |
| 4319 | } |
| 4320 | break; |
| 4321 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4322 | case 185: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4323 | |
| 4324 | { |
| 4325 | FRAG_VERT_ONLY("sampler2DArray", (yyvsp[(1) - (1)].lex).line); |
| 4326 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4327 | (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line); |
| 4328 | } |
| 4329 | break; |
| 4330 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4331 | case 186: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4332 | |
| 4333 | { |
| 4334 | FRAG_VERT_ONLY("isampler2D", (yyvsp[(1) - (1)].lex).line); |
| 4335 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4336 | (yyval.interm.type).setBasic(EbtISampler2D, qual, (yyvsp[(1) - (1)].lex).line); |
| 4337 | } |
| 4338 | break; |
| 4339 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4340 | case 187: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4341 | |
| 4342 | { |
| 4343 | FRAG_VERT_ONLY("isampler3D", (yyvsp[(1) - (1)].lex).line); |
| 4344 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4345 | (yyval.interm.type).setBasic(EbtISampler3D, qual, (yyvsp[(1) - (1)].lex).line); |
| 4346 | } |
| 4347 | break; |
| 4348 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4349 | case 188: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4350 | |
| 4351 | { |
| 4352 | FRAG_VERT_ONLY("isamplerCube", (yyvsp[(1) - (1)].lex).line); |
| 4353 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4354 | (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yyvsp[(1) - (1)].lex).line); |
| 4355 | } |
| 4356 | break; |
| 4357 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4358 | case 189: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4359 | |
| 4360 | { |
| 4361 | FRAG_VERT_ONLY("isampler2DArray", (yyvsp[(1) - (1)].lex).line); |
| 4362 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4363 | (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yyvsp[(1) - (1)].lex).line); |
| 4364 | } |
| 4365 | break; |
| 4366 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4367 | case 190: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4368 | |
| 4369 | { |
| 4370 | FRAG_VERT_ONLY("usampler2D", (yyvsp[(1) - (1)].lex).line); |
| 4371 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4372 | (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yyvsp[(1) - (1)].lex).line); |
| 4373 | } |
| 4374 | break; |
| 4375 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4376 | case 191: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4377 | |
| 4378 | { |
| 4379 | FRAG_VERT_ONLY("usampler3D", (yyvsp[(1) - (1)].lex).line); |
| 4380 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4381 | (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yyvsp[(1) - (1)].lex).line); |
| 4382 | } |
| 4383 | break; |
| 4384 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4385 | case 192: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4386 | |
| 4387 | { |
| 4388 | FRAG_VERT_ONLY("usamplerCube", (yyvsp[(1) - (1)].lex).line); |
| 4389 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4390 | (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yyvsp[(1) - (1)].lex).line); |
| 4391 | } |
| 4392 | break; |
| 4393 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4394 | case 193: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4395 | |
| 4396 | { |
| 4397 | FRAG_VERT_ONLY("usampler2DArray", (yyvsp[(1) - (1)].lex).line); |
| 4398 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4399 | (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line); |
| 4400 | } |
| 4401 | break; |
| 4402 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4403 | case 194: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4404 | |
| 4405 | { |
| 4406 | FRAG_VERT_ONLY("sampler2DShadow", (yyvsp[(1) - (1)].lex).line); |
| 4407 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4408 | (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yyvsp[(1) - (1)].lex).line); |
| 4409 | } |
| 4410 | break; |
| 4411 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4412 | case 195: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4413 | |
| 4414 | { |
| 4415 | FRAG_VERT_ONLY("samplerCubeShadow", (yyvsp[(1) - (1)].lex).line); |
| 4416 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4417 | (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yyvsp[(1) - (1)].lex).line); |
| 4418 | } |
| 4419 | break; |
| 4420 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4421 | case 196: |
Alexis Hetu | b14178b | 2015-04-13 13:23:20 -0400 | [diff] [blame] | 4422 | |
| 4423 | { |
| 4424 | FRAG_VERT_ONLY("sampler2DArrayShadow", (yyvsp[(1) - (1)].lex).line); |
| 4425 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4426 | (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yyvsp[(1) - (1)].lex).line); |
| 4427 | } |
| 4428 | break; |
| 4429 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4430 | case 197: |
Alexis Hetu | b027aa9 | 2015-01-19 15:56:12 -0500 | [diff] [blame] | 4431 | |
| 4432 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4433 | FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line); |
| 4434 | (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); |
| 4435 | (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4436 | } |
| 4437 | break; |
| 4438 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4439 | case 198: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4440 | |
| 4441 | { |
| 4442 | // |
| 4443 | // This is for user defined type names. The lexical phase looked up the |
| 4444 | // type. |
| 4445 | // |
| 4446 | TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType(); |
| 4447 | TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; |
| 4448 | (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line); |
| 4449 | (yyval.interm.type).userDef = &structure; |
| 4450 | } |
| 4451 | break; |
| 4452 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4453 | case 199: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4454 | |
| 4455 | { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); } |
| 4456 | break; |
| 4457 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4458 | case 200: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4459 | |
| 4460 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4461 | (yyval.interm.type) = context->addStructure((yyvsp[(1) - (6)].lex).line, (yyvsp[(2) - (6)].lex).line, (yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.fieldList)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4462 | } |
| 4463 | break; |
| 4464 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4465 | case 201: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4466 | |
| 4467 | { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); } |
| 4468 | break; |
| 4469 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4470 | case 202: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4471 | |
| 4472 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4473 | (yyval.interm.type) = context->addStructure((yyvsp[(1) - (5)].lex).line, (yyvsp[(1) - (5)].lex).line, NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4474 | } |
| 4475 | break; |
| 4476 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4477 | case 203: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4478 | |
| 4479 | { |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4480 | (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4481 | } |
| 4482 | break; |
| 4483 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4484 | case 204: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4485 | |
| 4486 | { |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4487 | (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList); |
| 4488 | for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) { |
| 4489 | TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i]; |
| 4490 | for (unsigned int j = 0; j < (yyval.interm.fieldList)->size(); ++j) { |
| 4491 | if ((*(yyval.interm.fieldList))[j]->name() == field->name()) { |
| 4492 | context->error((*(yyvsp[(2) - (2)].interm.fieldList))[i]->line(), "duplicate field name in structure:", "struct", field->name().c_str()); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4493 | context->recover(); |
| 4494 | } |
| 4495 | } |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4496 | (yyval.interm.fieldList)->push_back((*(yyvsp[(2) - (2)].interm.fieldList))[i]); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4497 | } |
| 4498 | } |
| 4499 | break; |
| 4500 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4501 | case 205: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4502 | |
| 4503 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4504 | (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4505 | } |
| 4506 | break; |
| 4507 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4508 | case 206: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4509 | |
| 4510 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4511 | // ES3 Only, but errors should be handled elsewhere |
| 4512 | (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier; |
| 4513 | (yyvsp[(2) - (4)].interm.type).layoutQualifier = (yyvsp[(1) - (4)].interm.type).layoutQualifier; |
| 4514 | (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.fieldList)); |
| 4515 | } |
| 4516 | break; |
| 4517 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4518 | case 207: |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4519 | |
| 4520 | { |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4521 | (yyval.interm.fieldList) = NewPoolTFieldList(); |
| 4522 | (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4523 | } |
| 4524 | break; |
| 4525 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4526 | case 208: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4527 | |
| 4528 | { |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4529 | (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4530 | } |
| 4531 | break; |
| 4532 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4533 | case 209: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4534 | |
| 4535 | { |
| 4536 | if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) |
| 4537 | context->recover(); |
| 4538 | |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4539 | TType* type = new TType(EbtVoid, EbpUndefined); |
| 4540 | (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4541 | } |
| 4542 | break; |
| 4543 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4544 | case 210: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4545 | |
| 4546 | { |
| 4547 | if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string)) |
| 4548 | context->recover(); |
| 4549 | |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4550 | TType* type = new TType(EbtVoid, EbpUndefined); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4551 | int size; |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4552 | if (context->arraySizeErrorCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLine(), (yyvsp[(3) - (4)].interm.intermTypedNode), size)) |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4553 | context->recover(); |
Alexis Hetu | a8b364b | 2015-06-10 11:48:40 -0400 | [diff] [blame] | 4554 | type->setArraySize(size); |
| 4555 | |
| 4556 | (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yyvsp[(1) - (4)].lex).line); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4557 | } |
| 4558 | break; |
| 4559 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4560 | case 211: |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 4561 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4562 | { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4563 | break; |
| 4564 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4565 | case 212: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4566 | |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4567 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4568 | break; |
| 4569 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4570 | case 213: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4571 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4572 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); } |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4573 | break; |
| 4574 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4575 | case 214: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4576 | |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4577 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4578 | break; |
| 4579 | |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4580 | case 215: |
Alexis Hetu | 55a2cbc | 2015-04-16 10:49:45 -0400 | [diff] [blame] | 4581 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4582 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4583 | break; |
| 4584 | |
| 4585 | case 216: |
| 4586 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4587 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4588 | break; |
| 4589 | |
| 4590 | case 217: |
| 4591 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4592 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4593 | break; |
| 4594 | |
| 4595 | case 218: |
| 4596 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4597 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
| 4598 | break; |
| 4599 | |
| 4600 | case 219: |
| 4601 | |
| 4602 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
| 4603 | break; |
| 4604 | |
| 4605 | case 220: |
| 4606 | |
| 4607 | { (yyval.interm.intermAggregate) = 0; } |
| 4608 | break; |
| 4609 | |
| 4610 | case 221: |
| 4611 | |
| 4612 | { context->symbolTable.push(); } |
| 4613 | break; |
| 4614 | |
| 4615 | case 222: |
| 4616 | |
| 4617 | { context->symbolTable.pop(); } |
| 4618 | break; |
| 4619 | |
| 4620 | case 223: |
| 4621 | |
Nicolas Capens | 7d62679 | 2015-02-17 17:58:31 -0500 | [diff] [blame] | 4622 | { |
| 4623 | if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) { |
| 4624 | (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence); |
| 4625 | (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line); |
| 4626 | } |
| 4627 | (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate); |
| 4628 | } |
| 4629 | break; |
| 4630 | |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4631 | case 224: |
| 4632 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4633 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4634 | break; |
| 4635 | |
| 4636 | case 225: |
| 4637 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4638 | { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } |
| 4639 | break; |
| 4640 | |
| 4641 | case 226: |
| 4642 | |
| 4643 | { context->symbolTable.push(); } |
| 4644 | break; |
| 4645 | |
| 4646 | case 227: |
| 4647 | |
| 4648 | { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); } |
| 4649 | break; |
| 4650 | |
| 4651 | case 228: |
| 4652 | |
| 4653 | { context->symbolTable.push(); } |
| 4654 | break; |
| 4655 | |
| 4656 | case 229: |
| 4657 | |
| 4658 | { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); } |
| 4659 | break; |
| 4660 | |
| 4661 | case 230: |
| 4662 | |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4663 | { |
| 4664 | (yyval.interm.intermNode) = 0; |
| 4665 | } |
| 4666 | break; |
| 4667 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4668 | case 231: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4669 | |
| 4670 | { |
| 4671 | if ((yyvsp[(2) - (3)].interm.intermAggregate)) { |
| 4672 | (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence); |
| 4673 | (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line); |
| 4674 | } |
| 4675 | (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate); |
| 4676 | } |
| 4677 | break; |
| 4678 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4679 | case 232: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4680 | |
| 4681 | { |
| 4682 | (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0); |
| 4683 | } |
| 4684 | break; |
| 4685 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4686 | case 233: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4687 | |
| 4688 | { |
| 4689 | (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0); |
| 4690 | } |
| 4691 | break; |
| 4692 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4693 | case 234: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4694 | |
| 4695 | { (yyval.interm.intermNode) = 0; } |
| 4696 | break; |
| 4697 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4698 | case 235: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4699 | |
| 4700 | { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); } |
| 4701 | break; |
| 4702 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4703 | case 236: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4704 | |
| 4705 | { |
| 4706 | if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode))) |
| 4707 | context->recover(); |
| 4708 | (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line); |
| 4709 | } |
| 4710 | break; |
| 4711 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4712 | case 237: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4713 | |
| 4714 | { |
| 4715 | (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode); |
| 4716 | (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode); |
| 4717 | } |
| 4718 | break; |
| 4719 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4720 | case 238: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4721 | |
| 4722 | { |
| 4723 | (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode); |
| 4724 | (yyval.interm.nodePair).node2 = 0; |
| 4725 | } |
| 4726 | break; |
| 4727 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4728 | case 239: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4729 | |
| 4730 | { |
| 4731 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 4732 | if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode))) |
| 4733 | context->recover(); |
| 4734 | } |
| 4735 | break; |
| 4736 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4737 | case 240: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4738 | |
| 4739 | { |
| 4740 | TIntermNode* intermNode; |
| 4741 | if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) |
| 4742 | context->recover(); |
| 4743 | if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) |
| 4744 | context->recover(); |
| 4745 | |
| 4746 | if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) |
| 4747 | (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode); |
| 4748 | else { |
| 4749 | context->recover(); |
| 4750 | (yyval.interm.intermTypedNode) = 0; |
| 4751 | } |
| 4752 | } |
| 4753 | break; |
| 4754 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4755 | case 241: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4756 | |
| 4757 | { context->symbolTable.push(); ++context->loopNestingLevel; } |
| 4758 | break; |
| 4759 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4760 | case 242: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4761 | |
| 4762 | { |
| 4763 | context->symbolTable.pop(); |
| 4764 | (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(1) - (6)].lex).line); |
| 4765 | --context->loopNestingLevel; |
| 4766 | } |
| 4767 | break; |
| 4768 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4769 | case 243: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4770 | |
| 4771 | { ++context->loopNestingLevel; } |
| 4772 | break; |
| 4773 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4774 | case 244: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4775 | |
| 4776 | { |
| 4777 | if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode))) |
| 4778 | context->recover(); |
| 4779 | |
| 4780 | (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(4) - (8)].lex).line); |
| 4781 | --context->loopNestingLevel; |
| 4782 | } |
| 4783 | break; |
| 4784 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4785 | case 245: |
Nicolas Capens | e9c5e4f | 2014-05-28 22:46:43 -0400 | [diff] [blame] | 4786 | |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4787 | { context->symbolTable.push(); ++context->loopNestingLevel; } |
Alexis Hetu | b027aa9 | 2015-01-19 15:56:12 -0500 | [diff] [blame] | 4788 | break; |
| 4789 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4790 | case 246: |
Alexis Hetu | b027aa9 | 2015-01-19 15:56:12 -0500 | [diff] [blame] | 4791 | |
| 4792 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4793 | context->symbolTable.pop(); |
| 4794 | (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopFor, (yyvsp[(4) - (7)].interm.intermNode), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node2), (yyvsp[(7) - (7)].interm.intermNode), (yyvsp[(1) - (7)].lex).line); |
| 4795 | --context->loopNestingLevel; |
Nicolas Capens | 3c20f80 | 2015-02-17 17:17:20 -0500 | [diff] [blame] | 4796 | } |
| 4797 | break; |
| 4798 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4799 | case 247: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4800 | |
| 4801 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4802 | (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4803 | } |
| 4804 | break; |
| 4805 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4806 | case 248: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4807 | |
| 4808 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4809 | (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4810 | } |
| 4811 | break; |
| 4812 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4813 | case 249: |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4814 | |
| 4815 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4816 | (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); |
| 4817 | } |
| 4818 | break; |
| 4819 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4820 | case 250: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4821 | |
| 4822 | { |
| 4823 | (yyval.interm.intermTypedNode) = 0; |
| 4824 | } |
| 4825 | break; |
| 4826 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4827 | case 251: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4828 | |
| 4829 | { |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4830 | (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode); |
| 4831 | (yyval.interm.nodePair).node2 = 0; |
| 4832 | } |
| 4833 | break; |
| 4834 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4835 | case 252: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4836 | |
| 4837 | { |
| 4838 | (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode); |
| 4839 | (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode); |
| 4840 | } |
| 4841 | break; |
| 4842 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4843 | case 253: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4844 | |
| 4845 | { |
| 4846 | if (context->loopNestingLevel <= 0) { |
| 4847 | context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", ""); |
| 4848 | context->recover(); |
| 4849 | } |
| 4850 | (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line); |
| 4851 | } |
| 4852 | break; |
| 4853 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4854 | case 254: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4855 | |
| 4856 | { |
| 4857 | if (context->loopNestingLevel <= 0) { |
| 4858 | context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", ""); |
| 4859 | context->recover(); |
| 4860 | } |
| 4861 | (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line); |
| 4862 | } |
| 4863 | break; |
| 4864 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4865 | case 255: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4866 | |
| 4867 | { |
| 4868 | (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line); |
| 4869 | if (context->currentFunctionType->getBasicType() != EbtVoid) { |
| 4870 | context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return"); |
| 4871 | context->recover(); |
| 4872 | } |
| 4873 | } |
| 4874 | break; |
| 4875 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4876 | case 256: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4877 | |
| 4878 | { |
| 4879 | (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line); |
| 4880 | context->functionReturnsValue = true; |
| 4881 | if (context->currentFunctionType->getBasicType() == EbtVoid) { |
| 4882 | context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return"); |
| 4883 | context->recover(); |
| 4884 | } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) { |
| 4885 | context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return"); |
| 4886 | context->recover(); |
| 4887 | } |
| 4888 | } |
| 4889 | break; |
| 4890 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4891 | case 257: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4892 | |
| 4893 | { |
| 4894 | FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line); |
| 4895 | (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line); |
| 4896 | } |
| 4897 | break; |
| 4898 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4899 | case 258: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4900 | |
| 4901 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4902 | (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4903 | context->treeRoot = (yyval.interm.intermNode); |
| 4904 | } |
| 4905 | break; |
| 4906 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4907 | case 259: |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4908 | |
| 4909 | { |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4910 | (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0); |
| 4911 | context->treeRoot = (yyval.interm.intermNode); |
Alexis Hetu | 1780905 | 2015-05-13 11:28:22 -0400 | [diff] [blame] | 4912 | } |
| 4913 | break; |
| 4914 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4915 | case 260: |
Alexis Hetu | ad6b875 | 2015-06-09 16:15:30 -0400 | [diff] [blame] | 4916 | |
| 4917 | { |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4918 | (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); |
| 4919 | } |
| 4920 | break; |
| 4921 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4922 | case 261: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4923 | |
| 4924 | { |
| 4925 | (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); |
| 4926 | } |
| 4927 | break; |
| 4928 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 4929 | case 262: |
Alexis Hetu | dd7ff7a | 2015-06-11 08:25:30 -0400 | [diff] [blame] | 4930 | |
| 4931 | { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4932 | TFunction* function = (yyvsp[(1) - (1)].interm).function; |
| 4933 | |
Nicolas Capens | 0a7f0c2 | 2015-02-18 14:47:31 -0500 | [diff] [blame] | 4934 | const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4935 | |
| 4936 | if (builtIn) |
| 4937 | { |
| 4938 | context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str()); |
| 4939 | context->recover(); |
| 4940 | } |
| 4941 | |
Nicolas Capens | 0a7f0c2 | 2015-02-18 14:47:31 -0500 | [diff] [blame] | 4942 | TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion)); |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4943 | // |
| 4944 | // Note: 'prevDec' could be 'function' if this is the first time we've seen function |
| 4945 | // as it would have just been put in the symbol table. Otherwise, we're looking up |
| 4946 | // an earlier occurance. |
| 4947 | // |
| 4948 | if (prevDec->isDefined()) { |
| 4949 | // |
| 4950 | // Then this function already has a body. |
| 4951 | // |
| 4952 | context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str()); |
| 4953 | context->recover(); |
| 4954 | } |
| 4955 | prevDec->setDefined(); |
| 4956 | |
| 4957 | // |
| 4958 | // Raise error message if main function takes any parameters or return anything other than void |
| 4959 | // |
| 4960 | if (function->getName() == "main") { |
| 4961 | if (function->getParamCount() > 0) { |
| 4962 | context->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function->getName().c_str()); |
| 4963 | context->recover(); |
| 4964 | } |
| 4965 | if (function->getReturnType().getBasicType() != EbtVoid) { |
| 4966 | context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value"); |
| 4967 | context->recover(); |
| 4968 | } |
| 4969 | } |
| 4970 | |
| 4971 | // |
| 4972 | // Remember the return type for later checking for RETURN statements. |
| 4973 | // |
| 4974 | context->currentFunctionType = &(prevDec->getReturnType()); |
| 4975 | context->functionReturnsValue = false; |
| 4976 | |
| 4977 | // |
| 4978 | // Insert parameters into the symbol table. |
| 4979 | // If the parameter has no name, it's not an error, just don't insert it |
| 4980 | // (could be used for unused args). |
| 4981 | // |
| 4982 | // Also, accumulate the list of parameters into the HIL, so lower level code |
| 4983 | // knows where to find parameters. |
| 4984 | // |
| 4985 | TIntermAggregate* paramNodes = new TIntermAggregate; |
| 4986 | for (int i = 0; i < function->getParamCount(); i++) { |
| 4987 | const TParameter& param = function->getParam(i); |
| 4988 | if (param.name != 0) { |
| 4989 | TVariable *variable = new TVariable(param.name, *param.type); |
| 4990 | // |
| 4991 | // Insert the parameters with name in the symbol table. |
| 4992 | // |
Nicolas Capens | d603ecd | 2015-02-18 14:52:21 -0500 | [diff] [blame] | 4993 | if (! context->symbolTable.declare(*variable)) { |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 4994 | context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str()); |
| 4995 | context->recover(); |
| 4996 | delete variable; |
| 4997 | } |
| 4998 | |
| 4999 | // |
| 5000 | // Add the parameter to the HIL |
| 5001 | // |
| 5002 | paramNodes = context->intermediate.growAggregate( |
| 5003 | paramNodes, |
| 5004 | context->intermediate.addSymbol(variable->getUniqueId(), |
| 5005 | variable->getName(), |
| 5006 | variable->getType(), (yyvsp[(1) - (1)].interm).line), |
| 5007 | (yyvsp[(1) - (1)].interm).line); |
| 5008 | } else { |
| 5009 | paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line); |
| 5010 | } |
| 5011 | } |
| 5012 | context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line); |
| 5013 | (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes; |
| 5014 | context->loopNestingLevel = 0; |
| 5015 | } |
| 5016 | break; |
| 5017 | |
Alexis Hetu | a35d823 | 2015-06-11 17:11:06 -0400 | [diff] [blame^] | 5018 | case 263: |
John Bauman | 66b8ab2 | 2014-05-06 15:57:45 -0400 | [diff] [blame] | 5019 | |
| 5020 | { |
| 5021 | //?? Check that all paths return a value if return type != void ? |
| 5022 | // May be best done as post process phase on intermediate code |
| 5023 | if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) { |
| 5024 | context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str()); |
| 5025 | context->recover(); |
| 5026 | } |
| 5027 | |
| 5028 | (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0); |
| 5029 | context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line); |
| 5030 | (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str()); |
| 5031 | (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType()); |
| 5032 | |
| 5033 | // store the pragma information for debug and optimize and other vendor specific |
| 5034 | // information. This information can be queried from the parse tree |
| 5035 | (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize); |
| 5036 | (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug); |
| 5037 | |
| 5038 | if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()) |
| 5039 | (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine()); |
| 5040 | |
| 5041 | context->symbolTable.pop(); |
| 5042 | } |
| 5043 | break; |
| 5044 | |
| 5045 | |
| 5046 | |
| 5047 | default: break; |
| 5048 | } |
| 5049 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
| 5050 | |
| 5051 | YYPOPSTACK (yylen); |
| 5052 | yylen = 0; |
| 5053 | YY_STACK_PRINT (yyss, yyssp); |
| 5054 | |
| 5055 | *++yyvsp = yyval; |
| 5056 | |
| 5057 | /* Now `shift' the result of the reduction. Determine what state |
| 5058 | that goes to, based on the state we popped back to and the rule |
| 5059 | number reduced by. */ |
| 5060 | |
| 5061 | yyn = yyr1[yyn]; |
| 5062 | |
| 5063 | yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; |
| 5064 | if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) |
| 5065 | yystate = yytable[yystate]; |
| 5066 | else |
| 5067 | yystate = yydefgoto[yyn - YYNTOKENS]; |
| 5068 | |
| 5069 | goto yynewstate; |
| 5070 | |
| 5071 | |
| 5072 | /*------------------------------------. |
| 5073 | | yyerrlab -- here on detecting error | |
| 5074 | `------------------------------------*/ |
| 5075 | yyerrlab: |
| 5076 | /* If not already recovering from an error, report this error. */ |
| 5077 | if (!yyerrstatus) |
| 5078 | { |
| 5079 | ++yynerrs; |
| 5080 | #if ! YYERROR_VERBOSE |
| 5081 | yyerror (context, YY_("syntax error")); |
| 5082 | #else |
| 5083 | { |
| 5084 | YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); |
| 5085 | if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) |
| 5086 | { |
| 5087 | YYSIZE_T yyalloc = 2 * yysize; |
| 5088 | if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) |
| 5089 | yyalloc = YYSTACK_ALLOC_MAXIMUM; |
| 5090 | if (yymsg != yymsgbuf) |
| 5091 | YYSTACK_FREE (yymsg); |
| 5092 | yymsg = (char *) YYSTACK_ALLOC (yyalloc); |
| 5093 | if (yymsg) |
| 5094 | yymsg_alloc = yyalloc; |
| 5095 | else |
| 5096 | { |
| 5097 | yymsg = yymsgbuf; |
| 5098 | yymsg_alloc = sizeof yymsgbuf; |
| 5099 | } |
| 5100 | } |
| 5101 | |
| 5102 | if (0 < yysize && yysize <= yymsg_alloc) |
| 5103 | { |
| 5104 | (void) yysyntax_error (yymsg, yystate, yychar); |
| 5105 | yyerror (context, yymsg); |
| 5106 | } |
| 5107 | else |
| 5108 | { |
| 5109 | yyerror (context, YY_("syntax error")); |
| 5110 | if (yysize != 0) |
| 5111 | goto yyexhaustedlab; |
| 5112 | } |
| 5113 | } |
| 5114 | #endif |
| 5115 | } |
| 5116 | |
| 5117 | |
| 5118 | |
| 5119 | if (yyerrstatus == 3) |
| 5120 | { |
| 5121 | /* If just tried and failed to reuse lookahead token after an |
| 5122 | error, discard it. */ |
| 5123 | |
| 5124 | if (yychar <= YYEOF) |
| 5125 | { |
| 5126 | /* Return failure if at end of input. */ |
| 5127 | if (yychar == YYEOF) |
| 5128 | YYABORT; |
| 5129 | } |
| 5130 | else |
| 5131 | { |
| 5132 | yydestruct ("Error: discarding", |
| 5133 | yytoken, &yylval, context); |
| 5134 | yychar = YYEMPTY; |
| 5135 | } |
| 5136 | } |
| 5137 | |
| 5138 | /* Else will try to reuse lookahead token after shifting the error |
| 5139 | token. */ |
| 5140 | goto yyerrlab1; |
| 5141 | |
| 5142 | |
| 5143 | /*---------------------------------------------------. |
| 5144 | | yyerrorlab -- error raised explicitly by YYERROR. | |
| 5145 | `---------------------------------------------------*/ |
| 5146 | yyerrorlab: |
| 5147 | |
| 5148 | /* Pacify compilers like GCC when the user code never invokes |
| 5149 | YYERROR and the label yyerrorlab therefore never appears in user |
| 5150 | code. */ |
| 5151 | if (/*CONSTCOND*/ 0) |
| 5152 | goto yyerrorlab; |
| 5153 | |
| 5154 | /* Do not reclaim the symbols of the rule which action triggered |
| 5155 | this YYERROR. */ |
| 5156 | YYPOPSTACK (yylen); |
| 5157 | yylen = 0; |
| 5158 | YY_STACK_PRINT (yyss, yyssp); |
| 5159 | yystate = *yyssp; |
| 5160 | goto yyerrlab1; |
| 5161 | |
| 5162 | |
| 5163 | /*-------------------------------------------------------------. |
| 5164 | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
| 5165 | `-------------------------------------------------------------*/ |
| 5166 | yyerrlab1: |
| 5167 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
| 5168 | |
| 5169 | for (;;) |
| 5170 | { |
| 5171 | yyn = yypact[yystate]; |
| 5172 | if (yyn != YYPACT_NINF) |
| 5173 | { |
| 5174 | yyn += YYTERROR; |
| 5175 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
| 5176 | { |
| 5177 | yyn = yytable[yyn]; |
| 5178 | if (0 < yyn) |
| 5179 | break; |
| 5180 | } |
| 5181 | } |
| 5182 | |
| 5183 | /* Pop the current state because it cannot handle the error token. */ |
| 5184 | if (yyssp == yyss) |
| 5185 | YYABORT; |
| 5186 | |
| 5187 | |
| 5188 | yydestruct ("Error: popping", |
| 5189 | yystos[yystate], yyvsp, context); |
| 5190 | YYPOPSTACK (1); |
| 5191 | yystate = *yyssp; |
| 5192 | YY_STACK_PRINT (yyss, yyssp); |
| 5193 | } |
| 5194 | |
| 5195 | *++yyvsp = yylval; |
| 5196 | |
| 5197 | |
| 5198 | /* Shift the error token. */ |
| 5199 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
| 5200 | |
| 5201 | yystate = yyn; |
| 5202 | goto yynewstate; |
| 5203 | |
| 5204 | |
| 5205 | /*-------------------------------------. |
| 5206 | | yyacceptlab -- YYACCEPT comes here. | |
| 5207 | `-------------------------------------*/ |
| 5208 | yyacceptlab: |
| 5209 | yyresult = 0; |
| 5210 | goto yyreturn; |
| 5211 | |
| 5212 | /*-----------------------------------. |
| 5213 | | yyabortlab -- YYABORT comes here. | |
| 5214 | `-----------------------------------*/ |
| 5215 | yyabortlab: |
| 5216 | yyresult = 1; |
| 5217 | goto yyreturn; |
| 5218 | |
| 5219 | #if !defined(yyoverflow) || YYERROR_VERBOSE |
| 5220 | /*-------------------------------------------------. |
| 5221 | | yyexhaustedlab -- memory exhaustion comes here. | |
| 5222 | `-------------------------------------------------*/ |
| 5223 | yyexhaustedlab: |
| 5224 | yyerror (context, YY_("memory exhausted")); |
| 5225 | yyresult = 2; |
| 5226 | /* Fall through. */ |
| 5227 | #endif |
| 5228 | |
| 5229 | yyreturn: |
| 5230 | if (yychar != YYEMPTY) |
| 5231 | yydestruct ("Cleanup: discarding lookahead", |
| 5232 | yytoken, &yylval, context); |
| 5233 | /* Do not reclaim the symbols of the rule which action triggered |
| 5234 | this YYABORT or YYACCEPT. */ |
| 5235 | YYPOPSTACK (yylen); |
| 5236 | YY_STACK_PRINT (yyss, yyssp); |
| 5237 | while (yyssp != yyss) |
| 5238 | { |
| 5239 | yydestruct ("Cleanup: popping", |
| 5240 | yystos[*yyssp], yyvsp, context); |
| 5241 | YYPOPSTACK (1); |
| 5242 | } |
| 5243 | #ifndef yyoverflow |
| 5244 | if (yyss != yyssa) |
| 5245 | YYSTACK_FREE (yyss); |
| 5246 | #endif |
| 5247 | #if YYERROR_VERBOSE |
| 5248 | if (yymsg != yymsgbuf) |
| 5249 | YYSTACK_FREE (yymsg); |
| 5250 | #endif |
| 5251 | /* Make sure YYID is used. */ |
| 5252 | return YYID (yyresult); |
| 5253 | } |
| 5254 | |
| 5255 | |
| 5256 | |
| 5257 | |
| 5258 | |
| 5259 | int glslang_parse(TParseContext* context) { |
| 5260 | return yyparse(context); |
| 5261 | } |
| 5262 | |