blob: 5acc53f6638ad9da4daa30a17cc4c632f6082f78 [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.org98c01b62013-05-30 00:06:25 +000098# ifndef YY_NULL
99# if defined __cplusplus && 201103L <= __cplusplus
100# define YY_NULL nullptr
101# else
102# define YY_NULL 0
103# endif
104# endif
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000105
106/* Enabling verbose error messages. */
107#ifdef YYERROR_VERBOSE
108# undef YYERROR_VERBOSE
109# define YYERROR_VERBOSE 1
110#else
111# define YYERROR_VERBOSE 0
112#endif
113
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000114/* In a future release of Bison, this section will be replaced
115 by #include "glslang_tab.h". */
116#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
117# define YY_YY_GLSLANG_TAB_H_INCLUDED
118/* Enabling traces. */
119#ifndef YYDEBUG
120# define YYDEBUG 0
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000121#endif
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000122#if YYDEBUG
123extern int yydebug;
124#endif
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000125
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000126/* Tokens. */
127#ifndef YYTOKENTYPE
128# define YYTOKENTYPE
129 /* Put the tokens into the symbol table, so that GDB and other debuggers
130 know about them. */
131 enum yytokentype {
132 INVARIANT = 258,
133 HIGH_PRECISION = 259,
134 MEDIUM_PRECISION = 260,
135 LOW_PRECISION = 261,
136 PRECISION = 262,
137 ATTRIBUTE = 263,
138 CONST_QUAL = 264,
139 BOOL_TYPE = 265,
140 FLOAT_TYPE = 266,
141 INT_TYPE = 267,
142 BREAK = 268,
143 CONTINUE = 269,
144 DO = 270,
145 ELSE = 271,
146 FOR = 272,
147 IF = 273,
148 DISCARD = 274,
149 RETURN = 275,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000150 SWITCH = 276,
151 CASE = 277,
152 DEFAULT = 278,
153 BVEC2 = 279,
154 BVEC3 = 280,
155 BVEC4 = 281,
156 IVEC2 = 282,
157 IVEC3 = 283,
158 IVEC4 = 284,
159 VEC2 = 285,
160 VEC3 = 286,
161 VEC4 = 287,
162 MATRIX2 = 288,
163 MATRIX3 = 289,
164 MATRIX4 = 290,
165 IN_QUAL = 291,
166 OUT_QUAL = 292,
167 INOUT_QUAL = 293,
168 UNIFORM = 294,
169 VARYING = 295,
170 CENTROID = 296,
171 FLAT = 297,
172 SMOOTH = 298,
173 STRUCT = 299,
174 VOID_TYPE = 300,
175 WHILE = 301,
176 SAMPLER2D = 302,
177 SAMPLERCUBE = 303,
178 SAMPLER_EXTERNAL_OES = 304,
179 SAMPLER2DRECT = 305,
180 SAMPLER3D = 306,
181 SAMPLER3DRECT = 307,
182 SAMPLER2DSHADOW = 308,
183 IDENTIFIER = 309,
184 TYPE_NAME = 310,
185 FLOATCONSTANT = 311,
186 INTCONSTANT = 312,
187 BOOLCONSTANT = 313,
188 FIELD_SELECTION = 314,
189 LEFT_OP = 315,
190 RIGHT_OP = 316,
191 INC_OP = 317,
192 DEC_OP = 318,
193 LE_OP = 319,
194 GE_OP = 320,
195 EQ_OP = 321,
196 NE_OP = 322,
197 AND_OP = 323,
198 OR_OP = 324,
199 XOR_OP = 325,
200 MUL_ASSIGN = 326,
201 DIV_ASSIGN = 327,
202 ADD_ASSIGN = 328,
203 MOD_ASSIGN = 329,
204 LEFT_ASSIGN = 330,
205 RIGHT_ASSIGN = 331,
206 AND_ASSIGN = 332,
207 XOR_ASSIGN = 333,
208 OR_ASSIGN = 334,
209 SUB_ASSIGN = 335,
210 LEFT_PAREN = 336,
211 RIGHT_PAREN = 337,
212 LEFT_BRACKET = 338,
213 RIGHT_BRACKET = 339,
214 LEFT_BRACE = 340,
215 RIGHT_BRACE = 341,
216 DOT = 342,
217 COMMA = 343,
218 COLON = 344,
219 EQUAL = 345,
220 SEMICOLON = 346,
221 BANG = 347,
222 DASH = 348,
223 TILDE = 349,
224 PLUS = 350,
225 STAR = 351,
226 SLASH = 352,
227 PERCENT = 353,
228 LEFT_ANGLE = 354,
229 RIGHT_ANGLE = 355,
230 VERTICAL_BAR = 356,
231 CARET = 357,
232 AMPERSAND = 358,
233 QUESTION = 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000234 };
235#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000236
237
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000238#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
239typedef union YYSTYPE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000240{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000241
242
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000243 struct {
244 TSourceLoc line;
245 union {
246 TString *string;
247 float f;
248 int i;
249 bool b;
250 };
251 TSymbol* symbol;
252 } lex;
253 struct {
254 TSourceLoc line;
255 TOperator op;
256 union {
257 TIntermNode* intermNode;
258 TIntermNodePair nodePair;
259 TIntermTyped* intermTypedNode;
260 TIntermAggregate* intermAggregate;
261 };
262 union {
263 TPublicType type;
264 TPrecision precision;
265 TQualifier qualifier;
266 TFunction* function;
267 TParameter param;
268 TTypeLine typeLine;
269 TTypeList* typeList;
270 };
271 } interm;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000272
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000273
274
275} YYSTYPE;
276# define YYSTYPE_IS_TRIVIAL 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000277# define yystype YYSTYPE /* obsolescent; will be withdrawn */
278# define YYSTYPE_IS_DECLARED 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000279#endif
280
281
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000282#ifdef YYPARSE_PARAM
283#if defined __STDC__ || defined __cplusplus
284int yyparse (void *YYPARSE_PARAM);
285#else
286int yyparse ();
287#endif
288#else /* ! YYPARSE_PARAM */
289#if defined __STDC__ || defined __cplusplus
290int yyparse (TParseContext* context);
291#else
292int yyparse ();
293#endif
294#endif /* ! YYPARSE_PARAM */
295
296#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
297
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000298/* Copy the second part of user declarations. */
299
300
301extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
302extern void yyerror(TParseContext* context, const char* reason);
303
304#define FRAG_VERT_ONLY(S, L) { \
305 if (context->shaderType != SH_FRAGMENT_SHADER && \
306 context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000307 context->error(L, " supported in vertex/fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000308 context->recover(); \
309 } \
310}
311
312#define VERTEX_ONLY(S, L) { \
313 if (context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000314 context->error(L, " supported in vertex shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000315 context->recover(); \
316 } \
317}
318
319#define FRAG_ONLY(S, L) { \
320 if (context->shaderType != SH_FRAGMENT_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000321 context->error(L, " supported in fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000322 context->recover(); \
323 } \
324}
325
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000326#define ES2_ONLY(S, L) { \
327 if (context->shaderVersion != 100) { \
328 context->error(L, " supported in GLSL ES 1.00 only ", S); \
329 context->recover(); \
330 } \
331}
332
333#define ES3_ONLY(S, L) { \
334 if (context->shaderVersion != 300) { \
335 context->error(L, " supported in GLSL ES 3.00 only ", S); \
336 context->recover(); \
337 } \
338}
339
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000340
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000341
342#ifdef short
343# undef short
344#endif
345
346#ifdef YYTYPE_UINT8
347typedef YYTYPE_UINT8 yytype_uint8;
348#else
349typedef unsigned char yytype_uint8;
350#endif
351
352#ifdef YYTYPE_INT8
353typedef YYTYPE_INT8 yytype_int8;
354#elif (defined __STDC__ || defined __C99__FUNC__ \
355 || defined __cplusplus || defined _MSC_VER)
356typedef signed char yytype_int8;
357#else
358typedef short int yytype_int8;
359#endif
360
361#ifdef YYTYPE_UINT16
362typedef YYTYPE_UINT16 yytype_uint16;
363#else
364typedef unsigned short int yytype_uint16;
365#endif
366
367#ifdef YYTYPE_INT16
368typedef YYTYPE_INT16 yytype_int16;
369#else
370typedef short int yytype_int16;
371#endif
372
373#ifndef YYSIZE_T
374# ifdef __SIZE_TYPE__
375# define YYSIZE_T __SIZE_TYPE__
376# elif defined size_t
377# define YYSIZE_T size_t
378# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
379 || defined __cplusplus || defined _MSC_VER)
380# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
381# define YYSIZE_T size_t
382# else
383# define YYSIZE_T unsigned int
384# endif
385#endif
386
387#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
388
389#ifndef YY_
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000390# if defined YYENABLE_NLS && YYENABLE_NLS
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000391# if ENABLE_NLS
392# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000393# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000394# endif
395# endif
396# ifndef YY_
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000397# define YY_(Msgid) Msgid
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000398# endif
399#endif
400
401/* Suppress unused-variable warnings by "using" E. */
402#if ! defined lint || defined __GNUC__
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000403# define YYUSE(E) ((void) (E))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000404#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000405# define YYUSE(E) /* empty */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000406#endif
407
408/* Identity function, used to suppress warnings about constant conditions. */
409#ifndef lint
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000410# define YYID(N) (N)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000411#else
412#if (defined __STDC__ || defined __C99__FUNC__ \
413 || defined __cplusplus || defined _MSC_VER)
414static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000415YYID (int yyi)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000416#else
417static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000418YYID (yyi)
419 int yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000420#endif
421{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000422 return yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000423}
424#endif
425
426#if ! defined yyoverflow || YYERROR_VERBOSE
427
428/* The parser invokes alloca or malloc; define the necessary symbols. */
429
430# ifdef YYSTACK_USE_ALLOCA
431# if YYSTACK_USE_ALLOCA
432# ifdef __GNUC__
433# define YYSTACK_ALLOC __builtin_alloca
434# elif defined __BUILTIN_VA_ARG_INCR
435# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
436# elif defined _AIX
437# define YYSTACK_ALLOC __alloca
438# elif defined _MSC_VER
439# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
440# define alloca _alloca
441# else
442# define YYSTACK_ALLOC alloca
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000443# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000444 || defined __cplusplus || defined _MSC_VER)
445# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000446 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
447# ifndef EXIT_SUCCESS
448# define EXIT_SUCCESS 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000449# endif
450# endif
451# endif
452# endif
453# endif
454
455# ifdef YYSTACK_ALLOC
456 /* Pacify GCC's `empty if-body' warning. */
457# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
458# ifndef YYSTACK_ALLOC_MAXIMUM
459 /* The OS might guarantee only one guard page at the bottom of the stack,
460 and a page size can be as small as 4096 bytes. So we cannot safely
461 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
462 to allow for a few compiler-allocated temporary stack slots. */
463# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
464# endif
465# else
466# define YYSTACK_ALLOC YYMALLOC
467# define YYSTACK_FREE YYFREE
468# ifndef YYSTACK_ALLOC_MAXIMUM
469# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
470# endif
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000471# if (defined __cplusplus && ! defined EXIT_SUCCESS \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000472 && ! ((defined YYMALLOC || defined malloc) \
473 && (defined YYFREE || defined free)))
474# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000475# ifndef EXIT_SUCCESS
476# define EXIT_SUCCESS 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000477# endif
478# endif
479# ifndef YYMALLOC
480# define YYMALLOC malloc
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000481# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000482 || defined __cplusplus || defined _MSC_VER)
483void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
484# endif
485# endif
486# ifndef YYFREE
487# define YYFREE free
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000488# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000489 || defined __cplusplus || defined _MSC_VER)
490void free (void *); /* INFRINGES ON USER NAME SPACE */
491# endif
492# endif
493# endif
494#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
495
496
497#if (! defined yyoverflow \
498 && (! defined __cplusplus \
499 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
500
501/* A type that is properly aligned for any stack member. */
502union yyalloc
503{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000504 yytype_int16 yyss_alloc;
505 YYSTYPE yyvs_alloc;
506};
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000507
508/* The size of the maximum gap between one aligned stack and the next. */
509# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
510
511/* The size of an array large to enough to hold all stacks, each with
512 N elements. */
513# define YYSTACK_BYTES(N) \
514 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
515 + YYSTACK_GAP_MAXIMUM)
516
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000517# define YYCOPY_NEEDED 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000518
519/* Relocate STACK from its old location to the new one. The
520 local variables YYSIZE and YYSTACKSIZE give the old and new number of
521 elements in the stack, and YYPTR gives the new location of the
522 stack. Advance YYPTR to a properly aligned location for the next
523 stack. */
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000524# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000525 do \
526 { \
527 YYSIZE_T yynewbytes; \
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000528 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
529 Stack = &yyptr->Stack_alloc; \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000530 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
531 yyptr += yynewbytes / sizeof (*yyptr); \
532 } \
533 while (YYID (0))
534
535#endif
536
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000537#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
538/* Copy COUNT objects from SRC to DST. The source and destination do
539 not overlap. */
540# ifndef YYCOPY
541# if defined __GNUC__ && 1 < __GNUC__
542# define YYCOPY(Dst, Src, Count) \
543 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
544# else
545# define YYCOPY(Dst, Src, Count) \
546 do \
547 { \
548 YYSIZE_T yyi; \
549 for (yyi = 0; yyi < (Count); yyi++) \
550 (Dst)[yyi] = (Src)[yyi]; \
551 } \
552 while (YYID (0))
553# endif
554# endif
555#endif /* !YYCOPY_NEEDED */
556
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000557/* YYFINAL -- State number of the termination state. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000558#define YYFINAL 81
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000559/* YYLAST -- Last index in YYTABLE. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000560#define YYLAST 1551
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000561
562/* YYNTOKENS -- Number of terminals. */
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000563#define YYNTOKENS 105
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000564/* YYNNTS -- Number of nonterminals. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000565#define YYNNTS 86
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000566/* YYNRULES -- Number of rules. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000567#define YYNRULES 211
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000568/* YYNRULES -- Number of states. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000569#define YYNSTATES 315
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000570
571/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
572#define YYUNDEFTOK 2
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000573#define YYMAXUTOK 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000574
575#define YYTRANSLATE(YYX) \
576 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
577
578/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
579static const yytype_uint8 yytranslate[] =
580{
581 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
607 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
608 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
609 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
610 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
611 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
612 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
613 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
614 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000615 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000616 95, 96, 97, 98, 99, 100, 101, 102, 103, 104
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000617};
618
619#if YYDEBUG
620/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
621 YYRHS. */
622static const yytype_uint16 yyprhs[] =
623{
624 0, 0, 3, 5, 7, 9, 11, 13, 17, 19,
625 24, 26, 30, 33, 36, 38, 40, 42, 46, 49,
626 52, 55, 57, 60, 64, 67, 69, 71, 73, 75,
627 78, 81, 84, 86, 88, 90, 92, 96, 100, 102,
628 106, 110, 112, 114, 118, 122, 126, 130, 132, 136,
629 140, 142, 144, 146, 148, 152, 154, 158, 160, 164,
630 166, 172, 174, 178, 180, 182, 184, 186, 188, 190,
631 194, 196, 199, 202, 207, 210, 212, 214, 217, 221,
632 225, 228, 234, 238, 241, 245, 248, 249, 251, 253,
633 255, 257, 259, 263, 269, 276, 282, 284, 287, 292,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000634 298, 303, 306, 308, 311, 313, 315, 317, 319, 321,
635 324, 326, 329, 331, 333, 335, 337, 340, 343, 345,
636 347, 350, 352, 354, 356, 358, 363, 365, 367, 369,
637 371, 373, 375, 377, 379, 381, 383, 385, 387, 389,
638 391, 393, 395, 397, 399, 401, 403, 405, 407, 408,
639 415, 416, 422, 424, 427, 431, 433, 437, 439, 444,
640 446, 448, 450, 452, 454, 456, 458, 460, 462, 465,
641 466, 467, 473, 475, 477, 478, 481, 482, 485, 488,
642 492, 494, 497, 499, 502, 508, 512, 514, 516, 521,
643 522, 529, 530, 539, 540, 548, 550, 552, 554, 555,
644 558, 562, 565, 568, 571, 575, 578, 580, 583, 585,
645 587, 588
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000646};
647
648/* YYRHS -- A `-1'-separated list of the rules' RHS. */
649static const yytype_int16 yyrhs[] =
650{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000651 187, 0, -1, 54, -1, 106, -1, 57, -1, 56,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000652 -1, 58, -1, 81, 133, 82, -1, 107, -1, 108,
653 83, 109, 84, -1, 110, -1, 108, 87, 59, -1,
654 108, 62, -1, 108, 63, -1, 133, -1, 111, -1,
655 112, -1, 108, 87, 112, -1, 114, 82, -1, 113,
656 82, -1, 115, 45, -1, 115, -1, 115, 131, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000657 114, 88, 131, -1, 116, 81, -1, 154, -1, 54,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000658 -1, 59, -1, 108, -1, 62, 117, -1, 63, 117,
659 -1, 118, 117, -1, 95, -1, 93, -1, 92, -1,
660 117, -1, 119, 96, 117, -1, 119, 97, 117, -1,
661 119, -1, 120, 95, 119, -1, 120, 93, 119, -1,
662 120, -1, 121, -1, 122, 99, 121, -1, 122, 100,
663 121, -1, 122, 64, 121, -1, 122, 65, 121, -1,
664 122, -1, 123, 66, 122, -1, 123, 67, 122, -1,
665 123, -1, 124, -1, 125, -1, 126, -1, 127, 68,
666 126, -1, 127, -1, 128, 70, 127, -1, 128, -1,
667 129, 69, 128, -1, 129, -1, 129, 104, 133, 89,
668 131, -1, 130, -1, 117, 132, 131, -1, 90, -1,
669 71, -1, 72, -1, 73, -1, 80, -1, 131, -1,
670 133, 88, 131, -1, 130, -1, 136, 91, -1, 144,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000671 91, -1, 7, 152, 153, 91, -1, 137, 82, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000672 139, -1, 138, -1, 139, 141, -1, 138, 88, 141,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000673 -1, 146, 54, 81, -1, 151, 54, -1, 151, 54,
674 83, 134, 84, -1, 148, 142, 140, -1, 142, 140,
675 -1, 148, 142, 143, -1, 142, 143, -1, -1, 36,
676 -1, 37, -1, 38, -1, 151, -1, 145, -1, 144,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000677 88, 54, -1, 144, 88, 54, 83, 84, -1, 144,
678 88, 54, 83, 134, 84, -1, 144, 88, 54, 90,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000679 162, -1, 146, -1, 146, 54, -1, 146, 54, 83,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000680 84, -1, 146, 54, 83, 134, 84, -1, 146, 54,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000681 90, 162, -1, 3, 54, -1, 151, -1, 149, 151,
682 -1, 43, -1, 42, -1, 9, -1, 8, -1, 40,
683 -1, 3, 40, -1, 150, -1, 147, 150, -1, 147,
684 -1, 9, -1, 36, -1, 37, -1, 41, 36, -1,
685 41, 37, -1, 39, -1, 153, -1, 152, 153, -1,
686 4, -1, 5, -1, 6, -1, 154, -1, 154, 83,
687 134, 84, -1, 45, -1, 11, -1, 12, -1, 10,
688 -1, 30, -1, 31, -1, 32, -1, 24, -1, 25,
689 -1, 26, -1, 27, -1, 28, -1, 29, -1, 33,
690 -1, 34, -1, 35, -1, 47, -1, 48, -1, 49,
691 -1, 50, -1, 155, -1, 55, -1, -1, 44, 54,
692 85, 156, 158, 86, -1, -1, 44, 85, 157, 158,
693 86, -1, 159, -1, 158, 159, -1, 151, 160, 91,
694 -1, 161, -1, 160, 88, 161, -1, 54, -1, 54,
695 83, 134, 84, -1, 131, -1, 135, -1, 166, -1,
696 165, -1, 163, -1, 175, -1, 176, -1, 179, -1,
697 186, -1, 85, 86, -1, -1, -1, 85, 167, 174,
698 168, 86, -1, 173, -1, 165, -1, -1, 171, 173,
699 -1, -1, 172, 165, -1, 85, 86, -1, 85, 174,
700 86, -1, 164, -1, 174, 164, -1, 91, -1, 133,
701 91, -1, 18, 81, 133, 82, 177, -1, 170, 16,
702 170, -1, 170, -1, 133, -1, 146, 54, 90, 162,
703 -1, -1, 46, 81, 180, 178, 82, 169, -1, -1,
704 15, 181, 170, 46, 81, 133, 82, 91, -1, -1,
705 17, 81, 182, 183, 185, 82, 169, -1, 175, -1,
706 163, -1, 178, -1, -1, 184, 91, -1, 184, 91,
707 133, -1, 14, 91, -1, 13, 91, -1, 20, 91,
708 -1, 20, 133, 91, -1, 19, 91, -1, 188, -1,
709 187, 188, -1, 189, -1, 135, -1, -1, 136, 190,
710 173, -1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000711};
712
713/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
714static const yytype_uint16 yyrline[] =
715{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000716 0, 184, 184, 219, 222, 235, 240, 245, 251, 254,
717 333, 336, 437, 447, 460, 468, 568, 571, 579, 583,
718 590, 594, 601, 607, 616, 624, 679, 686, 696, 699,
719 709, 719, 740, 741, 742, 747, 748, 757, 769, 770,
720 778, 789, 793, 794, 804, 814, 824, 837, 838, 848,
721 861, 865, 869, 873, 874, 887, 888, 901, 902, 915,
722 916, 933, 934, 947, 948, 949, 950, 951, 955, 958,
723 969, 977, 1004, 1009, 1023, 1061, 1064, 1071, 1079, 1100,
724 1121, 1132, 1161, 1166, 1176, 1181, 1191, 1194, 1197, 1200,
725 1206, 1213, 1216, 1238, 1256, 1280, 1303, 1307, 1325, 1333,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000726 1365, 1385, 1474, 1483, 1506, 1510, 1517, 1523, 1530, 1539,
727 1548, 1551, 1587, 1597, 1601, 1606, 1611, 1616, 1621, 1630,
728 1640, 1647, 1650, 1653, 1659, 1662, 1677, 1681, 1685, 1689,
729 1698, 1703, 1708, 1713, 1718, 1723, 1728, 1733, 1738, 1743,
730 1749, 1755, 1761, 1766, 1771, 1780, 1789, 1794, 1807, 1807,
731 1821, 1821, 1830, 1833, 1848, 1884, 1888, 1894, 1902, 1918,
732 1922, 1926, 1927, 1933, 1934, 1935, 1936, 1937, 1941, 1942,
733 1942, 1942, 1952, 1953, 1957, 1957, 1958, 1958, 1963, 1966,
734 1976, 1979, 1985, 1986, 1990, 1998, 2002, 2012, 2017, 2034,
735 2034, 2039, 2039, 2046, 2046, 2054, 2057, 2063, 2066, 2072,
736 2076, 2083, 2090, 2097, 2104, 2115, 2124, 2128, 2135, 2138,
737 2144, 2144
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000738};
739#endif
740
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000741#if YYDEBUG || YYERROR_VERBOSE || 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000742/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
743 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
744static const char *const yytname[] =
745{
746 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
747 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
748 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE",
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000749 "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE",
750 "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2",
751 "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL",
752 "INOUT_QUAL", "UNIFORM", "VARYING", "CENTROID", "FLAT", "SMOOTH",
753 "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE",
754 "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "SAMPLER3D", "SAMPLER3DRECT",
755 "SAMPLER2DSHADOW", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
756 "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
757 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
758 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
759 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
760 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
761 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
762 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
763 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
764 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000765 "primary_expression", "postfix_expression", "integer_expression",
766 "function_call", "function_call_or_method", "function_call_generic",
767 "function_call_header_no_parameters",
768 "function_call_header_with_parameters", "function_call_header",
769 "function_identifier", "unary_expression", "unary_operator",
770 "multiplicative_expression", "additive_expression", "shift_expression",
771 "relational_expression", "equality_expression", "and_expression",
772 "exclusive_or_expression", "inclusive_or_expression",
773 "logical_and_expression", "logical_xor_expression",
774 "logical_or_expression", "conditional_expression",
775 "assignment_expression", "assignment_operator", "expression",
776 "constant_expression", "declaration", "function_prototype",
777 "function_declarator", "function_header_with_parameters",
778 "function_header", "parameter_declarator", "parameter_declaration",
779 "parameter_qualifier", "parameter_type_specifier",
780 "init_declarator_list", "single_declaration", "fully_specified_type",
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000781 "interpolation_qualifier", "parameter_type_qualifier", "type_qualifier",
782 "storage_qualifier", "type_specifier", "precision_qualifier",
783 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
784 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000785 "struct_declarator_list", "struct_declarator", "initializer",
786 "declaration_statement", "statement", "simple_statement",
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000787 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000788 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
789 "statement_list", "expression_statement", "selection_statement",
790 "selection_rest_statement", "condition", "iteration_statement", "$@7",
791 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000792 "jump_statement", "translation_unit", "external_declaration",
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000793 "function_definition", "$@10", YY_NULL
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000794};
795#endif
796
797# ifdef YYPRINT
798/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
799 token YYLEX-NUM. */
800static const yytype_uint16 yytoknum[] =
801{
802 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
803 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
804 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
805 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
806 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
807 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
808 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
809 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
810 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000811 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
812 355, 356, 357, 358, 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000813};
814# endif
815
816/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
817static const yytype_uint8 yyr1[] =
818{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000819 0, 105, 106, 107, 107, 107, 107, 107, 108, 108,
820 108, 108, 108, 108, 109, 110, 111, 111, 112, 112,
821 113, 113, 114, 114, 115, 116, 116, 116, 117, 117,
822 117, 117, 118, 118, 118, 119, 119, 119, 120, 120,
823 120, 121, 122, 122, 122, 122, 122, 123, 123, 123,
824 124, 125, 126, 127, 127, 128, 128, 129, 129, 130,
825 130, 131, 131, 132, 132, 132, 132, 132, 133, 133,
826 134, 135, 135, 135, 136, 137, 137, 138, 138, 139,
827 140, 140, 141, 141, 141, 141, 142, 142, 142, 142,
828 143, 144, 144, 144, 144, 144, 145, 145, 145, 145,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000829 145, 145, 146, 146, 147, 147, 148, 149, 149, 149,
830 149, 149, 149, 150, 150, 150, 150, 150, 150, 151,
831 151, 152, 152, 152, 153, 153, 154, 154, 154, 154,
832 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
833 154, 154, 154, 154, 154, 154, 154, 154, 156, 155,
834 157, 155, 158, 158, 159, 160, 160, 161, 161, 162,
835 163, 164, 164, 165, 165, 165, 165, 165, 166, 167,
836 168, 166, 169, 169, 171, 170, 172, 170, 173, 173,
837 174, 174, 175, 175, 176, 177, 177, 178, 178, 180,
838 179, 181, 179, 182, 179, 183, 183, 184, 184, 185,
839 185, 186, 186, 186, 186, 186, 187, 187, 188, 188,
840 190, 189
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000841};
842
843/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
844static const yytype_uint8 yyr2[] =
845{
846 0, 2, 1, 1, 1, 1, 1, 3, 1, 4,
847 1, 3, 2, 2, 1, 1, 1, 3, 2, 2,
848 2, 1, 2, 3, 2, 1, 1, 1, 1, 2,
849 2, 2, 1, 1, 1, 1, 3, 3, 1, 3,
850 3, 1, 1, 3, 3, 3, 3, 1, 3, 3,
851 1, 1, 1, 1, 3, 1, 3, 1, 3, 1,
852 5, 1, 3, 1, 1, 1, 1, 1, 1, 3,
853 1, 2, 2, 4, 2, 1, 1, 2, 3, 3,
854 2, 5, 3, 2, 3, 2, 0, 1, 1, 1,
855 1, 1, 3, 5, 6, 5, 1, 2, 4, 5,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000856 4, 2, 1, 2, 1, 1, 1, 1, 1, 2,
857 1, 2, 1, 1, 1, 1, 2, 2, 1, 1,
858 2, 1, 1, 1, 1, 4, 1, 1, 1, 1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000859 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000860 1, 1, 1, 1, 1, 1, 1, 1, 0, 6,
861 0, 5, 1, 2, 3, 1, 3, 1, 4, 1,
862 1, 1, 1, 1, 1, 1, 1, 1, 2, 0,
863 0, 5, 1, 1, 0, 2, 0, 2, 2, 3,
864 1, 2, 1, 2, 5, 3, 1, 1, 4, 0,
865 6, 0, 8, 0, 7, 1, 1, 1, 0, 2,
866 3, 2, 2, 2, 3, 2, 1, 2, 1, 1,
867 0, 3
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000868};
869
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000870/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
871 Performed when YYTABLE doesn't specify something else to do. Zero
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000872 means the default is an error. */
873static const yytype_uint8 yydefact[] =
874{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000875 0, 0, 121, 122, 123, 0, 107, 113, 129, 127,
876 128, 133, 134, 135, 136, 137, 138, 130, 131, 132,
877 139, 140, 141, 114, 115, 118, 108, 0, 105, 104,
878 0, 126, 142, 143, 144, 145, 147, 209, 210, 0,
879 76, 86, 0, 91, 96, 112, 0, 110, 102, 0,
880 119, 124, 146, 0, 206, 208, 109, 101, 0, 116,
881 117, 0, 150, 71, 0, 74, 86, 106, 87, 88,
882 89, 77, 0, 86, 0, 72, 97, 111, 103, 120,
883 0, 1, 207, 0, 148, 0, 0, 211, 78, 83,
884 85, 90, 0, 92, 79, 0, 0, 2, 5, 4,
885 6, 27, 0, 0, 0, 34, 33, 32, 3, 8,
886 28, 10, 15, 16, 0, 0, 21, 0, 35, 0,
887 38, 41, 42, 47, 50, 51, 52, 53, 55, 57,
888 59, 70, 0, 25, 73, 0, 0, 0, 152, 0,
889 0, 191, 0, 0, 0, 0, 0, 169, 178, 182,
890 35, 61, 68, 0, 160, 0, 124, 163, 180, 162,
891 161, 0, 164, 165, 166, 167, 80, 82, 84, 0,
892 0, 98, 0, 159, 100, 29, 30, 0, 12, 13,
893 0, 0, 19, 18, 0, 20, 22, 24, 31, 0,
894 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
895 0, 0, 0, 125, 0, 157, 0, 155, 151, 153,
896 202, 201, 176, 193, 0, 205, 203, 0, 189, 168,
897 0, 64, 65, 66, 67, 63, 0, 0, 183, 179,
898 181, 0, 93, 0, 95, 99, 7, 0, 14, 26,
899 11, 17, 23, 36, 37, 40, 39, 45, 46, 43,
900 44, 48, 49, 54, 56, 58, 0, 149, 0, 0,
901 154, 0, 0, 0, 0, 0, 204, 0, 170, 62,
902 69, 0, 94, 9, 0, 0, 156, 0, 175, 177,
903 196, 195, 198, 176, 0, 187, 0, 0, 0, 81,
904 60, 158, 0, 197, 0, 0, 186, 184, 0, 0,
905 171, 0, 199, 0, 176, 0, 173, 190, 172, 0,
906 200, 194, 185, 188, 192
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000907};
908
909/* YYDEFGOTO[NTERM-NUM]. */
910static const yytype_int16 yydefgoto[] =
911{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000912 -1, 108, 109, 110, 237, 111, 112, 113, 114, 115,
913 116, 117, 150, 119, 120, 121, 122, 123, 124, 125,
914 126, 127, 128, 129, 130, 151, 152, 226, 153, 132,
915 154, 155, 39, 40, 41, 89, 71, 72, 90, 42,
916 43, 44, 45, 73, 46, 47, 48, 49, 50, 133,
917 52, 135, 85, 137, 138, 206, 207, 174, 157, 158,
918 159, 160, 220, 288, 307, 261, 262, 263, 308, 161,
919 162, 163, 297, 287, 164, 267, 212, 264, 282, 294,
920 295, 165, 53, 54, 55, 64
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000921};
922
923/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
924 STATE-NUM. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000925#define YYPACT_NINF -270
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000926static const yytype_int16 yypact[] =
927{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000928 1367, -24, -270, -270, -270, 141, -270, -270, -270, -270,
929 -270, -270, -270, -270, -270, -270, -270, -270, -270, -270,
930 -270, -270, -270, -270, -270, -270, -270, 30, -270, -270,
931 -28, -270, -270, -270, -270, -270, -270, -270, -62, -32,
932 -26, 1, -9, -270, 34, 32, 1414, -270, -270, 1496,
933 -270, 15, -270, 1314, -270, -270, -270, -270, 1496, -270,
934 -270, 6, -270, -270, 17, -270, 67, -270, -270, -270,
935 -270, -270, 1414, 113, 57, -270, -20, -270, -270, -270,
936 1060, -270, -270, 37, -270, 1414, 301, -270, -270, -270,
937 -270, 80, 1414, -6, -270, 838, 1060, 62, -270, -270,
938 -270, -270, 1060, 1060, 1060, -270, -270, -270, -270, -270,
939 -31, -270, -270, -270, 56, -65, 1132, 72, -270, 1060,
940 63, -53, -270, -40, 96, -270, -270, -270, 89, 94,
941 -56, -270, 90, -270, -270, 1414, 121, 1204, -270, 85,
942 86, -270, 97, 100, 93, 913, 104, 101, -270, -270,
943 68, -270, -270, 22, -270, -62, 71, -270, -270, -270,
944 -270, 394, -270, -270, -270, -270, 103, -270, -270, 985,
945 1060, -270, 105, -270, -270, -270, -270, -1, -270, -270,
946 1060, 1455, -270, -270, 1060, 107, -270, -270, -270, 1060,
947 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060,
948 1060, 1060, 1060, -270, 1251, 108, 39, -270, -270, -270,
949 -270, -270, 109, -270, 1060, -270, -270, 45, -270, -270,
950 487, -270, -270, -270, -270, -270, 1060, 1060, -270, -270,
951 -270, 1060, -270, 111, -270, -270, -270, 112, 110, -270,
952 116, -270, -270, -270, -270, 63, 63, -270, -270, -270,
953 -270, -40, -40, -270, 89, 94, 79, -270, 1060, 121,
954 -270, 146, 17, 673, 766, 8, -270, 203, 487, -270,
955 -270, 115, -270, -270, 1060, 118, -270, 122, -270, -270,
956 -270, -270, 203, 109, 153, 110, 151, 134, 131, -270,
957 -270, -270, 1060, -270, 127, 137, 205, -270, 132, 580,
958 -270, 13, 1060, 580, 109, 1060, -270, -270, -270, 133,
959 110, -270, -270, -270, -270
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000960};
961
962/* YYPGOTO[NTERM-NUM]. */
963static const yytype_int16 yypgoto[] =
964{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000965 -270, -270, -270, -270, -270, -270, -270, 42, -270, -270,
966 -270, -270, -75, -270, -21, -270, -87, -25, -270, -270,
967 -270, 26, 41, 25, -270, -76, -95, -270, -102, -89,
968 11, 12, -270, -270, -270, 157, 188, 182, 164, -270,
969 -270, -249, -270, -270, -270, 224, -38, 265, -13, 0,
970 -270, -270, -270, 136, -130, -270, 14, -161, 10, -139,
971 -248, -270, -270, -270, -27, -269, -270, -270, -61, 52,
972 16, -270, -270, -7, -270, -270, -270, -270, -270, -270,
973 -270, -270, -270, 225, -270, -270
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000974};
975
976/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
977 positive, shift that token. If negative, reduce the rule which
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000978 number is the opposite. If YYTABLE_NINF, syntax error. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000979#define YYTABLE_NINF -175
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000980static const yytype_int16 yytable[] =
981{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000982 51, 173, 177, 87, 131, 118, 172, 209, 78, 234,
983 67, 37, 38, 201, 296, 279, 56, 183, 286, 131,
984 118, 186, 230, 184, 193, 194, 61, 175, 176, 63,
985 57, 178, 179, 286, 91, 312, 79, 68, 69, 70,
986 191, 7, 192, 217, 188, 83, 51, 136, 202, 51,
987 65, 306, 180, 51, 91, 306, 181, 62, 51, 195,
988 196, 94, 66, 95, 37, 38, 59, 60, 23, 24,
989 96, 25, 51, 27, 209, 173, 67, 169, 238, 74,
990 233, 236, 75, -75, 170, 51, 156, 227, 76, 242,
991 283, 84, 51, 131, 118, 309, 227, 136, 80, 136,
992 256, 227, 86, 68, 69, 70, 247, 248, 249, 250,
993 227, 93, 265, 228, 243, 244, 118, 118, 118, 118,
994 118, 118, 118, 118, 118, 118, 118, 259, 134, 230,
995 260, 269, 270, 227, 166, 51, 266, 51, 182, 221,
996 222, 223, 271, -26, 313, 2, 3, 4, 224, 68,
997 69, 70, -25, 187, 80, 131, 118, 199, 225, 189,
998 190, 156, 197, 198, 200, 285, 136, 227, 274, 275,
999 245, 246, 251, 252, 203, 205, 210, 211, 213, 290,
1000 285, 214, 131, 118, 215, 218, 231, 219, -126, 235,
1001 301, 258, 277, 56, -174, 272, 273, -27, 227, 289,
1002 310, 278, 291, 292, 51, 298, 284, 2, 3, 4,
1003 173, 6, 7, 8, 9, 10, 299, 300, 302, 303,
1004 156, 304, 305, 241, 314, 253, 255, 11, 12, 13,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001005 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001006 24, 254, 25, 26, 27, 28, 29, 30, 31, 167,
1007 32, 33, 34, 35, 88, 92, 168, 97, 36, 98,
1008 99, 100, 101, 156, 156, 102, 103, 156, 156, 77,
1009 58, 204, 268, 276, 280, 293, 311, 0, 82, 0,
1010 281, 0, 156, 0, 104, 0, 0, 0, 0, 0,
1011 0, 0, 0, 0, 0, 105, 106, 0, 107, 156,
1012 0, 0, 0, 156, 1, 2, 3, 4, 5, 6,
1013 7, 8, 9, 10, 139, 140, 141, 0, 142, 143,
1014 144, 145, 0, 0, 0, 11, 12, 13, 14, 15,
1015 16, 17, 18, 19, 20, 21, 22, 23, 24, 0,
1016 25, 26, 27, 28, 29, 30, 31, 146, 32, 33,
1017 34, 35, 0, 0, 0, 97, 36, 98, 99, 100,
1018 101, 0, 0, 102, 103, 0, 0, 0, 0, 0,
kbr@chromium.org205fef32011-11-22 20:50:02 +00001019 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001020 0, 0, 104, 0, 0, 0, 147, 148, 0, 0,
1021 0, 0, 149, 105, 106, 0, 107, 1, 2, 3,
1022 4, 5, 6, 7, 8, 9, 10, 139, 140, 141,
1023 0, 142, 143, 144, 145, 0, 0, 0, 11, 12,
1024 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1025 23, 24, 0, 25, 26, 27, 28, 29, 30, 31,
1026 146, 32, 33, 34, 35, 0, 0, 0, 97, 36,
1027 98, 99, 100, 101, 0, 0, 102, 103, 0, 0,
1028 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1029 0, 0, 0, 0, 0, 104, 0, 0, 0, 147,
1030 229, 0, 0, 0, 0, 149, 105, 106, 0, 107,
1031 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1032 139, 140, 141, 0, 142, 143, 144, 145, 0, 0,
1033 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1034 20, 21, 22, 23, 24, 0, 25, 26, 27, 28,
1035 29, 30, 31, 146, 32, 33, 34, 35, 0, 0,
1036 0, 97, 36, 98, 99, 100, 101, 0, 0, 102,
1037 103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1038 0, 0, 0, 0, 0, 0, 0, 0, 104, 0,
1039 0, 0, 147, 0, 0, 0, 0, 0, 149, 105,
1040 106, 0, 107, 1, 2, 3, 4, 5, 6, 7,
1041 8, 9, 10, 139, 140, 141, 0, 142, 143, 144,
1042 145, 0, 0, 0, 11, 12, 13, 14, 15, 16,
1043 17, 18, 19, 20, 21, 22, 23, 24, 0, 25,
1044 26, 27, 28, 29, 30, 31, 146, 32, 33, 34,
1045 35, 0, 0, 0, 97, 36, 98, 99, 100, 101,
1046 0, 0, 102, 103, 0, 0, 0, 0, 0, 0,
1047 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1048 0, 104, 0, 0, 0, 86, 0, 0, 0, 0,
1049 0, 149, 105, 106, 0, 107, 1, 2, 3, 4,
1050 5, 6, 7, 8, 9, 10, 139, 140, 141, 0,
1051 142, 143, 144, 145, 0, 0, 0, 11, 12, 13,
1052 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1053 24, 0, 25, 26, 27, 28, 29, 30, 31, 146,
1054 32, 33, 34, 35, 0, 0, 0, 97, 36, 98,
1055 99, 100, 101, 0, 0, 102, 103, 0, 0, 0,
1056 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1057 0, 0, 0, 0, 104, 0, 0, 0, 0, 0,
1058 0, 0, 0, 0, 149, 105, 106, 0, 107, 1,
1059 2, 3, 4, 5, 6, 7, 8, 9, 10, 0,
1060 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001061 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001062 21, 22, 23, 24, 0, 25, 26, 27, 28, 29,
1063 30, 31, 0, 32, 33, 34, 35, 0, 0, 0,
1064 97, 36, 98, 99, 100, 101, 0, 0, 102, 103,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001066 0, 0, 0, 0, 0, 0, 0, 104, 8, 9,
1067 10, 0, 0, 0, 0, 0, 0, 149, 105, 106,
1068 0, 107, 11, 12, 13, 14, 15, 16, 17, 18,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001069 19, 20, 21, 22, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001070 0, 0, 30, 31, 0, 32, 33, 34, 35, 0,
1071 0, 0, 97, 36, 98, 99, 100, 101, 0, 0,
1072 102, 103, 0, 0, 0, 0, 0, 0, 0, 0,
1073 0, 0, 0, 0, 0, 0, 0, 0, 0, 104,
1074 0, 0, 171, 8, 9, 10, 0, 0, 0, 0,
1075 105, 106, 0, 107, 0, 0, 0, 11, 12, 13,
1076 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
1077 0, 0, 0, 0, 0, 0, 0, 30, 31, 0,
1078 32, 33, 34, 35, 0, 0, 0, 97, 36, 98,
1079 99, 100, 101, 0, 0, 102, 103, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001080 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001081 0, 0, 0, 0, 104, 8, 9, 10, 0, 0,
1082 0, 0, 0, 0, 216, 105, 106, 0, 107, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001083 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001084 22, 0, 0, 0, 0, 0, 0, 0, 0, 30,
1085 31, 0, 32, 33, 34, 35, 0, 0, 0, 97,
1086 36, 98, 99, 100, 101, 0, 0, 102, 103, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001087 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001088 0, 0, 0, 0, 0, 0, 104, 0, 0, 232,
1089 8, 9, 10, 0, 0, 0, 0, 105, 106, 0,
1090 107, 0, 0, 0, 11, 12, 13, 14, 15, 16,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001091 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001092 0, 0, 0, 0, 30, 31, 0, 32, 33, 34,
1093 35, 0, 0, 0, 97, 36, 98, 99, 100, 101,
1094 0, 0, 102, 103, 0, 0, 0, 0, 0, 0,
1095 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1096 0, 104, 8, 9, 10, 0, 0, 0, 0, 0,
1097 0, 0, 105, 106, 0, 107, 11, 12, 13, 14,
1098 15, 16, 17, 18, 19, 20, 21, 22, 0, 0,
1099 0, 0, 0, 0, 0, 0, 30, 185, 0, 32,
1100 33, 34, 35, 0, 0, 0, 97, 36, 98, 99,
1101 100, 101, 0, 0, 102, 103, 0, 0, 0, 0,
1102 0, 0, 0, 0, 0, 0, 0, 0, 2, 3,
1103 4, 0, 0, 104, 8, 9, 10, 0, 0, 0,
1104 0, 0, 0, 0, 105, 106, 0, 107, 11, 12,
1105 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1106 0, 0, 0, 0, 0, 0, 0, 0, 30, 31,
1107 0, 32, 33, 34, 35, 2, 3, 4, 0, 36,
1108 0, 8, 9, 10, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001109 0, 0, 0, 0, 0, 11, 12, 13, 14, 15,
1110 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001111 208, 0, 0, 0, 0, 30, 31, 0, 32, 33,
1112 34, 35, 0, 0, 0, 0, 36, 0, 0, 0,
1113 0, 0, 0, 0, 81, 0, 0, 1, 2, 3,
1114 4, 5, 6, 7, 8, 9, 10, 0, 0, 0,
1115 0, 0, 0, 0, 0, 0, 0, 257, 11, 12,
1116 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1117 23, 24, 0, 25, 26, 27, 28, 29, 30, 31,
1118 0, 32, 33, 34, 35, 0, 0, 0, 0, 36,
1119 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1120 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1121 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1122 20, 21, 22, 23, 24, 0, 25, 26, 27, 28,
1123 29, 30, 31, 0, 32, 33, 34, 35, 2, 3,
1124 4, 0, 36, 0, 8, 9, 10, 0, 0, 0,
1125 0, 0, 0, 0, 0, 0, 0, 0, 11, 12,
1126 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1127 0, 0, 0, 0, 0, 0, 0, 0, 30, 31,
1128 0, 32, 33, 34, 35, 8, 9, 10, 0, 36,
1129 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1130 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1131 22, 0, 0, 0, 0, 0, 0, 0, 0, 30,
1132 31, 0, 32, 33, 34, 35, 8, 9, 10, 239,
1133 36, 0, 0, 0, 240, 0, 0, 0, 0, 0,
1134 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1135 21, 22, 0, 0, 0, 0, 0, 0, 0, 0,
1136 30, 31, 0, 32, 33, 34, 35, 0, 0, 0,
1137 0, 36
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001138};
1139
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001140#define yypact_value_is_default(Yystate) \
1141 (!!((Yystate) == (-270)))
1142
1143#define yytable_value_is_error(Yytable_value) \
1144 YYID (0)
1145
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001146static const yytype_int16 yycheck[] =
1147{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001148 0, 96, 104, 64, 80, 80, 95, 137, 46, 170,
1149 9, 0, 0, 69, 283, 263, 40, 82, 267, 95,
1150 95, 116, 161, 88, 64, 65, 54, 102, 103, 91,
1151 54, 62, 63, 282, 72, 304, 49, 36, 37, 38,
1152 93, 9, 95, 145, 119, 58, 46, 85, 104, 49,
1153 82, 299, 83, 53, 92, 303, 87, 85, 58, 99,
1154 100, 81, 88, 83, 53, 53, 36, 37, 36, 37,
1155 90, 39, 72, 41, 204, 170, 9, 83, 180, 88,
1156 169, 82, 91, 82, 90, 85, 86, 88, 54, 184,
1157 82, 85, 92, 169, 169, 82, 88, 135, 83, 137,
1158 202, 88, 85, 36, 37, 38, 193, 194, 195, 196,
1159 88, 54, 214, 91, 189, 190, 191, 192, 193, 194,
1160 195, 196, 197, 198, 199, 200, 201, 88, 91, 268,
1161 91, 226, 227, 88, 54, 135, 91, 137, 82, 71,
1162 72, 73, 231, 81, 305, 4, 5, 6, 80, 36,
1163 37, 38, 81, 81, 83, 231, 231, 68, 90, 96,
1164 97, 161, 66, 67, 70, 267, 204, 88, 89, 258,
1165 191, 192, 197, 198, 84, 54, 91, 91, 81, 274,
1166 282, 81, 258, 258, 91, 81, 83, 86, 81, 84,
1167 292, 83, 46, 40, 85, 84, 84, 81, 88, 84,
1168 302, 262, 84, 81, 204, 54, 3, 4, 5, 6,
1169 305, 8, 9, 10, 11, 12, 82, 86, 91, 82,
1170 220, 16, 90, 181, 91, 199, 201, 24, 25, 26,
1171 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1172 37, 200, 39, 40, 41, 42, 43, 44, 45, 92,
1173 47, 48, 49, 50, 66, 73, 92, 54, 55, 56,
1174 57, 58, 59, 263, 264, 62, 63, 267, 268, 45,
1175 5, 135, 220, 259, 264, 282, 303, -1, 53, -1,
1176 264, -1, 282, -1, 81, -1, -1, -1, -1, -1,
1177 -1, -1, -1, -1, -1, 92, 93, -1, 95, 299,
1178 -1, -1, -1, 303, 3, 4, 5, 6, 7, 8,
1179 9, 10, 11, 12, 13, 14, 15, -1, 17, 18,
1180 19, 20, -1, -1, -1, 24, 25, 26, 27, 28,
1181 29, 30, 31, 32, 33, 34, 35, 36, 37, -1,
1182 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
1183 49, 50, -1, -1, -1, 54, 55, 56, 57, 58,
1184 59, -1, -1, 62, 63, -1, -1, -1, -1, -1,
1185 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1186 -1, -1, 81, -1, -1, -1, 85, 86, -1, -1,
1187 -1, -1, 91, 92, 93, -1, 95, 3, 4, 5,
1188 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1189 -1, 17, 18, 19, 20, -1, -1, -1, 24, 25,
1190 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1191 36, 37, -1, 39, 40, 41, 42, 43, 44, 45,
1192 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1193 56, 57, 58, 59, -1, -1, 62, 63, -1, -1,
1194 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1195 -1, -1, -1, -1, -1, 81, -1, -1, -1, 85,
1196 86, -1, -1, -1, -1, 91, 92, 93, -1, 95,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001197 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1198 13, 14, 15, -1, 17, 18, 19, 20, -1, -1,
1199 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001200 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1201 43, 44, 45, 46, 47, 48, 49, 50, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001202 -1, 54, 55, 56, 57, 58, 59, -1, -1, 62,
1203 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1204 -1, -1, -1, -1, -1, -1, -1, -1, 81, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001205 -1, -1, 85, -1, -1, -1, -1, -1, 91, 92,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001206 93, -1, 95, 3, 4, 5, 6, 7, 8, 9,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001207 10, 11, 12, 13, 14, 15, -1, 17, 18, 19,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001208 20, -1, -1, -1, 24, 25, 26, 27, 28, 29,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001209 30, 31, 32, 33, 34, 35, 36, 37, -1, 39,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001210 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001211 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1212 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001213 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001214 -1, 81, -1, -1, -1, 85, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001215 -1, 91, 92, 93, -1, 95, 3, 4, 5, 6,
1216 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
1217 17, 18, 19, 20, -1, -1, -1, 24, 25, 26,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001218 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001219 37, -1, 39, 40, 41, 42, 43, 44, 45, 46,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001220 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1221 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
zmo@google.com09c323a2011-08-12 18:22:25 +00001222 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001223 -1, -1, -1, -1, 81, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001224 -1, -1, -1, -1, 91, 92, 93, -1, 95, 3,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001225 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001226 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001227 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001228 34, 35, 36, 37, -1, 39, 40, 41, 42, 43,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001229 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1230 54, 55, 56, 57, 58, 59, -1, -1, 62, 63,
1231 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1232 -1, -1, -1, -1, -1, -1, -1, 81, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001233 12, -1, -1, -1, -1, -1, -1, 91, 92, 93,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001234 -1, 95, 24, 25, 26, 27, 28, 29, 30, 31,
1235 32, 33, 34, 35, -1, -1, -1, -1, -1, -1,
1236 -1, -1, 44, 45, -1, 47, 48, 49, 50, -1,
1237 -1, -1, 54, 55, 56, 57, 58, 59, -1, -1,
1238 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
1239 -1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001240 -1, -1, 84, 10, 11, 12, -1, -1, -1, -1,
1241 92, 93, -1, 95, -1, -1, -1, 24, 25, 26,
1242 27, 28, 29, 30, 31, 32, 33, 34, 35, -1,
1243 -1, -1, -1, -1, -1, -1, -1, 44, 45, -1,
1244 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1245 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001246 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001247 -1, -1, -1, -1, 81, 10, 11, 12, -1, -1,
1248 -1, -1, -1, -1, 91, 92, 93, -1, 95, 24,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001249 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1250 35, -1, -1, -1, -1, -1, -1, -1, -1, 44,
1251 45, -1, 47, 48, 49, 50, -1, -1, -1, 54,
1252 55, 56, 57, 58, 59, -1, -1, 62, 63, -1,
1253 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001254 -1, -1, -1, -1, -1, -1, 81, -1, -1, 84,
1255 10, 11, 12, -1, -1, -1, -1, 92, 93, -1,
1256 95, -1, -1, -1, 24, 25, 26, 27, 28, 29,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001257 30, 31, 32, 33, 34, 35, -1, -1, -1, -1,
1258 -1, -1, -1, -1, 44, 45, -1, 47, 48, 49,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001259 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1260 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
1261 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1262 -1, 81, 10, 11, 12, -1, -1, -1, -1, -1,
1263 -1, -1, 92, 93, -1, 95, 24, 25, 26, 27,
1264 28, 29, 30, 31, 32, 33, 34, 35, -1, -1,
1265 -1, -1, -1, -1, -1, -1, 44, 45, -1, 47,
1266 48, 49, 50, -1, -1, -1, 54, 55, 56, 57,
1267 58, 59, -1, -1, 62, 63, -1, -1, -1, -1,
1268 -1, -1, -1, -1, -1, -1, -1, -1, 4, 5,
1269 6, -1, -1, 81, 10, 11, 12, -1, -1, -1,
1270 -1, -1, -1, -1, 92, 93, -1, 95, 24, 25,
1271 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1272 -1, -1, -1, -1, -1, -1, -1, -1, 44, 45,
1273 -1, 47, 48, 49, 50, 4, 5, 6, -1, 55,
1274 -1, 10, 11, 12, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001275 -1, -1, -1, -1, -1, 24, 25, 26, 27, 28,
1276 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001277 86, -1, -1, -1, -1, 44, 45, -1, 47, 48,
1278 49, 50, -1, -1, -1, -1, 55, -1, -1, -1,
1279 -1, -1, -1, -1, 0, -1, -1, 3, 4, 5,
1280 6, 7, 8, 9, 10, 11, 12, -1, -1, -1,
1281 -1, -1, -1, -1, -1, -1, -1, 86, 24, 25,
1282 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1283 36, 37, -1, 39, 40, 41, 42, 43, 44, 45,
1284 -1, 47, 48, 49, 50, -1, -1, -1, -1, 55,
1285 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1286 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1287 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1288 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1289 43, 44, 45, -1, 47, 48, 49, 50, 4, 5,
1290 6, -1, 55, -1, 10, 11, 12, -1, -1, -1,
1291 -1, -1, -1, -1, -1, -1, -1, -1, 24, 25,
1292 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1293 -1, -1, -1, -1, -1, -1, -1, -1, 44, 45,
1294 -1, 47, 48, 49, 50, 10, 11, 12, -1, 55,
1295 -1, -1, -1, -1, -1, -1, -1, -1, -1, 24,
1296 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1297 35, -1, -1, -1, -1, -1, -1, -1, -1, 44,
1298 45, -1, 47, 48, 49, 50, 10, 11, 12, 54,
1299 55, -1, -1, -1, 59, -1, -1, -1, -1, -1,
1300 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1301 34, 35, -1, -1, -1, -1, -1, -1, -1, -1,
1302 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1303 -1, 55
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001304};
1305
1306/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1307 symbol of state STATE-NUM. */
1308static const yytype_uint8 yystos[] =
1309{
1310 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001311 12, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001312 33, 34, 35, 36, 37, 39, 40, 41, 42, 43,
1313 44, 45, 47, 48, 49, 50, 55, 135, 136, 137,
1314 138, 139, 144, 145, 146, 147, 149, 150, 151, 152,
1315 153, 154, 155, 187, 188, 189, 40, 54, 152, 36,
1316 37, 54, 85, 91, 190, 82, 88, 9, 36, 37,
1317 38, 141, 142, 148, 88, 91, 54, 150, 151, 153,
1318 83, 0, 188, 153, 85, 157, 85, 173, 141, 140,
1319 143, 151, 142, 54, 81, 83, 90, 54, 56, 57,
1320 58, 59, 62, 63, 81, 92, 93, 95, 106, 107,
1321 108, 110, 111, 112, 113, 114, 115, 116, 117, 118,
1322 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
1323 129, 130, 134, 154, 91, 156, 151, 158, 159, 13,
1324 14, 15, 17, 18, 19, 20, 46, 85, 86, 91,
1325 117, 130, 131, 133, 135, 136, 154, 163, 164, 165,
1326 166, 174, 175, 176, 179, 186, 54, 140, 143, 83,
1327 90, 84, 134, 131, 162, 117, 117, 133, 62, 63,
1328 83, 87, 82, 82, 88, 45, 131, 81, 117, 96,
1329 97, 93, 95, 64, 65, 99, 100, 66, 67, 68,
1330 70, 69, 104, 84, 158, 54, 160, 161, 86, 159,
1331 91, 91, 181, 81, 81, 91, 91, 133, 81, 86,
1332 167, 71, 72, 73, 80, 90, 132, 88, 91, 86,
1333 164, 83, 84, 134, 162, 84, 82, 109, 133, 54,
1334 59, 112, 131, 117, 117, 119, 119, 121, 121, 121,
1335 121, 122, 122, 126, 127, 128, 133, 86, 83, 88,
1336 91, 170, 171, 172, 182, 133, 91, 180, 174, 131,
1337 131, 134, 84, 84, 89, 134, 161, 46, 173, 165,
1338 163, 175, 183, 82, 3, 133, 146, 178, 168, 84,
1339 131, 84, 81, 178, 184, 185, 170, 177, 54, 82,
1340 86, 133, 91, 82, 16, 90, 165, 169, 173, 82,
1341 133, 169, 170, 162, 91
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001342};
1343
1344#define yyerrok (yyerrstatus = 0)
1345#define yyclearin (yychar = YYEMPTY)
1346#define YYEMPTY (-2)
1347#define YYEOF 0
1348
1349#define YYACCEPT goto yyacceptlab
1350#define YYABORT goto yyabortlab
1351#define YYERROR goto yyerrorlab
1352
1353
1354/* Like YYERROR except do call yyerror. This remains here temporarily
1355 to ease the transition to the new meaning of YYERROR, for GCC.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001356 Once GCC version 2 has supplanted version 1, this can go. However,
1357 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1358 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1359 discussed. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001360
1361#define YYFAIL goto yyerrlab
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001362#if defined YYFAIL
1363 /* This is here to suppress warnings from the GCC cpp's
1364 -Wunused-macros. Normally we don't worry about that warning, but
1365 some users do, and we want to make it easy for users to remove
1366 YYFAIL uses, which will produce warnings from Bison 2.5. */
1367#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001368
1369#define YYRECOVERING() (!!yyerrstatus)
1370
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001371#define YYBACKUP(Token, Value) \
1372do \
1373 if (yychar == YYEMPTY) \
1374 { \
1375 yychar = (Token); \
1376 yylval = (Value); \
1377 YYPOPSTACK (yylen); \
1378 yystate = *yyssp; \
1379 goto yybackup; \
1380 } \
1381 else \
1382 { \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001383 yyerror (context, YY_("syntax error: cannot back up")); \
1384 YYERROR; \
1385 } \
1386while (YYID (0))
1387
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001388/* Error token number */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001389#define YYTERROR 1
1390#define YYERRCODE 256
1391
1392
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001393/* This macro is provided for backward compatibility. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001394#ifndef YY_LOCATION_PRINT
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001395# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001396#endif
1397
1398
1399/* YYLEX -- calling `yylex' with the right arguments. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001400#ifdef YYLEX_PARAM
1401# define YYLEX yylex (&yylval, YYLEX_PARAM)
1402#else
1403# define YYLEX yylex (&yylval)
1404#endif
1405
1406/* Enable debugging if requested. */
1407#if YYDEBUG
1408
1409# ifndef YYFPRINTF
1410# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1411# define YYFPRINTF fprintf
1412# endif
1413
1414# define YYDPRINTF(Args) \
1415do { \
1416 if (yydebug) \
1417 YYFPRINTF Args; \
1418} while (YYID (0))
1419
1420# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1421do { \
1422 if (yydebug) \
1423 { \
1424 YYFPRINTF (stderr, "%s ", Title); \
1425 yy_symbol_print (stderr, \
1426 Type, Value, context); \
1427 YYFPRINTF (stderr, "\n"); \
1428 } \
1429} while (YYID (0))
1430
1431
1432/*--------------------------------.
1433| Print this symbol on YYOUTPUT. |
1434`--------------------------------*/
1435
1436/*ARGSUSED*/
1437#if (defined __STDC__ || defined __C99__FUNC__ \
1438 || defined __cplusplus || defined _MSC_VER)
1439static void
1440yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1441#else
1442static void
1443yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1444 FILE *yyoutput;
1445 int yytype;
1446 YYSTYPE const * const yyvaluep;
1447 TParseContext* context;
1448#endif
1449{
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001450 FILE *yyo = yyoutput;
1451 YYUSE (yyo);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001452 if (!yyvaluep)
1453 return;
1454 YYUSE (context);
1455# ifdef YYPRINT
1456 if (yytype < YYNTOKENS)
1457 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1458# else
1459 YYUSE (yyoutput);
1460# endif
1461 switch (yytype)
1462 {
1463 default:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001464 break;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001465 }
1466}
1467
1468
1469/*--------------------------------.
1470| Print this symbol on YYOUTPUT. |
1471`--------------------------------*/
1472
1473#if (defined __STDC__ || defined __C99__FUNC__ \
1474 || defined __cplusplus || defined _MSC_VER)
1475static void
1476yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1477#else
1478static void
1479yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1480 FILE *yyoutput;
1481 int yytype;
1482 YYSTYPE const * const yyvaluep;
1483 TParseContext* context;
1484#endif
1485{
1486 if (yytype < YYNTOKENS)
1487 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1488 else
1489 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1490
1491 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1492 YYFPRINTF (yyoutput, ")");
1493}
1494
1495/*------------------------------------------------------------------.
1496| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1497| TOP (included). |
1498`------------------------------------------------------------------*/
1499
1500#if (defined __STDC__ || defined __C99__FUNC__ \
1501 || defined __cplusplus || defined _MSC_VER)
1502static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001503yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001504#else
1505static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001506yy_stack_print (yybottom, yytop)
1507 yytype_int16 *yybottom;
1508 yytype_int16 *yytop;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001509#endif
1510{
1511 YYFPRINTF (stderr, "Stack now");
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001512 for (; yybottom <= yytop; yybottom++)
1513 {
1514 int yybot = *yybottom;
1515 YYFPRINTF (stderr, " %d", yybot);
1516 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001517 YYFPRINTF (stderr, "\n");
1518}
1519
1520# define YY_STACK_PRINT(Bottom, Top) \
1521do { \
1522 if (yydebug) \
1523 yy_stack_print ((Bottom), (Top)); \
1524} while (YYID (0))
1525
1526
1527/*------------------------------------------------.
1528| Report that the YYRULE is going to be reduced. |
1529`------------------------------------------------*/
1530
1531#if (defined __STDC__ || defined __C99__FUNC__ \
1532 || defined __cplusplus || defined _MSC_VER)
1533static void
1534yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1535#else
1536static void
1537yy_reduce_print (yyvsp, yyrule, context)
1538 YYSTYPE *yyvsp;
1539 int yyrule;
1540 TParseContext* context;
1541#endif
1542{
1543 int yynrhs = yyr2[yyrule];
1544 int yyi;
1545 unsigned long int yylno = yyrline[yyrule];
1546 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1547 yyrule - 1, yylno);
1548 /* The symbols being reduced. */
1549 for (yyi = 0; yyi < yynrhs; yyi++)
1550 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001551 YYFPRINTF (stderr, " $%d = ", yyi + 1);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001552 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1553 &(yyvsp[(yyi + 1) - (yynrhs)])
1554 , context);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001555 YYFPRINTF (stderr, "\n");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001556 }
1557}
1558
1559# define YY_REDUCE_PRINT(Rule) \
1560do { \
1561 if (yydebug) \
1562 yy_reduce_print (yyvsp, Rule, context); \
1563} while (YYID (0))
1564
1565/* Nonzero means print parse trace. It is left uninitialized so that
1566 multiple parsers can coexist. */
1567int yydebug;
1568#else /* !YYDEBUG */
1569# define YYDPRINTF(Args)
1570# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1571# define YY_STACK_PRINT(Bottom, Top)
1572# define YY_REDUCE_PRINT(Rule)
1573#endif /* !YYDEBUG */
1574
1575
1576/* YYINITDEPTH -- initial size of the parser's stacks. */
1577#ifndef YYINITDEPTH
1578# define YYINITDEPTH 200
1579#endif
1580
1581/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1582 if the built-in stack extension method is used).
1583
1584 Do not make this value too large; the results are undefined if
1585 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1586 evaluated with infinite-precision integer arithmetic. */
1587
1588#ifndef YYMAXDEPTH
1589# define YYMAXDEPTH 10000
1590#endif
1591
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001592
1593#if YYERROR_VERBOSE
1594
1595# ifndef yystrlen
1596# if defined __GLIBC__ && defined _STRING_H
1597# define yystrlen strlen
1598# else
1599/* Return the length of YYSTR. */
1600#if (defined __STDC__ || defined __C99__FUNC__ \
1601 || defined __cplusplus || defined _MSC_VER)
1602static YYSIZE_T
1603yystrlen (const char *yystr)
1604#else
1605static YYSIZE_T
1606yystrlen (yystr)
1607 const char *yystr;
1608#endif
1609{
1610 YYSIZE_T yylen;
1611 for (yylen = 0; yystr[yylen]; yylen++)
1612 continue;
1613 return yylen;
1614}
1615# endif
1616# endif
1617
1618# ifndef yystpcpy
1619# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1620# define yystpcpy stpcpy
1621# else
1622/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1623 YYDEST. */
1624#if (defined __STDC__ || defined __C99__FUNC__ \
1625 || defined __cplusplus || defined _MSC_VER)
1626static char *
1627yystpcpy (char *yydest, const char *yysrc)
1628#else
1629static char *
1630yystpcpy (yydest, yysrc)
1631 char *yydest;
1632 const char *yysrc;
1633#endif
1634{
1635 char *yyd = yydest;
1636 const char *yys = yysrc;
1637
1638 while ((*yyd++ = *yys++) != '\0')
1639 continue;
1640
1641 return yyd - 1;
1642}
1643# endif
1644# endif
1645
1646# ifndef yytnamerr
1647/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1648 quotes and backslashes, so that it's suitable for yyerror. The
1649 heuristic is that double-quoting is unnecessary unless the string
1650 contains an apostrophe, a comma, or backslash (other than
1651 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1652 null, do not copy; instead, return the length of what the result
1653 would have been. */
1654static YYSIZE_T
1655yytnamerr (char *yyres, const char *yystr)
1656{
1657 if (*yystr == '"')
1658 {
1659 YYSIZE_T yyn = 0;
1660 char const *yyp = yystr;
1661
1662 for (;;)
1663 switch (*++yyp)
1664 {
1665 case '\'':
1666 case ',':
1667 goto do_not_strip_quotes;
1668
1669 case '\\':
1670 if (*++yyp != '\\')
1671 goto do_not_strip_quotes;
1672 /* Fall through. */
1673 default:
1674 if (yyres)
1675 yyres[yyn] = *yyp;
1676 yyn++;
1677 break;
1678
1679 case '"':
1680 if (yyres)
1681 yyres[yyn] = '\0';
1682 return yyn;
1683 }
1684 do_not_strip_quotes: ;
1685 }
1686
1687 if (! yyres)
1688 return yystrlen (yystr);
1689
1690 return yystpcpy (yyres, yystr) - yyres;
1691}
1692# endif
1693
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001694/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1695 about the unexpected token YYTOKEN for the state stack whose top is
1696 YYSSP.
1697
1698 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1699 not large enough to hold the message. In that case, also set
1700 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1701 required number of bytes is too large to store. */
1702static int
1703yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1704 yytype_int16 *yyssp, int yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001705{
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001706 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1707 YYSIZE_T yysize = yysize0;
1708 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1709 /* Internationalized format string. */
1710 const char *yyformat = YY_NULL;
1711 /* Arguments of yyformat. */
1712 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1713 /* Number of reported tokens (one for the "unexpected", one per
1714 "expected"). */
1715 int yycount = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001716
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001717 /* There are many possibilities here to consider:
1718 - Assume YYFAIL is not used. It's too flawed to consider. See
1719 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1720 for details. YYERROR is fine as it does not invoke this
1721 function.
1722 - If this state is a consistent state with a default action, then
1723 the only way this function was invoked is if the default action
1724 is an error action. In that case, don't check for expected
1725 tokens because there are none.
1726 - The only way there can be no lookahead present (in yychar) is if
1727 this state is a consistent state with a default action. Thus,
1728 detecting the absence of a lookahead is sufficient to determine
1729 that there is no unexpected or expected token to report. In that
1730 case, just report a simple "syntax error".
1731 - Don't assume there isn't a lookahead just because this state is a
1732 consistent state with a default action. There might have been a
1733 previous inconsistent state, consistent state with a non-default
1734 action, or user semantic action that manipulated yychar.
1735 - Of course, the expected token list depends on states to have
1736 correct lookahead information, and it depends on the parser not
1737 to perform extra reductions after fetching a lookahead from the
1738 scanner and before detecting a syntax error. Thus, state merging
1739 (from LALR or IELR) and default reductions corrupt the expected
1740 token list. However, the list is correct for canonical LR with
1741 one exception: it will still contain any token that will not be
1742 accepted due to an error action in a later state.
1743 */
1744 if (yytoken != YYEMPTY)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001745 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001746 int yyn = yypact[*yyssp];
1747 yyarg[yycount++] = yytname[yytoken];
1748 if (!yypact_value_is_default (yyn))
1749 {
1750 /* Start YYX at -YYN if negative to avoid negative indexes in
1751 YYCHECK. In other words, skip the first -YYN actions for
1752 this state because they are default actions. */
1753 int yyxbegin = yyn < 0 ? -yyn : 0;
1754 /* Stay within bounds of both yycheck and yytname. */
1755 int yychecklim = YYLAST - yyn + 1;
1756 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1757 int yyx;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001758
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001759 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1760 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1761 && !yytable_value_is_error (yytable[yyx + yyn]))
1762 {
1763 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1764 {
1765 yycount = 1;
1766 yysize = yysize0;
1767 break;
1768 }
1769 yyarg[yycount++] = yytname[yyx];
1770 {
1771 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1772 if (! (yysize <= yysize1
1773 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1774 return 2;
1775 yysize = yysize1;
1776 }
1777 }
1778 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001779 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001780
1781 switch (yycount)
1782 {
1783# define YYCASE_(N, S) \
1784 case N: \
1785 yyformat = S; \
1786 break
1787 YYCASE_(0, YY_("syntax error"));
1788 YYCASE_(1, YY_("syntax error, unexpected %s"));
1789 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1790 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1791 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1792 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1793# undef YYCASE_
1794 }
1795
1796 {
1797 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1798 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1799 return 2;
1800 yysize = yysize1;
1801 }
1802
1803 if (*yymsg_alloc < yysize)
1804 {
1805 *yymsg_alloc = 2 * yysize;
1806 if (! (yysize <= *yymsg_alloc
1807 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1808 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1809 return 1;
1810 }
1811
1812 /* Avoid sprintf, as that infringes on the user's name space.
1813 Don't have undefined behavior even if the translation
1814 produced a string with the wrong number of "%s"s. */
1815 {
1816 char *yyp = *yymsg;
1817 int yyi = 0;
1818 while ((*yyp = *yyformat) != '\0')
1819 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1820 {
1821 yyp += yytnamerr (yyp, yyarg[yyi++]);
1822 yyformat += 2;
1823 }
1824 else
1825 {
1826 yyp++;
1827 yyformat++;
1828 }
1829 }
1830 return 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001831}
1832#endif /* YYERROR_VERBOSE */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001833
1834/*-----------------------------------------------.
1835| Release the memory associated to this symbol. |
1836`-----------------------------------------------*/
1837
1838/*ARGSUSED*/
1839#if (defined __STDC__ || defined __C99__FUNC__ \
1840 || defined __cplusplus || defined _MSC_VER)
1841static void
1842yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1843#else
1844static void
1845yydestruct (yymsg, yytype, yyvaluep, context)
1846 const char *yymsg;
1847 int yytype;
1848 YYSTYPE *yyvaluep;
1849 TParseContext* context;
1850#endif
1851{
1852 YYUSE (yyvaluep);
1853 YYUSE (context);
1854
1855 if (!yymsg)
1856 yymsg = "Deleting";
1857 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1858
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001859 switch (yytype)
1860 {
1861
1862 default:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001863 break;
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001864 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001865}
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001866
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001867
1868
1869
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001870/*----------.
1871| yyparse. |
1872`----------*/
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001873
1874#ifdef YYPARSE_PARAM
1875#if (defined __STDC__ || defined __C99__FUNC__ \
1876 || defined __cplusplus || defined _MSC_VER)
1877int
1878yyparse (void *YYPARSE_PARAM)
1879#else
1880int
1881yyparse (YYPARSE_PARAM)
1882 void *YYPARSE_PARAM;
1883#endif
1884#else /* ! YYPARSE_PARAM */
1885#if (defined __STDC__ || defined __C99__FUNC__ \
1886 || defined __cplusplus || defined _MSC_VER)
1887int
1888yyparse (TParseContext* context)
1889#else
1890int
1891yyparse (context)
1892 TParseContext* context;
1893#endif
1894#endif
1895{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001896/* The lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001897int yychar;
1898
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001899
1900#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1901/* Suppress an incorrect diagnostic about yylval being uninitialized. */
1902# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1903 _Pragma ("GCC diagnostic push") \
1904 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1905 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1906# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1907 _Pragma ("GCC diagnostic pop")
1908#else
1909/* Default value used for initialization, for pacifying older GCCs
1910 or non-GCC compilers. */
1911static YYSTYPE yyval_default;
1912# define YY_INITIAL_VALUE(Value) = Value
1913#endif
1914#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1915# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1916# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1917#endif
1918#ifndef YY_INITIAL_VALUE
1919# define YY_INITIAL_VALUE(Value) /* Nothing. */
1920#endif
1921
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001922/* The semantic value of the lookahead symbol. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001923YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001924
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001925 /* Number of syntax errors so far. */
1926 int yynerrs;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001927
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001928 int yystate;
1929 /* Number of tokens to shift before error messages enabled. */
1930 int yyerrstatus;
1931
1932 /* The stacks and their tools:
1933 `yyss': related to states.
1934 `yyvs': related to semantic values.
1935
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001936 Refer to the stacks through separate pointers, to allow yyoverflow
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001937 to reallocate them elsewhere. */
1938
1939 /* The state stack. */
1940 yytype_int16 yyssa[YYINITDEPTH];
1941 yytype_int16 *yyss;
1942 yytype_int16 *yyssp;
1943
1944 /* The semantic value stack. */
1945 YYSTYPE yyvsa[YYINITDEPTH];
1946 YYSTYPE *yyvs;
1947 YYSTYPE *yyvsp;
1948
1949 YYSIZE_T yystacksize;
1950
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001951 int yyn;
1952 int yyresult;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001953 /* Lookahead token as an internal (translated) token number. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001954 int yytoken = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001955 /* The variables used to return semantic value and location from the
1956 action routines. */
1957 YYSTYPE yyval;
1958
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001959#if YYERROR_VERBOSE
1960 /* Buffer for error messages, and its allocated size. */
1961 char yymsgbuf[128];
1962 char *yymsg = yymsgbuf;
1963 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1964#endif
1965
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001966#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1967
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001968 /* The number of symbols on the RHS of the reduced rule.
1969 Keep to zero when no symbol should be popped. */
1970 int yylen = 0;
1971
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001972 yyssp = yyss = yyssa;
1973 yyvsp = yyvs = yyvsa;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001974 yystacksize = YYINITDEPTH;
1975
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001976 YYDPRINTF ((stderr, "Starting parse\n"));
1977
1978 yystate = 0;
1979 yyerrstatus = 0;
1980 yynerrs = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001981 yychar = YYEMPTY; /* Cause a token to be read. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001982 goto yysetstate;
1983
1984/*------------------------------------------------------------.
1985| yynewstate -- Push a new state, which is found in yystate. |
1986`------------------------------------------------------------*/
1987 yynewstate:
1988 /* In all cases, when you get here, the value and location stacks
1989 have just been pushed. So pushing a state here evens the stacks. */
1990 yyssp++;
1991
1992 yysetstate:
1993 *yyssp = yystate;
1994
1995 if (yyss + yystacksize - 1 <= yyssp)
1996 {
1997 /* Get the current used size of the three stacks, in elements. */
1998 YYSIZE_T yysize = yyssp - yyss + 1;
1999
2000#ifdef yyoverflow
2001 {
2002 /* Give user a chance to reallocate the stack. Use copies of
2003 these so that the &'s don't force the real ones into
2004 memory. */
2005 YYSTYPE *yyvs1 = yyvs;
2006 yytype_int16 *yyss1 = yyss;
2007
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002008 /* Each stack pointer address is followed by the size of the
2009 data in use in that stack, in bytes. This used to be a
2010 conditional around just the two extra args, but that might
2011 be undefined if yyoverflow is a macro. */
2012 yyoverflow (YY_("memory exhausted"),
2013 &yyss1, yysize * sizeof (*yyssp),
2014 &yyvs1, yysize * sizeof (*yyvsp),
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002015 &yystacksize);
2016
2017 yyss = yyss1;
2018 yyvs = yyvs1;
2019 }
2020#else /* no yyoverflow */
2021# ifndef YYSTACK_RELOCATE
2022 goto yyexhaustedlab;
2023# else
2024 /* Extend the stack our own way. */
2025 if (YYMAXDEPTH <= yystacksize)
2026 goto yyexhaustedlab;
2027 yystacksize *= 2;
2028 if (YYMAXDEPTH < yystacksize)
2029 yystacksize = YYMAXDEPTH;
2030
2031 {
2032 yytype_int16 *yyss1 = yyss;
2033 union yyalloc *yyptr =
2034 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2035 if (! yyptr)
2036 goto yyexhaustedlab;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002037 YYSTACK_RELOCATE (yyss_alloc, yyss);
2038 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002039# undef YYSTACK_RELOCATE
2040 if (yyss1 != yyssa)
2041 YYSTACK_FREE (yyss1);
2042 }
2043# endif
2044#endif /* no yyoverflow */
2045
2046 yyssp = yyss + yysize - 1;
2047 yyvsp = yyvs + yysize - 1;
2048
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002049 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2050 (unsigned long int) yystacksize));
2051
2052 if (yyss + yystacksize - 1 <= yyssp)
2053 YYABORT;
2054 }
2055
2056 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2057
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002058 if (yystate == YYFINAL)
2059 YYACCEPT;
2060
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002061 goto yybackup;
2062
2063/*-----------.
2064| yybackup. |
2065`-----------*/
2066yybackup:
2067
2068 /* Do appropriate processing given the current state. Read a
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002069 lookahead token if we need one and don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002070
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002071 /* First try to decide what to do without reference to lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002072 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002073 if (yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002074 goto yydefault;
2075
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002076 /* Not known => get a lookahead token if don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002077
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002078 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002079 if (yychar == YYEMPTY)
2080 {
2081 YYDPRINTF ((stderr, "Reading a token: "));
2082 yychar = YYLEX;
2083 }
2084
2085 if (yychar <= YYEOF)
2086 {
2087 yychar = yytoken = YYEOF;
2088 YYDPRINTF ((stderr, "Now at end of input.\n"));
2089 }
2090 else
2091 {
2092 yytoken = YYTRANSLATE (yychar);
2093 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2094 }
2095
2096 /* If the proper action on seeing token YYTOKEN is to reduce or to
2097 detect an error, take that action. */
2098 yyn += yytoken;
2099 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2100 goto yydefault;
2101 yyn = yytable[yyn];
2102 if (yyn <= 0)
2103 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002104 if (yytable_value_is_error (yyn))
2105 goto yyerrlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002106 yyn = -yyn;
2107 goto yyreduce;
2108 }
2109
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002110 /* Count tokens shifted since error; after three, turn off error
2111 status. */
2112 if (yyerrstatus)
2113 yyerrstatus--;
2114
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002115 /* Shift the lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002116 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2117
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002118 /* Discard the shifted token. */
2119 yychar = YYEMPTY;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002120
2121 yystate = yyn;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002122 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002123 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002124 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002125
2126 goto yynewstate;
2127
2128
2129/*-----------------------------------------------------------.
2130| yydefault -- do the default action for the current state. |
2131`-----------------------------------------------------------*/
2132yydefault:
2133 yyn = yydefact[yystate];
2134 if (yyn == 0)
2135 goto yyerrlab;
2136 goto yyreduce;
2137
2138
2139/*-----------------------------.
2140| yyreduce -- Do a reduction. |
2141`-----------------------------*/
2142yyreduce:
2143 /* yyn is the number of a rule to reduce with. */
2144 yylen = yyr2[yyn];
2145
2146 /* If YYLEN is nonzero, implement the default value of the action:
2147 `$$ = $1'.
2148
2149 Otherwise, the following line sets YYVAL to garbage.
2150 This behavior is undocumented and Bison
2151 users should not rely upon it. Assigning to YYVAL
2152 unconditionally makes the parser a bit smaller, and it avoids a
2153 GCC warning that YYVAL may be used uninitialized. */
2154 yyval = yyvsp[1-yylen];
2155
2156
2157 YY_REDUCE_PRINT (yyn);
2158 switch (yyn)
2159 {
2160 case 2:
2161
2162 {
2163 // The symbol table search was done in the lexical phase
2164 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2165 const TVariable* variable;
2166 if (symbol == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002167 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002168 context->recover();
2169 TType type(EbtFloat, EbpUndefined);
2170 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00002171 context->symbolTable.declare(*fakeVariable);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002172 variable = fakeVariable;
2173 } else {
2174 // This identifier can only be a variable type symbol
2175 if (! symbol->isVariable()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002176 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002177 context->recover();
2178 }
2179 variable = static_cast<const TVariable*>(symbol);
2180 }
2181
2182 // don't delete $1.string, it's used by error recovery, and the pool
2183 // pop will reclaim the memory
2184
2185 if (variable->getType().getQualifier() == EvqConst ) {
2186 ConstantUnion* constArray = variable->getConstPointer();
2187 TType t(variable->getType());
2188 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2189 } else
2190 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2191 variable->getName(),
2192 variable->getType(), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002193 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002194 break;
2195
2196 case 3:
2197
2198 {
2199 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002200 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002201 break;
2202
2203 case 4:
2204
2205 {
2206 //
2207 // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
2208 // check for overflow for constants
2209 //
2210 if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002211 context->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002212 context->recover();
2213 }
2214 ConstantUnion *unionArray = new ConstantUnion[1];
2215 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2216 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002217 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002218 break;
2219
2220 case 5:
2221
2222 {
2223 ConstantUnion *unionArray = new ConstantUnion[1];
2224 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2225 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002226 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002227 break;
2228
2229 case 6:
2230
2231 {
2232 ConstantUnion *unionArray = new ConstantUnion[1];
2233 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2234 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002235 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002236 break;
2237
2238 case 7:
2239
2240 {
2241 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002242 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002243 break;
2244
2245 case 8:
2246
2247 {
2248 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002249 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002250 break;
2251
2252 case 9:
2253
2254 {
2255 if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) {
2256 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode())
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002257 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", (yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()->getSymbol().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002258 else
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002259 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", "expression");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002260 context->recover();
2261 }
2262 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
2263 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002264 (yyval.interm.intermTypedNode) = context->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002265 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors
2266 TVectorFields fields;
2267 fields.num = 1;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002268 fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0); // need to do it this way because v.xy sends fields integer array
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002269 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2270 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002271 (yyval.interm.intermTypedNode) = context->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002272 }
2273 } else {
2274 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002275 if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() ) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002276 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002277 extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002278 std::string extraInfo = extraInfoStream.str();
2279 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002280 context->recover();
2281 } else {
2282 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2283 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002284 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0)) {
2285 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), true, (yyvsp[(2) - (4)].lex).line))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002286 context->recover();
2287 } else {
2288 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line))
2289 context->recover();
2290 }
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002291 } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002292 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002293 extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002294 std::string extraInfo = extraInfoStream.str();
2295 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002296 context->recover();
2297 }
2298 }
2299 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2300 }
2301 } else {
2302 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
2303 context->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable");
2304 context->recover();
2305 }
2306
2307 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2308 }
2309 }
2310 if ((yyval.interm.intermTypedNode) == 0) {
2311 ConstantUnion *unionArray = new ConstantUnion[1];
2312 unionArray->setFConst(0.0f);
2313 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), (yyvsp[(2) - (4)].lex).line);
2314 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2315 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct())
2316 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName()));
2317 else
2318 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize(), (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()));
2319
2320 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2321 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2322 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2323 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
2324 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())
2325 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
2326 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2327 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst));
2328 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector())
2329 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary));
2330 else
2331 (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002332 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002333 break;
2334
2335 case 10:
2336
2337 {
2338 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002339 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002340 break;
2341
2342 case 11:
2343
2344 {
2345 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002346 context->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002347 context->recover();
2348 }
2349
2350 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) {
2351 TVectorFields fields;
2352 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2353 fields.num = 1;
2354 fields.offsets[0] = 0;
2355 context->recover();
2356 }
2357
2358 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { // constant folding for vector fields
2359 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line);
2360 if ((yyval.interm.intermTypedNode) == 0) {
2361 context->recover();
2362 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2363 }
2364 else
2365 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqConst, (int) (*(yyvsp[(3) - (3)].lex).string).size()));
2366 } else {
alokp@chromium.orgab8c0262012-08-13 17:36:25 +00002367 TString vectorString = *(yyvsp[(3) - (3)].lex).string;
2368 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line);
2369 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2370 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (int) vectorString.size()));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002371 }
2372 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) {
2373 TMatrixFields fields;
2374 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2375 fields.wholeRow = false;
2376 fields.wholeCol = false;
2377 fields.row = 0;
2378 fields.col = 0;
2379 context->recover();
2380 }
2381
2382 if (fields.wholeRow || fields.wholeCol) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002383 context->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002384 context->recover();
2385 ConstantUnion *unionArray = new ConstantUnion[1];
2386 unionArray->setIConst(0);
2387 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2388 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2389 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize()));
2390 } else {
2391 ConstantUnion *unionArray = new ConstantUnion[1];
2392 unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row);
2393 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2394 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2395 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision()));
2396 }
2397 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) {
2398 bool fieldFound = false;
2399 const TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct();
2400 if (fields == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002401 context->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002402 context->recover();
2403 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2404 } else {
2405 unsigned int i;
2406 for (i = 0; i < fields->size(); ++i) {
2407 if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
2408 fieldFound = true;
2409 break;
2410 }
2411 }
2412 if (fieldFound) {
2413 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) {
2414 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2415 if ((yyval.interm.intermTypedNode) == 0) {
2416 context->recover();
2417 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2418 }
2419 else {
2420 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2421 // change the qualifier of the return type, not of the structure field
2422 // as the structure definition is shared between various structures.
2423 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2424 }
2425 } else {
2426 ConstantUnion *unionArray = new ConstantUnion[1];
2427 unionArray->setIConst(i);
2428 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line);
2429 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2430 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2431 }
2432 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002433 context->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002434 context->recover();
2435 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2436 }
2437 }
2438 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002439 context->error((yyvsp[(2) - (3)].lex).line, " field selection requires structure, vector, or matrix on left hand side", (yyvsp[(3) - (3)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002440 context->recover();
2441 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2442 }
2443 // don't delete $3.string, it's from the pool
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002444 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002445 break;
2446
2447 case 12:
2448
2449 {
2450 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2451 context->recover();
2452 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2453 if ((yyval.interm.intermTypedNode) == 0) {
2454 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2455 context->recover();
2456 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2457 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002458 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002459 break;
2460
2461 case 13:
2462
2463 {
2464 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2465 context->recover();
2466 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2467 if ((yyval.interm.intermTypedNode) == 0) {
2468 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2469 context->recover();
2470 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2471 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002472 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002473 break;
2474
2475 case 14:
2476
2477 {
2478 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2479 context->recover();
2480 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002481 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002482 break;
2483
2484 case 15:
2485
2486 {
2487 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2488 TOperator op = fnCall->getBuiltInOp();
2489
2490 if (op != EOpNull)
2491 {
2492 //
2493 // Then this should be a constructor.
2494 // Don't go through the symbol table for constructors.
2495 // Their parameters will be verified algorithmically.
2496 //
2497 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2498 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2499 (yyval.interm.intermTypedNode) = 0;
2500 } else {
2501 //
2502 // It's a constructor, of type 'type'.
2503 //
2504 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2505 }
2506
2507 if ((yyval.interm.intermTypedNode) == 0) {
2508 context->recover();
2509 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2510 }
2511 (yyval.interm.intermTypedNode)->setType(type);
2512 } else {
2513 //
2514 // Not a constructor. Find it in the symbol table.
2515 //
2516 const TFunction* fnCandidate;
2517 bool builtIn;
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00002518 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, context->shaderVersion, &builtIn);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002519 if (fnCandidate) {
2520 //
2521 // A declared function.
2522 //
2523 if (builtIn && !fnCandidate->getExtension().empty() &&
2524 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2525 context->recover();
2526 }
2527 op = fnCandidate->getBuiltInOp();
2528 if (builtIn && op != EOpNull) {
2529 //
2530 // A function call mapped to a built-in operation.
2531 //
2532 if (fnCandidate->getParamCount() == 1) {
2533 //
2534 // Treat it like a built-in unary operator.
2535 //
2536 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2537 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002538 std::stringstream extraInfoStream;
2539 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2540 std::string extraInfo = extraInfoStream.str();
2541 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002542 YYERROR;
2543 }
2544 } else {
2545 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2546 }
2547 } else {
2548 // This is a real function call
2549
2550 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2551 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2552
2553 // this is how we know whether the given function is a builtIn function or a user defined function
2554 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2555 // if builtIn == true, it's definitely a builtIn function with EOpNull
2556 if (!builtIn)
2557 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2558 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2559
2560 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002561 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002562 qual = fnCandidate->getParam(i).type->getQualifier();
2563 if (qual == EvqOut || qual == EvqInOut) {
2564 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002565 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 +00002566 context->recover();
2567 }
2568 }
2569 }
2570 }
2571 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2572 } else {
2573 // error message was put out by PaFindFunction()
2574 // Put on a dummy node for error recovery
2575 ConstantUnion *unionArray = new ConstantUnion[1];
2576 unionArray->setFConst(0.0f);
2577 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2578 context->recover();
2579 }
2580 }
2581 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002582 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002583 break;
2584
2585 case 16:
2586
2587 {
2588 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002589 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002590 break;
2591
2592 case 17:
2593
2594 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002595 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002596 context->recover();
2597 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002598 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002599 break;
2600
2601 case 18:
2602
2603 {
2604 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2605 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002606 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002607 break;
2608
2609 case 19:
2610
2611 {
2612 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2613 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002614 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002615 break;
2616
2617 case 20:
2618
2619 {
2620 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2621 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002622 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002623 break;
2624
2625 case 21:
2626
2627 {
2628 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2629 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002630 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002631 break;
2632
2633 case 22:
2634
2635 {
2636 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2637 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2638 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2639 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002640 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002641 break;
2642
2643 case 23:
2644
2645 {
2646 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2647 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2648 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2649 (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 +00002650 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002651 break;
2652
2653 case 24:
2654
2655 {
2656 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002657 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002658 break;
2659
2660 case 25:
2661
2662 {
2663 //
2664 // Constructor
2665 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002666 TOperator op = EOpNull;
2667 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2668 op = EOpConstructStruct;
2669 } else {
2670 switch ((yyvsp[(1) - (1)].interm.type).type) {
2671 case EbtFloat:
2672 if ((yyvsp[(1) - (1)].interm.type).matrix) {
2673 switch((yyvsp[(1) - (1)].interm.type).size) {
2674 case 2: op = EOpConstructMat2; break;
2675 case 3: op = EOpConstructMat3; break;
2676 case 4: op = EOpConstructMat4; break;
2677 }
2678 } else {
2679 switch((yyvsp[(1) - (1)].interm.type).size) {
2680 case 1: op = EOpConstructFloat; break;
2681 case 2: op = EOpConstructVec2; break;
2682 case 3: op = EOpConstructVec3; break;
2683 case 4: op = EOpConstructVec4; break;
2684 }
2685 }
2686 break;
2687 case EbtInt:
2688 switch((yyvsp[(1) - (1)].interm.type).size) {
2689 case 1: op = EOpConstructInt; break;
2690 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2691 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2692 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2693 }
2694 break;
2695 case EbtBool:
2696 switch((yyvsp[(1) - (1)].interm.type).size) {
2697 case 1: op = EOpConstructBool; break;
2698 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2699 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2700 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2701 }
2702 break;
2703 default: break;
2704 }
2705 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002706 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 +00002707 context->recover();
2708 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2709 op = EOpConstructFloat;
2710 }
2711 }
2712 TString tempString;
2713 TType type((yyvsp[(1) - (1)].interm.type));
2714 TFunction *function = new TFunction(&tempString, type, op);
2715 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002716 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002717 break;
2718
2719 case 26:
2720
2721 {
2722 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2723 context->recover();
2724 TType type(EbtVoid, EbpUndefined);
2725 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2726 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002727 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002728 break;
2729
2730 case 27:
2731
2732 {
2733 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2734 context->recover();
2735 TType type(EbtVoid, EbpUndefined);
2736 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2737 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002738 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002739 break;
2740
2741 case 28:
2742
2743 {
2744 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002745 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002746 break;
2747
2748 case 29:
2749
2750 {
2751 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2752 context->recover();
2753 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2754 if ((yyval.interm.intermTypedNode) == 0) {
2755 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2756 context->recover();
2757 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2758 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002759 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002760 break;
2761
2762 case 30:
2763
2764 {
2765 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2766 context->recover();
2767 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2768 if ((yyval.interm.intermTypedNode) == 0) {
2769 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2770 context->recover();
2771 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2772 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002773 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002774 break;
2775
2776 case 31:
2777
2778 {
2779 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2780 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2781 if ((yyval.interm.intermTypedNode) == 0) {
2782 const char* errorOp = "";
2783 switch((yyvsp[(1) - (2)].interm).op) {
2784 case EOpNegative: errorOp = "-"; break;
2785 case EOpLogicalNot: errorOp = "!"; break;
2786 default: break;
2787 }
2788 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2789 context->recover();
2790 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2791 }
2792 } else
2793 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002794 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002795 break;
2796
2797 case 32:
2798
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002799 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002800 break;
2801
2802 case 33:
2803
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002804 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002805 break;
2806
2807 case 34:
2808
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002809 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002810 break;
2811
2812 case 35:
2813
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002814 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002815 break;
2816
2817 case 36:
2818
2819 {
2820 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2821 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2822 if ((yyval.interm.intermTypedNode) == 0) {
2823 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2824 context->recover();
2825 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2826 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002827 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002828 break;
2829
2830 case 37:
2831
2832 {
2833 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2834 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2835 if ((yyval.interm.intermTypedNode) == 0) {
2836 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2837 context->recover();
2838 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2839 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002840 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002841 break;
2842
2843 case 38:
2844
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002845 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002846 break;
2847
2848 case 39:
2849
2850 {
2851 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2852 if ((yyval.interm.intermTypedNode) == 0) {
2853 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2854 context->recover();
2855 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2856 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002857 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002858 break;
2859
2860 case 40:
2861
2862 {
2863 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2864 if ((yyval.interm.intermTypedNode) == 0) {
2865 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2866 context->recover();
2867 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2868 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002869 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002870 break;
2871
2872 case 41:
2873
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002874 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002875 break;
2876
2877 case 42:
2878
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002879 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002880 break;
2881
2882 case 43:
2883
2884 {
2885 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2886 if ((yyval.interm.intermTypedNode) == 0) {
2887 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2888 context->recover();
2889 ConstantUnion *unionArray = new ConstantUnion[1];
2890 unionArray->setBConst(false);
2891 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2892 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002893 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002894 break;
2895
2896 case 44:
2897
2898 {
2899 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2900 if ((yyval.interm.intermTypedNode) == 0) {
2901 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2902 context->recover();
2903 ConstantUnion *unionArray = new ConstantUnion[1];
2904 unionArray->setBConst(false);
2905 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2906 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002907 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002908 break;
2909
2910 case 45:
2911
2912 {
2913 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2914 if ((yyval.interm.intermTypedNode) == 0) {
2915 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2916 context->recover();
2917 ConstantUnion *unionArray = new ConstantUnion[1];
2918 unionArray->setBConst(false);
2919 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2920 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002921 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002922 break;
2923
2924 case 46:
2925
2926 {
2927 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2928 if ((yyval.interm.intermTypedNode) == 0) {
2929 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2930 context->recover();
2931 ConstantUnion *unionArray = new ConstantUnion[1];
2932 unionArray->setBConst(false);
2933 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2934 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002935 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002936 break;
2937
2938 case 47:
2939
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002940 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002941 break;
2942
2943 case 48:
2944
2945 {
2946 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2947 if ((yyval.interm.intermTypedNode) == 0) {
2948 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2949 context->recover();
2950 ConstantUnion *unionArray = new ConstantUnion[1];
2951 unionArray->setBConst(false);
2952 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2953 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002954 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002955 break;
2956
2957 case 49:
2958
2959 {
2960 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2961 if ((yyval.interm.intermTypedNode) == 0) {
2962 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2963 context->recover();
2964 ConstantUnion *unionArray = new ConstantUnion[1];
2965 unionArray->setBConst(false);
2966 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2967 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002968 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002969 break;
2970
2971 case 50:
2972
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002973 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002974 break;
2975
2976 case 51:
2977
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002978 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002979 break;
2980
2981 case 52:
2982
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002983 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002984 break;
2985
2986 case 53:
2987
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002988 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002989 break;
2990
2991 case 54:
2992
2993 {
2994 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2995 if ((yyval.interm.intermTypedNode) == 0) {
2996 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2997 context->recover();
2998 ConstantUnion *unionArray = new ConstantUnion[1];
2999 unionArray->setBConst(false);
3000 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
3001 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003002 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003003 break;
3004
3005 case 55:
3006
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003007 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003008 break;
3009
3010 case 56:
3011
3012 {
3013 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
3014 if ((yyval.interm.intermTypedNode) == 0) {
3015 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3016 context->recover();
3017 ConstantUnion *unionArray = new ConstantUnion[1];
3018 unionArray->setBConst(false);
3019 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
3020 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003021 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003022 break;
3023
3024 case 57:
3025
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003026 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003027 break;
3028
3029 case 58:
3030
3031 {
3032 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
3033 if ((yyval.interm.intermTypedNode) == 0) {
3034 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3035 context->recover();
3036 ConstantUnion *unionArray = new ConstantUnion[1];
3037 unionArray->setBConst(false);
3038 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
3039 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003040 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003041 break;
3042
3043 case 59:
3044
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003045 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003046 break;
3047
3048 case 60:
3049
3050 {
3051 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3052 context->recover();
3053
3054 (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);
3055 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3056 (yyval.interm.intermTypedNode) = 0;
3057
3058 if ((yyval.interm.intermTypedNode) == 0) {
3059 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3060 context->recover();
3061 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3062 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003063 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003064 break;
3065
3066 case 61:
3067
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003068 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003069 break;
3070
3071 case 62:
3072
3073 {
3074 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3075 context->recover();
3076 (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);
3077 if ((yyval.interm.intermTypedNode) == 0) {
3078 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3079 context->recover();
3080 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3081 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003082 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003083 break;
3084
3085 case 63:
3086
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003087 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003088 break;
3089
3090 case 64:
3091
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003092 { 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 +00003093 break;
3094
3095 case 65:
3096
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003097 { 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 +00003098 break;
3099
3100 case 66:
3101
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003102 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003103 break;
3104
3105 case 67:
3106
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003107 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003108 break;
3109
3110 case 68:
3111
3112 {
3113 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003114 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003115 break;
3116
3117 case 69:
3118
3119 {
3120 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3121 if ((yyval.interm.intermTypedNode) == 0) {
3122 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3123 context->recover();
3124 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3125 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003126 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003127 break;
3128
3129 case 70:
3130
3131 {
3132 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3133 context->recover();
3134 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003135 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003136 break;
3137
3138 case 71:
3139
3140 {
3141 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3142
3143 TIntermAggregate *prototype = new TIntermAggregate;
3144 prototype->setType(function.getReturnType());
3145 prototype->setName(function.getName());
3146
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003147 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003148 {
3149 const TParameter &param = function.getParam(i);
3150 if (param.name != 0)
3151 {
3152 TVariable *variable = new TVariable(param.name, *param.type);
3153
3154 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3155 }
3156 else
3157 {
3158 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3159 }
3160 }
3161
3162 prototype->setOp(EOpPrototype);
3163 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003164
3165 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003166 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003167 break;
3168
3169 case 72:
3170
3171 {
3172 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3173 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3174 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003175 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003176 break;
3177
3178 case 73:
3179
3180 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003181 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3182 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3183 context->recover();
3184 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003185 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3186 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3187 context->recover();
3188 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003189 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003190 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003191 break;
3192
3193 case 74:
3194
3195 {
3196 //
3197 // Multiple declarations of the same function are allowed.
3198 //
3199 // If this is a definition, the definition production code will check for redefinitions
3200 // (we don't know at this point if it's a definition or not).
3201 //
3202 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3203 //
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00003204 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003205 if (prevDec) {
3206 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003207 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 +00003208 context->recover();
3209 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003210 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003211 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003212 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 +00003213 context->recover();
3214 }
3215 }
3216 }
3217
3218 //
3219 // If this is a redeclaration, it could also be a definition,
3220 // in which case, we want to use the variable names from this one, and not the one that's
3221 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3222 //
3223 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3224 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3225
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003226 // We're at the inner scope level of the function's arguments and body statement.
3227 // Add the function prototype to the surrounding scope instead.
3228 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003229 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003230 break;
3231
3232 case 75:
3233
3234 {
3235 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003236 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003237 break;
3238
3239 case 76:
3240
3241 {
3242 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003243 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003244 break;
3245
3246 case 77:
3247
3248 {
3249 // Add the parameter
3250 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3251 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3252 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3253 else
3254 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003255 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003256 break;
3257
3258 case 78:
3259
3260 {
3261 //
3262 // Only first parameter of one-parameter functions can be void
3263 // The check for named parameters not being void is done in parameter_declarator
3264 //
3265 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3266 //
3267 // This parameter > first is void
3268 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003269 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003270 context->recover();
3271 delete (yyvsp[(3) - (3)].interm).param.type;
3272 } else {
3273 // Add the parameter
3274 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3275 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3276 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003277 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003278 break;
3279
3280 case 79:
3281
3282 {
3283 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003284 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 +00003285 context->recover();
3286 }
3287 // make sure a sampler is not involved as well...
3288 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3289 context->recover();
3290
3291 // Add the function as a prototype after parsing it (we do not support recursion)
3292 TFunction *function;
3293 TType type((yyvsp[(1) - (3)].interm.type));
3294 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3295 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003296
3297 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003298 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003299 break;
3300
3301 case 80:
3302
3303 {
3304 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003305 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 +00003306 context->recover();
3307 }
3308 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3309 context->recover();
3310 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3311 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3312 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003313 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003314 break;
3315
3316 case 81:
3317
3318 {
3319 // Check that we can make an array out of this type
3320 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3321 context->recover();
3322
3323 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3324 context->recover();
3325
3326 int size;
3327 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3328 context->recover();
3329 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3330
3331 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3332 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3333 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3334 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003335 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003336 break;
3337
3338 case 82:
3339
3340 {
3341 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003342 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003343 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003344 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003345 break;
3346
3347 case 83:
3348
3349 {
3350 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3351 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3352 context->recover();
3353 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3354 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003355 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003356 break;
3357
3358 case 84:
3359
3360 {
3361 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003362 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003363 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003364 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003365 break;
3366
3367 case 85:
3368
3369 {
3370 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3371 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3372 context->recover();
3373 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3374 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003375 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003376 break;
3377
3378 case 86:
3379
3380 {
3381 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003382 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003383 break;
3384
3385 case 87:
3386
3387 {
3388 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003389 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003390 break;
3391
3392 case 88:
3393
3394 {
3395 (yyval.interm.qualifier) = EvqOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003396 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003397 break;
3398
3399 case 89:
3400
3401 {
3402 (yyval.interm.qualifier) = EvqInOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003403 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003404 break;
3405
3406 case 90:
3407
3408 {
3409 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3410 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003411 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003412 break;
3413
3414 case 91:
3415
3416 {
3417 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003418 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003419 break;
3420
3421 case 92:
3422
3423 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003424 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3425 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003426 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 +00003427 context->recover();
3428 }
3429
zmo@google.comfd747b82011-04-23 01:30:07 +00003430 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3431 (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 +00003432
3433 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3434 context->recover();
3435
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003436 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 +00003437 context->recover();
3438
zmo@google.comfd747b82011-04-23 01:30:07 +00003439 TVariable* variable = 0;
3440 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 +00003441 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003442 if (symbol && variable)
3443 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003444 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003445 break;
3446
3447 case 93:
3448
3449 {
3450 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3451 context->recover();
3452
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003453 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 +00003454 context->recover();
3455
3456 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3457
3458 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))
3459 context->recover();
3460 else {
3461 (yyvsp[(1) - (5)].interm).type.setArray(true);
3462 TVariable* variable;
3463 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3464 context->recover();
3465 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003466 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003467 break;
3468
3469 case 94:
3470
3471 {
3472 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3473 context->recover();
3474
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003475 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 +00003476 context->recover();
3477
3478 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3479
3480 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))
3481 context->recover();
3482 else {
3483 int size;
3484 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3485 context->recover();
3486 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003487 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003488 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3489 context->recover();
3490 TType type = TType((yyvsp[(1) - (6)].interm).type);
3491 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003492 (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 +00003493 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003494 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003495 break;
3496
3497 case 95:
3498
3499 {
3500 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3501 context->recover();
3502
3503 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3504
3505 TIntermNode* intermNode;
3506 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3507 //
3508 // build the intermediate representation
3509 //
3510 if (intermNode)
3511 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3512 else
3513 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3514 } else {
3515 context->recover();
3516 (yyval.interm).intermAggregate = 0;
3517 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003518 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003519 break;
3520
3521 case 96:
3522
3523 {
3524 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3525 (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 +00003526 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003527 break;
3528
3529 case 97:
3530
3531 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003532 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3533 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003534
3535 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3536 context->recover();
3537
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003538 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 +00003539 context->recover();
3540
3541 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3542
zmo@google.comfd747b82011-04-23 01:30:07 +00003543 TVariable* variable = 0;
3544 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 +00003545 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003546 if (variable && symbol)
3547 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003548 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003549 break;
3550
3551 case 98:
3552
3553 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003554 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 +00003555 context->recover();
3556
zmo@google.comfd747b82011-04-23 01:30:07 +00003557 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3558 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003559 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003560 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003561 break;
3562
3563 case 99:
3564
3565 {
3566 TType type = TType((yyvsp[(1) - (5)].interm.type));
3567 int size;
3568 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3569 context->recover();
3570 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003571 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3572 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003573
3574 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3575 context->recover();
3576
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003577 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 +00003578 context->recover();
3579
3580 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3581
3582 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)))
3583 context->recover();
3584 else {
3585 int size;
3586 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3587 context->recover();
3588
3589 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003590 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003591 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3592 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003593 if (variable && symbol)
3594 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003595 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003596 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003597 break;
3598
3599 case 100:
3600
3601 {
3602 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3603 context->recover();
3604
3605 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3606
3607 TIntermNode* intermNode;
3608 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3609 //
3610 // Build intermediate representation
3611 //
3612 if(intermNode)
3613 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3614 else
3615 (yyval.interm).intermAggregate = 0;
3616 } else {
3617 context->recover();
3618 (yyval.interm).intermAggregate = 0;
3619 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003620 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003621 break;
3622
3623 case 101:
3624
3625 {
3626 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003627 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3628 context->recover();
3629 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3630 if (!(yyvsp[(2) - (2)].lex).symbol)
3631 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003632 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 +00003633 context->recover();
3634
3635 (yyval.interm).intermAggregate = 0;
3636 }
3637 else
3638 {
3639 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3640 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3641 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003642 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003643 break;
3644
3645 case 102:
3646
3647 {
3648 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3649
3650 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003651 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003652 context->recover();
3653 (yyvsp[(1) - (1)].interm.type).setArray(false);
3654 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003655 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003656 break;
3657
3658 case 103:
3659
3660 {
3661 if ((yyvsp[(2) - (2)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003662 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003663 context->recover();
3664 (yyvsp[(2) - (2)].interm.type).setArray(false);
3665 }
3666
3667 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3668 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003669 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003670 context->recover();
3671 }
3672 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3673 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003674 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003675 context->recover();
3676 }
3677 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3678 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003679 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003680 break;
3681
3682 case 104:
3683
3684 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003685 (yyval.interm.type).qualifier = EvqSmooth;
3686 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003687 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003688 break;
3689
3690 case 105:
3691
3692 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003693 (yyval.interm.type).qualifier = EvqFlat;
3694 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003695 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003696 break;
3697
3698 case 106:
3699
3700 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003701 (yyval.interm.qualifier) = EvqConst;
3702 }
3703 break;
3704
3705 case 107:
3706
3707 {
3708 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3709 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3710 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3711 context->recover();
3712 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3713 }
3714 break;
3715
3716 case 108:
3717
3718 {
3719 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003720 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3721 context->recover();
3722 if (context->shaderType == SH_VERTEX_SHADER)
3723 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3724 else
3725 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003726 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003727 break;
3728
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003729 case 109:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003730
3731 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003732 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003733 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3734 context->recover();
3735 if (context->shaderType == SH_VERTEX_SHADER)
3736 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3737 else
3738 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003739 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003740 break;
3741
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003742 case 110:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003743
3744 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003745 (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 +00003746 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003747 break;
3748
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003749 case 111:
3750
3751 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003752 if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothIn) {
3753 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3754 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothIn, (yyvsp[(2) - (2)].interm.type).line);
3755 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3756 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3757 else UNREACHABLE();
3758 }
3759 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidIn) {
3760 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3761 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidIn, (yyvsp[(2) - (2)].interm.type).line);
3762 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3763 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3764 else UNREACHABLE();
3765 }
3766 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothOut) {
3767 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3768 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothOut, (yyvsp[(2) - (2)].interm.type).line);
3769 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3770 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3771 else UNREACHABLE();
3772 }
3773 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidOut) {
3774 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3775 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidOut, (yyvsp[(2) - (2)].interm.type).line);
3776 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3777 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3778 else UNREACHABLE();
3779 }
3780 else {
3781 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));
3782 context->recover();
3783
3784 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
3785 }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003786 }
3787 break;
3788
3789 case 112:
3790
3791 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003792 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));
3793 context->recover();
3794
3795 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3796 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003797 }
3798 break;
3799
3800 case 113:
3801
3802 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003803 (yyval.interm.type).qualifier = EvqConst;
3804 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003805 }
3806 break;
3807
3808 case 114:
3809
3810 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003811 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
3812 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqSmoothIn : EvqAttribute;
3813 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003814 }
3815 break;
3816
3817 case 115:
3818
3819 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003820 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
3821 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqSmoothOut;
3822 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3823 }
3824 break;
3825
3826 case 116:
3827
3828 {
3829 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line);
3830 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqAttribute;
3831 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3832 }
3833 break;
3834
3835 case 117:
3836
3837 {
3838 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line);
3839 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqCentroidOut;
3840 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3841 }
3842 break;
3843
3844 case 118:
3845
3846 {
3847 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3848 context->recover();
3849 (yyval.interm.type).qualifier = EvqUniform;
3850 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3851 }
3852 break;
3853
3854 case 119:
3855
3856 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003857 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003858
3859 if ((yyval.interm.type).precision == EbpUndefined) {
3860 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3861 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3862 context->recover();
3863 }
3864 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003865 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003866 break;
3867
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003868 case 120:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003869
3870 {
3871 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3872 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003873 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003874 break;
3875
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003876 case 121:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003877
3878 {
3879 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003880 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003881 break;
3882
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003883 case 122:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003884
3885 {
3886 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003887 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003888 break;
3889
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003890 case 123:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003891
3892 {
3893 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003894 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003895 break;
3896
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003897 case 124:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003898
3899 {
3900 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003901 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003902 break;
3903
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003904 case 125:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003905
3906 {
3907 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3908
3909 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3910 context->recover();
3911 else {
3912 int size;
3913 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3914 context->recover();
3915 (yyval.interm.type).setArray(true, size);
3916 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003917 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003918 break;
3919
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003920 case 126:
3921
3922 {
3923 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003924 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003925 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003926 break;
3927
3928 case 127:
3929
3930 {
3931 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003932 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003933 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003934 break;
3935
3936 case 128:
3937
3938 {
3939 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003940 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003941 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003942 break;
3943
3944 case 129:
3945
3946 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003947 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3948 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003949 }
3950 break;
3951
3952 case 130:
3953
3954 {
3955 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003956 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3957 (yyval.interm.type).setAggregate(2);
3958 }
3959 break;
3960
3961 case 131:
3962
3963 {
3964 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3965 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3966 (yyval.interm.type).setAggregate(3);
3967 }
3968 break;
3969
3970 case 132:
3971
3972 {
3973 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3974 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3975 (yyval.interm.type).setAggregate(4);
3976 }
3977 break;
3978
3979 case 133:
3980
3981 {
3982 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3983 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3984 (yyval.interm.type).setAggregate(2);
3985 }
3986 break;
3987
3988 case 134:
3989
3990 {
3991 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003992 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3993 (yyval.interm.type).setAggregate(3);
3994 }
3995 break;
3996
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003997 case 135:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003998
3999 {
4000 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4001 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4002 (yyval.interm.type).setAggregate(4);
4003 }
4004 break;
4005
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004006 case 136:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004007
4008 {
4009 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4010 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4011 (yyval.interm.type).setAggregate(2);
4012 }
4013 break;
4014
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004015 case 137:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004016
4017 {
4018 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4019 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4020 (yyval.interm.type).setAggregate(3);
4021 }
4022 break;
4023
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004024 case 138:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004025
4026 {
4027 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4028 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4029 (yyval.interm.type).setAggregate(4);
4030 }
4031 break;
4032
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004033 case 139:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004034
4035 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004036 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
4037 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4038 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4039 (yyval.interm.type).setAggregate(2, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004040 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004041 break;
4042
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004043 case 140:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004044
4045 {
4046 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
4047 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4048 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4049 (yyval.interm.type).setAggregate(3, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004050 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004051 break;
4052
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004053 case 141:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004054
4055 {
4056 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
4057 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4058 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4059 (yyval.interm.type).setAggregate(4, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004060 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004061 break;
4062
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004063 case 142:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004064
4065 {
4066 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4067 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4068 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004069 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004070 break;
4071
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004072 case 143:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004073
4074 {
4075 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4076 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4077 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004078 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004079 break;
4080
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004081 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004082
4083 {
zmo@google.com09c323a2011-08-12 18:22:25 +00004084 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004085 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00004086 context->recover();
4087 }
4088 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4089 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4090 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004091 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004092 break;
4093
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004094 case 145:
zmo@google.com09c323a2011-08-12 18:22:25 +00004095
4096 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004097 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004098 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00004099 context->recover();
4100 }
4101 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
4102 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4103 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004104 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004105 break;
4106
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004107 case 146:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004108
4109 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004110 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4111 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4112 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004113 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004114 break;
4115
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004116 case 147:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004117
4118 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004119 //
4120 // This is for user defined type names. The lexical phase looked up the
4121 // type.
4122 //
4123 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4124 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4125 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4126 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004127 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004128 break;
4129
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004130 case 148:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004131
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004132 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004133 break;
4134
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004135 case 149:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004136
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004137 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004138 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
4139 context->recover();
4140
4141 TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
4142 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004143 if (! context->symbolTable.declare(*userTypeDef)) {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004144 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
4145 context->recover();
4146 }
4147 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004148 (yyval.interm.type).userDef = structure;
kbr@chromium.org476541f2011-10-27 21:14:51 +00004149 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004150 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004151 break;
4152
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004153 case 150:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004154
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004155 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004156 break;
4157
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004158 case 151:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004159
kbr@chromium.org476541f2011-10-27 21:14:51 +00004160 {
4161 TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
4162 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
4163 (yyval.interm.type).userDef = structure;
4164 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004165 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004166 break;
4167
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004168 case 152:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004169
4170 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004171 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004172 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004173 break;
4174
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004175 case 153:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004176
4177 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004178 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4179 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4180 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4181 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4182 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());
4183 context->recover();
4184 }
4185 }
4186 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4187 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004188 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004189 break;
4190
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004191 case 154:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004192
4193 {
4194 (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
4195
4196 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
4197 context->recover();
4198 }
4199 for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) {
4200 //
4201 // Careful not to replace already known aspects of type, like array-ness
4202 //
4203 TType* type = (*(yyval.interm.typeList))[i].type;
4204 type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
4205 type->setNominalSize((yyvsp[(1) - (3)].interm.type).size);
4206 type->setMatrix((yyvsp[(1) - (3)].interm.type).matrix);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00004207 type->setPrecision((yyvsp[(1) - (3)].interm.type).precision);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004208
4209 // don't allow arrays of arrays
4210 if (type->isArray()) {
4211 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type)))
4212 context->recover();
4213 }
4214 if ((yyvsp[(1) - (3)].interm.type).array)
4215 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize);
4216 if ((yyvsp[(1) - (3)].interm.type).userDef) {
4217 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
4218 type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName());
4219 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004220
4221 if (context->structNestingErrorCheck((yyvsp[(1) - (3)].interm.type).line, *type)) {
4222 context->recover();
4223 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004224 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004225 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004226 break;
4227
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004228 case 155:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004229
4230 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004231 (yyval.interm.typeList) = NewPoolTTypeList();
4232 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004233 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004234 break;
4235
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004236 case 156:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004237
4238 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004239 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004240 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004241 break;
4242
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004243 case 157:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004244
4245 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004246 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4247 context->recover();
4248
4249 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4250 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4251 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004252 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004253 break;
4254
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004255 case 158:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004256
4257 {
4258 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4259 context->recover();
4260
4261 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4262 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4263 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4264
4265 int size;
4266 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4267 context->recover();
4268 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004269 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004270 break;
4271
kbr@chromium.org476541f2011-10-27 21:14:51 +00004272 case 159:
4273
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004274 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004275 break;
4276
4277 case 160:
4278
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004279 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004280 break;
4281
4282 case 161:
4283
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004284 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004285 break;
4286
4287 case 162:
4288
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004289 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004290 break;
4291
4292 case 163:
4293
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004294 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004295 break;
4296
kbr@chromium.org476541f2011-10-27 21:14:51 +00004297 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004298
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004299 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004300 break;
4301
4302 case 165:
4303
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004304 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004305 break;
4306
4307 case 166:
4308
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004309 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004310 break;
4311
4312 case 167:
4313
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004314 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4315 break;
4316
4317 case 168:
4318
4319 { (yyval.interm.intermAggregate) = 0; }
4320 break;
4321
4322 case 169:
4323
4324 { context->symbolTable.push(); }
4325 break;
4326
4327 case 170:
4328
4329 { context->symbolTable.pop(); }
4330 break;
4331
4332 case 171:
4333
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004334 {
4335 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4336 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4337 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4338 }
4339 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4340 }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004341 break;
4342
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004343 case 172:
4344
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004345 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004346 break;
4347
4348 case 173:
4349
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004350 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004351 break;
4352
4353 case 174:
4354
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004355 { context->symbolTable.push(); }
4356 break;
4357
4358 case 175:
4359
4360 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4361 break;
4362
4363 case 176:
4364
4365 { context->symbolTable.push(); }
4366 break;
4367
4368 case 177:
4369
4370 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4371 break;
4372
4373 case 178:
4374
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004375 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004376 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004377 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004378 break;
4379
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004380 case 179:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004381
4382 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004383 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004384 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004385 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4386 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004387 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004388 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004389 break;
4390
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004391 case 180:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004392
4393 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004394 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004395 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004396 break;
4397
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004398 case 181:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004399
kbr@chromium.org205fef32011-11-22 20:50:02 +00004400 {
4401 (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 +00004402 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004403 break;
4404
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004405 case 182:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004406
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004407 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004408 break;
4409
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004410 case 183:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004411
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004412 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004413 break;
4414
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004415 case 184:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004416
4417 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004418 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4419 context->recover();
4420 (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 +00004421 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004422 break;
4423
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004424 case 185:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004425
4426 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004427 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4428 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004429 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004430 break;
4431
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004432 case 186:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004433
4434 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004435 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4436 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004437 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004438 break;
4439
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004440 case 187:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004441
4442 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004443 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4444 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4445 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004446 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004447 break;
4448
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004449 case 188:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004450
4451 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004452 TIntermNode* intermNode;
4453 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4454 context->recover();
4455 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4456 context->recover();
4457
4458 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4459 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4460 else {
4461 context->recover();
4462 (yyval.interm.intermTypedNode) = 0;
4463 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004464 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004465 break;
4466
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004467 case 189:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004468
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004469 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004470 break;
4471
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004472 case 190:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004473
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004474 {
4475 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004476 (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 +00004477 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004478 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004479 break;
4480
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004481 case 191:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004482
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004483 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004484 break;
4485
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004486 case 192:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004487
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004488 {
4489 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4490 context->recover();
4491
alokp@chromium.org52813552010-11-16 18:36:09 +00004492 (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 +00004493 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004494 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004495 break;
4496
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004497 case 193:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004498
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004499 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004500 break;
4501
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004502 case 194:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004503
4504 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004505 context->symbolTable.pop();
4506 (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);
4507 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004508 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004509 break;
4510
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004511 case 195:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004512
4513 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004514 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004515 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004516 break;
4517
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004518 case 196:
zmo@google.com09c323a2011-08-12 18:22:25 +00004519
4520 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004521 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004522 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004523 break;
4524
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004525 case 197:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004526
4527 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004528 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004529 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004530 break;
4531
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004532 case 198:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004533
4534 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004535 (yyval.interm.intermTypedNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004536 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004537 break;
4538
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004539 case 199:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004540
4541 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004542 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4543 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004544 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004545 break;
4546
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004547 case 200:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004548
4549 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004550 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4551 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004552 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004553 break;
4554
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004555 case 201:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004556
4557 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004558 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004559 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004560 context->recover();
4561 }
4562 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004563 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004564 break;
4565
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004566 case 202:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004567
4568 {
4569 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004570 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004571 context->recover();
4572 }
4573 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004574 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004575 break;
4576
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004577 case 203:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004578
4579 {
4580 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4581 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004582 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004583 context->recover();
4584 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004585 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004586 break;
4587
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004588 case 204:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004589
4590 {
4591 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4592 context->functionReturnsValue = true;
4593 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004594 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004595 context->recover();
4596 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004597 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004598 context->recover();
4599 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004600 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004601 break;
4602
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004603 case 205:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004604
4605 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004606 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4607 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004608 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004609 break;
4610
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004611 case 206:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004612
4613 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004614 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004615 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004616 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004617 break;
4618
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004619 case 207:
zmo@google.com09c323a2011-08-12 18:22:25 +00004620
4621 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004622 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4623 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004624 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004625 break;
4626
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004627 case 208:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004628
4629 {
4630 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004631 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004632 break;
4633
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004634 case 209:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004635
4636 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004637 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004638 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004639 break;
4640
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004641 case 210:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004642
4643 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004644 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004645
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004646 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004647
4648 if (builtIn)
4649 {
4650 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4651 context->recover();
4652 }
4653
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004654 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004655 //
4656 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4657 // as it would have just been put in the symbol table. Otherwise, we're looking up
4658 // an earlier occurance.
4659 //
4660 if (prevDec->isDefined()) {
4661 //
4662 // Then this function already has a body.
4663 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004664 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004665 context->recover();
4666 }
4667 prevDec->setDefined();
4668
4669 //
4670 // Raise error message if main function takes any parameters or return anything other than void
4671 //
4672 if (function->getName() == "main") {
4673 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004674 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 +00004675 context->recover();
4676 }
4677 if (function->getReturnType().getBasicType() != EbtVoid) {
4678 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4679 context->recover();
4680 }
4681 }
4682
4683 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004684 // Remember the return type for later checking for RETURN statements.
4685 //
4686 context->currentFunctionType = &(prevDec->getReturnType());
4687 context->functionReturnsValue = false;
4688
4689 //
4690 // Insert parameters into the symbol table.
4691 // If the parameter has no name, it's not an error, just don't insert it
4692 // (could be used for unused args).
4693 //
4694 // Also, accumulate the list of parameters into the HIL, so lower level code
4695 // knows where to find parameters.
4696 //
4697 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004698 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004699 const TParameter& param = function->getParam(i);
4700 if (param.name != 0) {
4701 TVariable *variable = new TVariable(param.name, *param.type);
4702 //
4703 // Insert the parameters with name in the symbol table.
4704 //
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004705 if (! context->symbolTable.declare(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004706 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004707 context->recover();
4708 delete variable;
4709 }
4710
4711 //
4712 // Add the parameter to the HIL
4713 //
4714 paramNodes = context->intermediate.growAggregate(
4715 paramNodes,
4716 context->intermediate.addSymbol(variable->getUniqueId(),
4717 variable->getName(),
4718 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4719 (yyvsp[(1) - (1)].interm).line);
4720 } else {
4721 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4722 }
4723 }
4724 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4725 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4726 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004727 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004728 break;
4729
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004730 case 211:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004731
4732 {
4733 //?? Check that all paths return a value if return type != void ?
4734 // May be best done as post process phase on intermediate code
4735 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4736 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4737 context->recover();
4738 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004739
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004740 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4741 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4742 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4743 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4744
4745 // store the pragma information for debug and optimize and other vendor specific
4746 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004747 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4748 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004749
4750 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4751 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004752
4753 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004754 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004755 break;
4756
4757
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004758
4759 default: break;
4760 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004761 /* User semantic actions sometimes alter yychar, and that requires
4762 that yytoken be updated with the new translation. We take the
4763 approach of translating immediately before every use of yytoken.
4764 One alternative is translating here after every semantic action,
4765 but that translation would be missed if the semantic action invokes
4766 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4767 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4768 incorrect destructor might then be invoked immediately. In the
4769 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4770 to an incorrect destructor call or verbose syntax error message
4771 before the lookahead is translated. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004772 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4773
4774 YYPOPSTACK (yylen);
4775 yylen = 0;
4776 YY_STACK_PRINT (yyss, yyssp);
4777
4778 *++yyvsp = yyval;
4779
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004780 /* Now `shift' the result of the reduction. Determine what state
4781 that goes to, based on the state we popped back to and the rule
4782 number reduced by. */
4783
4784 yyn = yyr1[yyn];
4785
4786 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4787 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4788 yystate = yytable[yystate];
4789 else
4790 yystate = yydefgoto[yyn - YYNTOKENS];
4791
4792 goto yynewstate;
4793
4794
4795/*------------------------------------.
4796| yyerrlab -- here on detecting error |
4797`------------------------------------*/
4798yyerrlab:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004799 /* Make sure we have latest lookahead translation. See comments at
4800 user semantic actions for why this is necessary. */
4801 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4802
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004803 /* If not already recovering from an error, report this error. */
4804 if (!yyerrstatus)
4805 {
4806 ++yynerrs;
4807#if ! YYERROR_VERBOSE
4808 yyerror (context, YY_("syntax error"));
4809#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004810# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4811 yyssp, yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004812 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004813 char const *yymsgp = YY_("syntax error");
4814 int yysyntax_error_status;
4815 yysyntax_error_status = YYSYNTAX_ERROR;
4816 if (yysyntax_error_status == 0)
4817 yymsgp = yymsg;
4818 else if (yysyntax_error_status == 1)
4819 {
4820 if (yymsg != yymsgbuf)
4821 YYSTACK_FREE (yymsg);
4822 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4823 if (!yymsg)
4824 {
4825 yymsg = yymsgbuf;
4826 yymsg_alloc = sizeof yymsgbuf;
4827 yysyntax_error_status = 2;
4828 }
4829 else
4830 {
4831 yysyntax_error_status = YYSYNTAX_ERROR;
4832 yymsgp = yymsg;
4833 }
4834 }
4835 yyerror (context, yymsgp);
4836 if (yysyntax_error_status == 2)
4837 goto yyexhaustedlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004838 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004839# undef YYSYNTAX_ERROR
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004840#endif
4841 }
4842
4843
4844
4845 if (yyerrstatus == 3)
4846 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004847 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004848 error, discard it. */
4849
4850 if (yychar <= YYEOF)
4851 {
4852 /* Return failure if at end of input. */
4853 if (yychar == YYEOF)
4854 YYABORT;
4855 }
4856 else
4857 {
4858 yydestruct ("Error: discarding",
4859 yytoken, &yylval, context);
4860 yychar = YYEMPTY;
4861 }
4862 }
4863
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004864 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004865 token. */
4866 goto yyerrlab1;
4867
4868
4869/*---------------------------------------------------.
4870| yyerrorlab -- error raised explicitly by YYERROR. |
4871`---------------------------------------------------*/
4872yyerrorlab:
4873
4874 /* Pacify compilers like GCC when the user code never invokes
4875 YYERROR and the label yyerrorlab therefore never appears in user
4876 code. */
4877 if (/*CONSTCOND*/ 0)
4878 goto yyerrorlab;
4879
4880 /* Do not reclaim the symbols of the rule which action triggered
4881 this YYERROR. */
4882 YYPOPSTACK (yylen);
4883 yylen = 0;
4884 YY_STACK_PRINT (yyss, yyssp);
4885 yystate = *yyssp;
4886 goto yyerrlab1;
4887
4888
4889/*-------------------------------------------------------------.
4890| yyerrlab1 -- common code for both syntax error and YYERROR. |
4891`-------------------------------------------------------------*/
4892yyerrlab1:
4893 yyerrstatus = 3; /* Each real token shifted decrements this. */
4894
4895 for (;;)
4896 {
4897 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004898 if (!yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004899 {
4900 yyn += YYTERROR;
4901 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4902 {
4903 yyn = yytable[yyn];
4904 if (0 < yyn)
4905 break;
4906 }
4907 }
4908
4909 /* Pop the current state because it cannot handle the error token. */
4910 if (yyssp == yyss)
4911 YYABORT;
4912
4913
4914 yydestruct ("Error: popping",
4915 yystos[yystate], yyvsp, context);
4916 YYPOPSTACK (1);
4917 yystate = *yyssp;
4918 YY_STACK_PRINT (yyss, yyssp);
4919 }
4920
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004921 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004922 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004923 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004924
4925
4926 /* Shift the error token. */
4927 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4928
4929 yystate = yyn;
4930 goto yynewstate;
4931
4932
4933/*-------------------------------------.
4934| yyacceptlab -- YYACCEPT comes here. |
4935`-------------------------------------*/
4936yyacceptlab:
4937 yyresult = 0;
4938 goto yyreturn;
4939
4940/*-----------------------------------.
4941| yyabortlab -- YYABORT comes here. |
4942`-----------------------------------*/
4943yyabortlab:
4944 yyresult = 1;
4945 goto yyreturn;
4946
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004947#if !defined yyoverflow || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004948/*-------------------------------------------------.
4949| yyexhaustedlab -- memory exhaustion comes here. |
4950`-------------------------------------------------*/
4951yyexhaustedlab:
4952 yyerror (context, YY_("memory exhausted"));
4953 yyresult = 2;
4954 /* Fall through. */
4955#endif
4956
4957yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004958 if (yychar != YYEMPTY)
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004959 {
4960 /* Make sure we have latest lookahead translation. See comments at
4961 user semantic actions for why this is necessary. */
4962 yytoken = YYTRANSLATE (yychar);
4963 yydestruct ("Cleanup: discarding lookahead",
4964 yytoken, &yylval, context);
4965 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004966 /* Do not reclaim the symbols of the rule which action triggered
4967 this YYABORT or YYACCEPT. */
4968 YYPOPSTACK (yylen);
4969 YY_STACK_PRINT (yyss, yyssp);
4970 while (yyssp != yyss)
4971 {
4972 yydestruct ("Cleanup: popping",
4973 yystos[*yyssp], yyvsp, context);
4974 YYPOPSTACK (1);
4975 }
4976#ifndef yyoverflow
4977 if (yyss != yyssa)
4978 YYSTACK_FREE (yyss);
4979#endif
4980#if YYERROR_VERBOSE
4981 if (yymsg != yymsgbuf)
4982 YYSTACK_FREE (yymsg);
4983#endif
4984 /* Make sure YYID is used. */
4985 return YYID (yyresult);
4986}
4987
4988
4989
4990
4991
4992int glslang_parse(TParseContext* context) {
4993 return yyparse(context);
4994}