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