blob: 0ec85a378987be634edb4d0834c29c496bf960ec [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.org5703d882013-05-30 00:19:38 +0000729 0, 187, 187, 222, 225, 230, 235, 240, 246, 249,
730 252, 255, 258, 268, 281, 289, 389, 392, 400, 404,
731 411, 415, 422, 428, 437, 445, 500, 507, 517, 520,
732 530, 540, 561, 562, 563, 568, 569, 578, 590, 591,
733 599, 610, 614, 615, 625, 635, 645, 658, 659, 669,
734 682, 686, 690, 694, 695, 708, 709, 722, 723, 736,
735 737, 754, 755, 768, 769, 770, 771, 772, 776, 779,
736 790, 798, 806, 833, 838, 849, 853, 857, 864, 902,
737 905, 912, 920, 941, 962, 973, 1002, 1007, 1017, 1022,
738 1032, 1035, 1038, 1041, 1047, 1054, 1057, 1079, 1097, 1121,
739 1144, 1148, 1166, 1174, 1206, 1226, 1315, 1324, 1330, 1334,
740 1341, 1347, 1354, 1363, 1372, 1375, 1411, 1421, 1425, 1430,
741 1435, 1440, 1445, 1454, 1464, 1471, 1474, 1477, 1483, 1486,
742 1501, 1505, 1509, 1513, 1522, 1527, 1532, 1537, 1542, 1547,
743 1552, 1557, 1562, 1567, 1573, 1579, 1585, 1590, 1595, 1600,
744 1605, 1610, 1615, 1620, 1625, 1634, 1643, 1648, 1661, 1661,
745 1664, 1664, 1670, 1673, 1688, 1691, 1699, 1703, 1709, 1717,
746 1733, 1737, 1741, 1742, 1748, 1749, 1750, 1751, 1752, 1756,
747 1757, 1757, 1757, 1767, 1768, 1772, 1772, 1773, 1773, 1778,
748 1781, 1791, 1794, 1800, 1801, 1805, 1813, 1817, 1827, 1832,
749 1849, 1849, 1854, 1854, 1861, 1861, 1869, 1872, 1878, 1881,
750 1887, 1891, 1898, 1905, 1912, 1919, 1930, 1939, 1943, 1950,
751 1953, 1959, 1959
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 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002301 ConstantUnion *unionArray = new ConstantUnion[1];
2302 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2303 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002304 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002305 break;
2306
2307 case 5:
2308
2309 {
2310 ConstantUnion *unionArray = new ConstantUnion[1];
2311 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2312 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002313 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002314 break;
2315
2316 case 6:
2317
2318 {
2319 ConstantUnion *unionArray = new ConstantUnion[1];
2320 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2321 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002322 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002323 break;
2324
2325 case 7:
2326
2327 {
2328 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002329 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002330 break;
2331
2332 case 8:
2333
2334 {
2335 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002336 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002337 break;
2338
2339 case 9:
2340
2341 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002342 (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 +00002343 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002344 break;
2345
2346 case 10:
2347
2348 {
2349 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002350 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002351 break;
2352
2353 case 11:
2354
2355 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002356 (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 +00002357 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002358 break;
2359
2360 case 12:
2361
2362 {
2363 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2364 context->recover();
2365 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2366 if ((yyval.interm.intermTypedNode) == 0) {
2367 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2368 context->recover();
2369 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2370 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002371 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002372 break;
2373
2374 case 13:
2375
2376 {
2377 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2378 context->recover();
2379 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2380 if ((yyval.interm.intermTypedNode) == 0) {
2381 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2382 context->recover();
2383 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2384 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002385 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002386 break;
2387
2388 case 14:
2389
2390 {
2391 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2392 context->recover();
2393 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002394 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002395 break;
2396
2397 case 15:
2398
2399 {
2400 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2401 TOperator op = fnCall->getBuiltInOp();
2402
2403 if (op != EOpNull)
2404 {
2405 //
2406 // Then this should be a constructor.
2407 // Don't go through the symbol table for constructors.
2408 // Their parameters will be verified algorithmically.
2409 //
2410 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2411 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2412 (yyval.interm.intermTypedNode) = 0;
2413 } else {
2414 //
2415 // It's a constructor, of type 'type'.
2416 //
2417 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2418 }
2419
2420 if ((yyval.interm.intermTypedNode) == 0) {
2421 context->recover();
2422 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2423 }
2424 (yyval.interm.intermTypedNode)->setType(type);
2425 } else {
2426 //
2427 // Not a constructor. Find it in the symbol table.
2428 //
2429 const TFunction* fnCandidate;
2430 bool builtIn;
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00002431 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, context->shaderVersion, &builtIn);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002432 if (fnCandidate) {
2433 //
2434 // A declared function.
2435 //
2436 if (builtIn && !fnCandidate->getExtension().empty() &&
2437 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2438 context->recover();
2439 }
2440 op = fnCandidate->getBuiltInOp();
2441 if (builtIn && op != EOpNull) {
2442 //
2443 // A function call mapped to a built-in operation.
2444 //
2445 if (fnCandidate->getParamCount() == 1) {
2446 //
2447 // Treat it like a built-in unary operator.
2448 //
2449 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2450 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002451 std::stringstream extraInfoStream;
2452 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2453 std::string extraInfo = extraInfoStream.str();
2454 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002455 YYERROR;
2456 }
2457 } else {
2458 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2459 }
2460 } else {
2461 // This is a real function call
2462
2463 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2464 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2465
2466 // this is how we know whether the given function is a builtIn function or a user defined function
2467 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2468 // if builtIn == true, it's definitely a builtIn function with EOpNull
2469 if (!builtIn)
2470 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2471 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2472
2473 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002474 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002475 qual = fnCandidate->getParam(i).type->getQualifier();
2476 if (qual == EvqOut || qual == EvqInOut) {
2477 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002478 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 +00002479 context->recover();
2480 }
2481 }
2482 }
2483 }
2484 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2485 } else {
2486 // error message was put out by PaFindFunction()
2487 // Put on a dummy node for error recovery
2488 ConstantUnion *unionArray = new ConstantUnion[1];
2489 unionArray->setFConst(0.0f);
2490 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2491 context->recover();
2492 }
2493 }
2494 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002495 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002496 break;
2497
2498 case 16:
2499
2500 {
2501 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002502 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002503 break;
2504
2505 case 17:
2506
2507 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002508 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002509 context->recover();
2510 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002511 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002512 break;
2513
2514 case 18:
2515
2516 {
2517 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2518 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002519 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002520 break;
2521
2522 case 19:
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 20:
2531
2532 {
2533 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2534 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002535 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002536 break;
2537
2538 case 21:
2539
2540 {
2541 (yyval.interm).function = (yyvsp[(1) - (1)].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 22:
2547
2548 {
2549 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2550 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2551 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2552 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002553 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002554 break;
2555
2556 case 23:
2557
2558 {
2559 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2560 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2561 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2562 (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 +00002563 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002564 break;
2565
2566 case 24:
2567
2568 {
2569 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002570 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002571 break;
2572
2573 case 25:
2574
2575 {
2576 //
2577 // Constructor
2578 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002579 TOperator op = EOpNull;
2580 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2581 op = EOpConstructStruct;
2582 } else {
2583 switch ((yyvsp[(1) - (1)].interm.type).type) {
2584 case EbtFloat:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002585 if ((yyvsp[(1) - (1)].interm.type).isMatrix()) {
2586 switch((yyvsp[(1) - (1)].interm.type).getCols()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002587 case 2: op = EOpConstructMat2; break;
2588 case 3: op = EOpConstructMat3; break;
2589 case 4: op = EOpConstructMat4; break;
2590 }
2591 } else {
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002592 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002593 case 1: op = EOpConstructFloat; break;
2594 case 2: op = EOpConstructVec2; break;
2595 case 3: op = EOpConstructVec3; break;
2596 case 4: op = EOpConstructVec4; break;
2597 }
2598 }
2599 break;
2600 case EbtInt:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002601 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002602 case 1: op = EOpConstructInt; break;
2603 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2604 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2605 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2606 }
2607 break;
2608 case EbtBool:
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 = EOpConstructBool; break;
2611 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2612 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2613 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2614 }
2615 break;
2616 default: break;
2617 }
2618 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002619 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 +00002620 context->recover();
2621 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2622 op = EOpConstructFloat;
2623 }
2624 }
2625 TString tempString;
2626 TType type((yyvsp[(1) - (1)].interm.type));
2627 TFunction *function = new TFunction(&tempString, type, op);
2628 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002629 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002630 break;
2631
2632 case 26:
2633
2634 {
2635 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2636 context->recover();
2637 TType type(EbtVoid, EbpUndefined);
2638 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2639 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002640 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002641 break;
2642
2643 case 27:
2644
2645 {
2646 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2647 context->recover();
2648 TType type(EbtVoid, EbpUndefined);
2649 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2650 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002651 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002652 break;
2653
2654 case 28:
2655
2656 {
2657 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002658 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002659 break;
2660
2661 case 29:
2662
2663 {
2664 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2665 context->recover();
2666 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2667 if ((yyval.interm.intermTypedNode) == 0) {
2668 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2669 context->recover();
2670 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2671 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002672 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002673 break;
2674
2675 case 30:
2676
2677 {
2678 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2679 context->recover();
2680 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2681 if ((yyval.interm.intermTypedNode) == 0) {
2682 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2683 context->recover();
2684 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2685 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002686 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002687 break;
2688
2689 case 31:
2690
2691 {
2692 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2693 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2694 if ((yyval.interm.intermTypedNode) == 0) {
2695 const char* errorOp = "";
2696 switch((yyvsp[(1) - (2)].interm).op) {
2697 case EOpNegative: errorOp = "-"; break;
2698 case EOpLogicalNot: errorOp = "!"; break;
2699 default: break;
2700 }
2701 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2702 context->recover();
2703 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2704 }
2705 } else
2706 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002707 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002708 break;
2709
2710 case 32:
2711
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002712 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002713 break;
2714
2715 case 33:
2716
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002717 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002718 break;
2719
2720 case 34:
2721
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002722 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002723 break;
2724
2725 case 35:
2726
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002727 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002728 break;
2729
2730 case 36:
2731
2732 {
2733 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2734 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2735 if ((yyval.interm.intermTypedNode) == 0) {
2736 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2737 context->recover();
2738 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2739 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002740 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002741 break;
2742
2743 case 37:
2744
2745 {
2746 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2747 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2748 if ((yyval.interm.intermTypedNode) == 0) {
2749 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2750 context->recover();
2751 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2752 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002753 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002754 break;
2755
2756 case 38:
2757
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002758 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002759 break;
2760
2761 case 39:
2762
2763 {
2764 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2765 if ((yyval.interm.intermTypedNode) == 0) {
2766 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2767 context->recover();
2768 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2769 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002770 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002771 break;
2772
2773 case 40:
2774
2775 {
2776 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2777 if ((yyval.interm.intermTypedNode) == 0) {
2778 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2779 context->recover();
2780 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2781 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002782 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002783 break;
2784
2785 case 41:
2786
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002787 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002788 break;
2789
2790 case 42:
2791
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002792 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002793 break;
2794
2795 case 43:
2796
2797 {
2798 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2799 if ((yyval.interm.intermTypedNode) == 0) {
2800 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2801 context->recover();
2802 ConstantUnion *unionArray = new ConstantUnion[1];
2803 unionArray->setBConst(false);
2804 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2805 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002806 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002807 break;
2808
2809 case 44:
2810
2811 {
2812 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2813 if ((yyval.interm.intermTypedNode) == 0) {
2814 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2815 context->recover();
2816 ConstantUnion *unionArray = new ConstantUnion[1];
2817 unionArray->setBConst(false);
2818 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2819 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002820 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002821 break;
2822
2823 case 45:
2824
2825 {
2826 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2827 if ((yyval.interm.intermTypedNode) == 0) {
2828 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2829 context->recover();
2830 ConstantUnion *unionArray = new ConstantUnion[1];
2831 unionArray->setBConst(false);
2832 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2833 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002834 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002835 break;
2836
2837 case 46:
2838
2839 {
2840 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2841 if ((yyval.interm.intermTypedNode) == 0) {
2842 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2843 context->recover();
2844 ConstantUnion *unionArray = new ConstantUnion[1];
2845 unionArray->setBConst(false);
2846 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2847 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002848 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002849 break;
2850
2851 case 47:
2852
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002853 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002854 break;
2855
2856 case 48:
2857
2858 {
2859 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2860 if ((yyval.interm.intermTypedNode) == 0) {
2861 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2862 context->recover();
2863 ConstantUnion *unionArray = new ConstantUnion[1];
2864 unionArray->setBConst(false);
2865 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2866 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002867 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002868 break;
2869
2870 case 49:
2871
2872 {
2873 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2874 if ((yyval.interm.intermTypedNode) == 0) {
2875 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2876 context->recover();
2877 ConstantUnion *unionArray = new ConstantUnion[1];
2878 unionArray->setBConst(false);
2879 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2880 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002881 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002882 break;
2883
2884 case 50:
2885
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002886 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002887 break;
2888
2889 case 51:
2890
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002891 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002892 break;
2893
2894 case 52:
2895
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002896 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002897 break;
2898
2899 case 53:
2900
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002901 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002902 break;
2903
2904 case 54:
2905
2906 {
2907 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2908 if ((yyval.interm.intermTypedNode) == 0) {
2909 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2910 context->recover();
2911 ConstantUnion *unionArray = new ConstantUnion[1];
2912 unionArray->setBConst(false);
2913 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2914 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002915 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002916 break;
2917
2918 case 55:
2919
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002920 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002921 break;
2922
2923 case 56:
2924
2925 {
2926 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2927 if ((yyval.interm.intermTypedNode) == 0) {
2928 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2929 context->recover();
2930 ConstantUnion *unionArray = new ConstantUnion[1];
2931 unionArray->setBConst(false);
2932 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2933 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002934 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002935 break;
2936
2937 case 57:
2938
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002939 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002940 break;
2941
2942 case 58:
2943
2944 {
2945 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2946 if ((yyval.interm.intermTypedNode) == 0) {
2947 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2948 context->recover();
2949 ConstantUnion *unionArray = new ConstantUnion[1];
2950 unionArray->setBConst(false);
2951 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2952 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002953 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002954 break;
2955
2956 case 59:
2957
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002958 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002959 break;
2960
2961 case 60:
2962
2963 {
2964 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
2965 context->recover();
2966
2967 (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);
2968 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
2969 (yyval.interm.intermTypedNode) = 0;
2970
2971 if ((yyval.interm.intermTypedNode) == 0) {
2972 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
2973 context->recover();
2974 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
2975 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002976 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002977 break;
2978
2979 case 61:
2980
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002981 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002982 break;
2983
2984 case 62:
2985
2986 {
2987 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
2988 context->recover();
2989 (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);
2990 if ((yyval.interm.intermTypedNode) == 0) {
2991 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2992 context->recover();
2993 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2994 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002995 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002996 break;
2997
2998 case 63:
2999
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003000 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003001 break;
3002
3003 case 64:
3004
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003005 { 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 +00003006 break;
3007
3008 case 65:
3009
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003010 { 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 +00003011 break;
3012
3013 case 66:
3014
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003015 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003016 break;
3017
3018 case 67:
3019
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003020 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003021 break;
3022
3023 case 68:
3024
3025 {
3026 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003027 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003028 break;
3029
3030 case 69:
3031
3032 {
3033 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3034 if ((yyval.interm.intermTypedNode) == 0) {
3035 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3036 context->recover();
3037 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3038 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003039 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003040 break;
3041
3042 case 70:
3043
3044 {
3045 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3046 context->recover();
3047 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003048 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003049 break;
3050
3051 case 71:
3052
3053 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003054 if (context->enterStructDeclaration((yyvsp[(1) - (2)].lex).line, *(yyvsp[(1) - (2)].lex).string))
3055 context->recover();
3056 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3057 }
3058 break;
3059
3060 case 72:
3061
3062 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003063 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3064
3065 TIntermAggregate *prototype = new TIntermAggregate;
3066 prototype->setType(function.getReturnType());
3067 prototype->setName(function.getName());
3068
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003069 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003070 {
3071 const TParameter &param = function.getParam(i);
3072 if (param.name != 0)
3073 {
3074 TVariable *variable = new TVariable(param.name, *param.type);
3075
3076 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3077 }
3078 else
3079 {
3080 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3081 }
3082 }
3083
3084 prototype->setOp(EOpPrototype);
3085 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003086
3087 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003088 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003089 break;
3090
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003091 case 73:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003092
3093 {
3094 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3095 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3096 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003097 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003098 break;
3099
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003100 case 74:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003101
3102 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003103 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3104 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3105 context->recover();
3106 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003107 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3108 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3109 context->recover();
3110 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003111 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003112 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003113 break;
3114
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003115 case 75:
3116
3117 {
3118 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yyvsp[(1) - (5)].interm.type).line, "interface blocks");
3119 (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);
3120 }
3121 break;
3122
3123 case 76:
3124
3125 {
3126 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yyvsp[(1) - (6)].interm.type).line, "interface blocks");
3127 (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);
3128 }
3129 break;
3130
3131 case 77:
3132
3133 {
3134 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yyvsp[(1) - (9)].interm.type).line, "interface blocks");
3135 (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);
3136 }
3137 break;
3138
3139 case 78:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003140
3141 {
3142 //
3143 // Multiple declarations of the same function are allowed.
3144 //
3145 // If this is a definition, the definition production code will check for redefinitions
3146 // (we don't know at this point if it's a definition or not).
3147 //
3148 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3149 //
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00003150 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003151 if (prevDec) {
3152 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003153 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 +00003154 context->recover();
3155 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003156 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003157 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003158 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 +00003159 context->recover();
3160 }
3161 }
3162 }
3163
3164 //
3165 // If this is a redeclaration, it could also be a definition,
3166 // in which case, we want to use the variable names from this one, and not the one that's
3167 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3168 //
3169 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3170 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3171
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003172 // We're at the inner scope level of the function's arguments and body statement.
3173 // Add the function prototype to the surrounding scope instead.
3174 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003175 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003176 break;
3177
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003178 case 79:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003179
3180 {
3181 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003182 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003183 break;
3184
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003185 case 80:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003186
3187 {
3188 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003189 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003190 break;
3191
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003192 case 81:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003193
3194 {
3195 // Add the parameter
3196 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3197 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3198 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3199 else
3200 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003201 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003202 break;
3203
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003204 case 82:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003205
3206 {
3207 //
3208 // Only first parameter of one-parameter functions can be void
3209 // The check for named parameters not being void is done in parameter_declarator
3210 //
3211 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3212 //
3213 // This parameter > first is void
3214 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003215 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003216 context->recover();
3217 delete (yyvsp[(3) - (3)].interm).param.type;
3218 } else {
3219 // Add the parameter
3220 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3221 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3222 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003223 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003224 break;
3225
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003226 case 83:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003227
3228 {
3229 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003230 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 +00003231 context->recover();
3232 }
3233 // make sure a sampler is not involved as well...
3234 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3235 context->recover();
3236
3237 // Add the function as a prototype after parsing it (we do not support recursion)
3238 TFunction *function;
3239 TType type((yyvsp[(1) - (3)].interm.type));
3240 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3241 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003242
3243 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003244 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003245 break;
3246
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003247 case 84:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003248
3249 {
3250 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003251 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 +00003252 context->recover();
3253 }
3254 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3255 context->recover();
3256 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3257 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3258 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003259 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003260 break;
3261
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003262 case 85:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003263
3264 {
3265 // Check that we can make an array out of this type
3266 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3267 context->recover();
3268
3269 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3270 context->recover();
3271
3272 int size;
3273 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3274 context->recover();
3275 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3276
3277 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3278 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3279 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3280 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003281 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003282 break;
3283
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003284 case 86:
3285
3286 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003287 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3288 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3289 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003290 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003291 break;
3292
3293 case 87:
3294
3295 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003296 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3297 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3298 context->recover();
3299 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3300 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003301 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003302 break;
3303
3304 case 88:
3305
3306 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003307 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3308 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3309 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003310 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003311 break;
3312
3313 case 89:
3314
3315 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003316 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3317 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3318 context->recover();
3319 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3320 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003321 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003322 break;
3323
3324 case 90:
3325
3326 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003327 (yyval.interm.qualifier) = EvqIn;
3328 }
3329 break;
3330
3331 case 91:
3332
3333 {
3334 (yyval.interm.qualifier) = EvqIn;
3335 }
3336 break;
3337
3338 case 92:
3339
3340 {
3341 (yyval.interm.qualifier) = EvqOut;
3342 }
3343 break;
3344
3345 case 93:
3346
3347 {
3348 (yyval.interm.qualifier) = EvqInOut;
3349 }
3350 break;
3351
3352 case 94:
3353
3354 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003355 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3356 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003357 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003358 break;
3359
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003360 case 95:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003361
3362 {
3363 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003364 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003365 break;
3366
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003367 case 96:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003368
3369 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003370 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3371 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003372 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 +00003373 context->recover();
3374 }
3375
zmo@google.comfd747b82011-04-23 01:30:07 +00003376 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3377 (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 +00003378
3379 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3380 context->recover();
3381
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003382 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 +00003383 context->recover();
3384
zmo@google.comfd747b82011-04-23 01:30:07 +00003385 TVariable* variable = 0;
3386 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 +00003387 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003388 if (symbol && variable)
3389 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003390 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003391 break;
3392
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003393 case 97:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003394
3395 {
3396 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3397 context->recover();
3398
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003399 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 +00003400 context->recover();
3401
3402 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3403
3404 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))
3405 context->recover();
3406 else {
3407 (yyvsp[(1) - (5)].interm).type.setArray(true);
3408 TVariable* variable;
3409 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3410 context->recover();
3411 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003412 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003413 break;
3414
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003415 case 98:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003416
3417 {
3418 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3419 context->recover();
3420
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003421 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 +00003422 context->recover();
3423
3424 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3425
3426 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))
3427 context->recover();
3428 else {
3429 int size;
3430 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3431 context->recover();
3432 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003433 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003434 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3435 context->recover();
3436 TType type = TType((yyvsp[(1) - (6)].interm).type);
3437 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003438 (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 +00003439 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003440 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003441 break;
3442
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003443 case 99:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003444
3445 {
3446 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3447 context->recover();
3448
3449 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3450
3451 TIntermNode* intermNode;
3452 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3453 //
3454 // build the intermediate representation
3455 //
3456 if (intermNode)
3457 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3458 else
3459 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3460 } else {
3461 context->recover();
3462 (yyval.interm).intermAggregate = 0;
3463 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003464 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003465 break;
3466
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003467 case 100:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003468
3469 {
3470 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3471 (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 +00003472 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003473 break;
3474
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003475 case 101:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003476
3477 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003478 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3479 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003480
3481 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3482 context->recover();
3483
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003484 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 +00003485 context->recover();
3486
3487 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3488
zmo@google.comfd747b82011-04-23 01:30:07 +00003489 TVariable* variable = 0;
3490 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 +00003491 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003492 if (variable && symbol)
3493 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003494 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003495 break;
3496
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003497 case 102:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003498
3499 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003500 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 +00003501 context->recover();
3502
zmo@google.comfd747b82011-04-23 01:30:07 +00003503 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3504 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003505 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003506 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003507 break;
3508
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003509 case 103:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003510
3511 {
3512 TType type = TType((yyvsp[(1) - (5)].interm.type));
3513 int size;
3514 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3515 context->recover();
3516 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003517 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3518 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003519
3520 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3521 context->recover();
3522
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003523 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 +00003524 context->recover();
3525
3526 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3527
3528 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)))
3529 context->recover();
3530 else {
3531 int size;
3532 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3533 context->recover();
3534
3535 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003536 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003537 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3538 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003539 if (variable && symbol)
3540 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003541 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003542 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003543 break;
3544
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003545 case 104:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003546
3547 {
3548 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3549 context->recover();
3550
3551 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3552
3553 TIntermNode* intermNode;
3554 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3555 //
3556 // Build intermediate representation
3557 //
3558 if(intermNode)
3559 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3560 else
3561 (yyval.interm).intermAggregate = 0;
3562 } else {
3563 context->recover();
3564 (yyval.interm).intermAggregate = 0;
3565 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003566 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003567 break;
3568
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003569 case 105:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003570
3571 {
3572 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003573 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3574 context->recover();
3575 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3576 if (!(yyvsp[(2) - (2)].lex).symbol)
3577 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003578 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 +00003579 context->recover();
3580
3581 (yyval.interm).intermAggregate = 0;
3582 }
3583 else
3584 {
3585 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3586 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3587 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003588 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003589 break;
3590
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003591 case 106:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003592
3593 {
3594 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3595
3596 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003597 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003598 context->recover();
3599 (yyvsp[(1) - (1)].interm.type).setArray(false);
3600 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003601 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003602 break;
3603
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003604 case 107:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003605
3606 {
shannonwoods@chromium.org0f376ca2013-05-30 00:19:23 +00003607 (yyval.interm.type) = context->addFullySpecifiedType((yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003608 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003609 break;
3610
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003611 case 108:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003612
3613 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003614 (yyval.interm.type).qualifier = EvqSmooth;
3615 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003616 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003617 break;
3618
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003619 case 109:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003620
3621 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003622 (yyval.interm.type).qualifier = EvqFlat;
3623 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003624 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003625 break;
3626
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003627 case 110:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003628
3629 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003630 (yyval.interm.qualifier) = EvqConst;
3631 }
3632 break;
3633
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003634 case 111:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003635
3636 {
3637 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3638 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3639 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3640 context->recover();
3641 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3642 }
3643 break;
3644
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003645 case 112:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003646
3647 {
3648 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003649 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3650 context->recover();
3651 if (context->shaderType == SH_VERTEX_SHADER)
3652 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3653 else
3654 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003655 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003656 break;
3657
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003658 case 113:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003659
3660 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003661 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003662 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3663 context->recover();
3664 if (context->shaderType == SH_VERTEX_SHADER)
3665 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3666 else
3667 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003668 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003669 break;
3670
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003671 case 114:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003672
3673 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003674 (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 +00003675 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003676 break;
3677
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003678 case 115:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003679
3680 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003681 if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothIn) {
3682 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3683 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothIn, (yyvsp[(2) - (2)].interm.type).line);
3684 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3685 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3686 else UNREACHABLE();
3687 }
3688 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidIn) {
3689 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3690 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidIn, (yyvsp[(2) - (2)].interm.type).line);
3691 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3692 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3693 else UNREACHABLE();
3694 }
3695 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothOut) {
3696 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3697 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothOut, (yyvsp[(2) - (2)].interm.type).line);
3698 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3699 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3700 else UNREACHABLE();
3701 }
3702 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidOut) {
3703 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3704 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidOut, (yyvsp[(2) - (2)].interm.type).line);
3705 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3706 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3707 else UNREACHABLE();
3708 }
3709 else {
3710 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));
3711 context->recover();
3712
3713 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
3714 }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003715 }
3716 break;
3717
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003718 case 116:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003719
3720 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003721 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));
3722 context->recover();
3723
3724 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3725 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003726 }
3727 break;
3728
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003729 case 117:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003730
3731 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003732 (yyval.interm.type).qualifier = EvqConst;
3733 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003734 }
3735 break;
3736
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003737 case 118:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003738
3739 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003740 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003741 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqSmoothIn : EvqAttribute;
3742 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003743 }
3744 break;
3745
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003746 case 119:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003747
3748 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003749 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003750 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqSmoothOut;
3751 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3752 }
3753 break;
3754
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003755 case 120:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003756
3757 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003758 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003759 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqAttribute;
3760 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3761 }
3762 break;
3763
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003764 case 121:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003765
3766 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003767 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003768 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqCentroidOut;
3769 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3770 }
3771 break;
3772
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003773 case 122:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003774
3775 {
3776 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3777 context->recover();
3778 (yyval.interm.type).qualifier = EvqUniform;
3779 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3780 }
3781 break;
3782
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003783 case 123:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003784
3785 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003786 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003787
3788 if ((yyval.interm.type).precision == EbpUndefined) {
3789 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3790 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3791 context->recover();
3792 }
3793 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003794 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003795 break;
3796
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003797 case 124:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003798
3799 {
3800 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3801 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003802 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003803 break;
3804
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003805 case 125:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003806
3807 {
3808 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003809 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003810 break;
3811
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003812 case 126:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003813
3814 {
3815 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003816 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003817 break;
3818
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003819 case 127:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003820
3821 {
3822 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003823 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003824 break;
3825
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003826 case 128:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003827
3828 {
3829 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003830 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003831 break;
3832
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003833 case 129:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003834
3835 {
3836 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3837
3838 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3839 context->recover();
3840 else {
3841 int size;
3842 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3843 context->recover();
3844 (yyval.interm.type).setArray(true, size);
3845 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003846 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003847 break;
3848
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003849 case 130:
3850
3851 {
3852 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003853 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003854 }
3855 break;
3856
3857 case 131:
3858
3859 {
3860 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3861 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003862 }
3863 break;
3864
3865 case 132:
3866
3867 {
3868 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003869 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003870 }
3871 break;
3872
3873 case 133:
3874
3875 {
3876 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3877 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003878 }
3879 break;
3880
3881 case 134:
3882
3883 {
3884 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003885 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3886 (yyval.interm.type).setAggregate(2);
3887 }
3888 break;
3889
3890 case 135:
3891
3892 {
3893 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3894 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3895 (yyval.interm.type).setAggregate(3);
3896 }
3897 break;
3898
3899 case 136:
3900
3901 {
3902 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3903 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3904 (yyval.interm.type).setAggregate(4);
3905 }
3906 break;
3907
3908 case 137:
3909
3910 {
3911 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3912 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3913 (yyval.interm.type).setAggregate(2);
3914 }
3915 break;
3916
3917 case 138:
3918
3919 {
3920 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003921 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3922 (yyval.interm.type).setAggregate(3);
3923 }
3924 break;
3925
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003926 case 139:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003927
3928 {
3929 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3930 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3931 (yyval.interm.type).setAggregate(4);
3932 }
3933 break;
3934
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003935 case 140:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003936
3937 {
3938 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3939 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3940 (yyval.interm.type).setAggregate(2);
3941 }
3942 break;
3943
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003944 case 141:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003945
3946 {
3947 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3948 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3949 (yyval.interm.type).setAggregate(3);
3950 }
3951 break;
3952
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003953 case 142:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003954
3955 {
3956 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3957 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3958 (yyval.interm.type).setAggregate(4);
3959 }
3960 break;
3961
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003962 case 143:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003963
3964 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003965 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
3966 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3967 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00003968 (yyval.interm.type).setMatrix(2, 2);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003969 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003970 break;
3971
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003972 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003973
3974 {
3975 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
3976 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3977 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00003978 (yyval.interm.type).setMatrix(3, 3);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003979 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003980 break;
3981
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003982 case 145:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003983
3984 {
3985 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
3986 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3987 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00003988 (yyval.interm.type).setMatrix(4, 4);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003989 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003990 break;
3991
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003992 case 146:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003993
3994 {
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00003995 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3996 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3997 (yyval.interm.type).setMatrix(2, 3);
3998 }
3999 break;
4000
4001 case 147:
4002
4003 {
4004 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4005 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4006 (yyval.interm.type).setMatrix(3, 2);
4007 }
4008 break;
4009
4010 case 148:
4011
4012 {
4013 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4014 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4015 (yyval.interm.type).setMatrix(2, 4);
4016 }
4017 break;
4018
4019 case 149:
4020
4021 {
4022 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4023 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4024 (yyval.interm.type).setMatrix(4, 2);
4025 }
4026 break;
4027
4028 case 150:
4029
4030 {
4031 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4032 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4033 (yyval.interm.type).setMatrix(3, 4);
4034 }
4035 break;
4036
4037 case 151:
4038
4039 {
4040 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4041 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4042 (yyval.interm.type).setMatrix(4, 3);
4043 }
4044 break;
4045
4046 case 152:
4047
4048 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004049 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4050 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4051 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004052 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004053 break;
4054
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004055 case 153:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004056
4057 {
4058 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4059 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4060 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004061 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004062 break;
4063
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004064 case 154:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004065
4066 {
zmo@google.com09c323a2011-08-12 18:22:25 +00004067 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004068 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00004069 context->recover();
4070 }
4071 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4072 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4073 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004074 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004075 break;
4076
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004077 case 155:
zmo@google.com09c323a2011-08-12 18:22:25 +00004078
4079 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004080 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004081 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00004082 context->recover();
4083 }
4084 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
4085 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4086 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004087 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004088 break;
4089
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004090 case 156:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004091
4092 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004093 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4094 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4095 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004096 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004097 break;
4098
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004099 case 157:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004100
4101 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004102 //
4103 // This is for user defined type names. The lexical phase looked up the
4104 // type.
4105 //
4106 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4107 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4108 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4109 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004110 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004111 break;
4112
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004113 case 158:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004114
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004115 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004116 break;
4117
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004118 case 159:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004119
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004120 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004121 (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 +00004122 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004123 break;
4124
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004125 case 160:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004126
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004127 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004128 break;
4129
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004130 case 161:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004131
kbr@chromium.org476541f2011-10-27 21:14:51 +00004132 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004133 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (5)].lex).line, 0, "", (yyvsp[(4) - (5)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004134 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004135 break;
4136
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004137 case 162:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004138
4139 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004140 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004141 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004142 break;
4143
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004144 case 163:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004145
4146 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004147 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4148 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4149 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4150 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4151 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());
4152 context->recover();
4153 }
4154 }
4155 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4156 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004157 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004158 break;
4159
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004160 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004161
4162 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004163 (yyval.interm.typeList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004164 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004165 break;
4166
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004167 case 165:
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004168
4169 {
4170 // ES3 Only, but errors should be handled elsewhere
4171 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4172 (yyval.interm.typeList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.typeList));
4173 }
4174 break;
4175
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004176 case 166:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004177
4178 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004179 (yyval.interm.typeList) = NewPoolTTypeList();
4180 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004181 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004182 break;
4183
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004184 case 167:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004185
4186 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004187 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004188 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004189 break;
4190
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004191 case 168:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004192
4193 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004194 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4195 context->recover();
4196
4197 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4198 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4199 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004200 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004201 break;
4202
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004203 case 169:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004204
4205 {
4206 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4207 context->recover();
4208
4209 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4210 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4211 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4212
4213 int size;
4214 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4215 context->recover();
4216 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004217 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004218 break;
4219
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004220 case 170:
4221
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004222 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004223 break;
4224
4225 case 171:
4226
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004227 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4228 break;
4229
4230 case 172:
4231
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004232 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004233 break;
4234
4235 case 173:
4236
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004237 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004238 break;
4239
4240 case 174:
4241
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004242 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004243 break;
4244
4245 case 175:
4246
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004247 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004248 break;
4249
4250 case 176:
4251
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004252 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004253 break;
4254
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004255 case 177:
4256
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004257 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004258 break;
4259
4260 case 178:
4261
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004262 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4263 break;
4264
4265 case 179:
4266
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004267 { (yyval.interm.intermAggregate) = 0; }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004268 break;
4269
4270 case 180:
4271
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004272 { context->symbolTable.push(); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004273 break;
4274
4275 case 181:
4276
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004277 { context->symbolTable.pop(); }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004278 break;
4279
4280 case 182:
4281
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004282 {
4283 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4284 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4285 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4286 }
4287 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4288 }
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004289 break;
4290
4291 case 183:
4292
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004293 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4294 break;
4295
4296 case 184:
4297
4298 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4299 break;
4300
4301 case 185:
4302
4303 { context->symbolTable.push(); }
4304 break;
4305
4306 case 186:
4307
4308 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4309 break;
4310
4311 case 187:
4312
4313 { context->symbolTable.push(); }
4314 break;
4315
4316 case 188:
4317
4318 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4319 break;
4320
4321 case 189:
4322
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004323 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004324 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004325 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004326 break;
4327
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004328 case 190:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004329
4330 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004331 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004332 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004333 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4334 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004335 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004336 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004337 break;
4338
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004339 case 191:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004340
4341 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004342 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004343 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004344 break;
4345
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004346 case 192:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004347
kbr@chromium.org205fef32011-11-22 20:50:02 +00004348 {
4349 (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 +00004350 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004351 break;
4352
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004353 case 193:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004354
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004355 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004356 break;
4357
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004358 case 194:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004359
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004360 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004361 break;
4362
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004363 case 195:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004364
4365 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004366 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4367 context->recover();
4368 (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 +00004369 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004370 break;
4371
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004372 case 196:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004373
4374 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004375 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4376 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004377 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004378 break;
4379
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004380 case 197:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004381
4382 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004383 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4384 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004385 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004386 break;
4387
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004388 case 198:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004389
4390 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004391 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4392 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4393 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004394 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004395 break;
4396
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004397 case 199:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004398
4399 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004400 TIntermNode* intermNode;
4401 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4402 context->recover();
4403 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4404 context->recover();
4405
4406 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4407 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4408 else {
4409 context->recover();
4410 (yyval.interm.intermTypedNode) = 0;
4411 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004412 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004413 break;
4414
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004415 case 200:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004416
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004417 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004418 break;
4419
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004420 case 201:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004421
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004422 {
4423 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004424 (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 +00004425 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004426 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004427 break;
4428
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004429 case 202:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004430
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004431 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004432 break;
4433
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004434 case 203:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004435
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004436 {
4437 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4438 context->recover();
4439
alokp@chromium.org52813552010-11-16 18:36:09 +00004440 (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 +00004441 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004442 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004443 break;
4444
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004445 case 204:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004446
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004447 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004448 break;
4449
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004450 case 205:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004451
4452 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004453 context->symbolTable.pop();
4454 (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);
4455 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004456 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004457 break;
4458
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004459 case 206:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004460
4461 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004462 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004463 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004464 break;
4465
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004466 case 207:
zmo@google.com09c323a2011-08-12 18:22:25 +00004467
4468 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004469 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004470 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004471 break;
4472
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004473 case 208:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004474
4475 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004476 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004477 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004478 break;
4479
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004480 case 209:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004481
4482 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004483 (yyval.interm.intermTypedNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004484 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004485 break;
4486
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004487 case 210:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004488
4489 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004490 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4491 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004492 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004493 break;
4494
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004495 case 211:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004496
4497 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004498 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4499 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004500 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004501 break;
4502
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004503 case 212:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004504
4505 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004506 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004507 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004508 context->recover();
4509 }
4510 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004511 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004512 break;
4513
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004514 case 213:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004515
4516 {
4517 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004518 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004519 context->recover();
4520 }
4521 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004522 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004523 break;
4524
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004525 case 214:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004526
4527 {
4528 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4529 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004530 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004531 context->recover();
4532 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004533 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004534 break;
4535
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004536 case 215:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004537
4538 {
4539 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4540 context->functionReturnsValue = true;
4541 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004542 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004543 context->recover();
4544 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004545 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004546 context->recover();
4547 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004548 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004549 break;
4550
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004551 case 216:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004552
4553 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004554 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4555 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004556 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004557 break;
4558
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004559 case 217:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004560
4561 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004562 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004563 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004564 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004565 break;
4566
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004567 case 218:
zmo@google.com09c323a2011-08-12 18:22:25 +00004568
4569 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004570 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4571 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004572 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004573 break;
4574
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004575 case 219:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004576
4577 {
4578 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004579 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004580 break;
4581
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004582 case 220:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004583
4584 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004585 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004586 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004587 break;
4588
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004589 case 221:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004590
4591 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004592 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004593
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004594 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004595
4596 if (builtIn)
4597 {
4598 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4599 context->recover();
4600 }
4601
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004602 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004603 //
4604 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4605 // as it would have just been put in the symbol table. Otherwise, we're looking up
4606 // an earlier occurance.
4607 //
4608 if (prevDec->isDefined()) {
4609 //
4610 // Then this function already has a body.
4611 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004612 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004613 context->recover();
4614 }
4615 prevDec->setDefined();
4616
4617 //
4618 // Raise error message if main function takes any parameters or return anything other than void
4619 //
4620 if (function->getName() == "main") {
4621 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004622 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 +00004623 context->recover();
4624 }
4625 if (function->getReturnType().getBasicType() != EbtVoid) {
4626 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4627 context->recover();
4628 }
4629 }
4630
4631 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004632 // Remember the return type for later checking for RETURN statements.
4633 //
4634 context->currentFunctionType = &(prevDec->getReturnType());
4635 context->functionReturnsValue = false;
4636
4637 //
4638 // Insert parameters into the symbol table.
4639 // If the parameter has no name, it's not an error, just don't insert it
4640 // (could be used for unused args).
4641 //
4642 // Also, accumulate the list of parameters into the HIL, so lower level code
4643 // knows where to find parameters.
4644 //
4645 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004646 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004647 const TParameter& param = function->getParam(i);
4648 if (param.name != 0) {
4649 TVariable *variable = new TVariable(param.name, *param.type);
4650 //
4651 // Insert the parameters with name in the symbol table.
4652 //
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004653 if (! context->symbolTable.declare(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004654 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004655 context->recover();
4656 delete variable;
4657 }
4658
4659 //
4660 // Add the parameter to the HIL
4661 //
4662 paramNodes = context->intermediate.growAggregate(
4663 paramNodes,
4664 context->intermediate.addSymbol(variable->getUniqueId(),
4665 variable->getName(),
4666 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4667 (yyvsp[(1) - (1)].interm).line);
4668 } else {
4669 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4670 }
4671 }
4672 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4673 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4674 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004675 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004676 break;
4677
shannonwoods@chromium.org9bd22fa2013-05-30 00:18:47 +00004678 case 222:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004679
4680 {
4681 //?? Check that all paths return a value if return type != void ?
4682 // May be best done as post process phase on intermediate code
4683 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4684 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4685 context->recover();
4686 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004687
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004688 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4689 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4690 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4691 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4692
4693 // store the pragma information for debug and optimize and other vendor specific
4694 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004695 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4696 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004697
4698 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4699 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004700
4701 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004702 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004703 break;
4704
4705
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004706
4707 default: break;
4708 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004709 /* User semantic actions sometimes alter yychar, and that requires
4710 that yytoken be updated with the new translation. We take the
4711 approach of translating immediately before every use of yytoken.
4712 One alternative is translating here after every semantic action,
4713 but that translation would be missed if the semantic action invokes
4714 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4715 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4716 incorrect destructor might then be invoked immediately. In the
4717 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4718 to an incorrect destructor call or verbose syntax error message
4719 before the lookahead is translated. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004720 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4721
4722 YYPOPSTACK (yylen);
4723 yylen = 0;
4724 YY_STACK_PRINT (yyss, yyssp);
4725
4726 *++yyvsp = yyval;
4727
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004728 /* Now `shift' the result of the reduction. Determine what state
4729 that goes to, based on the state we popped back to and the rule
4730 number reduced by. */
4731
4732 yyn = yyr1[yyn];
4733
4734 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4735 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4736 yystate = yytable[yystate];
4737 else
4738 yystate = yydefgoto[yyn - YYNTOKENS];
4739
4740 goto yynewstate;
4741
4742
4743/*------------------------------------.
4744| yyerrlab -- here on detecting error |
4745`------------------------------------*/
4746yyerrlab:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004747 /* Make sure we have latest lookahead translation. See comments at
4748 user semantic actions for why this is necessary. */
4749 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4750
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004751 /* If not already recovering from an error, report this error. */
4752 if (!yyerrstatus)
4753 {
4754 ++yynerrs;
4755#if ! YYERROR_VERBOSE
4756 yyerror (context, YY_("syntax error"));
4757#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004758# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4759 yyssp, yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004760 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004761 char const *yymsgp = YY_("syntax error");
4762 int yysyntax_error_status;
4763 yysyntax_error_status = YYSYNTAX_ERROR;
4764 if (yysyntax_error_status == 0)
4765 yymsgp = yymsg;
4766 else if (yysyntax_error_status == 1)
4767 {
4768 if (yymsg != yymsgbuf)
4769 YYSTACK_FREE (yymsg);
4770 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4771 if (!yymsg)
4772 {
4773 yymsg = yymsgbuf;
4774 yymsg_alloc = sizeof yymsgbuf;
4775 yysyntax_error_status = 2;
4776 }
4777 else
4778 {
4779 yysyntax_error_status = YYSYNTAX_ERROR;
4780 yymsgp = yymsg;
4781 }
4782 }
4783 yyerror (context, yymsgp);
4784 if (yysyntax_error_status == 2)
4785 goto yyexhaustedlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004786 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004787# undef YYSYNTAX_ERROR
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004788#endif
4789 }
4790
4791
4792
4793 if (yyerrstatus == 3)
4794 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004795 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004796 error, discard it. */
4797
4798 if (yychar <= YYEOF)
4799 {
4800 /* Return failure if at end of input. */
4801 if (yychar == YYEOF)
4802 YYABORT;
4803 }
4804 else
4805 {
4806 yydestruct ("Error: discarding",
4807 yytoken, &yylval, context);
4808 yychar = YYEMPTY;
4809 }
4810 }
4811
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004812 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004813 token. */
4814 goto yyerrlab1;
4815
4816
4817/*---------------------------------------------------.
4818| yyerrorlab -- error raised explicitly by YYERROR. |
4819`---------------------------------------------------*/
4820yyerrorlab:
4821
4822 /* Pacify compilers like GCC when the user code never invokes
4823 YYERROR and the label yyerrorlab therefore never appears in user
4824 code. */
4825 if (/*CONSTCOND*/ 0)
4826 goto yyerrorlab;
4827
4828 /* Do not reclaim the symbols of the rule which action triggered
4829 this YYERROR. */
4830 YYPOPSTACK (yylen);
4831 yylen = 0;
4832 YY_STACK_PRINT (yyss, yyssp);
4833 yystate = *yyssp;
4834 goto yyerrlab1;
4835
4836
4837/*-------------------------------------------------------------.
4838| yyerrlab1 -- common code for both syntax error and YYERROR. |
4839`-------------------------------------------------------------*/
4840yyerrlab1:
4841 yyerrstatus = 3; /* Each real token shifted decrements this. */
4842
4843 for (;;)
4844 {
4845 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004846 if (!yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004847 {
4848 yyn += YYTERROR;
4849 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4850 {
4851 yyn = yytable[yyn];
4852 if (0 < yyn)
4853 break;
4854 }
4855 }
4856
4857 /* Pop the current state because it cannot handle the error token. */
4858 if (yyssp == yyss)
4859 YYABORT;
4860
4861
4862 yydestruct ("Error: popping",
4863 yystos[yystate], yyvsp, context);
4864 YYPOPSTACK (1);
4865 yystate = *yyssp;
4866 YY_STACK_PRINT (yyss, yyssp);
4867 }
4868
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004869 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004870 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004871 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004872
4873
4874 /* Shift the error token. */
4875 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4876
4877 yystate = yyn;
4878 goto yynewstate;
4879
4880
4881/*-------------------------------------.
4882| yyacceptlab -- YYACCEPT comes here. |
4883`-------------------------------------*/
4884yyacceptlab:
4885 yyresult = 0;
4886 goto yyreturn;
4887
4888/*-----------------------------------.
4889| yyabortlab -- YYABORT comes here. |
4890`-----------------------------------*/
4891yyabortlab:
4892 yyresult = 1;
4893 goto yyreturn;
4894
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004895#if !defined yyoverflow || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004896/*-------------------------------------------------.
4897| yyexhaustedlab -- memory exhaustion comes here. |
4898`-------------------------------------------------*/
4899yyexhaustedlab:
4900 yyerror (context, YY_("memory exhausted"));
4901 yyresult = 2;
4902 /* Fall through. */
4903#endif
4904
4905yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004906 if (yychar != YYEMPTY)
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004907 {
4908 /* Make sure we have latest lookahead translation. See comments at
4909 user semantic actions for why this is necessary. */
4910 yytoken = YYTRANSLATE (yychar);
4911 yydestruct ("Cleanup: discarding lookahead",
4912 yytoken, &yylval, context);
4913 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004914 /* Do not reclaim the symbols of the rule which action triggered
4915 this YYABORT or YYACCEPT. */
4916 YYPOPSTACK (yylen);
4917 YY_STACK_PRINT (yyss, yyssp);
4918 while (yyssp != yyss)
4919 {
4920 yydestruct ("Cleanup: popping",
4921 yystos[*yyssp], yyvsp, context);
4922 YYPOPSTACK (1);
4923 }
4924#ifndef yyoverflow
4925 if (yyss != yyssa)
4926 YYSTACK_FREE (yyss);
4927#endif
4928#if YYERROR_VERBOSE
4929 if (yymsg != yymsgbuf)
4930 YYSTACK_FREE (yymsg);
4931#endif
4932 /* Make sure YYID is used. */
4933 return YYID (yyresult);
4934}
4935
4936
4937
4938
4939
4940int glslang_parse(TParseContext* context) {
4941 return yyparse(context);
4942}