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