blob: 80414ebe40059d899bcce46dfc83f1aa91e31129 [file] [log] [blame]
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001/* A Bison parser, made by GNU Bison 2.7. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00003/* Bison implementation for Yacc-like parsers in C
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00005 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00006
7 This program is free software: you can redistribute it and/or modify
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00008 it under the terms of the GNU General Public License as published by
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00009 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000012 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000016
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000017 You should have received a copy of the GNU General Public License
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000018 along with this program. If not, see <http://www.gnu.org/licenses/>. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000019
20/* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000029
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000030 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33/* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36/* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43/* Identify Bison output. */
44#define YYBISON 1
45
46/* Bison version. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +000047#define YYBISON_VERSION "2.7"
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000048
49/* Skeleton name. */
50#define YYSKELETON_NAME "yacc.c"
51
52/* Pure parsers. */
53#define YYPURE 1
54
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000055/* Push parsers. */
56#define YYPUSH 0
57
58/* Pull parsers. */
59#define YYPULL 1
60
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000061
62
63
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000064/* Copy the first part of user declarations. */
65
66
67//
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +000068// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000069// Use of this source code is governed by a BSD-style license that can be
70// found in the LICENSE file.
71//
72
73// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
74
75// Ignore errors in auto-generated code.
76#if defined(__GNUC__)
77#pragma GCC diagnostic ignored "-Wunused-function"
78#pragma GCC diagnostic ignored "-Wunused-variable"
79#pragma GCC diagnostic ignored "-Wswitch-enum"
80#elif defined(_MSC_VER)
81#pragma warning(disable: 4065)
82#pragma warning(disable: 4189)
83#pragma warning(disable: 4505)
84#pragma warning(disable: 4701)
85#endif
86
87#include "compiler/SymbolTable.h"
88#include "compiler/ParseHelper.h"
89#include "GLSLANG/ShaderLang.h"
90
daniel@transgaming.comb3077d02013-01-11 04:12:09 +000091#define YYENABLE_NLS 0
92#define YYLTYPE_IS_TRIVIAL 1
93
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000094#define YYLEX_PARAM context->scanner
95
96
97
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +000098
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +000099# ifndef YY_NULL
100# if defined __cplusplus && 201103L <= __cplusplus
101# define YY_NULL nullptr
102# else
103# define YY_NULL 0
104# endif
105# endif
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000106
107/* Enabling verbose error messages. */
108#ifdef YYERROR_VERBOSE
109# undef YYERROR_VERBOSE
110# define YYERROR_VERBOSE 1
111#else
112# define YYERROR_VERBOSE 0
113#endif
114
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000115/* In a future release of Bison, this section will be replaced
116 by #include "glslang_tab.h". */
117#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
118# define YY_YY_GLSLANG_TAB_H_INCLUDED
119/* Enabling traces. */
120#ifndef YYDEBUG
121# define YYDEBUG 0
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000122#endif
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000123#if YYDEBUG
124extern int yydebug;
125#endif
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000126
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000127/* Tokens. */
128#ifndef YYTOKENTYPE
129# define YYTOKENTYPE
130 /* Put the tokens into the symbol table, so that GDB and other debuggers
131 know about them. */
132 enum yytokentype {
133 INVARIANT = 258,
134 HIGH_PRECISION = 259,
135 MEDIUM_PRECISION = 260,
136 LOW_PRECISION = 261,
137 PRECISION = 262,
138 ATTRIBUTE = 263,
139 CONST_QUAL = 264,
140 BOOL_TYPE = 265,
141 FLOAT_TYPE = 266,
142 INT_TYPE = 267,
143 BREAK = 268,
144 CONTINUE = 269,
145 DO = 270,
146 ELSE = 271,
147 FOR = 272,
148 IF = 273,
149 DISCARD = 274,
150 RETURN = 275,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000151 SWITCH = 276,
152 CASE = 277,
153 DEFAULT = 278,
154 BVEC2 = 279,
155 BVEC3 = 280,
156 BVEC4 = 281,
157 IVEC2 = 282,
158 IVEC3 = 283,
159 IVEC4 = 284,
160 VEC2 = 285,
161 VEC3 = 286,
162 VEC4 = 287,
163 MATRIX2 = 288,
164 MATRIX3 = 289,
165 MATRIX4 = 290,
166 IN_QUAL = 291,
167 OUT_QUAL = 292,
168 INOUT_QUAL = 293,
169 UNIFORM = 294,
170 VARYING = 295,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000171 MATRIX2x3 = 296,
172 MATRIX3x2 = 297,
173 MATRIX2x4 = 298,
174 MATRIX4x2 = 299,
175 MATRIX3x4 = 300,
176 MATRIX4x3 = 301,
177 CENTROID = 302,
178 FLAT = 303,
179 SMOOTH = 304,
180 STRUCT = 305,
181 VOID_TYPE = 306,
182 WHILE = 307,
183 SAMPLER2D = 308,
184 SAMPLERCUBE = 309,
185 SAMPLER_EXTERNAL_OES = 310,
186 SAMPLER2DRECT = 311,
187 SAMPLER3D = 312,
188 SAMPLER3DRECT = 313,
189 SAMPLER2DSHADOW = 314,
190 IDENTIFIER = 315,
191 TYPE_NAME = 316,
192 FLOATCONSTANT = 317,
193 INTCONSTANT = 318,
194 BOOLCONSTANT = 319,
195 FIELD_SELECTION = 320,
196 LEFT_OP = 321,
197 RIGHT_OP = 322,
198 INC_OP = 323,
199 DEC_OP = 324,
200 LE_OP = 325,
201 GE_OP = 326,
202 EQ_OP = 327,
203 NE_OP = 328,
204 AND_OP = 329,
205 OR_OP = 330,
206 XOR_OP = 331,
207 MUL_ASSIGN = 332,
208 DIV_ASSIGN = 333,
209 ADD_ASSIGN = 334,
210 MOD_ASSIGN = 335,
211 LEFT_ASSIGN = 336,
212 RIGHT_ASSIGN = 337,
213 AND_ASSIGN = 338,
214 XOR_ASSIGN = 339,
215 OR_ASSIGN = 340,
216 SUB_ASSIGN = 341,
217 LEFT_PAREN = 342,
218 RIGHT_PAREN = 343,
219 LEFT_BRACKET = 344,
220 RIGHT_BRACKET = 345,
221 LEFT_BRACE = 346,
222 RIGHT_BRACE = 347,
223 DOT = 348,
224 COMMA = 349,
225 COLON = 350,
226 EQUAL = 351,
227 SEMICOLON = 352,
228 BANG = 353,
229 DASH = 354,
230 TILDE = 355,
231 PLUS = 356,
232 STAR = 357,
233 SLASH = 358,
234 PERCENT = 359,
235 LEFT_ANGLE = 360,
236 RIGHT_ANGLE = 361,
237 VERTICAL_BAR = 362,
238 CARET = 363,
239 AMPERSAND = 364,
240 QUESTION = 365
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000241 };
242#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000243
244
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000245#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
246typedef union YYSTYPE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000247{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000248
249
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000250 struct {
251 TSourceLoc line;
252 union {
253 TString *string;
254 float f;
255 int i;
256 bool b;
257 };
258 TSymbol* symbol;
259 } lex;
260 struct {
261 TSourceLoc line;
262 TOperator op;
263 union {
264 TIntermNode* intermNode;
265 TIntermNodePair nodePair;
266 TIntermTyped* intermTypedNode;
267 TIntermAggregate* intermAggregate;
268 };
269 union {
270 TPublicType type;
271 TPrecision precision;
272 TQualifier qualifier;
273 TFunction* function;
274 TParameter param;
275 TTypeLine typeLine;
276 TTypeList* typeList;
277 };
278 } interm;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000279
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000280
281
282} YYSTYPE;
283# define YYSTYPE_IS_TRIVIAL 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000284# define yystype YYSTYPE /* obsolescent; will be withdrawn */
285# define YYSTYPE_IS_DECLARED 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000286#endif
287
288
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000289#ifdef YYPARSE_PARAM
290#if defined __STDC__ || defined __cplusplus
291int yyparse (void *YYPARSE_PARAM);
292#else
293int yyparse ();
294#endif
295#else /* ! YYPARSE_PARAM */
296#if defined __STDC__ || defined __cplusplus
297int yyparse (TParseContext* context);
298#else
299int yyparse ();
300#endif
301#endif /* ! YYPARSE_PARAM */
302
303#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
304
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000305/* Copy the second part of user declarations. */
306
307
308extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
309extern void yyerror(TParseContext* context, const char* reason);
310
311#define FRAG_VERT_ONLY(S, L) { \
312 if (context->shaderType != SH_FRAGMENT_SHADER && \
313 context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000314 context->error(L, " supported in vertex/fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000315 context->recover(); \
316 } \
317}
318
319#define VERTEX_ONLY(S, L) { \
320 if (context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000321 context->error(L, " supported in vertex shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000322 context->recover(); \
323 } \
324}
325
326#define FRAG_ONLY(S, L) { \
327 if (context->shaderType != SH_FRAGMENT_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000328 context->error(L, " supported in fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000329 context->recover(); \
330 } \
331}
332
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000333#define ES2_ONLY(S, L) { \
334 if (context->shaderVersion != 100) { \
335 context->error(L, " supported in GLSL ES 1.00 only ", S); \
336 context->recover(); \
337 } \
338}
339
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000340#define ES3_ONLY(TOKEN, LINE, REASON) { \
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000341 if (context->shaderVersion != 300) { \
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000342 context->error(LINE, REASON " supported in GLSL ES 3.00 only ", TOKEN); \
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000343 context->recover(); \
344 } \
345}
346
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000347
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000348
349#ifdef short
350# undef short
351#endif
352
353#ifdef YYTYPE_UINT8
354typedef YYTYPE_UINT8 yytype_uint8;
355#else
356typedef unsigned char yytype_uint8;
357#endif
358
359#ifdef YYTYPE_INT8
360typedef YYTYPE_INT8 yytype_int8;
361#elif (defined __STDC__ || defined __C99__FUNC__ \
362 || defined __cplusplus || defined _MSC_VER)
363typedef signed char yytype_int8;
364#else
365typedef short int yytype_int8;
366#endif
367
368#ifdef YYTYPE_UINT16
369typedef YYTYPE_UINT16 yytype_uint16;
370#else
371typedef unsigned short int yytype_uint16;
372#endif
373
374#ifdef YYTYPE_INT16
375typedef YYTYPE_INT16 yytype_int16;
376#else
377typedef short int yytype_int16;
378#endif
379
380#ifndef YYSIZE_T
381# ifdef __SIZE_TYPE__
382# define YYSIZE_T __SIZE_TYPE__
383# elif defined size_t
384# define YYSIZE_T size_t
385# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
386 || defined __cplusplus || defined _MSC_VER)
387# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
388# define YYSIZE_T size_t
389# else
390# define YYSIZE_T unsigned int
391# endif
392#endif
393
394#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
395
396#ifndef YY_
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000397# if defined YYENABLE_NLS && YYENABLE_NLS
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000398# if ENABLE_NLS
399# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000400# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000401# endif
402# endif
403# ifndef YY_
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000404# define YY_(Msgid) Msgid
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000405# endif
406#endif
407
408/* Suppress unused-variable warnings by "using" E. */
409#if ! defined lint || defined __GNUC__
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000410# define YYUSE(E) ((void) (E))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000411#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000412# define YYUSE(E) /* empty */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000413#endif
414
415/* Identity function, used to suppress warnings about constant conditions. */
416#ifndef lint
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000417# define YYID(N) (N)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000418#else
419#if (defined __STDC__ || defined __C99__FUNC__ \
420 || defined __cplusplus || defined _MSC_VER)
421static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000422YYID (int yyi)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000423#else
424static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000425YYID (yyi)
426 int yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000427#endif
428{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000429 return yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000430}
431#endif
432
433#if ! defined yyoverflow || YYERROR_VERBOSE
434
435/* The parser invokes alloca or malloc; define the necessary symbols. */
436
437# ifdef YYSTACK_USE_ALLOCA
438# if YYSTACK_USE_ALLOCA
439# ifdef __GNUC__
440# define YYSTACK_ALLOC __builtin_alloca
441# elif defined __BUILTIN_VA_ARG_INCR
442# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
443# elif defined _AIX
444# define YYSTACK_ALLOC __alloca
445# elif defined _MSC_VER
446# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
447# define alloca _alloca
448# else
449# define YYSTACK_ALLOC alloca
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000450# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000451 || defined __cplusplus || defined _MSC_VER)
452# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000453 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
454# ifndef EXIT_SUCCESS
455# define EXIT_SUCCESS 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000456# endif
457# endif
458# endif
459# endif
460# endif
461
462# ifdef YYSTACK_ALLOC
463 /* Pacify GCC's `empty if-body' warning. */
464# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
465# ifndef YYSTACK_ALLOC_MAXIMUM
466 /* The OS might guarantee only one guard page at the bottom of the stack,
467 and a page size can be as small as 4096 bytes. So we cannot safely
468 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
469 to allow for a few compiler-allocated temporary stack slots. */
470# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
471# endif
472# else
473# define YYSTACK_ALLOC YYMALLOC
474# define YYSTACK_FREE YYFREE
475# ifndef YYSTACK_ALLOC_MAXIMUM
476# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
477# endif
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000478# if (defined __cplusplus && ! defined EXIT_SUCCESS \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000479 && ! ((defined YYMALLOC || defined malloc) \
480 && (defined YYFREE || defined free)))
481# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000482# ifndef EXIT_SUCCESS
483# define EXIT_SUCCESS 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000484# endif
485# endif
486# ifndef YYMALLOC
487# define YYMALLOC malloc
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000488# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000489 || defined __cplusplus || defined _MSC_VER)
490void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
491# endif
492# endif
493# ifndef YYFREE
494# define YYFREE free
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000495# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000496 || defined __cplusplus || defined _MSC_VER)
497void free (void *); /* INFRINGES ON USER NAME SPACE */
498# endif
499# endif
500# endif
501#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
502
503
504#if (! defined yyoverflow \
505 && (! defined __cplusplus \
506 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
507
508/* A type that is properly aligned for any stack member. */
509union yyalloc
510{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000511 yytype_int16 yyss_alloc;
512 YYSTYPE yyvs_alloc;
513};
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000514
515/* The size of the maximum gap between one aligned stack and the next. */
516# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
517
518/* The size of an array large to enough to hold all stacks, each with
519 N elements. */
520# define YYSTACK_BYTES(N) \
521 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
522 + YYSTACK_GAP_MAXIMUM)
523
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000524# define YYCOPY_NEEDED 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000525
526/* Relocate STACK from its old location to the new one. The
527 local variables YYSIZE and YYSTACKSIZE give the old and new number of
528 elements in the stack, and YYPTR gives the new location of the
529 stack. Advance YYPTR to a properly aligned location for the next
530 stack. */
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000531# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000532 do \
533 { \
534 YYSIZE_T yynewbytes; \
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000535 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
536 Stack = &yyptr->Stack_alloc; \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000537 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
538 yyptr += yynewbytes / sizeof (*yyptr); \
539 } \
540 while (YYID (0))
541
542#endif
543
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000544#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
545/* Copy COUNT objects from SRC to DST. The source and destination do
546 not overlap. */
547# ifndef YYCOPY
548# if defined __GNUC__ && 1 < __GNUC__
549# define YYCOPY(Dst, Src, Count) \
550 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
551# else
552# define YYCOPY(Dst, Src, Count) \
553 do \
554 { \
555 YYSIZE_T yyi; \
556 for (yyi = 0; yyi < (Count); yyi++) \
557 (Dst)[yyi] = (Src)[yyi]; \
558 } \
559 while (YYID (0))
560# endif
561# endif
562#endif /* !YYCOPY_NEEDED */
563
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000564/* YYFINAL -- State number of the termination state. */
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000565#define YYFINAL 89
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000566/* YYLAST -- Last index in YYTABLE. */
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000567#define YYLAST 1906
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000568
569/* YYNTOKENS -- Number of terminals. */
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000570#define YYNTOKENS 111
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000571/* YYNNTS -- Number of nonterminals. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000572#define YYNNTS 87
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000573/* YYNRULES -- Number of rules. */
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000574#define YYNRULES 222
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000575/* YYNRULES -- Number of states. */
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000576#define YYNSTATES 338
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000577
578/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
579#define YYUNDEFTOK 2
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000580#define YYMAXUTOK 365
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000581
582#define YYTRANSLATE(YYX) \
583 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
584
585/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
586static const yytype_uint8 yytranslate[] =
587{
588 0, 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, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
614 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
615 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
616 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
617 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
618 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
619 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
620 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
621 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000622 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000623 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
624 105, 106, 107, 108, 109, 110
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000625};
626
627#if YYDEBUG
628/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
629 YYRHS. */
630static const yytype_uint16 yyprhs[] =
631{
632 0, 0, 3, 5, 7, 9, 11, 13, 17, 19,
633 24, 26, 30, 33, 36, 38, 40, 42, 46, 49,
634 52, 55, 57, 60, 64, 67, 69, 71, 73, 75,
635 78, 81, 84, 86, 88, 90, 92, 96, 100, 102,
636 106, 110, 112, 114, 118, 122, 126, 130, 132, 136,
637 140, 142, 144, 146, 148, 152, 154, 158, 160, 164,
638 166, 172, 174, 178, 180, 182, 184, 186, 188, 190,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000639 194, 196, 199, 202, 205, 210, 216, 223, 233, 236,
640 238, 240, 243, 247, 251, 254, 260, 264, 267, 271,
641 274, 275, 277, 279, 281, 283, 285, 289, 295, 302,
642 308, 310, 313, 318, 324, 329, 332, 334, 337, 339,
643 341, 343, 345, 347, 350, 352, 355, 357, 359, 361,
644 363, 366, 369, 371, 373, 376, 378, 380, 382, 384,
645 389, 391, 393, 395, 397, 399, 401, 403, 405, 407,
646 409, 411, 413, 415, 417, 419, 421, 423, 425, 427,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000647 429, 431, 433, 435, 437, 439, 441, 443, 445, 446,
648 453, 454, 460, 462, 465, 469, 474, 476, 480, 482,
649 487, 489, 491, 493, 495, 497, 499, 501, 503, 505,
650 508, 509, 510, 516, 518, 520, 521, 524, 525, 528,
651 531, 535, 537, 540, 542, 545, 551, 555, 557, 559,
652 564, 565, 572, 573, 582, 583, 591, 593, 595, 597,
653 598, 601, 605, 608, 611, 614, 618, 621, 623, 626,
654 628, 630, 631
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000655};
656
657/* YYRHS -- A `-1'-separated list of the rules' RHS. */
658static const yytype_int16 yyrhs[] =
659{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000660 194, 0, -1, 60, -1, 112, -1, 63, -1, 62,
661 -1, 64, -1, 87, 139, 88, -1, 113, -1, 114,
662 89, 115, 90, -1, 116, -1, 114, 93, 65, -1,
663 114, 68, -1, 114, 69, -1, 139, -1, 117, -1,
664 118, -1, 114, 93, 118, -1, 120, 88, -1, 119,
665 88, -1, 121, 51, -1, 121, -1, 121, 137, -1,
666 120, 94, 137, -1, 122, 87, -1, 161, -1, 60,
667 -1, 65, -1, 114, -1, 68, 123, -1, 69, 123,
668 -1, 124, 123, -1, 101, -1, 99, -1, 98, -1,
669 123, -1, 125, 102, 123, -1, 125, 103, 123, -1,
670 125, -1, 126, 101, 125, -1, 126, 99, 125, -1,
671 126, -1, 127, -1, 128, 105, 127, -1, 128, 106,
672 127, -1, 128, 70, 127, -1, 128, 71, 127, -1,
673 128, -1, 129, 72, 128, -1, 129, 73, 128, -1,
674 129, -1, 130, -1, 131, -1, 132, -1, 133, 74,
675 132, -1, 133, -1, 134, 76, 133, -1, 134, -1,
676 135, 75, 134, -1, 135, -1, 135, 110, 139, 95,
677 137, -1, 136, -1, 123, 138, 137, -1, 96, -1,
678 77, -1, 78, -1, 79, -1, 86, -1, 137, -1,
679 139, 94, 137, -1, 136, -1, 60, 91, -1, 143,
680 97, -1, 151, 97, -1, 7, 159, 160, 97, -1,
681 156, 141, 165, 92, 97, -1, 156, 141, 165, 92,
682 60, 97, -1, 156, 141, 165, 92, 60, 89, 140,
683 90, 97, -1, 144, 88, -1, 146, -1, 145, -1,
684 146, 148, -1, 145, 94, 148, -1, 153, 60, 87,
685 -1, 158, 60, -1, 158, 60, 89, 140, 90, -1,
686 155, 149, 147, -1, 149, 147, -1, 155, 149, 150,
687 -1, 149, 150, -1, -1, 36, -1, 37, -1, 38,
688 -1, 158, -1, 152, -1, 151, 94, 60, -1, 151,
689 94, 60, 89, 90, -1, 151, 94, 60, 89, 140,
690 90, -1, 151, 94, 60, 96, 169, -1, 153, -1,
691 153, 60, -1, 153, 60, 89, 90, -1, 153, 60,
692 89, 140, 90, -1, 153, 60, 96, 169, -1, 3,
693 60, -1, 158, -1, 156, 158, -1, 49, -1, 48,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000694 -1, 9, -1, 8, -1, 40, -1, 3, 40, -1,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000695 157, -1, 154, 157, -1, 154, -1, 9, -1, 36,
696 -1, 37, -1, 47, 36, -1, 47, 37, -1, 39,
697 -1, 160, -1, 159, 160, -1, 4, -1, 5, -1,
698 6, -1, 161, -1, 161, 89, 140, 90, -1, 51,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000699 -1, 11, -1, 12, -1, 10, -1, 30, -1, 31,
700 -1, 32, -1, 24, -1, 25, -1, 26, -1, 27,
701 -1, 28, -1, 29, -1, 33, -1, 34, -1, 35,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000702 -1, 41, -1, 42, -1, 43, -1, 44, -1, 45,
703 -1, 46, -1, 53, -1, 54, -1, 55, -1, 56,
704 -1, 162, -1, 61, -1, -1, 50, 60, 91, 163,
705 165, 92, -1, -1, 50, 91, 164, 165, 92, -1,
706 166, -1, 165, 166, -1, 158, 167, 97, -1, 156,
707 158, 167, 97, -1, 168, -1, 167, 94, 168, -1,
708 60, -1, 60, 89, 140, 90, -1, 137, -1, 142,
709 -1, 173, -1, 172, -1, 170, -1, 182, -1, 183,
710 -1, 186, -1, 193, -1, 91, 92, -1, -1, -1,
711 91, 174, 181, 175, 92, -1, 180, -1, 172, -1,
712 -1, 178, 180, -1, -1, 179, 172, -1, 91, 92,
713 -1, 91, 181, 92, -1, 171, -1, 181, 171, -1,
714 97, -1, 139, 97, -1, 18, 87, 139, 88, 184,
715 -1, 177, 16, 177, -1, 177, -1, 139, -1, 153,
716 60, 96, 169, -1, -1, 52, 87, 187, 185, 88,
717 176, -1, -1, 15, 188, 177, 52, 87, 139, 88,
718 97, -1, -1, 17, 87, 189, 190, 192, 88, 176,
719 -1, 182, -1, 170, -1, 185, -1, -1, 191, 97,
720 -1, 191, 97, 139, -1, 14, 97, -1, 13, 97,
721 -1, 20, 97, -1, 20, 139, 97, -1, 19, 97,
722 -1, 195, -1, 194, 195, -1, 196, -1, 142, -1,
723 -1, 143, 197, 180, -1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000724};
725
726/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
727static const yytype_uint16 yyrline[] =
728{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000729 0, 187, 187, 222, 225, 238, 243, 248, 254, 257,
730 260, 263, 266, 276, 289, 297, 397, 400, 408, 412,
731 419, 423, 430, 436, 445, 453, 508, 515, 525, 528,
732 538, 548, 569, 570, 571, 576, 577, 586, 598, 599,
733 607, 618, 622, 623, 633, 643, 653, 666, 667, 677,
734 690, 694, 698, 702, 703, 716, 717, 730, 731, 744,
735 745, 762, 763, 776, 777, 778, 779, 780, 784, 787,
736 798, 806, 814, 841, 846, 857, 861, 865, 872, 910,
737 913, 920, 928, 949, 970, 981, 1010, 1015, 1025, 1030,
738 1040, 1043, 1046, 1049, 1055, 1062, 1065, 1087, 1105, 1129,
739 1152, 1156, 1174, 1182, 1214, 1234, 1323, 1332, 1355, 1359,
740 1366, 1372, 1379, 1388, 1397, 1400, 1436, 1446, 1450, 1455,
741 1460, 1465, 1470, 1479, 1489, 1496, 1499, 1502, 1508, 1511,
742 1526, 1530, 1534, 1538, 1547, 1552, 1557, 1562, 1567, 1572,
743 1577, 1582, 1587, 1592, 1598, 1604, 1610, 1615, 1620, 1625,
744 1630, 1635, 1640, 1645, 1650, 1659, 1668, 1673, 1686, 1686,
745 1689, 1689, 1695, 1698, 1713, 1716, 1724, 1728, 1734, 1742,
746 1758, 1762, 1766, 1767, 1773, 1774, 1775, 1776, 1777, 1781,
747 1782, 1782, 1782, 1792, 1793, 1797, 1797, 1798, 1798, 1803,
748 1806, 1816, 1819, 1825, 1826, 1830, 1838, 1842, 1852, 1857,
749 1874, 1874, 1879, 1879, 1886, 1886, 1894, 1897, 1903, 1906,
750 1912, 1916, 1923, 1930, 1937, 1944, 1955, 1964, 1968, 1975,
751 1978, 1984, 1984
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000752};
753#endif
754
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000755#if YYDEBUG || YYERROR_VERBOSE || 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000756/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
757 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
758static const char *const yytname[] =
759{
760 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
761 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
762 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE",
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000763 "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE",
764 "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2",
765 "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL",
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000766 "INOUT_QUAL", "UNIFORM", "VARYING", "MATRIX2x3", "MATRIX3x2",
767 "MATRIX2x4", "MATRIX4x2", "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT",
768 "SMOOTH", "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE",
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000769 "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "SAMPLER3D", "SAMPLER3DRECT",
770 "SAMPLER2DSHADOW", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
771 "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
772 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
773 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
774 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
775 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
776 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
777 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
778 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
779 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000780 "primary_expression", "postfix_expression", "integer_expression",
781 "function_call", "function_call_or_method", "function_call_generic",
782 "function_call_header_no_parameters",
783 "function_call_header_with_parameters", "function_call_header",
784 "function_identifier", "unary_expression", "unary_operator",
785 "multiplicative_expression", "additive_expression", "shift_expression",
786 "relational_expression", "equality_expression", "and_expression",
787 "exclusive_or_expression", "inclusive_or_expression",
788 "logical_and_expression", "logical_xor_expression",
789 "logical_or_expression", "conditional_expression",
790 "assignment_expression", "assignment_operator", "expression",
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000791 "constant_expression", "enter_struct", "declaration",
792 "function_prototype", "function_declarator",
793 "function_header_with_parameters", "function_header",
794 "parameter_declarator", "parameter_declaration", "parameter_qualifier",
795 "parameter_type_specifier", "init_declarator_list", "single_declaration",
796 "fully_specified_type", "interpolation_qualifier",
797 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
798 "type_specifier", "precision_qualifier", "type_specifier_no_prec",
799 "type_specifier_nonarray", "struct_specifier", "$@1", "$@2",
800 "struct_declaration_list", "struct_declaration",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000801 "struct_declarator_list", "struct_declarator", "initializer",
802 "declaration_statement", "statement", "simple_statement",
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000803 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000804 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
805 "statement_list", "expression_statement", "selection_statement",
806 "selection_rest_statement", "condition", "iteration_statement", "$@7",
807 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000808 "jump_statement", "translation_unit", "external_declaration",
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000809 "function_definition", "$@10", YY_NULL
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000810};
811#endif
812
813# ifdef YYPRINT
814/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
815 token YYLEX-NUM. */
816static const yytype_uint16 yytoknum[] =
817{
818 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
819 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
820 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
821 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
822 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
823 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
824 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
825 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
826 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000827 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000828 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
829 365
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000830};
831# endif
832
833/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
834static const yytype_uint8 yyr1[] =
835{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000836 0, 111, 112, 113, 113, 113, 113, 113, 114, 114,
837 114, 114, 114, 114, 115, 116, 117, 117, 118, 118,
838 119, 119, 120, 120, 121, 122, 122, 122, 123, 123,
839 123, 123, 124, 124, 124, 125, 125, 125, 126, 126,
840 126, 127, 128, 128, 128, 128, 128, 129, 129, 129,
841 130, 131, 132, 133, 133, 134, 134, 135, 135, 136,
842 136, 137, 137, 138, 138, 138, 138, 138, 139, 139,
843 140, 141, 142, 142, 142, 142, 142, 142, 143, 144,
844 144, 145, 145, 146, 147, 147, 148, 148, 148, 148,
845 149, 149, 149, 149, 150, 151, 151, 151, 151, 151,
846 152, 152, 152, 152, 152, 152, 153, 153, 154, 154,
847 155, 156, 156, 156, 156, 156, 156, 157, 157, 157,
848 157, 157, 157, 158, 158, 159, 159, 159, 160, 160,
849 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
850 161, 161, 161, 161, 161, 161, 161, 161, 161, 161,
851 161, 161, 161, 161, 161, 161, 161, 161, 163, 162,
852 164, 162, 165, 165, 166, 166, 167, 167, 168, 168,
853 169, 170, 171, 171, 172, 172, 172, 172, 172, 173,
854 174, 175, 173, 176, 176, 178, 177, 179, 177, 180,
855 180, 181, 181, 182, 182, 183, 184, 184, 185, 185,
856 187, 186, 188, 186, 189, 186, 190, 190, 191, 191,
857 192, 192, 193, 193, 193, 193, 193, 194, 194, 195,
858 195, 197, 196
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000859};
860
861/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
862static const yytype_uint8 yyr2[] =
863{
864 0, 2, 1, 1, 1, 1, 1, 3, 1, 4,
865 1, 3, 2, 2, 1, 1, 1, 3, 2, 2,
866 2, 1, 2, 3, 2, 1, 1, 1, 1, 2,
867 2, 2, 1, 1, 1, 1, 3, 3, 1, 3,
868 3, 1, 1, 3, 3, 3, 3, 1, 3, 3,
869 1, 1, 1, 1, 3, 1, 3, 1, 3, 1,
870 5, 1, 3, 1, 1, 1, 1, 1, 1, 3,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000871 1, 2, 2, 2, 4, 5, 6, 9, 2, 1,
872 1, 2, 3, 3, 2, 5, 3, 2, 3, 2,
873 0, 1, 1, 1, 1, 1, 3, 5, 6, 5,
874 1, 2, 4, 5, 4, 2, 1, 2, 1, 1,
875 1, 1, 1, 2, 1, 2, 1, 1, 1, 1,
876 2, 2, 1, 1, 2, 1, 1, 1, 1, 4,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000877 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000878 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000879 1, 1, 1, 1, 1, 1, 1, 1, 0, 6,
880 0, 5, 1, 2, 3, 4, 1, 3, 1, 4,
881 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
882 0, 0, 5, 1, 1, 0, 2, 0, 2, 2,
883 3, 1, 2, 1, 2, 5, 3, 1, 1, 4,
884 0, 6, 0, 8, 0, 7, 1, 1, 1, 0,
885 2, 3, 2, 2, 2, 3, 2, 1, 2, 1,
886 1, 0, 3
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000887};
888
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000889/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
890 Performed when YYTABLE doesn't specify something else to do. Zero
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000891 means the default is an error. */
892static const yytype_uint8 yydefact[] =
893{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000894 0, 0, 125, 126, 127, 0, 111, 117, 133, 131,
895 132, 137, 138, 139, 140, 141, 142, 134, 135, 136,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000896 143, 144, 145, 118, 119, 122, 112, 146, 147, 148,
897 149, 150, 151, 0, 109, 108, 0, 130, 152, 153,
898 154, 155, 157, 220, 221, 0, 80, 90, 0, 95,
899 100, 116, 0, 114, 106, 0, 123, 128, 156, 0,
900 217, 219, 113, 105, 0, 120, 121, 0, 160, 72,
901 0, 78, 90, 110, 91, 92, 93, 81, 0, 90,
902 0, 73, 101, 115, 0, 0, 107, 124, 0, 1,
903 218, 0, 158, 0, 0, 222, 82, 87, 89, 94,
904 0, 96, 83, 0, 0, 71, 0, 0, 0, 0,
905 162, 2, 5, 4, 6, 27, 0, 0, 0, 34,
906 33, 32, 3, 8, 28, 10, 15, 16, 0, 0,
907 21, 0, 35, 0, 38, 41, 42, 47, 50, 51,
908 52, 53, 55, 57, 59, 70, 0, 25, 74, 0,
909 0, 0, 0, 202, 0, 0, 0, 0, 0, 180,
910 189, 193, 35, 61, 68, 0, 171, 0, 128, 174,
911 191, 173, 172, 0, 175, 176, 177, 178, 84, 86,
912 88, 0, 0, 102, 0, 170, 104, 0, 168, 0,
913 166, 0, 163, 29, 30, 0, 12, 13, 0, 0,
914 19, 18, 0, 20, 22, 24, 31, 0, 0, 0,
915 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
916 0, 129, 0, 161, 213, 212, 187, 204, 0, 216,
917 214, 0, 200, 179, 0, 64, 65, 66, 67, 63,
918 0, 0, 194, 190, 192, 0, 97, 0, 99, 103,
919 0, 0, 0, 164, 0, 75, 7, 0, 14, 26,
920 11, 17, 23, 36, 37, 40, 39, 45, 46, 43,
921 44, 48, 49, 54, 56, 58, 0, 159, 0, 0,
922 0, 0, 0, 215, 0, 181, 62, 69, 0, 98,
923 165, 0, 167, 0, 76, 9, 0, 0, 186, 188,
924 207, 206, 209, 187, 198, 0, 0, 0, 0, 85,
925 169, 0, 60, 0, 208, 0, 0, 197, 195, 0,
926 0, 182, 0, 0, 210, 0, 187, 0, 184, 201,
927 183, 77, 0, 211, 205, 196, 199, 203
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000928};
929
930/* YYDEFGOTO[NTERM-NUM]. */
931static const yytype_int16 yydefgoto[] =
932{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000933 -1, 122, 123, 124, 257, 125, 126, 127, 128, 129,
934 130, 131, 162, 133, 134, 135, 136, 137, 138, 139,
935 140, 141, 142, 143, 144, 163, 164, 240, 165, 146,
936 85, 166, 167, 45, 46, 47, 97, 77, 78, 98,
937 48, 49, 50, 51, 79, 52, 53, 54, 55, 56,
938 147, 58, 149, 93, 109, 110, 189, 190, 186, 169,
939 170, 171, 172, 234, 308, 329, 278, 279, 280, 330,
940 173, 174, 175, 318, 307, 176, 284, 226, 281, 302,
941 315, 316, 177, 59, 60, 61, 70
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000942};
943
944/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
945 STATE-NUM. */
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000946#define YYPACT_NINF -286
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000947static const yytype_int16 yypact[] =
948{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000949 1591, -20, -286, -286, -286, 139, -286, -286, -286, -286,
950 -286, -286, -286, -286, -286, -286, -286, -286, -286, -286,
951 -286, -286, -286, -286, -286, -286, -286, -286, -286, -286,
952 -286, -286, -286, 99, -286, -286, -28, -286, -286, -286,
953 -286, -286, -286, -286, -72, -11, -59, 1, -73, -286,
954 28, 66, 1698, -286, -286, 1845, -286, 8, -286, 1532,
955 -286, -286, -286, -286, 1845, -286, -286, 15, -286, -286,
956 31, -286, 74, -286, -286, -286, -286, -286, 1751, 110,
957 57, -286, -5, -286, 47, 1645, -286, -286, 1197, -286,
958 -286, 58, -286, 1645, 304, -286, -286, -286, -286, 104,
959 1751, -29, -286, 957, 1197, -286, 127, 1751, 109, 1355,
960 -286, 83, -286, -286, -286, -286, 1197, 1197, 1197, -286,
961 -286, -286, -286, -286, -46, -286, -286, -286, 91, -14,
962 1275, 93, -286, 1197, 56, 55, -286, -40, 88, -286,
963 -286, -286, 107, 108, -56, -286, 95, -286, -286, 1645,
964 1409, 86, 89, -286, 100, 101, 92, 1038, 105, 102,
965 -286, -286, 46, -286, -286, -18, -286, -72, -39, -286,
966 -286, -286, -286, 403, -286, -286, -286, -286, 111, -286,
967 -286, 1116, 1197, -286, 103, -286, -286, 109, 113, -2,
968 -286, -44, -286, -286, -286, 2, -286, -286, 1197, 1798,
969 -286, -286, 1197, 117, -286, -286, -286, 1197, 1197, 1197,
970 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197, 1197,
971 1197, -286, 1463, -286, -286, -286, 106, -286, 1197, -286,
972 -286, 36, -286, -286, 502, -286, -286, -286, -286, -286,
973 1197, 1197, -286, -286, -286, 1197, -286, 115, -286, -286,
974 37, 1197, 109, -286, -53, -286, -286, 116, 97, -286,
975 120, -286, -286, -286, -286, 56, 56, -286, -286, -286,
976 -286, -40, -40, -286, 107, 108, 68, -286, 144, 31,
977 700, 799, 26, -286, 879, 502, -286, -286, 118, -286,
978 -286, 119, -286, 1197, -286, -286, 1197, 123, -286, -286,
979 -286, -286, 879, 106, 97, 138, 1751, 125, 122, -286,
980 -286, 128, -286, 1197, -286, 126, 129, 199, -286, 124,
981 601, -286, 130, 27, 1197, 601, 106, 1197, -286, -286,
982 -286, -286, 131, 97, -286, -286, -286, -286
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000983};
984
985/* YYPGOTO[NTERM-NUM]. */
986static const yytype_int16 yypgoto[] =
987{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +0000988 -286, -286, -286, -286, -286, -286, -286, 20, -286, -286,
989 -286, -286, 49, -286, -34, -286, -85, -38, -286, -286,
990 -286, 7, 11, 12, -286, -77, -101, -286, -112, -94,
991 -286, 13, 14, -286, -286, -286, 132, 153, 154, 135,
992 -286, -286, -251, -286, -286, -81, 185, -51, 232, 6,
993 0, -286, -286, -286, -78, -104, 51, -13, -174, -41,
994 -166, -263, -286, -286, -286, -84, -285, -286, -286, -68,
995 9, -37, -286, -286, -60, -286, -286, -286, -286, -286,
996 -286, -286, -286, -286, 186, -286, -286
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000997};
998
999/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1000 positive, shift that token. If negative, reduce the rule which
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001001 number is the opposite. If YYTABLE_NINF, syntax error. */
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001002#define YYTABLE_NINF -186
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001003static const yytype_int16 yytable[] =
1004{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001005 57, 86, 95, 185, 107, 192, 195, 244, 248, 184,
1006 73, 145, 107, 43, 44, 150, 254, 299, 317, 219,
1007 62, 80, 196, 197, 81, 69, 145, 99, 107, 204,
1008 211, 212, 67, 305, 108, 72, 293, 74, 75, 76,
1009 63, 335, 108, 198, 294, 231, 192, 199, -25, 99,
1010 88, 305, 57, 255, 220, 57, 187, 328, 108, 57,
1011 181, 87, 328, 68, 57, 213, 214, 182, 107, 107,
1012 91, 222, 43, 44, 201, 7, 241, 71, 57, 242,
1013 202, 185, 102, 73, 103, 57, 258, 247, 82, -79,
1014 256, 104, 252, 57, 168, 253, 241, 88, 108, 108,
1015 57, 262, 23, 24, 145, 25, 92, 57, 276, 57,
1016 74, 75, 76, 33, 303, 332, 282, 101, 192, 244,
1017 241, 241, 94, 235, 236, 237, 267, 268, 269, 270,
1018 241, 252, 238, 283, 290, 65, 66, 132, 105, 286,
1019 287, 107, 239, 2, 3, 4, 74, 75, 76, 57,
1020 57, 288, 132, 336, 209, 148, 210, 291, 207, 208,
1021 215, 216, 241, 296, 178, 193, 194, 62, 145, 188,
1022 -26, 108, 304, 168, 145, 265, 266, 271, 272, 200,
1023 205, 217, 206, 224, 218, 221, 225, 227, 228, 229,
1024 304, 241, 232, 249, 233, 312, 297, -185, 319, 311,
1025 245, 323, 251, 306, -130, 289, 295, -27, 309, 310,
1026 313, 298, 333, 320, 321, 326, 145, 325, 322, 261,
1027 327, 306, 57, 324, 273, 96, 185, 331, 337, 274,
1028 132, 275, 179, 100, 168, 180, 83, 64, 250, 292,
1029 300, 334, 314, 285, 301, 90, 0, 0, 0, 0,
1030 0, 0, 0, 0, 0, 86, 263, 264, 132, 132,
1031 132, 132, 132, 132, 132, 132, 132, 132, 132, 0,
1032 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1033 168, 168, 0, 0, 168, 168, 0, 0, 0, 0,
1034 0, 0, 0, 0, 132, 0, 0, 0, 0, 0,
1035 132, 0, 168, 0, 0, 0, 57, 1, 2, 3,
1036 4, 5, 6, 7, 8, 9, 10, 151, 152, 153,
1037 168, 154, 155, 156, 157, 168, 0, 0, 11, 12,
1038 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1039 23, 24, 132, 25, 26, 27, 28, 29, 30, 31,
1040 32, 33, 34, 35, 36, 37, 158, 38, 39, 40,
1041 41, 0, 0, 0, 111, 42, 112, 113, 114, 115,
1042 0, 0, 116, 117, 0, 0, 0, 0, 0, 0,
1043 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1044 0, 118, 0, 0, 0, 159, 160, 0, 0, 0,
1045 0, 161, 119, 120, 0, 121, 1, 2, 3, 4,
1046 5, 6, 7, 8, 9, 10, 151, 152, 153, 0,
1047 154, 155, 156, 157, 0, 0, 0, 11, 12, 13,
1048 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1049 24, 0, 25, 26, 27, 28, 29, 30, 31, 32,
1050 33, 34, 35, 36, 37, 158, 38, 39, 40, 41,
1051 0, 0, 0, 111, 42, 112, 113, 114, 115, 0,
1052 0, 116, 117, 0, 0, 0, 0, 0, 0, 0,
1053 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1054 118, 0, 0, 0, 159, 243, 0, 0, 0, 0,
1055 161, 119, 120, 0, 121, 1, 2, 3, 4, 5,
1056 6, 7, 8, 9, 10, 151, 152, 153, 0, 154,
1057 155, 156, 157, 0, 0, 0, 11, 12, 13, 14,
1058 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1059 0, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1060 34, 35, 36, 37, 158, 38, 39, 40, 41, 0,
1061 0, 0, 111, 42, 112, 113, 114, 115, 0, 0,
1062 116, 117, 0, 0, 0, 0, 0, 0, 0, 0,
1063 0, 0, 0, 0, 0, 0, 0, 0, 0, 118,
1064 0, 0, 0, 159, 0, 0, 0, 0, 0, 161,
1065 119, 120, 0, 121, 1, 2, 3, 4, 5, 6,
1066 7, 8, 9, 10, 151, 152, 153, 0, 154, 155,
1067 156, 157, 0, 0, 0, 11, 12, 13, 14, 15,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001068 16, 17, 18, 19, 20, 21, 22, 23, 24, 0,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001069 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1070 35, 36, 37, 158, 38, 39, 40, 41, 0, 0,
1071 0, 111, 42, 112, 113, 114, 115, 0, 0, 116,
1072 117, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1073 0, 0, 0, 0, 0, 0, 0, 0, 118, 0,
1074 0, 0, 94, 0, 0, 0, 0, 0, 161, 119,
1075 120, 0, 121, 1, 2, 3, 4, 5, 6, 7,
1076 8, 9, 10, 151, 152, 153, 0, 154, 155, 156,
1077 157, 0, 0, 0, 11, 12, 13, 14, 15, 16,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001078 17, 18, 19, 20, 21, 22, 23, 24, 0, 25,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001079 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1080 36, 37, 158, 38, 39, 40, 41, 0, 0, 0,
1081 111, 42, 112, 113, 114, 115, 0, 0, 116, 117,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001082 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001083 0, 0, 0, 0, 0, 0, 0, 118, 0, 0,
1084 0, 0, 0, 0, 0, 0, 0, 161, 119, 120,
1085 0, 121, 1, 2, 3, 4, 5, 6, 7, 8,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001086 9, 10, 0, 0, 0, 0, 0, 0, 0, 0,
1087 0, 0, 0, 11, 12, 13, 14, 15, 16, 17,
1088 18, 19, 20, 21, 22, 23, 24, 0, 25, 26,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001089 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1090 37, 0, 38, 39, 40, 41, 0, 0, 0, 111,
1091 42, 112, 113, 114, 115, 0, 0, 116, 117, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001092 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001093 0, 0, 106, 2, 3, 4, 118, 6, 7, 8,
1094 9, 10, 0, 0, 0, 0, 161, 119, 120, 0,
1095 121, 0, 0, 11, 12, 13, 14, 15, 16, 17,
1096 18, 19, 20, 21, 22, 23, 24, 0, 25, 26,
1097 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1098 37, 0, 38, 39, 40, 41, 0, 0, 0, 111,
1099 42, 112, 113, 114, 115, 0, 0, 116, 117, 0,
1100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1101 0, 0, 0, 0, 0, 0, 118, 8, 9, 10,
1102 0, 0, 0, 0, 0, 0, 0, 119, 120, 0,
1103 121, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1104 20, 21, 22, 0, 0, 0, 0, 0, 27, 28,
1105 29, 30, 31, 32, 0, 0, 0, 36, 37, 0,
1106 38, 39, 40, 41, 0, 0, 0, 111, 42, 112,
1107 113, 114, 115, 0, 0, 116, 117, 0, 0, 0,
1108 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1109 0, 0, 0, 0, 118, 0, 0, 183, 8, 9,
1110 10, 0, 0, 0, 0, 119, 120, 0, 121, 0,
1111 0, 0, 11, 12, 13, 14, 15, 16, 17, 18,
1112 19, 20, 21, 22, 0, 0, 0, 0, 0, 27,
1113 28, 29, 30, 31, 32, 0, 0, 0, 36, 37,
1114 0, 38, 39, 40, 41, 0, 0, 0, 111, 42,
1115 112, 113, 114, 115, 0, 0, 116, 117, 0, 0,
1116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1117 0, 0, 0, 0, 0, 118, 8, 9, 10, 0,
1118 0, 0, 0, 0, 0, 230, 119, 120, 0, 121,
1119 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1120 21, 22, 0, 0, 0, 0, 0, 27, 28, 29,
1121 30, 31, 32, 0, 0, 0, 36, 37, 0, 38,
1122 39, 40, 41, 0, 0, 0, 111, 42, 112, 113,
1123 114, 115, 0, 0, 116, 117, 0, 0, 0, 0,
1124 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1125 0, 0, 0, 118, 0, 0, 246, 8, 9, 10,
1126 0, 0, 0, 0, 119, 120, 0, 121, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001127 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001128 20, 21, 22, 0, 0, 0, 0, 0, 27, 28,
1129 29, 30, 31, 32, 0, 0, 0, 36, 37, 0,
1130 38, 39, 40, 41, 0, 0, 0, 111, 42, 112,
1131 113, 114, 115, 0, 0, 116, 117, 0, 0, 0,
1132 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1133 0, 0, 0, 0, 118, 8, 9, 10, 0, 0,
1134 0, 0, 0, 0, 0, 119, 120, 0, 121, 11,
1135 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1136 22, 0, 0, 0, 0, 0, 27, 28, 29, 30,
1137 31, 32, 0, 0, 0, 36, 203, 0, 38, 39,
1138 40, 41, 0, 0, 0, 111, 42, 112, 113, 114,
1139 115, 0, 0, 116, 117, 0, 0, 0, 0, 0,
1140 0, 0, 0, 0, 0, 0, 0, 0, 106, 2,
1141 3, 4, 118, 6, 7, 8, 9, 10, 0, 0,
1142 0, 0, 0, 119, 120, 0, 121, 0, 0, 11,
1143 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1144 22, 23, 24, 0, 25, 26, 27, 28, 29, 30,
1145 31, 32, 33, 34, 35, 36, 37, 0, 38, 39,
1146 40, 41, 106, 2, 3, 4, 42, 6, 7, 8,
1147 9, 10, 0, 0, 0, 0, 0, 0, 0, 0,
1148 0, 0, 0, 11, 12, 13, 14, 15, 16, 17,
1149 18, 19, 20, 21, 22, 23, 24, 191, 25, 26,
1150 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1151 37, 0, 38, 39, 40, 41, 106, 2, 3, 4,
1152 42, 6, 7, 8, 9, 10, 0, 0, 0, 0,
1153 0, 0, 0, 0, 0, 0, 0, 11, 12, 13,
1154 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1155 24, 223, 25, 26, 27, 28, 29, 30, 31, 32,
1156 33, 34, 35, 36, 37, 0, 38, 39, 40, 41,
1157 0, 0, 0, 0, 42, 0, 0, 0, 0, 0,
1158 0, 0, 89, 0, 0, 1, 2, 3, 4, 5,
1159 6, 7, 8, 9, 10, 0, 0, 0, 0, 0,
1160 0, 0, 0, 0, 0, 277, 11, 12, 13, 14,
1161 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1162 0, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1163 34, 35, 36, 37, 0, 38, 39, 40, 41, 0,
1164 0, 0, 0, 42, 1, 2, 3, 4, 5, 6,
1165 7, 8, 9, 10, 0, 0, 0, 0, 0, 0,
1166 0, 0, 0, 0, 0, 11, 12, 13, 14, 15,
1167 16, 17, 18, 19, 20, 21, 22, 23, 24, 0,
1168 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1169 35, 36, 37, 0, 38, 39, 40, 41, 106, 2,
1170 3, 4, 42, 6, 7, 8, 9, 10, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001171 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1172 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001173 22, 23, 24, 0, 25, 26, 27, 28, 29, 30,
1174 31, 32, 33, 34, 35, 36, 37, 0, 38, 39,
1175 40, 41, 2, 3, 4, 0, 42, 0, 8, 9,
1176 10, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1177 0, 0, 11, 12, 13, 14, 15, 16, 17, 18,
1178 19, 20, 21, 22, 0, 0, 0, 0, 0, 27,
1179 28, 29, 30, 31, 32, 0, 0, 0, 36, 37,
1180 0, 38, 39, 40, 41, 2, 3, 4, 84, 42,
1181 0, 8, 9, 10, 0, 0, 0, 0, 0, 0,
1182 0, 0, 0, 0, 0, 11, 12, 13, 14, 15,
1183 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
1184 0, 0, 27, 28, 29, 30, 31, 32, 0, 0,
1185 0, 36, 37, 0, 38, 39, 40, 41, 8, 9,
1186 10, 0, 42, 0, 0, 0, 0, 0, 0, 0,
1187 0, 0, 11, 12, 13, 14, 15, 16, 17, 18,
1188 19, 20, 21, 22, 0, 0, 0, 0, 0, 27,
1189 28, 29, 30, 31, 32, 0, 0, 0, 36, 37,
1190 0, 38, 39, 40, 41, 8, 9, 10, 259, 42,
1191 0, 0, 0, 260, 0, 0, 0, 0, 0, 11,
1192 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1193 22, 0, 0, 0, 0, 0, 27, 28, 29, 30,
1194 31, 32, 0, 0, 0, 36, 37, 0, 38, 39,
1195 40, 41, 0, 0, 0, 0, 42
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001196};
1197
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001198#define yypact_value_is_default(Yystate) \
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001199 (!!((Yystate) == (-286)))
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001200
1201#define yytable_value_is_error(Yytable_value) \
1202 YYID (0)
1203
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001204static const yytype_int16 yycheck[] =
1205{
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001206 0, 52, 70, 104, 85, 109, 118, 173, 182, 103,
1207 9, 88, 93, 0, 0, 93, 60, 280, 303, 75,
1208 40, 94, 68, 69, 97, 97, 103, 78, 109, 130,
1209 70, 71, 60, 284, 85, 94, 89, 36, 37, 38,
1210 60, 326, 93, 89, 97, 157, 150, 93, 87, 100,
1211 89, 302, 52, 97, 110, 55, 107, 320, 109, 59,
1212 89, 55, 325, 91, 64, 105, 106, 96, 149, 150,
1213 64, 149, 59, 59, 88, 9, 94, 88, 78, 97,
1214 94, 182, 87, 9, 89, 85, 198, 181, 60, 88,
1215 88, 96, 94, 93, 94, 97, 94, 89, 149, 150,
1216 100, 202, 36, 37, 181, 39, 91, 107, 220, 109,
1217 36, 37, 38, 47, 88, 88, 228, 60, 222, 285,
1218 94, 94, 91, 77, 78, 79, 211, 212, 213, 214,
1219 94, 94, 86, 97, 97, 36, 37, 88, 91, 240,
1220 241, 222, 96, 4, 5, 6, 36, 37, 38, 149,
1221 150, 245, 103, 327, 99, 97, 101, 251, 102, 103,
1222 72, 73, 94, 95, 60, 116, 117, 40, 245, 60,
1223 87, 222, 284, 173, 251, 209, 210, 215, 216, 88,
1224 87, 74, 133, 97, 76, 90, 97, 87, 87, 97,
1225 302, 94, 87, 90, 92, 296, 52, 91, 60, 293,
1226 89, 313, 89, 284, 87, 90, 90, 87, 90, 90,
1227 87, 279, 324, 88, 92, 16, 293, 88, 90, 199,
1228 96, 302, 222, 97, 217, 72, 327, 97, 97, 218,
1229 181, 219, 100, 79, 234, 100, 51, 5, 187, 252,
1230 281, 325, 302, 234, 281, 59, -1, -1, -1, -1,
1231 -1, -1, -1, -1, -1, 306, 207, 208, 209, 210,
1232 211, 212, 213, 214, 215, 216, 217, 218, 219, -1,
1233 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1234 280, 281, -1, -1, 284, 285, -1, -1, -1, -1,
1235 -1, -1, -1, -1, 245, -1, -1, -1, -1, -1,
1236 251, -1, 302, -1, -1, -1, 306, 3, 4, 5,
1237 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1238 320, 17, 18, 19, 20, 325, -1, -1, 24, 25,
1239 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1240 36, 37, 293, 39, 40, 41, 42, 43, 44, 45,
1241 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1242 56, -1, -1, -1, 60, 61, 62, 63, 64, 65,
1243 -1, -1, 68, 69, -1, -1, -1, -1, -1, -1,
1244 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1245 -1, 87, -1, -1, -1, 91, 92, -1, -1, -1,
1246 -1, 97, 98, 99, -1, 101, 3, 4, 5, 6,
1247 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
1248 17, 18, 19, 20, -1, -1, -1, 24, 25, 26,
1249 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1250 37, -1, 39, 40, 41, 42, 43, 44, 45, 46,
1251 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
1252 -1, -1, -1, 60, 61, 62, 63, 64, 65, -1,
1253 -1, 68, 69, -1, -1, -1, -1, -1, -1, -1,
1254 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1255 87, -1, -1, -1, 91, 92, -1, -1, -1, -1,
1256 97, 98, 99, -1, 101, 3, 4, 5, 6, 7,
1257 8, 9, 10, 11, 12, 13, 14, 15, -1, 17,
1258 18, 19, 20, -1, -1, -1, 24, 25, 26, 27,
1259 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1260 -1, 39, 40, 41, 42, 43, 44, 45, 46, 47,
1261 48, 49, 50, 51, 52, 53, 54, 55, 56, -1,
1262 -1, -1, 60, 61, 62, 63, 64, 65, -1, -1,
1263 68, 69, -1, -1, -1, -1, -1, -1, -1, -1,
1264 -1, -1, -1, -1, -1, -1, -1, -1, -1, 87,
1265 -1, -1, -1, 91, -1, -1, -1, -1, -1, 97,
1266 98, 99, -1, 101, 3, 4, 5, 6, 7, 8,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001267 9, 10, 11, 12, 13, 14, 15, -1, 17, 18,
1268 19, 20, -1, -1, -1, 24, 25, 26, 27, 28,
1269 29, 30, 31, 32, 33, 34, 35, 36, 37, -1,
1270 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001271 49, 50, 51, 52, 53, 54, 55, 56, -1, -1,
1272 -1, 60, 61, 62, 63, 64, 65, -1, -1, 68,
1273 69, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1274 -1, -1, -1, -1, -1, -1, -1, -1, 87, -1,
1275 -1, -1, 91, -1, -1, -1, -1, -1, 97, 98,
1276 99, -1, 101, 3, 4, 5, 6, 7, 8, 9,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001277 10, 11, 12, 13, 14, 15, -1, 17, 18, 19,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001278 20, -1, -1, -1, 24, 25, 26, 27, 28, 29,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001279 30, 31, 32, 33, 34, 35, 36, 37, -1, 39,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001280 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001281 50, 51, 52, 53, 54, 55, 56, -1, -1, -1,
1282 60, 61, 62, 63, 64, 65, -1, -1, 68, 69,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001283 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001284 -1, -1, -1, -1, -1, -1, -1, 87, -1, -1,
1285 -1, -1, -1, -1, -1, -1, -1, 97, 98, 99,
1286 -1, 101, 3, 4, 5, 6, 7, 8, 9, 10,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001287 11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
1288 -1, -1, -1, 24, 25, 26, 27, 28, 29, 30,
1289 31, 32, 33, 34, 35, 36, 37, -1, 39, 40,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001290 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
1291 51, -1, 53, 54, 55, 56, -1, -1, -1, 60,
1292 61, 62, 63, 64, 65, -1, -1, 68, 69, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001293 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001294 -1, -1, 3, 4, 5, 6, 87, 8, 9, 10,
1295 11, 12, -1, -1, -1, -1, 97, 98, 99, -1,
1296 101, -1, -1, 24, 25, 26, 27, 28, 29, 30,
1297 31, 32, 33, 34, 35, 36, 37, -1, 39, 40,
1298 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
1299 51, -1, 53, 54, 55, 56, -1, -1, -1, 60,
1300 61, 62, 63, 64, 65, -1, -1, 68, 69, -1,
1301 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1302 -1, -1, -1, -1, -1, -1, 87, 10, 11, 12,
1303 -1, -1, -1, -1, -1, -1, -1, 98, 99, -1,
1304 101, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1305 33, 34, 35, -1, -1, -1, -1, -1, 41, 42,
1306 43, 44, 45, 46, -1, -1, -1, 50, 51, -1,
1307 53, 54, 55, 56, -1, -1, -1, 60, 61, 62,
1308 63, 64, 65, -1, -1, 68, 69, -1, -1, -1,
1309 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1310 -1, -1, -1, -1, 87, -1, -1, 90, 10, 11,
1311 12, -1, -1, -1, -1, 98, 99, -1, 101, -1,
1312 -1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
1313 32, 33, 34, 35, -1, -1, -1, -1, -1, 41,
1314 42, 43, 44, 45, 46, -1, -1, -1, 50, 51,
1315 -1, 53, 54, 55, 56, -1, -1, -1, 60, 61,
1316 62, 63, 64, 65, -1, -1, 68, 69, -1, -1,
1317 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1318 -1, -1, -1, -1, -1, 87, 10, 11, 12, -1,
1319 -1, -1, -1, -1, -1, 97, 98, 99, -1, 101,
1320 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1321 34, 35, -1, -1, -1, -1, -1, 41, 42, 43,
1322 44, 45, 46, -1, -1, -1, 50, 51, -1, 53,
1323 54, 55, 56, -1, -1, -1, 60, 61, 62, 63,
1324 64, 65, -1, -1, 68, 69, -1, -1, -1, -1,
1325 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1326 -1, -1, -1, 87, -1, -1, 90, 10, 11, 12,
1327 -1, -1, -1, -1, 98, 99, -1, 101, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001328 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001329 33, 34, 35, -1, -1, -1, -1, -1, 41, 42,
1330 43, 44, 45, 46, -1, -1, -1, 50, 51, -1,
1331 53, 54, 55, 56, -1, -1, -1, 60, 61, 62,
1332 63, 64, 65, -1, -1, 68, 69, -1, -1, -1,
1333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1334 -1, -1, -1, -1, 87, 10, 11, 12, -1, -1,
1335 -1, -1, -1, -1, -1, 98, 99, -1, 101, 24,
1336 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1337 35, -1, -1, -1, -1, -1, 41, 42, 43, 44,
1338 45, 46, -1, -1, -1, 50, 51, -1, 53, 54,
1339 55, 56, -1, -1, -1, 60, 61, 62, 63, 64,
1340 65, -1, -1, 68, 69, -1, -1, -1, -1, -1,
1341 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
1342 5, 6, 87, 8, 9, 10, 11, 12, -1, -1,
1343 -1, -1, -1, 98, 99, -1, 101, -1, -1, 24,
1344 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1345 35, 36, 37, -1, 39, 40, 41, 42, 43, 44,
1346 45, 46, 47, 48, 49, 50, 51, -1, 53, 54,
1347 55, 56, 3, 4, 5, 6, 61, 8, 9, 10,
1348 11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
1349 -1, -1, -1, 24, 25, 26, 27, 28, 29, 30,
1350 31, 32, 33, 34, 35, 36, 37, 92, 39, 40,
1351 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
1352 51, -1, 53, 54, 55, 56, 3, 4, 5, 6,
1353 61, 8, 9, 10, 11, 12, -1, -1, -1, -1,
1354 -1, -1, -1, -1, -1, -1, -1, 24, 25, 26,
1355 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1356 37, 92, 39, 40, 41, 42, 43, 44, 45, 46,
1357 47, 48, 49, 50, 51, -1, 53, 54, 55, 56,
1358 -1, -1, -1, -1, 61, -1, -1, -1, -1, -1,
1359 -1, -1, 0, -1, -1, 3, 4, 5, 6, 7,
1360 8, 9, 10, 11, 12, -1, -1, -1, -1, -1,
1361 -1, -1, -1, -1, -1, 92, 24, 25, 26, 27,
1362 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1363 -1, 39, 40, 41, 42, 43, 44, 45, 46, 47,
1364 48, 49, 50, 51, -1, 53, 54, 55, 56, -1,
1365 -1, -1, -1, 61, 3, 4, 5, 6, 7, 8,
1366 9, 10, 11, 12, -1, -1, -1, -1, -1, -1,
1367 -1, -1, -1, -1, -1, 24, 25, 26, 27, 28,
1368 29, 30, 31, 32, 33, 34, 35, 36, 37, -1,
1369 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
1370 49, 50, 51, -1, 53, 54, 55, 56, 3, 4,
1371 5, 6, 61, 8, 9, 10, 11, 12, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001372 -1, -1, -1, -1, -1, -1, -1, -1, -1, 24,
1373 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001374 35, 36, 37, -1, 39, 40, 41, 42, 43, 44,
1375 45, 46, 47, 48, 49, 50, 51, -1, 53, 54,
1376 55, 56, 4, 5, 6, -1, 61, -1, 10, 11,
1377 12, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1378 -1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
1379 32, 33, 34, 35, -1, -1, -1, -1, -1, 41,
1380 42, 43, 44, 45, 46, -1, -1, -1, 50, 51,
1381 -1, 53, 54, 55, 56, 4, 5, 6, 60, 61,
1382 -1, 10, 11, 12, -1, -1, -1, -1, -1, -1,
1383 -1, -1, -1, -1, -1, 24, 25, 26, 27, 28,
1384 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
1385 -1, -1, 41, 42, 43, 44, 45, 46, -1, -1,
1386 -1, 50, 51, -1, 53, 54, 55, 56, 10, 11,
1387 12, -1, 61, -1, -1, -1, -1, -1, -1, -1,
1388 -1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
1389 32, 33, 34, 35, -1, -1, -1, -1, -1, 41,
1390 42, 43, 44, 45, 46, -1, -1, -1, 50, 51,
1391 -1, 53, 54, 55, 56, 10, 11, 12, 60, 61,
1392 -1, -1, -1, 65, -1, -1, -1, -1, -1, 24,
1393 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1394 35, -1, -1, -1, -1, -1, 41, 42, 43, 44,
1395 45, 46, -1, -1, -1, 50, 51, -1, 53, 54,
1396 55, 56, -1, -1, -1, -1, 61
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001397};
1398
1399/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1400 symbol of state STATE-NUM. */
1401static const yytype_uint8 yystos[] =
1402{
1403 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001404 12, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001405 33, 34, 35, 36, 37, 39, 40, 41, 42, 43,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001406 44, 45, 46, 47, 48, 49, 50, 51, 53, 54,
1407 55, 56, 61, 142, 143, 144, 145, 146, 151, 152,
1408 153, 154, 156, 157, 158, 159, 160, 161, 162, 194,
1409 195, 196, 40, 60, 159, 36, 37, 60, 91, 97,
1410 197, 88, 94, 9, 36, 37, 38, 148, 149, 155,
1411 94, 97, 60, 157, 60, 141, 158, 160, 89, 0,
1412 195, 160, 91, 164, 91, 180, 148, 147, 150, 158,
1413 149, 60, 87, 89, 96, 91, 3, 156, 158, 165,
1414 166, 60, 62, 63, 64, 65, 68, 69, 87, 98,
1415 99, 101, 112, 113, 114, 116, 117, 118, 119, 120,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001416 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00001417 131, 132, 133, 134, 135, 136, 140, 161, 97, 163,
1418 165, 13, 14, 15, 17, 18, 19, 20, 52, 91,
1419 92, 97, 123, 136, 137, 139, 142, 143, 161, 170,
1420 171, 172, 173, 181, 182, 183, 186, 193, 60, 147,
1421 150, 89, 96, 90, 140, 137, 169, 158, 60, 167,
1422 168, 92, 166, 123, 123, 139, 68, 69, 89, 93,
1423 88, 88, 94, 51, 137, 87, 123, 102, 103, 99,
1424 101, 70, 71, 105, 106, 72, 73, 74, 76, 75,
1425 110, 90, 165, 92, 97, 97, 188, 87, 87, 97,
1426 97, 139, 87, 92, 174, 77, 78, 79, 86, 96,
1427 138, 94, 97, 92, 171, 89, 90, 140, 169, 90,
1428 167, 89, 94, 97, 60, 97, 88, 115, 139, 60,
1429 65, 118, 137, 123, 123, 125, 125, 127, 127, 127,
1430 127, 128, 128, 132, 133, 134, 139, 92, 177, 178,
1431 179, 189, 139, 97, 187, 181, 137, 137, 140, 90,
1432 97, 140, 168, 89, 97, 90, 95, 52, 180, 172,
1433 170, 182, 190, 88, 139, 153, 156, 185, 175, 90,
1434 90, 140, 137, 87, 185, 191, 192, 177, 184, 60,
1435 88, 92, 90, 139, 97, 88, 16, 96, 172, 176,
1436 180, 97, 88, 139, 176, 177, 169, 97
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001437};
1438
1439#define yyerrok (yyerrstatus = 0)
1440#define yyclearin (yychar = YYEMPTY)
1441#define YYEMPTY (-2)
1442#define YYEOF 0
1443
1444#define YYACCEPT goto yyacceptlab
1445#define YYABORT goto yyabortlab
1446#define YYERROR goto yyerrorlab
1447
1448
1449/* Like YYERROR except do call yyerror. This remains here temporarily
1450 to ease the transition to the new meaning of YYERROR, for GCC.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001451 Once GCC version 2 has supplanted version 1, this can go. However,
1452 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1453 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1454 discussed. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001455
1456#define YYFAIL goto yyerrlab
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001457#if defined YYFAIL
1458 /* This is here to suppress warnings from the GCC cpp's
1459 -Wunused-macros. Normally we don't worry about that warning, but
1460 some users do, and we want to make it easy for users to remove
1461 YYFAIL uses, which will produce warnings from Bison 2.5. */
1462#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001463
1464#define YYRECOVERING() (!!yyerrstatus)
1465
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001466#define YYBACKUP(Token, Value) \
1467do \
1468 if (yychar == YYEMPTY) \
1469 { \
1470 yychar = (Token); \
1471 yylval = (Value); \
1472 YYPOPSTACK (yylen); \
1473 yystate = *yyssp; \
1474 goto yybackup; \
1475 } \
1476 else \
1477 { \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001478 yyerror (context, YY_("syntax error: cannot back up")); \
1479 YYERROR; \
1480 } \
1481while (YYID (0))
1482
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001483/* Error token number */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001484#define YYTERROR 1
1485#define YYERRCODE 256
1486
1487
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001488/* This macro is provided for backward compatibility. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001489#ifndef YY_LOCATION_PRINT
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001490# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001491#endif
1492
1493
1494/* YYLEX -- calling `yylex' with the right arguments. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001495#ifdef YYLEX_PARAM
1496# define YYLEX yylex (&yylval, YYLEX_PARAM)
1497#else
1498# define YYLEX yylex (&yylval)
1499#endif
1500
1501/* Enable debugging if requested. */
1502#if YYDEBUG
1503
1504# ifndef YYFPRINTF
1505# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1506# define YYFPRINTF fprintf
1507# endif
1508
1509# define YYDPRINTF(Args) \
1510do { \
1511 if (yydebug) \
1512 YYFPRINTF Args; \
1513} while (YYID (0))
1514
1515# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1516do { \
1517 if (yydebug) \
1518 { \
1519 YYFPRINTF (stderr, "%s ", Title); \
1520 yy_symbol_print (stderr, \
1521 Type, Value, context); \
1522 YYFPRINTF (stderr, "\n"); \
1523 } \
1524} while (YYID (0))
1525
1526
1527/*--------------------------------.
1528| Print this symbol on YYOUTPUT. |
1529`--------------------------------*/
1530
1531/*ARGSUSED*/
1532#if (defined __STDC__ || defined __C99__FUNC__ \
1533 || defined __cplusplus || defined _MSC_VER)
1534static void
1535yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1536#else
1537static void
1538yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1539 FILE *yyoutput;
1540 int yytype;
1541 YYSTYPE const * const yyvaluep;
1542 TParseContext* context;
1543#endif
1544{
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001545 FILE *yyo = yyoutput;
1546 YYUSE (yyo);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001547 if (!yyvaluep)
1548 return;
1549 YYUSE (context);
1550# ifdef YYPRINT
1551 if (yytype < YYNTOKENS)
1552 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1553# else
1554 YYUSE (yyoutput);
1555# endif
1556 switch (yytype)
1557 {
1558 default:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001559 break;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001560 }
1561}
1562
1563
1564/*--------------------------------.
1565| Print this symbol on YYOUTPUT. |
1566`--------------------------------*/
1567
1568#if (defined __STDC__ || defined __C99__FUNC__ \
1569 || defined __cplusplus || defined _MSC_VER)
1570static void
1571yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1572#else
1573static void
1574yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1575 FILE *yyoutput;
1576 int yytype;
1577 YYSTYPE const * const yyvaluep;
1578 TParseContext* context;
1579#endif
1580{
1581 if (yytype < YYNTOKENS)
1582 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1583 else
1584 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1585
1586 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1587 YYFPRINTF (yyoutput, ")");
1588}
1589
1590/*------------------------------------------------------------------.
1591| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1592| TOP (included). |
1593`------------------------------------------------------------------*/
1594
1595#if (defined __STDC__ || defined __C99__FUNC__ \
1596 || defined __cplusplus || defined _MSC_VER)
1597static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001598yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001599#else
1600static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001601yy_stack_print (yybottom, yytop)
1602 yytype_int16 *yybottom;
1603 yytype_int16 *yytop;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001604#endif
1605{
1606 YYFPRINTF (stderr, "Stack now");
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001607 for (; yybottom <= yytop; yybottom++)
1608 {
1609 int yybot = *yybottom;
1610 YYFPRINTF (stderr, " %d", yybot);
1611 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001612 YYFPRINTF (stderr, "\n");
1613}
1614
1615# define YY_STACK_PRINT(Bottom, Top) \
1616do { \
1617 if (yydebug) \
1618 yy_stack_print ((Bottom), (Top)); \
1619} while (YYID (0))
1620
1621
1622/*------------------------------------------------.
1623| Report that the YYRULE is going to be reduced. |
1624`------------------------------------------------*/
1625
1626#if (defined __STDC__ || defined __C99__FUNC__ \
1627 || defined __cplusplus || defined _MSC_VER)
1628static void
1629yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1630#else
1631static void
1632yy_reduce_print (yyvsp, yyrule, context)
1633 YYSTYPE *yyvsp;
1634 int yyrule;
1635 TParseContext* context;
1636#endif
1637{
1638 int yynrhs = yyr2[yyrule];
1639 int yyi;
1640 unsigned long int yylno = yyrline[yyrule];
1641 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1642 yyrule - 1, yylno);
1643 /* The symbols being reduced. */
1644 for (yyi = 0; yyi < yynrhs; yyi++)
1645 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001646 YYFPRINTF (stderr, " $%d = ", yyi + 1);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001647 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1648 &(yyvsp[(yyi + 1) - (yynrhs)])
1649 , context);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001650 YYFPRINTF (stderr, "\n");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001651 }
1652}
1653
1654# define YY_REDUCE_PRINT(Rule) \
1655do { \
1656 if (yydebug) \
1657 yy_reduce_print (yyvsp, Rule, context); \
1658} while (YYID (0))
1659
1660/* Nonzero means print parse trace. It is left uninitialized so that
1661 multiple parsers can coexist. */
1662int yydebug;
1663#else /* !YYDEBUG */
1664# define YYDPRINTF(Args)
1665# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1666# define YY_STACK_PRINT(Bottom, Top)
1667# define YY_REDUCE_PRINT(Rule)
1668#endif /* !YYDEBUG */
1669
1670
1671/* YYINITDEPTH -- initial size of the parser's stacks. */
1672#ifndef YYINITDEPTH
1673# define YYINITDEPTH 200
1674#endif
1675
1676/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1677 if the built-in stack extension method is used).
1678
1679 Do not make this value too large; the results are undefined if
1680 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1681 evaluated with infinite-precision integer arithmetic. */
1682
1683#ifndef YYMAXDEPTH
1684# define YYMAXDEPTH 10000
1685#endif
1686
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001687
1688#if YYERROR_VERBOSE
1689
1690# ifndef yystrlen
1691# if defined __GLIBC__ && defined _STRING_H
1692# define yystrlen strlen
1693# else
1694/* Return the length of YYSTR. */
1695#if (defined __STDC__ || defined __C99__FUNC__ \
1696 || defined __cplusplus || defined _MSC_VER)
1697static YYSIZE_T
1698yystrlen (const char *yystr)
1699#else
1700static YYSIZE_T
1701yystrlen (yystr)
1702 const char *yystr;
1703#endif
1704{
1705 YYSIZE_T yylen;
1706 for (yylen = 0; yystr[yylen]; yylen++)
1707 continue;
1708 return yylen;
1709}
1710# endif
1711# endif
1712
1713# ifndef yystpcpy
1714# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1715# define yystpcpy stpcpy
1716# else
1717/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1718 YYDEST. */
1719#if (defined __STDC__ || defined __C99__FUNC__ \
1720 || defined __cplusplus || defined _MSC_VER)
1721static char *
1722yystpcpy (char *yydest, const char *yysrc)
1723#else
1724static char *
1725yystpcpy (yydest, yysrc)
1726 char *yydest;
1727 const char *yysrc;
1728#endif
1729{
1730 char *yyd = yydest;
1731 const char *yys = yysrc;
1732
1733 while ((*yyd++ = *yys++) != '\0')
1734 continue;
1735
1736 return yyd - 1;
1737}
1738# endif
1739# endif
1740
1741# ifndef yytnamerr
1742/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1743 quotes and backslashes, so that it's suitable for yyerror. The
1744 heuristic is that double-quoting is unnecessary unless the string
1745 contains an apostrophe, a comma, or backslash (other than
1746 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1747 null, do not copy; instead, return the length of what the result
1748 would have been. */
1749static YYSIZE_T
1750yytnamerr (char *yyres, const char *yystr)
1751{
1752 if (*yystr == '"')
1753 {
1754 YYSIZE_T yyn = 0;
1755 char const *yyp = yystr;
1756
1757 for (;;)
1758 switch (*++yyp)
1759 {
1760 case '\'':
1761 case ',':
1762 goto do_not_strip_quotes;
1763
1764 case '\\':
1765 if (*++yyp != '\\')
1766 goto do_not_strip_quotes;
1767 /* Fall through. */
1768 default:
1769 if (yyres)
1770 yyres[yyn] = *yyp;
1771 yyn++;
1772 break;
1773
1774 case '"':
1775 if (yyres)
1776 yyres[yyn] = '\0';
1777 return yyn;
1778 }
1779 do_not_strip_quotes: ;
1780 }
1781
1782 if (! yyres)
1783 return yystrlen (yystr);
1784
1785 return yystpcpy (yyres, yystr) - yyres;
1786}
1787# endif
1788
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001789/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1790 about the unexpected token YYTOKEN for the state stack whose top is
1791 YYSSP.
1792
1793 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1794 not large enough to hold the message. In that case, also set
1795 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1796 required number of bytes is too large to store. */
1797static int
1798yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1799 yytype_int16 *yyssp, int yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001800{
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001801 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1802 YYSIZE_T yysize = yysize0;
1803 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1804 /* Internationalized format string. */
1805 const char *yyformat = YY_NULL;
1806 /* Arguments of yyformat. */
1807 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1808 /* Number of reported tokens (one for the "unexpected", one per
1809 "expected"). */
1810 int yycount = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001811
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001812 /* There are many possibilities here to consider:
1813 - Assume YYFAIL is not used. It's too flawed to consider. See
1814 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1815 for details. YYERROR is fine as it does not invoke this
1816 function.
1817 - If this state is a consistent state with a default action, then
1818 the only way this function was invoked is if the default action
1819 is an error action. In that case, don't check for expected
1820 tokens because there are none.
1821 - The only way there can be no lookahead present (in yychar) is if
1822 this state is a consistent state with a default action. Thus,
1823 detecting the absence of a lookahead is sufficient to determine
1824 that there is no unexpected or expected token to report. In that
1825 case, just report a simple "syntax error".
1826 - Don't assume there isn't a lookahead just because this state is a
1827 consistent state with a default action. There might have been a
1828 previous inconsistent state, consistent state with a non-default
1829 action, or user semantic action that manipulated yychar.
1830 - Of course, the expected token list depends on states to have
1831 correct lookahead information, and it depends on the parser not
1832 to perform extra reductions after fetching a lookahead from the
1833 scanner and before detecting a syntax error. Thus, state merging
1834 (from LALR or IELR) and default reductions corrupt the expected
1835 token list. However, the list is correct for canonical LR with
1836 one exception: it will still contain any token that will not be
1837 accepted due to an error action in a later state.
1838 */
1839 if (yytoken != YYEMPTY)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001840 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001841 int yyn = yypact[*yyssp];
1842 yyarg[yycount++] = yytname[yytoken];
1843 if (!yypact_value_is_default (yyn))
1844 {
1845 /* Start YYX at -YYN if negative to avoid negative indexes in
1846 YYCHECK. In other words, skip the first -YYN actions for
1847 this state because they are default actions. */
1848 int yyxbegin = yyn < 0 ? -yyn : 0;
1849 /* Stay within bounds of both yycheck and yytname. */
1850 int yychecklim = YYLAST - yyn + 1;
1851 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1852 int yyx;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001853
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001854 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1855 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1856 && !yytable_value_is_error (yytable[yyx + yyn]))
1857 {
1858 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1859 {
1860 yycount = 1;
1861 yysize = yysize0;
1862 break;
1863 }
1864 yyarg[yycount++] = yytname[yyx];
1865 {
1866 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1867 if (! (yysize <= yysize1
1868 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1869 return 2;
1870 yysize = yysize1;
1871 }
1872 }
1873 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001874 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001875
1876 switch (yycount)
1877 {
1878# define YYCASE_(N, S) \
1879 case N: \
1880 yyformat = S; \
1881 break
1882 YYCASE_(0, YY_("syntax error"));
1883 YYCASE_(1, YY_("syntax error, unexpected %s"));
1884 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1885 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1886 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1887 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1888# undef YYCASE_
1889 }
1890
1891 {
1892 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1893 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1894 return 2;
1895 yysize = yysize1;
1896 }
1897
1898 if (*yymsg_alloc < yysize)
1899 {
1900 *yymsg_alloc = 2 * yysize;
1901 if (! (yysize <= *yymsg_alloc
1902 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1903 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1904 return 1;
1905 }
1906
1907 /* Avoid sprintf, as that infringes on the user's name space.
1908 Don't have undefined behavior even if the translation
1909 produced a string with the wrong number of "%s"s. */
1910 {
1911 char *yyp = *yymsg;
1912 int yyi = 0;
1913 while ((*yyp = *yyformat) != '\0')
1914 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1915 {
1916 yyp += yytnamerr (yyp, yyarg[yyi++]);
1917 yyformat += 2;
1918 }
1919 else
1920 {
1921 yyp++;
1922 yyformat++;
1923 }
1924 }
1925 return 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001926}
1927#endif /* YYERROR_VERBOSE */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001928
1929/*-----------------------------------------------.
1930| Release the memory associated to this symbol. |
1931`-----------------------------------------------*/
1932
1933/*ARGSUSED*/
1934#if (defined __STDC__ || defined __C99__FUNC__ \
1935 || defined __cplusplus || defined _MSC_VER)
1936static void
1937yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1938#else
1939static void
1940yydestruct (yymsg, yytype, yyvaluep, context)
1941 const char *yymsg;
1942 int yytype;
1943 YYSTYPE *yyvaluep;
1944 TParseContext* context;
1945#endif
1946{
1947 YYUSE (yyvaluep);
1948 YYUSE (context);
1949
1950 if (!yymsg)
1951 yymsg = "Deleting";
1952 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1953
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001954 switch (yytype)
1955 {
1956
1957 default:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001958 break;
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001959 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001960}
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001961
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001962
1963
1964
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001965/*----------.
1966| yyparse. |
1967`----------*/
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001968
1969#ifdef YYPARSE_PARAM
1970#if (defined __STDC__ || defined __C99__FUNC__ \
1971 || defined __cplusplus || defined _MSC_VER)
1972int
1973yyparse (void *YYPARSE_PARAM)
1974#else
1975int
1976yyparse (YYPARSE_PARAM)
1977 void *YYPARSE_PARAM;
1978#endif
1979#else /* ! YYPARSE_PARAM */
1980#if (defined __STDC__ || defined __C99__FUNC__ \
1981 || defined __cplusplus || defined _MSC_VER)
1982int
1983yyparse (TParseContext* context)
1984#else
1985int
1986yyparse (context)
1987 TParseContext* context;
1988#endif
1989#endif
1990{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001991/* The lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001992int yychar;
1993
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001994
1995#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1996/* Suppress an incorrect diagnostic about yylval being uninitialized. */
1997# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1998 _Pragma ("GCC diagnostic push") \
1999 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
2000 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
2001# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
2002 _Pragma ("GCC diagnostic pop")
2003#else
2004/* Default value used for initialization, for pacifying older GCCs
2005 or non-GCC compilers. */
2006static YYSTYPE yyval_default;
2007# define YY_INITIAL_VALUE(Value) = Value
2008#endif
2009#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2010# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2011# define YY_IGNORE_MAYBE_UNINITIALIZED_END
2012#endif
2013#ifndef YY_INITIAL_VALUE
2014# define YY_INITIAL_VALUE(Value) /* Nothing. */
2015#endif
2016
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002017/* The semantic value of the lookahead symbol. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002018YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002019
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002020 /* Number of syntax errors so far. */
2021 int yynerrs;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002022
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002023 int yystate;
2024 /* Number of tokens to shift before error messages enabled. */
2025 int yyerrstatus;
2026
2027 /* The stacks and their tools:
2028 `yyss': related to states.
2029 `yyvs': related to semantic values.
2030
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002031 Refer to the stacks through separate pointers, to allow yyoverflow
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002032 to reallocate them elsewhere. */
2033
2034 /* The state stack. */
2035 yytype_int16 yyssa[YYINITDEPTH];
2036 yytype_int16 *yyss;
2037 yytype_int16 *yyssp;
2038
2039 /* The semantic value stack. */
2040 YYSTYPE yyvsa[YYINITDEPTH];
2041 YYSTYPE *yyvs;
2042 YYSTYPE *yyvsp;
2043
2044 YYSIZE_T yystacksize;
2045
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002046 int yyn;
2047 int yyresult;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002048 /* Lookahead token as an internal (translated) token number. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002049 int yytoken = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002050 /* The variables used to return semantic value and location from the
2051 action routines. */
2052 YYSTYPE yyval;
2053
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002054#if YYERROR_VERBOSE
2055 /* Buffer for error messages, and its allocated size. */
2056 char yymsgbuf[128];
2057 char *yymsg = yymsgbuf;
2058 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2059#endif
2060
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002061#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2062
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002063 /* The number of symbols on the RHS of the reduced rule.
2064 Keep to zero when no symbol should be popped. */
2065 int yylen = 0;
2066
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002067 yyssp = yyss = yyssa;
2068 yyvsp = yyvs = yyvsa;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002069 yystacksize = YYINITDEPTH;
2070
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002071 YYDPRINTF ((stderr, "Starting parse\n"));
2072
2073 yystate = 0;
2074 yyerrstatus = 0;
2075 yynerrs = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002076 yychar = YYEMPTY; /* Cause a token to be read. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002077 goto yysetstate;
2078
2079/*------------------------------------------------------------.
2080| yynewstate -- Push a new state, which is found in yystate. |
2081`------------------------------------------------------------*/
2082 yynewstate:
2083 /* In all cases, when you get here, the value and location stacks
2084 have just been pushed. So pushing a state here evens the stacks. */
2085 yyssp++;
2086
2087 yysetstate:
2088 *yyssp = yystate;
2089
2090 if (yyss + yystacksize - 1 <= yyssp)
2091 {
2092 /* Get the current used size of the three stacks, in elements. */
2093 YYSIZE_T yysize = yyssp - yyss + 1;
2094
2095#ifdef yyoverflow
2096 {
2097 /* Give user a chance to reallocate the stack. Use copies of
2098 these so that the &'s don't force the real ones into
2099 memory. */
2100 YYSTYPE *yyvs1 = yyvs;
2101 yytype_int16 *yyss1 = yyss;
2102
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002103 /* Each stack pointer address is followed by the size of the
2104 data in use in that stack, in bytes. This used to be a
2105 conditional around just the two extra args, but that might
2106 be undefined if yyoverflow is a macro. */
2107 yyoverflow (YY_("memory exhausted"),
2108 &yyss1, yysize * sizeof (*yyssp),
2109 &yyvs1, yysize * sizeof (*yyvsp),
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002110 &yystacksize);
2111
2112 yyss = yyss1;
2113 yyvs = yyvs1;
2114 }
2115#else /* no yyoverflow */
2116# ifndef YYSTACK_RELOCATE
2117 goto yyexhaustedlab;
2118# else
2119 /* Extend the stack our own way. */
2120 if (YYMAXDEPTH <= yystacksize)
2121 goto yyexhaustedlab;
2122 yystacksize *= 2;
2123 if (YYMAXDEPTH < yystacksize)
2124 yystacksize = YYMAXDEPTH;
2125
2126 {
2127 yytype_int16 *yyss1 = yyss;
2128 union yyalloc *yyptr =
2129 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2130 if (! yyptr)
2131 goto yyexhaustedlab;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002132 YYSTACK_RELOCATE (yyss_alloc, yyss);
2133 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002134# undef YYSTACK_RELOCATE
2135 if (yyss1 != yyssa)
2136 YYSTACK_FREE (yyss1);
2137 }
2138# endif
2139#endif /* no yyoverflow */
2140
2141 yyssp = yyss + yysize - 1;
2142 yyvsp = yyvs + yysize - 1;
2143
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002144 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2145 (unsigned long int) yystacksize));
2146
2147 if (yyss + yystacksize - 1 <= yyssp)
2148 YYABORT;
2149 }
2150
2151 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2152
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002153 if (yystate == YYFINAL)
2154 YYACCEPT;
2155
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002156 goto yybackup;
2157
2158/*-----------.
2159| yybackup. |
2160`-----------*/
2161yybackup:
2162
2163 /* Do appropriate processing given the current state. Read a
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002164 lookahead token if we need one and don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002165
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002166 /* First try to decide what to do without reference to lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002167 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002168 if (yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002169 goto yydefault;
2170
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002171 /* Not known => get a lookahead token if don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002172
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002173 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002174 if (yychar == YYEMPTY)
2175 {
2176 YYDPRINTF ((stderr, "Reading a token: "));
2177 yychar = YYLEX;
2178 }
2179
2180 if (yychar <= YYEOF)
2181 {
2182 yychar = yytoken = YYEOF;
2183 YYDPRINTF ((stderr, "Now at end of input.\n"));
2184 }
2185 else
2186 {
2187 yytoken = YYTRANSLATE (yychar);
2188 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2189 }
2190
2191 /* If the proper action on seeing token YYTOKEN is to reduce or to
2192 detect an error, take that action. */
2193 yyn += yytoken;
2194 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2195 goto yydefault;
2196 yyn = yytable[yyn];
2197 if (yyn <= 0)
2198 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002199 if (yytable_value_is_error (yyn))
2200 goto yyerrlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002201 yyn = -yyn;
2202 goto yyreduce;
2203 }
2204
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002205 /* Count tokens shifted since error; after three, turn off error
2206 status. */
2207 if (yyerrstatus)
2208 yyerrstatus--;
2209
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002210 /* Shift the lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002211 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2212
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002213 /* Discard the shifted token. */
2214 yychar = YYEMPTY;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002215
2216 yystate = yyn;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002217 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002218 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002219 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002220
2221 goto yynewstate;
2222
2223
2224/*-----------------------------------------------------------.
2225| yydefault -- do the default action for the current state. |
2226`-----------------------------------------------------------*/
2227yydefault:
2228 yyn = yydefact[yystate];
2229 if (yyn == 0)
2230 goto yyerrlab;
2231 goto yyreduce;
2232
2233
2234/*-----------------------------.
2235| yyreduce -- Do a reduction. |
2236`-----------------------------*/
2237yyreduce:
2238 /* yyn is the number of a rule to reduce with. */
2239 yylen = yyr2[yyn];
2240
2241 /* If YYLEN is nonzero, implement the default value of the action:
2242 `$$ = $1'.
2243
2244 Otherwise, the following line sets YYVAL to garbage.
2245 This behavior is undocumented and Bison
2246 users should not rely upon it. Assigning to YYVAL
2247 unconditionally makes the parser a bit smaller, and it avoids a
2248 GCC warning that YYVAL may be used uninitialized. */
2249 yyval = yyvsp[1-yylen];
2250
2251
2252 YY_REDUCE_PRINT (yyn);
2253 switch (yyn)
2254 {
2255 case 2:
2256
2257 {
2258 // The symbol table search was done in the lexical phase
2259 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2260 const TVariable* variable;
2261 if (symbol == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002262 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002263 context->recover();
2264 TType type(EbtFloat, EbpUndefined);
2265 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00002266 context->symbolTable.declare(*fakeVariable);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002267 variable = fakeVariable;
2268 } else {
2269 // This identifier can only be a variable type symbol
2270 if (! symbol->isVariable()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002271 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002272 context->recover();
2273 }
2274 variable = static_cast<const TVariable*>(symbol);
2275 }
2276
2277 // don't delete $1.string, it's used by error recovery, and the pool
2278 // pop will reclaim the memory
2279
2280 if (variable->getType().getQualifier() == EvqConst ) {
2281 ConstantUnion* constArray = variable->getConstPointer();
2282 TType t(variable->getType());
2283 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2284 } else
2285 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2286 variable->getName(),
2287 variable->getType(), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002288 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002289 break;
2290
2291 case 3:
2292
2293 {
2294 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002295 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002296 break;
2297
2298 case 4:
2299
2300 {
2301 //
2302 // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
2303 // check for overflow for constants
2304 //
2305 if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002306 context->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002307 context->recover();
2308 }
2309 ConstantUnion *unionArray = new ConstantUnion[1];
2310 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2311 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002312 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002313 break;
2314
2315 case 5:
2316
2317 {
2318 ConstantUnion *unionArray = new ConstantUnion[1];
2319 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2320 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002321 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002322 break;
2323
2324 case 6:
2325
2326 {
2327 ConstantUnion *unionArray = new ConstantUnion[1];
2328 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2329 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002330 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002331 break;
2332
2333 case 7:
2334
2335 {
2336 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002337 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002338 break;
2339
2340 case 8:
2341
2342 {
2343 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002344 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002345 break;
2346
2347 case 9:
2348
2349 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002350 (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002351 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002352 break;
2353
2354 case 10:
2355
2356 {
2357 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002358 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002359 break;
2360
2361 case 11:
2362
2363 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002364 (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);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002365 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002366 break;
2367
2368 case 12:
2369
2370 {
2371 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2372 context->recover();
2373 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2374 if ((yyval.interm.intermTypedNode) == 0) {
2375 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2376 context->recover();
2377 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2378 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002379 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002380 break;
2381
2382 case 13:
2383
2384 {
2385 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2386 context->recover();
2387 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2388 if ((yyval.interm.intermTypedNode) == 0) {
2389 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2390 context->recover();
2391 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2392 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002393 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002394 break;
2395
2396 case 14:
2397
2398 {
2399 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2400 context->recover();
2401 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002402 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002403 break;
2404
2405 case 15:
2406
2407 {
2408 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2409 TOperator op = fnCall->getBuiltInOp();
2410
2411 if (op != EOpNull)
2412 {
2413 //
2414 // Then this should be a constructor.
2415 // Don't go through the symbol table for constructors.
2416 // Their parameters will be verified algorithmically.
2417 //
2418 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2419 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2420 (yyval.interm.intermTypedNode) = 0;
2421 } else {
2422 //
2423 // It's a constructor, of type 'type'.
2424 //
2425 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2426 }
2427
2428 if ((yyval.interm.intermTypedNode) == 0) {
2429 context->recover();
2430 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2431 }
2432 (yyval.interm.intermTypedNode)->setType(type);
2433 } else {
2434 //
2435 // Not a constructor. Find it in the symbol table.
2436 //
2437 const TFunction* fnCandidate;
2438 bool builtIn;
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00002439 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, context->shaderVersion, &builtIn);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002440 if (fnCandidate) {
2441 //
2442 // A declared function.
2443 //
2444 if (builtIn && !fnCandidate->getExtension().empty() &&
2445 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2446 context->recover();
2447 }
2448 op = fnCandidate->getBuiltInOp();
2449 if (builtIn && op != EOpNull) {
2450 //
2451 // A function call mapped to a built-in operation.
2452 //
2453 if (fnCandidate->getParamCount() == 1) {
2454 //
2455 // Treat it like a built-in unary operator.
2456 //
2457 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2458 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002459 std::stringstream extraInfoStream;
2460 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2461 std::string extraInfo = extraInfoStream.str();
2462 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002463 YYERROR;
2464 }
2465 } else {
2466 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2467 }
2468 } else {
2469 // This is a real function call
2470
2471 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2472 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2473
2474 // this is how we know whether the given function is a builtIn function or a user defined function
2475 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2476 // if builtIn == true, it's definitely a builtIn function with EOpNull
2477 if (!builtIn)
2478 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2479 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2480
2481 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002482 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002483 qual = fnCandidate->getParam(i).type->getQualifier();
2484 if (qual == EvqOut || qual == EvqInOut) {
2485 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002486 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002487 context->recover();
2488 }
2489 }
2490 }
2491 }
2492 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2493 } else {
2494 // error message was put out by PaFindFunction()
2495 // Put on a dummy node for error recovery
2496 ConstantUnion *unionArray = new ConstantUnion[1];
2497 unionArray->setFConst(0.0f);
2498 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2499 context->recover();
2500 }
2501 }
2502 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002503 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002504 break;
2505
2506 case 16:
2507
2508 {
2509 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002510 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002511 break;
2512
2513 case 17:
2514
2515 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002516 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002517 context->recover();
2518 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002519 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002520 break;
2521
2522 case 18:
2523
2524 {
2525 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2526 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002527 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002528 break;
2529
2530 case 19:
2531
2532 {
2533 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2534 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002535 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002536 break;
2537
2538 case 20:
2539
2540 {
2541 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2542 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002543 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002544 break;
2545
2546 case 21:
2547
2548 {
2549 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2550 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002551 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002552 break;
2553
2554 case 22:
2555
2556 {
2557 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2558 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2559 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2560 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002561 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002562 break;
2563
2564 case 23:
2565
2566 {
2567 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2568 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2569 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2570 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002571 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002572 break;
2573
2574 case 24:
2575
2576 {
2577 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002578 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002579 break;
2580
2581 case 25:
2582
2583 {
2584 //
2585 // Constructor
2586 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002587 TOperator op = EOpNull;
2588 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2589 op = EOpConstructStruct;
2590 } else {
2591 switch ((yyvsp[(1) - (1)].interm.type).type) {
2592 case EbtFloat:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002593 if ((yyvsp[(1) - (1)].interm.type).isMatrix()) {
2594 switch((yyvsp[(1) - (1)].interm.type).getCols()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002595 case 2: op = EOpConstructMat2; break;
2596 case 3: op = EOpConstructMat3; break;
2597 case 4: op = EOpConstructMat4; break;
2598 }
2599 } else {
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002600 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002601 case 1: op = EOpConstructFloat; break;
2602 case 2: op = EOpConstructVec2; break;
2603 case 3: op = EOpConstructVec3; break;
2604 case 4: op = EOpConstructVec4; break;
2605 }
2606 }
2607 break;
2608 case EbtInt:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002609 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002610 case 1: op = EOpConstructInt; break;
2611 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2612 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2613 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2614 }
2615 break;
2616 case EbtBool:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002617 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002618 case 1: op = EOpConstructBool; break;
2619 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2620 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2621 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2622 }
2623 break;
2624 default: break;
2625 }
2626 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002627 context->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002628 context->recover();
2629 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2630 op = EOpConstructFloat;
2631 }
2632 }
2633 TString tempString;
2634 TType type((yyvsp[(1) - (1)].interm.type));
2635 TFunction *function = new TFunction(&tempString, type, op);
2636 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002637 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002638 break;
2639
2640 case 26:
2641
2642 {
2643 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2644 context->recover();
2645 TType type(EbtVoid, EbpUndefined);
2646 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2647 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002648 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002649 break;
2650
2651 case 27:
2652
2653 {
2654 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2655 context->recover();
2656 TType type(EbtVoid, EbpUndefined);
2657 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2658 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002659 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002660 break;
2661
2662 case 28:
2663
2664 {
2665 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002666 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002667 break;
2668
2669 case 29:
2670
2671 {
2672 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2673 context->recover();
2674 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2675 if ((yyval.interm.intermTypedNode) == 0) {
2676 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2677 context->recover();
2678 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2679 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002680 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002681 break;
2682
2683 case 30:
2684
2685 {
2686 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2687 context->recover();
2688 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2689 if ((yyval.interm.intermTypedNode) == 0) {
2690 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2691 context->recover();
2692 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2693 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002694 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002695 break;
2696
2697 case 31:
2698
2699 {
2700 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2701 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2702 if ((yyval.interm.intermTypedNode) == 0) {
2703 const char* errorOp = "";
2704 switch((yyvsp[(1) - (2)].interm).op) {
2705 case EOpNegative: errorOp = "-"; break;
2706 case EOpLogicalNot: errorOp = "!"; break;
2707 default: break;
2708 }
2709 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2710 context->recover();
2711 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2712 }
2713 } else
2714 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002715 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002716 break;
2717
2718 case 32:
2719
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002720 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002721 break;
2722
2723 case 33:
2724
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002725 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002726 break;
2727
2728 case 34:
2729
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002730 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002731 break;
2732
2733 case 35:
2734
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002735 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002736 break;
2737
2738 case 36:
2739
2740 {
2741 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2742 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2743 if ((yyval.interm.intermTypedNode) == 0) {
2744 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2745 context->recover();
2746 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2747 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002748 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002749 break;
2750
2751 case 37:
2752
2753 {
2754 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2755 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2756 if ((yyval.interm.intermTypedNode) == 0) {
2757 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2758 context->recover();
2759 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2760 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002761 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002762 break;
2763
2764 case 38:
2765
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002766 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002767 break;
2768
2769 case 39:
2770
2771 {
2772 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2773 if ((yyval.interm.intermTypedNode) == 0) {
2774 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2775 context->recover();
2776 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2777 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002778 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002779 break;
2780
2781 case 40:
2782
2783 {
2784 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2785 if ((yyval.interm.intermTypedNode) == 0) {
2786 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2787 context->recover();
2788 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2789 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002790 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002791 break;
2792
2793 case 41:
2794
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002795 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002796 break;
2797
2798 case 42:
2799
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002800 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002801 break;
2802
2803 case 43:
2804
2805 {
2806 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2807 if ((yyval.interm.intermTypedNode) == 0) {
2808 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2809 context->recover();
2810 ConstantUnion *unionArray = new ConstantUnion[1];
2811 unionArray->setBConst(false);
2812 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2813 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002814 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002815 break;
2816
2817 case 44:
2818
2819 {
2820 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2821 if ((yyval.interm.intermTypedNode) == 0) {
2822 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2823 context->recover();
2824 ConstantUnion *unionArray = new ConstantUnion[1];
2825 unionArray->setBConst(false);
2826 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2827 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002828 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002829 break;
2830
2831 case 45:
2832
2833 {
2834 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2835 if ((yyval.interm.intermTypedNode) == 0) {
2836 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2837 context->recover();
2838 ConstantUnion *unionArray = new ConstantUnion[1];
2839 unionArray->setBConst(false);
2840 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2841 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002842 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002843 break;
2844
2845 case 46:
2846
2847 {
2848 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2849 if ((yyval.interm.intermTypedNode) == 0) {
2850 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2851 context->recover();
2852 ConstantUnion *unionArray = new ConstantUnion[1];
2853 unionArray->setBConst(false);
2854 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2855 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002856 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002857 break;
2858
2859 case 47:
2860
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002861 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002862 break;
2863
2864 case 48:
2865
2866 {
2867 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2868 if ((yyval.interm.intermTypedNode) == 0) {
2869 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2870 context->recover();
2871 ConstantUnion *unionArray = new ConstantUnion[1];
2872 unionArray->setBConst(false);
2873 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2874 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002875 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002876 break;
2877
2878 case 49:
2879
2880 {
2881 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2882 if ((yyval.interm.intermTypedNode) == 0) {
2883 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2884 context->recover();
2885 ConstantUnion *unionArray = new ConstantUnion[1];
2886 unionArray->setBConst(false);
2887 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2888 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002889 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002890 break;
2891
2892 case 50:
2893
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002894 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002895 break;
2896
2897 case 51:
2898
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002899 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002900 break;
2901
2902 case 52:
2903
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002904 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002905 break;
2906
2907 case 53:
2908
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002909 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002910 break;
2911
2912 case 54:
2913
2914 {
2915 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
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 ConstantUnion *unionArray = new ConstantUnion[1];
2920 unionArray->setBConst(false);
2921 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2922 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002923 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002924 break;
2925
2926 case 55:
2927
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002928 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002929 break;
2930
2931 case 56:
2932
2933 {
2934 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2935 if ((yyval.interm.intermTypedNode) == 0) {
2936 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2937 context->recover();
2938 ConstantUnion *unionArray = new ConstantUnion[1];
2939 unionArray->setBConst(false);
2940 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2941 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002942 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002943 break;
2944
2945 case 57:
2946
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002947 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002948 break;
2949
2950 case 58:
2951
2952 {
2953 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2954 if ((yyval.interm.intermTypedNode) == 0) {
2955 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2956 context->recover();
2957 ConstantUnion *unionArray = new ConstantUnion[1];
2958 unionArray->setBConst(false);
2959 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2960 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002961 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002962 break;
2963
2964 case 59:
2965
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002966 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002967 break;
2968
2969 case 60:
2970
2971 {
2972 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
2973 context->recover();
2974
2975 (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);
2976 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
2977 (yyval.interm.intermTypedNode) = 0;
2978
2979 if ((yyval.interm.intermTypedNode) == 0) {
2980 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
2981 context->recover();
2982 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
2983 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002984 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002985 break;
2986
2987 case 61:
2988
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002989 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002990 break;
2991
2992 case 62:
2993
2994 {
2995 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
2996 context->recover();
2997 (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);
2998 if ((yyval.interm.intermTypedNode) == 0) {
2999 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3000 context->recover();
3001 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3002 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003003 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003004 break;
3005
3006 case 63:
3007
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003008 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003009 break;
3010
3011 case 64:
3012
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003013 { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003014 break;
3015
3016 case 65:
3017
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003018 { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003019 break;
3020
3021 case 66:
3022
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003023 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003024 break;
3025
3026 case 67:
3027
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003028 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003029 break;
3030
3031 case 68:
3032
3033 {
3034 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003035 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003036 break;
3037
3038 case 69:
3039
3040 {
3041 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3042 if ((yyval.interm.intermTypedNode) == 0) {
3043 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3044 context->recover();
3045 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3046 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003047 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003048 break;
3049
3050 case 70:
3051
3052 {
3053 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3054 context->recover();
3055 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003056 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003057 break;
3058
3059 case 71:
3060
3061 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003062 if (context->enterStructDeclaration((yyvsp[(1) - (2)].lex).line, *(yyvsp[(1) - (2)].lex).string))
3063 context->recover();
3064 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3065 }
3066 break;
3067
3068 case 72:
3069
3070 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003071 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3072
3073 TIntermAggregate *prototype = new TIntermAggregate;
3074 prototype->setType(function.getReturnType());
3075 prototype->setName(function.getName());
3076
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003077 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003078 {
3079 const TParameter &param = function.getParam(i);
3080 if (param.name != 0)
3081 {
3082 TVariable *variable = new TVariable(param.name, *param.type);
3083
3084 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3085 }
3086 else
3087 {
3088 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3089 }
3090 }
3091
3092 prototype->setOp(EOpPrototype);
3093 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003094
3095 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003096 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003097 break;
3098
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003099 case 73:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003100
3101 {
3102 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3103 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3104 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003105 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003106 break;
3107
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003108 case 74:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003109
3110 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003111 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3112 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3113 context->recover();
3114 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003115 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3116 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3117 context->recover();
3118 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003119 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003120 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003121 break;
3122
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003123 case 75:
3124
3125 {
3126 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yyvsp[(1) - (5)].interm.type).line, "interface blocks");
3127 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (5)].interm.type), (yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].interm.typeList), "", 0, NULL, 0);
3128 }
3129 break;
3130
3131 case 76:
3132
3133 {
3134 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yyvsp[(1) - (6)].interm.type).line, "interface blocks");
3135 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (6)].interm.type), (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].interm.typeList), *(yyvsp[(5) - (6)].lex).string, (yyvsp[(5) - (6)].lex).line, NULL, 0);
3136 }
3137 break;
3138
3139 case 77:
3140
3141 {
3142 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yyvsp[(1) - (9)].interm.type).line, "interface blocks");
3143 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (9)].interm.type), (yyvsp[(2) - (9)].lex).line, *(yyvsp[(2) - (9)].lex).string, (yyvsp[(3) - (9)].interm.typeList), *(yyvsp[(5) - (9)].lex).string, (yyvsp[(5) - (9)].lex).line, (yyvsp[(7) - (9)].interm.intermTypedNode), (yyvsp[(6) - (9)].lex).line);
3144 }
3145 break;
3146
3147 case 78:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003148
3149 {
3150 //
3151 // Multiple declarations of the same function are allowed.
3152 //
3153 // If this is a definition, the definition production code will check for redefinitions
3154 // (we don't know at this point if it's a definition or not).
3155 //
3156 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3157 //
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00003158 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003159 if (prevDec) {
3160 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003161 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003162 context->recover();
3163 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003164 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003165 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003166 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003167 context->recover();
3168 }
3169 }
3170 }
3171
3172 //
3173 // If this is a redeclaration, it could also be a definition,
3174 // in which case, we want to use the variable names from this one, and not the one that's
3175 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3176 //
3177 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3178 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3179
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003180 // We're at the inner scope level of the function's arguments and body statement.
3181 // Add the function prototype to the surrounding scope instead.
3182 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003183 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003184 break;
3185
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003186 case 79:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003187
3188 {
3189 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003190 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003191 break;
3192
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003193 case 80:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003194
3195 {
3196 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003197 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003198 break;
3199
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003200 case 81:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003201
3202 {
3203 // Add the parameter
3204 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3205 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3206 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3207 else
3208 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003209 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003210 break;
3211
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003212 case 82:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003213
3214 {
3215 //
3216 // Only first parameter of one-parameter functions can be void
3217 // The check for named parameters not being void is done in parameter_declarator
3218 //
3219 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3220 //
3221 // This parameter > first is void
3222 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003223 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003224 context->recover();
3225 delete (yyvsp[(3) - (3)].interm).param.type;
3226 } else {
3227 // Add the parameter
3228 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3229 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3230 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003231 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003232 break;
3233
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003234 case 83:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003235
3236 {
3237 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003238 context->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003239 context->recover();
3240 }
3241 // make sure a sampler is not involved as well...
3242 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3243 context->recover();
3244
3245 // Add the function as a prototype after parsing it (we do not support recursion)
3246 TFunction *function;
3247 TType type((yyvsp[(1) - (3)].interm.type));
3248 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3249 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003250
3251 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003252 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003253 break;
3254
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003255 case 84:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003256
3257 {
3258 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003259 context->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003260 context->recover();
3261 }
3262 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3263 context->recover();
3264 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3265 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3266 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003267 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003268 break;
3269
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003270 case 85:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003271
3272 {
3273 // Check that we can make an array out of this type
3274 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3275 context->recover();
3276
3277 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3278 context->recover();
3279
3280 int size;
3281 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3282 context->recover();
3283 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3284
3285 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3286 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3287 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3288 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003289 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003290 break;
3291
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003292 case 86:
3293
3294 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003295 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3296 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3297 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003298 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003299 break;
3300
3301 case 87:
3302
3303 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003304 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3305 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3306 context->recover();
3307 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3308 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003309 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003310 break;
3311
3312 case 88:
3313
3314 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003315 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3316 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3317 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003318 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003319 break;
3320
3321 case 89:
3322
3323 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003324 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3325 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3326 context->recover();
3327 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3328 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003329 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003330 break;
3331
3332 case 90:
3333
3334 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003335 (yyval.interm.qualifier) = EvqIn;
3336 }
3337 break;
3338
3339 case 91:
3340
3341 {
3342 (yyval.interm.qualifier) = EvqIn;
3343 }
3344 break;
3345
3346 case 92:
3347
3348 {
3349 (yyval.interm.qualifier) = EvqOut;
3350 }
3351 break;
3352
3353 case 93:
3354
3355 {
3356 (yyval.interm.qualifier) = EvqInOut;
3357 }
3358 break;
3359
3360 case 94:
3361
3362 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003363 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3364 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003365 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003366 break;
3367
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003368 case 95:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003369
3370 {
3371 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003372 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003373 break;
3374
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003375 case 96:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003376
3377 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003378 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3379 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003380 context->error((yyvsp[(3) - (3)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(3) - (3)].lex).string->c_str());
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003381 context->recover();
3382 }
3383
zmo@google.comfd747b82011-04-23 01:30:07 +00003384 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3385 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, symbol, (yyvsp[(3) - (3)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003386
3387 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3388 context->recover();
3389
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003390 if (context->nonInitConstErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, false))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003391 context->recover();
3392
zmo@google.comfd747b82011-04-23 01:30:07 +00003393 TVariable* variable = 0;
3394 if (context->nonInitErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, variable))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003395 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003396 if (symbol && variable)
3397 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003398 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003399 break;
3400
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003401 case 97:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003402
3403 {
3404 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3405 context->recover();
3406
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003407 if (context->nonInitConstErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, true))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003408 context->recover();
3409
3410 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3411
3412 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))
3413 context->recover();
3414 else {
3415 (yyvsp[(1) - (5)].interm).type.setArray(true);
3416 TVariable* variable;
3417 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3418 context->recover();
3419 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003420 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003421 break;
3422
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003423 case 98:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003424
3425 {
3426 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3427 context->recover();
3428
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003429 if (context->nonInitConstErrorCheck((yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, true))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003430 context->recover();
3431
3432 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3433
3434 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))
3435 context->recover();
3436 else {
3437 int size;
3438 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3439 context->recover();
3440 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003441 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003442 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3443 context->recover();
3444 TType type = TType((yyvsp[(1) - (6)].interm).type);
3445 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003446 (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);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003447 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003448 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003449 break;
3450
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003451 case 99:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003452
3453 {
3454 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3455 context->recover();
3456
3457 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3458
3459 TIntermNode* intermNode;
3460 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3461 //
3462 // build the intermediate representation
3463 //
3464 if (intermNode)
3465 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3466 else
3467 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3468 } else {
3469 context->recover();
3470 (yyval.interm).intermAggregate = 0;
3471 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003472 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003473 break;
3474
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003475 case 100:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003476
3477 {
3478 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3479 (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);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003480 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003481 break;
3482
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003483 case 101:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003484
3485 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003486 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3487 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003488
3489 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3490 context->recover();
3491
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003492 if (context->nonInitConstErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, false))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003493 context->recover();
3494
3495 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3496
zmo@google.comfd747b82011-04-23 01:30:07 +00003497 TVariable* variable = 0;
3498 if (context->nonInitErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, variable))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003499 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003500 if (variable && symbol)
3501 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003502 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003503 break;
3504
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003505 case 102:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003506
3507 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003508 context->error((yyvsp[(2) - (4)].lex).line, "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str());
kbr@chromium.org04277b82011-06-02 18:41:26 +00003509 context->recover();
3510
zmo@google.comfd747b82011-04-23 01:30:07 +00003511 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3512 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003513 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003514 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003515 break;
3516
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003517 case 103:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003518
3519 {
3520 TType type = TType((yyvsp[(1) - (5)].interm.type));
3521 int size;
3522 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3523 context->recover();
3524 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003525 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3526 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003527
3528 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3529 context->recover();
3530
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003531 if (context->nonInitConstErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), true))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003532 context->recover();
3533
3534 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3535
3536 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)))
3537 context->recover();
3538 else {
3539 int size;
3540 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3541 context->recover();
3542
3543 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003544 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003545 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3546 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003547 if (variable && symbol)
3548 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003549 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003550 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003551 break;
3552
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003553 case 104:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003554
3555 {
3556 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3557 context->recover();
3558
3559 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3560
3561 TIntermNode* intermNode;
3562 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3563 //
3564 // Build intermediate representation
3565 //
3566 if(intermNode)
3567 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3568 else
3569 (yyval.interm).intermAggregate = 0;
3570 } else {
3571 context->recover();
3572 (yyval.interm).intermAggregate = 0;
3573 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003574 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003575 break;
3576
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003577 case 105:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003578
3579 {
3580 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003581 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3582 context->recover();
3583 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3584 if (!(yyvsp[(2) - (2)].lex).symbol)
3585 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003586 context->error((yyvsp[(2) - (2)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(2) - (2)].lex).string->c_str());
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003587 context->recover();
3588
3589 (yyval.interm).intermAggregate = 0;
3590 }
3591 else
3592 {
3593 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3594 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3595 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003596 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003597 break;
3598
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003599 case 106:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003600
3601 {
3602 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3603
3604 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003605 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003606 context->recover();
3607 (yyvsp[(1) - (1)].interm.type).setArray(false);
3608 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003609 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003610 break;
3611
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003612 case 107:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003613
3614 {
3615 if ((yyvsp[(2) - (2)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003616 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003617 context->recover();
3618 (yyvsp[(2) - (2)].interm.type).setArray(false);
3619 }
3620
3621 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3622 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003623 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003624 context->recover();
3625 }
3626 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3627 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003628 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003629 context->recover();
3630 }
3631 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3632 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003633 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003634 break;
3635
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003636 case 108:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003637
3638 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003639 (yyval.interm.type).qualifier = EvqSmooth;
3640 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003641 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003642 break;
3643
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003644 case 109:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003645
3646 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003647 (yyval.interm.type).qualifier = EvqFlat;
3648 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003649 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003650 break;
3651
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003652 case 110:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003653
3654 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003655 (yyval.interm.qualifier) = EvqConst;
3656 }
3657 break;
3658
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003659 case 111:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003660
3661 {
3662 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3663 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3664 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3665 context->recover();
3666 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3667 }
3668 break;
3669
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003670 case 112:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003671
3672 {
3673 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003674 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3675 context->recover();
3676 if (context->shaderType == SH_VERTEX_SHADER)
3677 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3678 else
3679 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003680 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003681 break;
3682
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003683 case 113:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003684
3685 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003686 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003687 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3688 context->recover();
3689 if (context->shaderType == SH_VERTEX_SHADER)
3690 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3691 else
3692 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003693 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003694 break;
3695
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003696 case 114:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003697
3698 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003699 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yyvsp[(1) - (1)].interm.type).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003700 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003701 break;
3702
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003703 case 115:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003704
3705 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003706 if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothIn) {
3707 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3708 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothIn, (yyvsp[(2) - (2)].interm.type).line);
3709 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3710 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3711 else UNREACHABLE();
3712 }
3713 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidIn) {
3714 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3715 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidIn, (yyvsp[(2) - (2)].interm.type).line);
3716 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3717 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3718 else UNREACHABLE();
3719 }
3720 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothOut) {
3721 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3722 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothOut, (yyvsp[(2) - (2)].interm.type).line);
3723 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3724 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3725 else UNREACHABLE();
3726 }
3727 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidOut) {
3728 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3729 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidOut, (yyvsp[(2) - (2)].interm.type).line);
3730 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3731 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3732 else UNREACHABLE();
3733 }
3734 else {
3735 context->error((yyvsp[(1) - (2)].interm.type).line, "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getInterpolationString((yyvsp[(1) - (2)].interm.type).qualifier));
3736 context->recover();
3737
3738 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
3739 }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003740 }
3741 break;
3742
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003743 case 116:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003744
3745 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003746 context->error((yyvsp[(1) - (1)].interm.type).line, "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getInterpolationString((yyvsp[(1) - (1)].interm.type).qualifier));
3747 context->recover();
3748
3749 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3750 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003751 }
3752 break;
3753
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003754 case 117:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003755
3756 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003757 (yyval.interm.type).qualifier = EvqConst;
3758 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003759 }
3760 break;
3761
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003762 case 118:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003763
3764 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003765 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003766 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqSmoothIn : EvqAttribute;
3767 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003768 }
3769 break;
3770
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003771 case 119:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003772
3773 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003774 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003775 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqSmoothOut;
3776 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3777 }
3778 break;
3779
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003780 case 120:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003781
3782 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003783 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003784 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqAttribute;
3785 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3786 }
3787 break;
3788
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003789 case 121:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003790
3791 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003792 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003793 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqCentroidOut;
3794 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3795 }
3796 break;
3797
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003798 case 122:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003799
3800 {
3801 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3802 context->recover();
3803 (yyval.interm.type).qualifier = EvqUniform;
3804 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3805 }
3806 break;
3807
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003808 case 123:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003809
3810 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003811 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003812
3813 if ((yyval.interm.type).precision == EbpUndefined) {
3814 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3815 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3816 context->recover();
3817 }
3818 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003819 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003820 break;
3821
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003822 case 124:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003823
3824 {
3825 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3826 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003827 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003828 break;
3829
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003830 case 125:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003831
3832 {
3833 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003834 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003835 break;
3836
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003837 case 126:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003838
3839 {
3840 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003841 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003842 break;
3843
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003844 case 127:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003845
3846 {
3847 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003848 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003849 break;
3850
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003851 case 128:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003852
3853 {
3854 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003855 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003856 break;
3857
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003858 case 129:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003859
3860 {
3861 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3862
3863 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3864 context->recover();
3865 else {
3866 int size;
3867 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3868 context->recover();
3869 (yyval.interm.type).setArray(true, size);
3870 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003871 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003872 break;
3873
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003874 case 130:
3875
3876 {
3877 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003878 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003879 }
3880 break;
3881
3882 case 131:
3883
3884 {
3885 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3886 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003887 }
3888 break;
3889
3890 case 132:
3891
3892 {
3893 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003894 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003895 }
3896 break;
3897
3898 case 133:
3899
3900 {
3901 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3902 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003903 }
3904 break;
3905
3906 case 134:
3907
3908 {
3909 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003910 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3911 (yyval.interm.type).setAggregate(2);
3912 }
3913 break;
3914
3915 case 135:
3916
3917 {
3918 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3919 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3920 (yyval.interm.type).setAggregate(3);
3921 }
3922 break;
3923
3924 case 136:
3925
3926 {
3927 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3928 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3929 (yyval.interm.type).setAggregate(4);
3930 }
3931 break;
3932
3933 case 137:
3934
3935 {
3936 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3937 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3938 (yyval.interm.type).setAggregate(2);
3939 }
3940 break;
3941
3942 case 138:
3943
3944 {
3945 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003946 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3947 (yyval.interm.type).setAggregate(3);
3948 }
3949 break;
3950
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003951 case 139:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003952
3953 {
3954 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3955 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3956 (yyval.interm.type).setAggregate(4);
3957 }
3958 break;
3959
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003960 case 140:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003961
3962 {
3963 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3964 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3965 (yyval.interm.type).setAggregate(2);
3966 }
3967 break;
3968
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003969 case 141:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003970
3971 {
3972 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3973 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3974 (yyval.interm.type).setAggregate(3);
3975 }
3976 break;
3977
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003978 case 142:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003979
3980 {
3981 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3982 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3983 (yyval.interm.type).setAggregate(4);
3984 }
3985 break;
3986
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003987 case 143:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003988
3989 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003990 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
3991 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3992 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00003993 (yyval.interm.type).setMatrix(2, 2);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003994 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003995 break;
3996
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003997 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003998
3999 {
4000 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
4001 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4002 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00004003 (yyval.interm.type).setMatrix(3, 3);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004004 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004005 break;
4006
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004007 case 145:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004008
4009 {
4010 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
4011 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4012 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00004013 (yyval.interm.type).setMatrix(4, 4);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004014 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004015 break;
4016
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004017 case 146:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004018
4019 {
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004020 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4021 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4022 (yyval.interm.type).setMatrix(2, 3);
4023 }
4024 break;
4025
4026 case 147:
4027
4028 {
4029 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4030 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4031 (yyval.interm.type).setMatrix(3, 2);
4032 }
4033 break;
4034
4035 case 148:
4036
4037 {
4038 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4039 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4040 (yyval.interm.type).setMatrix(2, 4);
4041 }
4042 break;
4043
4044 case 149:
4045
4046 {
4047 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4048 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4049 (yyval.interm.type).setMatrix(4, 2);
4050 }
4051 break;
4052
4053 case 150:
4054
4055 {
4056 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4057 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4058 (yyval.interm.type).setMatrix(3, 4);
4059 }
4060 break;
4061
4062 case 151:
4063
4064 {
4065 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4066 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4067 (yyval.interm.type).setMatrix(4, 3);
4068 }
4069 break;
4070
4071 case 152:
4072
4073 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004074 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4075 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4076 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004077 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004078 break;
4079
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004080 case 153:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004081
4082 {
4083 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4084 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4085 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004086 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004087 break;
4088
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004089 case 154:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004090
4091 {
zmo@google.com09c323a2011-08-12 18:22:25 +00004092 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004093 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00004094 context->recover();
4095 }
4096 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4097 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4098 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004099 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004100 break;
4101
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004102 case 155:
zmo@google.com09c323a2011-08-12 18:22:25 +00004103
4104 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004105 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004106 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00004107 context->recover();
4108 }
4109 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
4110 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4111 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004112 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004113 break;
4114
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004115 case 156:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004116
4117 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004118 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4119 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4120 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004121 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004122 break;
4123
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004124 case 157:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004125
4126 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004127 //
4128 // This is for user defined type names. The lexical phase looked up the
4129 // type.
4130 //
4131 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4132 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4133 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4134 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004135 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004136 break;
4137
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004138 case 158:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004139
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004140 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004141 break;
4142
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004143 case 159:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004144
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004145 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004146 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (6)].lex).line, (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004147 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004148 break;
4149
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004150 case 160:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004151
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004152 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004153 break;
4154
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004155 case 161:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004156
kbr@chromium.org476541f2011-10-27 21:14:51 +00004157 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004158 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (5)].lex).line, 0, "", (yyvsp[(4) - (5)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004159 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004160 break;
4161
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004162 case 162:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004163
4164 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004165 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004166 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004167 break;
4168
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004169 case 163:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004170
4171 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004172 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4173 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4174 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4175 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4176 context->error((*(yyvsp[(2) - (2)].interm.typeList))[i].line, "duplicate field name in structure:", "struct", (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName().c_str());
4177 context->recover();
4178 }
4179 }
4180 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4181 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004182 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004183 break;
4184
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004185 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004186
4187 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004188 (yyval.interm.typeList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004189 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004190 break;
4191
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004192 case 165:
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004193
4194 {
4195 // ES3 Only, but errors should be handled elsewhere
4196 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4197 (yyval.interm.typeList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.typeList));
4198 }
4199 break;
4200
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004201 case 166:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004202
4203 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004204 (yyval.interm.typeList) = NewPoolTTypeList();
4205 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004206 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004207 break;
4208
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004209 case 167:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004210
4211 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004212 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004213 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004214 break;
4215
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004216 case 168:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004217
4218 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004219 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4220 context->recover();
4221
4222 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4223 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4224 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004225 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004226 break;
4227
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004228 case 169:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004229
4230 {
4231 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4232 context->recover();
4233
4234 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4235 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4236 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4237
4238 int size;
4239 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4240 context->recover();
4241 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004242 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004243 break;
4244
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004245 case 170:
4246
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004247 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004248 break;
4249
4250 case 171:
4251
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004252 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4253 break;
4254
4255 case 172:
4256
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004257 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004258 break;
4259
4260 case 173:
4261
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004262 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004263 break;
4264
4265 case 174:
4266
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004267 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004268 break;
4269
4270 case 175:
4271
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004272 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004273 break;
4274
4275 case 176:
4276
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004277 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004278 break;
4279
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004280 case 177:
4281
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004282 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004283 break;
4284
4285 case 178:
4286
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004287 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4288 break;
4289
4290 case 179:
4291
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004292 { (yyval.interm.intermAggregate) = 0; }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004293 break;
4294
4295 case 180:
4296
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004297 { context->symbolTable.push(); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004298 break;
4299
4300 case 181:
4301
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004302 { context->symbolTable.pop(); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004303 break;
4304
4305 case 182:
4306
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004307 {
4308 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4309 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4310 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4311 }
4312 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4313 }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004314 break;
4315
4316 case 183:
4317
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004318 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4319 break;
4320
4321 case 184:
4322
4323 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4324 break;
4325
4326 case 185:
4327
4328 { context->symbolTable.push(); }
4329 break;
4330
4331 case 186:
4332
4333 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4334 break;
4335
4336 case 187:
4337
4338 { context->symbolTable.push(); }
4339 break;
4340
4341 case 188:
4342
4343 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4344 break;
4345
4346 case 189:
4347
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004348 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004349 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004350 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004351 break;
4352
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004353 case 190:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004354
4355 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004356 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004357 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004358 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4359 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004360 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004361 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004362 break;
4363
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004364 case 191:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004365
4366 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004367 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004368 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004369 break;
4370
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004371 case 192:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004372
kbr@chromium.org205fef32011-11-22 20:50:02 +00004373 {
4374 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004375 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004376 break;
4377
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004378 case 193:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004379
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004380 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004381 break;
4382
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004383 case 194:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004384
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004385 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004386 break;
4387
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004388 case 195:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004389
4390 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004391 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4392 context->recover();
4393 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004394 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004395 break;
4396
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004397 case 196:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004398
4399 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004400 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4401 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004402 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004403 break;
4404
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004405 case 197:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004406
4407 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004408 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4409 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004410 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004411 break;
4412
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004413 case 198:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004414
4415 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004416 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4417 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4418 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004419 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004420 break;
4421
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004422 case 199:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004423
4424 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004425 TIntermNode* intermNode;
4426 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4427 context->recover();
4428 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4429 context->recover();
4430
4431 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4432 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4433 else {
4434 context->recover();
4435 (yyval.interm.intermTypedNode) = 0;
4436 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004437 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004438 break;
4439
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004440 case 200:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004441
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004442 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004443 break;
4444
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004445 case 201:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004446
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004447 {
4448 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004449 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(1) - (6)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004450 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004451 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004452 break;
4453
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004454 case 202:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004455
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004456 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004457 break;
4458
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004459 case 203:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004460
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004461 {
4462 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4463 context->recover();
4464
alokp@chromium.org52813552010-11-16 18:36:09 +00004465 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(4) - (8)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004466 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004467 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004468 break;
4469
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004470 case 204:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004471
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004472 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004473 break;
4474
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004475 case 205:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004476
4477 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004478 context->symbolTable.pop();
4479 (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);
4480 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004481 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004482 break;
4483
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004484 case 206:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004485
4486 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004487 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004488 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004489 break;
4490
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004491 case 207:
zmo@google.com09c323a2011-08-12 18:22:25 +00004492
4493 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004494 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004495 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004496 break;
4497
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004498 case 208:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004499
4500 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004501 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004502 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004503 break;
4504
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004505 case 209:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004506
4507 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004508 (yyval.interm.intermTypedNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004509 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004510 break;
4511
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004512 case 210:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004513
4514 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004515 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4516 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004517 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004518 break;
4519
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004520 case 211:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004521
4522 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004523 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4524 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004525 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004526 break;
4527
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004528 case 212:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004529
4530 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004531 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004532 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004533 context->recover();
4534 }
4535 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004536 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004537 break;
4538
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004539 case 213:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004540
4541 {
4542 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004543 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004544 context->recover();
4545 }
4546 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004547 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004548 break;
4549
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004550 case 214:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004551
4552 {
4553 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4554 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004555 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004556 context->recover();
4557 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004558 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004559 break;
4560
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004561 case 215:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004562
4563 {
4564 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4565 context->functionReturnsValue = true;
4566 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004567 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004568 context->recover();
4569 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004570 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004571 context->recover();
4572 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004573 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004574 break;
4575
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004576 case 216:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004577
4578 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004579 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4580 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004581 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004582 break;
4583
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004584 case 217:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004585
4586 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004587 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004588 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004589 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004590 break;
4591
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004592 case 218:
zmo@google.com09c323a2011-08-12 18:22:25 +00004593
4594 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004595 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4596 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004597 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004598 break;
4599
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004600 case 219:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004601
4602 {
4603 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004604 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004605 break;
4606
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004607 case 220:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004608
4609 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004610 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004611 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004612 break;
4613
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004614 case 221:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004615
4616 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004617 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004618
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004619 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004620
4621 if (builtIn)
4622 {
4623 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4624 context->recover();
4625 }
4626
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004627 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004628 //
4629 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4630 // as it would have just been put in the symbol table. Otherwise, we're looking up
4631 // an earlier occurance.
4632 //
4633 if (prevDec->isDefined()) {
4634 //
4635 // Then this function already has a body.
4636 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004637 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004638 context->recover();
4639 }
4640 prevDec->setDefined();
4641
4642 //
4643 // Raise error message if main function takes any parameters or return anything other than void
4644 //
4645 if (function->getName() == "main") {
4646 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004647 context->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004648 context->recover();
4649 }
4650 if (function->getReturnType().getBasicType() != EbtVoid) {
4651 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4652 context->recover();
4653 }
4654 }
4655
4656 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004657 // Remember the return type for later checking for RETURN statements.
4658 //
4659 context->currentFunctionType = &(prevDec->getReturnType());
4660 context->functionReturnsValue = false;
4661
4662 //
4663 // Insert parameters into the symbol table.
4664 // If the parameter has no name, it's not an error, just don't insert it
4665 // (could be used for unused args).
4666 //
4667 // Also, accumulate the list of parameters into the HIL, so lower level code
4668 // knows where to find parameters.
4669 //
4670 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004671 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004672 const TParameter& param = function->getParam(i);
4673 if (param.name != 0) {
4674 TVariable *variable = new TVariable(param.name, *param.type);
4675 //
4676 // Insert the parameters with name in the symbol table.
4677 //
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004678 if (! context->symbolTable.declare(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004679 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004680 context->recover();
4681 delete variable;
4682 }
4683
4684 //
4685 // Add the parameter to the HIL
4686 //
4687 paramNodes = context->intermediate.growAggregate(
4688 paramNodes,
4689 context->intermediate.addSymbol(variable->getUniqueId(),
4690 variable->getName(),
4691 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4692 (yyvsp[(1) - (1)].interm).line);
4693 } else {
4694 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4695 }
4696 }
4697 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4698 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4699 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004700 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004701 break;
4702
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004703 case 222:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004704
4705 {
4706 //?? Check that all paths return a value if return type != void ?
4707 // May be best done as post process phase on intermediate code
4708 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4709 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4710 context->recover();
4711 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004712
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004713 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4714 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4715 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4716 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4717
4718 // store the pragma information for debug and optimize and other vendor specific
4719 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004720 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4721 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004722
4723 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4724 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004725
4726 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004727 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004728 break;
4729
4730
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004731
4732 default: break;
4733 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004734 /* User semantic actions sometimes alter yychar, and that requires
4735 that yytoken be updated with the new translation. We take the
4736 approach of translating immediately before every use of yytoken.
4737 One alternative is translating here after every semantic action,
4738 but that translation would be missed if the semantic action invokes
4739 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4740 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4741 incorrect destructor might then be invoked immediately. In the
4742 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4743 to an incorrect destructor call or verbose syntax error message
4744 before the lookahead is translated. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004745 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4746
4747 YYPOPSTACK (yylen);
4748 yylen = 0;
4749 YY_STACK_PRINT (yyss, yyssp);
4750
4751 *++yyvsp = yyval;
4752
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004753 /* Now `shift' the result of the reduction. Determine what state
4754 that goes to, based on the state we popped back to and the rule
4755 number reduced by. */
4756
4757 yyn = yyr1[yyn];
4758
4759 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4760 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4761 yystate = yytable[yystate];
4762 else
4763 yystate = yydefgoto[yyn - YYNTOKENS];
4764
4765 goto yynewstate;
4766
4767
4768/*------------------------------------.
4769| yyerrlab -- here on detecting error |
4770`------------------------------------*/
4771yyerrlab:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004772 /* Make sure we have latest lookahead translation. See comments at
4773 user semantic actions for why this is necessary. */
4774 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4775
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004776 /* If not already recovering from an error, report this error. */
4777 if (!yyerrstatus)
4778 {
4779 ++yynerrs;
4780#if ! YYERROR_VERBOSE
4781 yyerror (context, YY_("syntax error"));
4782#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004783# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4784 yyssp, yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004785 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004786 char const *yymsgp = YY_("syntax error");
4787 int yysyntax_error_status;
4788 yysyntax_error_status = YYSYNTAX_ERROR;
4789 if (yysyntax_error_status == 0)
4790 yymsgp = yymsg;
4791 else if (yysyntax_error_status == 1)
4792 {
4793 if (yymsg != yymsgbuf)
4794 YYSTACK_FREE (yymsg);
4795 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4796 if (!yymsg)
4797 {
4798 yymsg = yymsgbuf;
4799 yymsg_alloc = sizeof yymsgbuf;
4800 yysyntax_error_status = 2;
4801 }
4802 else
4803 {
4804 yysyntax_error_status = YYSYNTAX_ERROR;
4805 yymsgp = yymsg;
4806 }
4807 }
4808 yyerror (context, yymsgp);
4809 if (yysyntax_error_status == 2)
4810 goto yyexhaustedlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004811 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004812# undef YYSYNTAX_ERROR
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004813#endif
4814 }
4815
4816
4817
4818 if (yyerrstatus == 3)
4819 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004820 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004821 error, discard it. */
4822
4823 if (yychar <= YYEOF)
4824 {
4825 /* Return failure if at end of input. */
4826 if (yychar == YYEOF)
4827 YYABORT;
4828 }
4829 else
4830 {
4831 yydestruct ("Error: discarding",
4832 yytoken, &yylval, context);
4833 yychar = YYEMPTY;
4834 }
4835 }
4836
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004837 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004838 token. */
4839 goto yyerrlab1;
4840
4841
4842/*---------------------------------------------------.
4843| yyerrorlab -- error raised explicitly by YYERROR. |
4844`---------------------------------------------------*/
4845yyerrorlab:
4846
4847 /* Pacify compilers like GCC when the user code never invokes
4848 YYERROR and the label yyerrorlab therefore never appears in user
4849 code. */
4850 if (/*CONSTCOND*/ 0)
4851 goto yyerrorlab;
4852
4853 /* Do not reclaim the symbols of the rule which action triggered
4854 this YYERROR. */
4855 YYPOPSTACK (yylen);
4856 yylen = 0;
4857 YY_STACK_PRINT (yyss, yyssp);
4858 yystate = *yyssp;
4859 goto yyerrlab1;
4860
4861
4862/*-------------------------------------------------------------.
4863| yyerrlab1 -- common code for both syntax error and YYERROR. |
4864`-------------------------------------------------------------*/
4865yyerrlab1:
4866 yyerrstatus = 3; /* Each real token shifted decrements this. */
4867
4868 for (;;)
4869 {
4870 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004871 if (!yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004872 {
4873 yyn += YYTERROR;
4874 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4875 {
4876 yyn = yytable[yyn];
4877 if (0 < yyn)
4878 break;
4879 }
4880 }
4881
4882 /* Pop the current state because it cannot handle the error token. */
4883 if (yyssp == yyss)
4884 YYABORT;
4885
4886
4887 yydestruct ("Error: popping",
4888 yystos[yystate], yyvsp, context);
4889 YYPOPSTACK (1);
4890 yystate = *yyssp;
4891 YY_STACK_PRINT (yyss, yyssp);
4892 }
4893
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004894 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004895 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004896 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004897
4898
4899 /* Shift the error token. */
4900 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4901
4902 yystate = yyn;
4903 goto yynewstate;
4904
4905
4906/*-------------------------------------.
4907| yyacceptlab -- YYACCEPT comes here. |
4908`-------------------------------------*/
4909yyacceptlab:
4910 yyresult = 0;
4911 goto yyreturn;
4912
4913/*-----------------------------------.
4914| yyabortlab -- YYABORT comes here. |
4915`-----------------------------------*/
4916yyabortlab:
4917 yyresult = 1;
4918 goto yyreturn;
4919
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004920#if !defined yyoverflow || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004921/*-------------------------------------------------.
4922| yyexhaustedlab -- memory exhaustion comes here. |
4923`-------------------------------------------------*/
4924yyexhaustedlab:
4925 yyerror (context, YY_("memory exhausted"));
4926 yyresult = 2;
4927 /* Fall through. */
4928#endif
4929
4930yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004931 if (yychar != YYEMPTY)
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004932 {
4933 /* Make sure we have latest lookahead translation. See comments at
4934 user semantic actions for why this is necessary. */
4935 yytoken = YYTRANSLATE (yychar);
4936 yydestruct ("Cleanup: discarding lookahead",
4937 yytoken, &yylval, context);
4938 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004939 /* Do not reclaim the symbols of the rule which action triggered
4940 this YYABORT or YYACCEPT. */
4941 YYPOPSTACK (yylen);
4942 YY_STACK_PRINT (yyss, yyssp);
4943 while (yyssp != yyss)
4944 {
4945 yydestruct ("Cleanup: popping",
4946 yystos[*yyssp], yyvsp, context);
4947 YYPOPSTACK (1);
4948 }
4949#ifndef yyoverflow
4950 if (yyss != yyssa)
4951 YYSTACK_FREE (yyss);
4952#endif
4953#if YYERROR_VERBOSE
4954 if (yymsg != yymsgbuf)
4955 YYSTACK_FREE (yymsg);
4956#endif
4957 /* Make sure YYID is used. */
4958 return YYID (yyresult);
4959}
4960
4961
4962
4963
4964
4965int glslang_parse(TParseContext* context) {
4966 return yyparse(context);
4967}