blob: 4fff0b37aa5f1e793bb8aebe5189d2e6f86eccb1 [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,
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +0000717 257, 260, 263, 273, 286, 294, 394, 397, 405, 409,
718 416, 420, 427, 433, 442, 450, 505, 512, 522, 525,
719 535, 545, 566, 567, 568, 573, 574, 583, 595, 596,
720 604, 615, 619, 620, 630, 640, 650, 663, 664, 674,
721 687, 691, 695, 699, 700, 713, 714, 727, 728, 741,
722 742, 759, 760, 773, 774, 775, 776, 777, 781, 784,
723 795, 803, 830, 835, 849, 887, 890, 897, 905, 926,
724 947, 958, 987, 992, 1002, 1007, 1017, 1020, 1023, 1026,
725 1032, 1039, 1042, 1064, 1082, 1106, 1129, 1133, 1151, 1159,
726 1191, 1211, 1300, 1309, 1332, 1336, 1343, 1349, 1356, 1365,
727 1374, 1377, 1413, 1423, 1427, 1432, 1437, 1442, 1447, 1456,
728 1466, 1473, 1476, 1479, 1485, 1488, 1503, 1507, 1511, 1515,
729 1524, 1529, 1534, 1539, 1544, 1549, 1554, 1559, 1564, 1569,
730 1575, 1581, 1587, 1592, 1597, 1606, 1615, 1620, 1633, 1633,
731 1636, 1636, 1642, 1645, 1660, 1666, 1670, 1676, 1684, 1700,
732 1704, 1708, 1709, 1715, 1716, 1717, 1718, 1719, 1723, 1724,
733 1724, 1724, 1734, 1735, 1739, 1739, 1740, 1740, 1745, 1748,
734 1758, 1761, 1767, 1768, 1772, 1780, 1784, 1794, 1799, 1816,
735 1816, 1821, 1821, 1828, 1828, 1836, 1839, 1845, 1848, 1854,
736 1858, 1865, 1872, 1879, 1886, 1897, 1906, 1910, 1917, 1920,
737 1926, 1926
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 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002255 (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002256 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002257 break;
2258
2259 case 10:
2260
2261 {
2262 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002263 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002264 break;
2265
2266 case 11:
2267
2268 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002269 (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002270 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002271 break;
2272
2273 case 12:
2274
2275 {
2276 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2277 context->recover();
2278 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2279 if ((yyval.interm.intermTypedNode) == 0) {
2280 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2281 context->recover();
2282 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2283 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002284 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002285 break;
2286
2287 case 13:
2288
2289 {
2290 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2291 context->recover();
2292 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2293 if ((yyval.interm.intermTypedNode) == 0) {
2294 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2295 context->recover();
2296 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2297 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002298 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002299 break;
2300
2301 case 14:
2302
2303 {
2304 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2305 context->recover();
2306 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002307 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002308 break;
2309
2310 case 15:
2311
2312 {
2313 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2314 TOperator op = fnCall->getBuiltInOp();
2315
2316 if (op != EOpNull)
2317 {
2318 //
2319 // Then this should be a constructor.
2320 // Don't go through the symbol table for constructors.
2321 // Their parameters will be verified algorithmically.
2322 //
2323 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2324 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2325 (yyval.interm.intermTypedNode) = 0;
2326 } else {
2327 //
2328 // It's a constructor, of type 'type'.
2329 //
2330 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2331 }
2332
2333 if ((yyval.interm.intermTypedNode) == 0) {
2334 context->recover();
2335 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2336 }
2337 (yyval.interm.intermTypedNode)->setType(type);
2338 } else {
2339 //
2340 // Not a constructor. Find it in the symbol table.
2341 //
2342 const TFunction* fnCandidate;
2343 bool builtIn;
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00002344 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, context->shaderVersion, &builtIn);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002345 if (fnCandidate) {
2346 //
2347 // A declared function.
2348 //
2349 if (builtIn && !fnCandidate->getExtension().empty() &&
2350 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2351 context->recover();
2352 }
2353 op = fnCandidate->getBuiltInOp();
2354 if (builtIn && op != EOpNull) {
2355 //
2356 // A function call mapped to a built-in operation.
2357 //
2358 if (fnCandidate->getParamCount() == 1) {
2359 //
2360 // Treat it like a built-in unary operator.
2361 //
2362 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2363 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002364 std::stringstream extraInfoStream;
2365 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2366 std::string extraInfo = extraInfoStream.str();
2367 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002368 YYERROR;
2369 }
2370 } else {
2371 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2372 }
2373 } else {
2374 // This is a real function call
2375
2376 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2377 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2378
2379 // this is how we know whether the given function is a builtIn function or a user defined function
2380 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2381 // if builtIn == true, it's definitely a builtIn function with EOpNull
2382 if (!builtIn)
2383 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2384 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2385
2386 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002387 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002388 qual = fnCandidate->getParam(i).type->getQualifier();
2389 if (qual == EvqOut || qual == EvqInOut) {
2390 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002391 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 +00002392 context->recover();
2393 }
2394 }
2395 }
2396 }
2397 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2398 } else {
2399 // error message was put out by PaFindFunction()
2400 // Put on a dummy node for error recovery
2401 ConstantUnion *unionArray = new ConstantUnion[1];
2402 unionArray->setFConst(0.0f);
2403 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2404 context->recover();
2405 }
2406 }
2407 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002408 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002409 break;
2410
2411 case 16:
2412
2413 {
2414 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002415 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002416 break;
2417
2418 case 17:
2419
2420 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002421 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002422 context->recover();
2423 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002424 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002425 break;
2426
2427 case 18:
2428
2429 {
2430 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2431 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002432 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002433 break;
2434
2435 case 19:
2436
2437 {
2438 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2439 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002440 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002441 break;
2442
2443 case 20:
2444
2445 {
2446 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2447 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002448 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002449 break;
2450
2451 case 21:
2452
2453 {
2454 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2455 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002456 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002457 break;
2458
2459 case 22:
2460
2461 {
2462 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2463 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2464 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2465 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002466 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002467 break;
2468
2469 case 23:
2470
2471 {
2472 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2473 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2474 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2475 (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 +00002476 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002477 break;
2478
2479 case 24:
2480
2481 {
2482 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002483 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002484 break;
2485
2486 case 25:
2487
2488 {
2489 //
2490 // Constructor
2491 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002492 TOperator op = EOpNull;
2493 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2494 op = EOpConstructStruct;
2495 } else {
2496 switch ((yyvsp[(1) - (1)].interm.type).type) {
2497 case EbtFloat:
2498 if ((yyvsp[(1) - (1)].interm.type).matrix) {
2499 switch((yyvsp[(1) - (1)].interm.type).size) {
2500 case 2: op = EOpConstructMat2; break;
2501 case 3: op = EOpConstructMat3; break;
2502 case 4: op = EOpConstructMat4; break;
2503 }
2504 } else {
2505 switch((yyvsp[(1) - (1)].interm.type).size) {
2506 case 1: op = EOpConstructFloat; break;
2507 case 2: op = EOpConstructVec2; break;
2508 case 3: op = EOpConstructVec3; break;
2509 case 4: op = EOpConstructVec4; break;
2510 }
2511 }
2512 break;
2513 case EbtInt:
2514 switch((yyvsp[(1) - (1)].interm.type).size) {
2515 case 1: op = EOpConstructInt; break;
2516 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2517 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2518 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2519 }
2520 break;
2521 case EbtBool:
2522 switch((yyvsp[(1) - (1)].interm.type).size) {
2523 case 1: op = EOpConstructBool; break;
2524 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2525 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2526 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2527 }
2528 break;
2529 default: break;
2530 }
2531 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002532 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 +00002533 context->recover();
2534 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2535 op = EOpConstructFloat;
2536 }
2537 }
2538 TString tempString;
2539 TType type((yyvsp[(1) - (1)].interm.type));
2540 TFunction *function = new TFunction(&tempString, type, op);
2541 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002542 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002543 break;
2544
2545 case 26:
2546
2547 {
2548 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2549 context->recover();
2550 TType type(EbtVoid, EbpUndefined);
2551 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2552 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002553 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002554 break;
2555
2556 case 27:
2557
2558 {
2559 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2560 context->recover();
2561 TType type(EbtVoid, EbpUndefined);
2562 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2563 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002564 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002565 break;
2566
2567 case 28:
2568
2569 {
2570 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002571 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002572 break;
2573
2574 case 29:
2575
2576 {
2577 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2578 context->recover();
2579 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2580 if ((yyval.interm.intermTypedNode) == 0) {
2581 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2582 context->recover();
2583 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2584 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002585 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002586 break;
2587
2588 case 30:
2589
2590 {
2591 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2592 context->recover();
2593 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2594 if ((yyval.interm.intermTypedNode) == 0) {
2595 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2596 context->recover();
2597 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2598 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002599 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002600 break;
2601
2602 case 31:
2603
2604 {
2605 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2606 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2607 if ((yyval.interm.intermTypedNode) == 0) {
2608 const char* errorOp = "";
2609 switch((yyvsp[(1) - (2)].interm).op) {
2610 case EOpNegative: errorOp = "-"; break;
2611 case EOpLogicalNot: errorOp = "!"; break;
2612 default: break;
2613 }
2614 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2615 context->recover();
2616 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2617 }
2618 } else
2619 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002620 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002621 break;
2622
2623 case 32:
2624
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002625 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002626 break;
2627
2628 case 33:
2629
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002630 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002631 break;
2632
2633 case 34:
2634
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002635 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002636 break;
2637
2638 case 35:
2639
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002640 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002641 break;
2642
2643 case 36:
2644
2645 {
2646 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2647 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2648 if ((yyval.interm.intermTypedNode) == 0) {
2649 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2650 context->recover();
2651 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2652 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002653 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002654 break;
2655
2656 case 37:
2657
2658 {
2659 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2660 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2661 if ((yyval.interm.intermTypedNode) == 0) {
2662 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2663 context->recover();
2664 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2665 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002666 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002667 break;
2668
2669 case 38:
2670
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002671 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002672 break;
2673
2674 case 39:
2675
2676 {
2677 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2678 if ((yyval.interm.intermTypedNode) == 0) {
2679 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2680 context->recover();
2681 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2682 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002683 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002684 break;
2685
2686 case 40:
2687
2688 {
2689 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2690 if ((yyval.interm.intermTypedNode) == 0) {
2691 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2692 context->recover();
2693 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2694 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002695 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002696 break;
2697
2698 case 41:
2699
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002700 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002701 break;
2702
2703 case 42:
2704
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002705 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002706 break;
2707
2708 case 43:
2709
2710 {
2711 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2712 if ((yyval.interm.intermTypedNode) == 0) {
2713 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2714 context->recover();
2715 ConstantUnion *unionArray = new ConstantUnion[1];
2716 unionArray->setBConst(false);
2717 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2718 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002719 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002720 break;
2721
2722 case 44:
2723
2724 {
2725 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2726 if ((yyval.interm.intermTypedNode) == 0) {
2727 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2728 context->recover();
2729 ConstantUnion *unionArray = new ConstantUnion[1];
2730 unionArray->setBConst(false);
2731 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2732 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002733 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002734 break;
2735
2736 case 45:
2737
2738 {
2739 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2740 if ((yyval.interm.intermTypedNode) == 0) {
2741 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2742 context->recover();
2743 ConstantUnion *unionArray = new ConstantUnion[1];
2744 unionArray->setBConst(false);
2745 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2746 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002747 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002748 break;
2749
2750 case 46:
2751
2752 {
2753 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2754 if ((yyval.interm.intermTypedNode) == 0) {
2755 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2756 context->recover();
2757 ConstantUnion *unionArray = new ConstantUnion[1];
2758 unionArray->setBConst(false);
2759 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2760 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002761 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002762 break;
2763
2764 case 47:
2765
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002766 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002767 break;
2768
2769 case 48:
2770
2771 {
2772 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2773 if ((yyval.interm.intermTypedNode) == 0) {
2774 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2775 context->recover();
2776 ConstantUnion *unionArray = new ConstantUnion[1];
2777 unionArray->setBConst(false);
2778 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2779 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002780 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002781 break;
2782
2783 case 49:
2784
2785 {
2786 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2787 if ((yyval.interm.intermTypedNode) == 0) {
2788 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2789 context->recover();
2790 ConstantUnion *unionArray = new ConstantUnion[1];
2791 unionArray->setBConst(false);
2792 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2793 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002794 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002795 break;
2796
2797 case 50:
2798
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002799 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002800 break;
2801
2802 case 51:
2803
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002804 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002805 break;
2806
2807 case 52:
2808
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002809 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002810 break;
2811
2812 case 53:
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 54:
2818
2819 {
2820 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2821 if ((yyval.interm.intermTypedNode) == 0) {
2822 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2823 context->recover();
2824 ConstantUnion *unionArray = new ConstantUnion[1];
2825 unionArray->setBConst(false);
2826 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2827 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002828 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002829 break;
2830
2831 case 55:
2832
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002833 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002834 break;
2835
2836 case 56:
2837
2838 {
2839 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2840 if ((yyval.interm.intermTypedNode) == 0) {
2841 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2842 context->recover();
2843 ConstantUnion *unionArray = new ConstantUnion[1];
2844 unionArray->setBConst(false);
2845 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2846 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002847 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002848 break;
2849
2850 case 57:
2851
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002852 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002853 break;
2854
2855 case 58:
2856
2857 {
2858 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2859 if ((yyval.interm.intermTypedNode) == 0) {
2860 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2861 context->recover();
2862 ConstantUnion *unionArray = new ConstantUnion[1];
2863 unionArray->setBConst(false);
2864 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2865 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002866 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002867 break;
2868
2869 case 59:
2870
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002871 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002872 break;
2873
2874 case 60:
2875
2876 {
2877 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
2878 context->recover();
2879
2880 (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);
2881 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
2882 (yyval.interm.intermTypedNode) = 0;
2883
2884 if ((yyval.interm.intermTypedNode) == 0) {
2885 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
2886 context->recover();
2887 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
2888 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002889 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002890 break;
2891
2892 case 61:
2893
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002894 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002895 break;
2896
2897 case 62:
2898
2899 {
2900 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
2901 context->recover();
2902 (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);
2903 if ((yyval.interm.intermTypedNode) == 0) {
2904 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2905 context->recover();
2906 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2907 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002908 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002909 break;
2910
2911 case 63:
2912
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002913 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002914 break;
2915
2916 case 64:
2917
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002918 { 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 +00002919 break;
2920
2921 case 65:
2922
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002923 { 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 +00002924 break;
2925
2926 case 66:
2927
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002928 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002929 break;
2930
2931 case 67:
2932
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002933 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002934 break;
2935
2936 case 68:
2937
2938 {
2939 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002940 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002941 break;
2942
2943 case 69:
2944
2945 {
2946 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
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 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
2951 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002952 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002953 break;
2954
2955 case 70:
2956
2957 {
2958 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
2959 context->recover();
2960 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002961 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002962 break;
2963
2964 case 71:
2965
2966 {
2967 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
2968
2969 TIntermAggregate *prototype = new TIntermAggregate;
2970 prototype->setType(function.getReturnType());
2971 prototype->setName(function.getName());
2972
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002973 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002974 {
2975 const TParameter &param = function.getParam(i);
2976 if (param.name != 0)
2977 {
2978 TVariable *variable = new TVariable(param.name, *param.type);
2979
2980 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
2981 }
2982 else
2983 {
2984 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
2985 }
2986 }
2987
2988 prototype->setOp(EOpPrototype);
2989 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00002990
2991 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002992 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002993 break;
2994
2995 case 72:
2996
2997 {
2998 if ((yyvsp[(1) - (2)].interm).intermAggregate)
2999 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3000 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003001 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003002 break;
3003
3004 case 73:
3005
3006 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003007 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3008 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3009 context->recover();
3010 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003011 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3012 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3013 context->recover();
3014 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003015 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003016 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003017 break;
3018
3019 case 74:
3020
3021 {
3022 //
3023 // Multiple declarations of the same function are allowed.
3024 //
3025 // If this is a definition, the definition production code will check for redefinitions
3026 // (we don't know at this point if it's a definition or not).
3027 //
3028 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3029 //
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00003030 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003031 if (prevDec) {
3032 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003033 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 +00003034 context->recover();
3035 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003036 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003037 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003038 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 +00003039 context->recover();
3040 }
3041 }
3042 }
3043
3044 //
3045 // If this is a redeclaration, it could also be a definition,
3046 // in which case, we want to use the variable names from this one, and not the one that's
3047 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3048 //
3049 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3050 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3051
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003052 // We're at the inner scope level of the function's arguments and body statement.
3053 // Add the function prototype to the surrounding scope instead.
3054 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003055 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003056 break;
3057
3058 case 75:
3059
3060 {
3061 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003062 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003063 break;
3064
3065 case 76:
3066
3067 {
3068 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003069 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003070 break;
3071
3072 case 77:
3073
3074 {
3075 // Add the parameter
3076 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3077 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3078 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3079 else
3080 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003081 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003082 break;
3083
3084 case 78:
3085
3086 {
3087 //
3088 // Only first parameter of one-parameter functions can be void
3089 // The check for named parameters not being void is done in parameter_declarator
3090 //
3091 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3092 //
3093 // This parameter > first is void
3094 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003095 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003096 context->recover();
3097 delete (yyvsp[(3) - (3)].interm).param.type;
3098 } else {
3099 // Add the parameter
3100 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3101 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3102 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003103 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003104 break;
3105
3106 case 79:
3107
3108 {
3109 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003110 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 +00003111 context->recover();
3112 }
3113 // make sure a sampler is not involved as well...
3114 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3115 context->recover();
3116
3117 // Add the function as a prototype after parsing it (we do not support recursion)
3118 TFunction *function;
3119 TType type((yyvsp[(1) - (3)].interm.type));
3120 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3121 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003122
3123 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003124 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003125 break;
3126
3127 case 80:
3128
3129 {
3130 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003131 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 +00003132 context->recover();
3133 }
3134 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3135 context->recover();
3136 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3137 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3138 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003139 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003140 break;
3141
3142 case 81:
3143
3144 {
3145 // Check that we can make an array out of this type
3146 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3147 context->recover();
3148
3149 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3150 context->recover();
3151
3152 int size;
3153 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3154 context->recover();
3155 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3156
3157 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3158 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3159 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3160 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003161 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003162 break;
3163
3164 case 82:
3165
3166 {
3167 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003168 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 +00003169 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003170 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003171 break;
3172
3173 case 83:
3174
3175 {
3176 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3177 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3178 context->recover();
3179 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3180 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003181 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003182 break;
3183
3184 case 84:
3185
3186 {
3187 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003188 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 +00003189 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003190 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003191 break;
3192
3193 case 85:
3194
3195 {
3196 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3197 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3198 context->recover();
3199 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3200 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003201 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003202 break;
3203
3204 case 86:
3205
3206 {
3207 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003208 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003209 break;
3210
3211 case 87:
3212
3213 {
3214 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003215 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003216 break;
3217
3218 case 88:
3219
3220 {
3221 (yyval.interm.qualifier) = EvqOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003222 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003223 break;
3224
3225 case 89:
3226
3227 {
3228 (yyval.interm.qualifier) = EvqInOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003229 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003230 break;
3231
3232 case 90:
3233
3234 {
3235 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3236 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003237 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003238 break;
3239
3240 case 91:
3241
3242 {
3243 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003244 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003245 break;
3246
3247 case 92:
3248
3249 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003250 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3251 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003252 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 +00003253 context->recover();
3254 }
3255
zmo@google.comfd747b82011-04-23 01:30:07 +00003256 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3257 (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 +00003258
3259 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3260 context->recover();
3261
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003262 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 +00003263 context->recover();
3264
zmo@google.comfd747b82011-04-23 01:30:07 +00003265 TVariable* variable = 0;
3266 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 +00003267 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003268 if (symbol && variable)
3269 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003270 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003271 break;
3272
3273 case 93:
3274
3275 {
3276 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3277 context->recover();
3278
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003279 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 +00003280 context->recover();
3281
3282 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3283
3284 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))
3285 context->recover();
3286 else {
3287 (yyvsp[(1) - (5)].interm).type.setArray(true);
3288 TVariable* variable;
3289 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3290 context->recover();
3291 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003292 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003293 break;
3294
3295 case 94:
3296
3297 {
3298 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3299 context->recover();
3300
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003301 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 +00003302 context->recover();
3303
3304 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3305
3306 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))
3307 context->recover();
3308 else {
3309 int size;
3310 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3311 context->recover();
3312 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003313 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003314 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3315 context->recover();
3316 TType type = TType((yyvsp[(1) - (6)].interm).type);
3317 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003318 (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 +00003319 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003320 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003321 break;
3322
3323 case 95:
3324
3325 {
3326 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3327 context->recover();
3328
3329 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3330
3331 TIntermNode* intermNode;
3332 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3333 //
3334 // build the intermediate representation
3335 //
3336 if (intermNode)
3337 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3338 else
3339 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3340 } else {
3341 context->recover();
3342 (yyval.interm).intermAggregate = 0;
3343 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003344 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003345 break;
3346
3347 case 96:
3348
3349 {
3350 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3351 (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 +00003352 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003353 break;
3354
3355 case 97:
3356
3357 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003358 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3359 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003360
3361 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3362 context->recover();
3363
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003364 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 +00003365 context->recover();
3366
3367 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3368
zmo@google.comfd747b82011-04-23 01:30:07 +00003369 TVariable* variable = 0;
3370 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 +00003371 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003372 if (variable && symbol)
3373 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003374 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003375 break;
3376
3377 case 98:
3378
3379 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003380 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 +00003381 context->recover();
3382
zmo@google.comfd747b82011-04-23 01:30:07 +00003383 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3384 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003385 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003386 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003387 break;
3388
3389 case 99:
3390
3391 {
3392 TType type = TType((yyvsp[(1) - (5)].interm.type));
3393 int size;
3394 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3395 context->recover();
3396 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003397 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3398 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003399
3400 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3401 context->recover();
3402
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003403 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 +00003404 context->recover();
3405
3406 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3407
3408 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)))
3409 context->recover();
3410 else {
3411 int size;
3412 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3413 context->recover();
3414
3415 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003416 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003417 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3418 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003419 if (variable && symbol)
3420 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003421 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003422 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003423 break;
3424
3425 case 100:
3426
3427 {
3428 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3429 context->recover();
3430
3431 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3432
3433 TIntermNode* intermNode;
3434 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3435 //
3436 // Build intermediate representation
3437 //
3438 if(intermNode)
3439 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3440 else
3441 (yyval.interm).intermAggregate = 0;
3442 } else {
3443 context->recover();
3444 (yyval.interm).intermAggregate = 0;
3445 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003446 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003447 break;
3448
3449 case 101:
3450
3451 {
3452 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003453 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3454 context->recover();
3455 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3456 if (!(yyvsp[(2) - (2)].lex).symbol)
3457 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003458 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 +00003459 context->recover();
3460
3461 (yyval.interm).intermAggregate = 0;
3462 }
3463 else
3464 {
3465 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3466 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3467 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003468 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003469 break;
3470
3471 case 102:
3472
3473 {
3474 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3475
3476 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003477 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003478 context->recover();
3479 (yyvsp[(1) - (1)].interm.type).setArray(false);
3480 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003481 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003482 break;
3483
3484 case 103:
3485
3486 {
3487 if ((yyvsp[(2) - (2)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003488 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003489 context->recover();
3490 (yyvsp[(2) - (2)].interm.type).setArray(false);
3491 }
3492
3493 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3494 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003495 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 +00003496 context->recover();
3497 }
3498 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3499 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003500 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 +00003501 context->recover();
3502 }
3503 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3504 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003505 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003506 break;
3507
3508 case 104:
3509
3510 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003511 (yyval.interm.type).qualifier = EvqSmooth;
3512 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003513 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003514 break;
3515
3516 case 105:
3517
3518 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003519 (yyval.interm.type).qualifier = EvqFlat;
3520 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003521 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003522 break;
3523
3524 case 106:
3525
3526 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003527 (yyval.interm.qualifier) = EvqConst;
3528 }
3529 break;
3530
3531 case 107:
3532
3533 {
3534 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3535 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3536 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3537 context->recover();
3538 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3539 }
3540 break;
3541
3542 case 108:
3543
3544 {
3545 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003546 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3547 context->recover();
3548 if (context->shaderType == SH_VERTEX_SHADER)
3549 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3550 else
3551 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003552 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003553 break;
3554
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003555 case 109:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003556
3557 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003558 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003559 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3560 context->recover();
3561 if (context->shaderType == SH_VERTEX_SHADER)
3562 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3563 else
3564 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003565 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003566 break;
3567
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003568 case 110:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003569
3570 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003571 (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 +00003572 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003573 break;
3574
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003575 case 111:
3576
3577 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003578 if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothIn) {
3579 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3580 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothIn, (yyvsp[(2) - (2)].interm.type).line);
3581 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3582 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3583 else UNREACHABLE();
3584 }
3585 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidIn) {
3586 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3587 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidIn, (yyvsp[(2) - (2)].interm.type).line);
3588 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3589 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3590 else UNREACHABLE();
3591 }
3592 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothOut) {
3593 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3594 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothOut, (yyvsp[(2) - (2)].interm.type).line);
3595 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3596 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3597 else UNREACHABLE();
3598 }
3599 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidOut) {
3600 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3601 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidOut, (yyvsp[(2) - (2)].interm.type).line);
3602 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3603 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3604 else UNREACHABLE();
3605 }
3606 else {
3607 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));
3608 context->recover();
3609
3610 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
3611 }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003612 }
3613 break;
3614
3615 case 112:
3616
3617 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003618 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));
3619 context->recover();
3620
3621 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3622 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003623 }
3624 break;
3625
3626 case 113:
3627
3628 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003629 (yyval.interm.type).qualifier = EvqConst;
3630 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003631 }
3632 break;
3633
3634 case 114:
3635
3636 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003637 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
3638 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqSmoothIn : EvqAttribute;
3639 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003640 }
3641 break;
3642
3643 case 115:
3644
3645 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003646 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
3647 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqSmoothOut;
3648 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3649 }
3650 break;
3651
3652 case 116:
3653
3654 {
3655 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line);
3656 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqAttribute;
3657 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3658 }
3659 break;
3660
3661 case 117:
3662
3663 {
3664 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line);
3665 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqCentroidOut;
3666 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3667 }
3668 break;
3669
3670 case 118:
3671
3672 {
3673 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3674 context->recover();
3675 (yyval.interm.type).qualifier = EvqUniform;
3676 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3677 }
3678 break;
3679
3680 case 119:
3681
3682 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003683 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003684
3685 if ((yyval.interm.type).precision == EbpUndefined) {
3686 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3687 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3688 context->recover();
3689 }
3690 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003691 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003692 break;
3693
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003694 case 120:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003695
3696 {
3697 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3698 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003699 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003700 break;
3701
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003702 case 121:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003703
3704 {
3705 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003706 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003707 break;
3708
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003709 case 122:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003710
3711 {
3712 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003713 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003714 break;
3715
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003716 case 123:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003717
3718 {
3719 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003720 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003721 break;
3722
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003723 case 124:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003724
3725 {
3726 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003727 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003728 break;
3729
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003730 case 125:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003731
3732 {
3733 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3734
3735 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3736 context->recover();
3737 else {
3738 int size;
3739 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3740 context->recover();
3741 (yyval.interm.type).setArray(true, size);
3742 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003743 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003744 break;
3745
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003746 case 126:
3747
3748 {
3749 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003750 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003751 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003752 break;
3753
3754 case 127:
3755
3756 {
3757 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003758 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003759 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003760 break;
3761
3762 case 128:
3763
3764 {
3765 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003766 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003767 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003768 break;
3769
3770 case 129:
3771
3772 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003773 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3774 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003775 }
3776 break;
3777
3778 case 130:
3779
3780 {
3781 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003782 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3783 (yyval.interm.type).setAggregate(2);
3784 }
3785 break;
3786
3787 case 131:
3788
3789 {
3790 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3791 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3792 (yyval.interm.type).setAggregate(3);
3793 }
3794 break;
3795
3796 case 132:
3797
3798 {
3799 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3800 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3801 (yyval.interm.type).setAggregate(4);
3802 }
3803 break;
3804
3805 case 133:
3806
3807 {
3808 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3809 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3810 (yyval.interm.type).setAggregate(2);
3811 }
3812 break;
3813
3814 case 134:
3815
3816 {
3817 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003818 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3819 (yyval.interm.type).setAggregate(3);
3820 }
3821 break;
3822
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003823 case 135:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003824
3825 {
3826 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3827 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3828 (yyval.interm.type).setAggregate(4);
3829 }
3830 break;
3831
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003832 case 136:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003833
3834 {
3835 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3836 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3837 (yyval.interm.type).setAggregate(2);
3838 }
3839 break;
3840
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003841 case 137:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003842
3843 {
3844 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3845 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3846 (yyval.interm.type).setAggregate(3);
3847 }
3848 break;
3849
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003850 case 138:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003851
3852 {
3853 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3854 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3855 (yyval.interm.type).setAggregate(4);
3856 }
3857 break;
3858
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003859 case 139:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003860
3861 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003862 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
3863 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3864 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3865 (yyval.interm.type).setAggregate(2, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003866 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003867 break;
3868
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003869 case 140:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003870
3871 {
3872 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
3873 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3874 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3875 (yyval.interm.type).setAggregate(3, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003876 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003877 break;
3878
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003879 case 141:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003880
3881 {
3882 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
3883 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3884 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3885 (yyval.interm.type).setAggregate(4, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003886 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003887 break;
3888
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003889 case 142:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003890
3891 {
3892 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
3893 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3894 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003895 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003896 break;
3897
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003898 case 143:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003899
3900 {
3901 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
3902 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3903 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003904 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003905 break;
3906
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003907 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003908
3909 {
zmo@google.com09c323a2011-08-12 18:22:25 +00003910 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003911 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00003912 context->recover();
3913 }
3914 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
3915 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3916 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003917 }
zmo@google.com09c323a2011-08-12 18:22:25 +00003918 break;
3919
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003920 case 145:
zmo@google.com09c323a2011-08-12 18:22:25 +00003921
3922 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00003923 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003924 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00003925 context->recover();
3926 }
3927 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
3928 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3929 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003930 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003931 break;
3932
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003933 case 146:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003934
3935 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00003936 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
3937 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3938 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003939 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00003940 break;
3941
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003942 case 147:
kbr@chromium.org205fef32011-11-22 20:50:02 +00003943
3944 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003945 //
3946 // This is for user defined type names. The lexical phase looked up the
3947 // type.
3948 //
3949 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
3950 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3951 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
3952 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003953 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003954 break;
3955
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003956 case 148:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003957
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003958 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00003959 break;
3960
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003961 case 149:
kbr@chromium.org205fef32011-11-22 20:50:02 +00003962
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003963 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00003964 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (6)].lex).line, (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003965 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00003966 break;
3967
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003968 case 150:
kbr@chromium.org476541f2011-10-27 21:14:51 +00003969
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003970 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00003971 break;
3972
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003973 case 151:
kbr@chromium.org205fef32011-11-22 20:50:02 +00003974
kbr@chromium.org476541f2011-10-27 21:14:51 +00003975 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00003976 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (5)].lex).line, 0, "", (yyvsp[(4) - (5)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003977 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003978 break;
3979
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003980 case 152:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003981
3982 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00003983 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003984 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00003985 break;
3986
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003987 case 153:
kbr@chromium.org205fef32011-11-22 20:50:02 +00003988
3989 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003990 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
3991 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
3992 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
3993 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
3994 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());
3995 context->recover();
3996 }
3997 }
3998 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
3999 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004000 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004001 break;
4002
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004003 case 154:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004004
4005 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004006 (yyval.interm.typeList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004007 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004008 break;
4009
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004010 case 155:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004011
4012 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004013 (yyval.interm.typeList) = NewPoolTTypeList();
4014 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004015 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004016 break;
4017
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004018 case 156:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004019
4020 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004021 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004022 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004023 break;
4024
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004025 case 157:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004026
4027 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004028 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4029 context->recover();
4030
4031 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4032 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4033 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004034 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004035 break;
4036
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004037 case 158:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004038
4039 {
4040 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4041 context->recover();
4042
4043 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4044 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4045 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4046
4047 int size;
4048 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4049 context->recover();
4050 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004051 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004052 break;
4053
kbr@chromium.org476541f2011-10-27 21:14:51 +00004054 case 159:
4055
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004056 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004057 break;
4058
4059 case 160:
4060
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004061 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004062 break;
4063
4064 case 161:
4065
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004066 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004067 break;
4068
4069 case 162:
4070
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004071 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004072 break;
4073
4074 case 163:
4075
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004076 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004077 break;
4078
kbr@chromium.org476541f2011-10-27 21:14:51 +00004079 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004080
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004081 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004082 break;
4083
4084 case 165:
4085
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004086 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004087 break;
4088
4089 case 166:
4090
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004091 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004092 break;
4093
4094 case 167:
4095
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004096 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4097 break;
4098
4099 case 168:
4100
4101 { (yyval.interm.intermAggregate) = 0; }
4102 break;
4103
4104 case 169:
4105
4106 { context->symbolTable.push(); }
4107 break;
4108
4109 case 170:
4110
4111 { context->symbolTable.pop(); }
4112 break;
4113
4114 case 171:
4115
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004116 {
4117 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4118 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4119 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4120 }
4121 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4122 }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004123 break;
4124
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004125 case 172:
4126
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004127 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004128 break;
4129
4130 case 173:
4131
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004132 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004133 break;
4134
4135 case 174:
4136
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004137 { context->symbolTable.push(); }
4138 break;
4139
4140 case 175:
4141
4142 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4143 break;
4144
4145 case 176:
4146
4147 { context->symbolTable.push(); }
4148 break;
4149
4150 case 177:
4151
4152 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4153 break;
4154
4155 case 178:
4156
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004157 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004158 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004159 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004160 break;
4161
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004162 case 179:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004163
4164 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004165 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004166 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004167 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4168 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004169 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004170 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004171 break;
4172
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004173 case 180:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004174
4175 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004176 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004177 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004178 break;
4179
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004180 case 181:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004181
kbr@chromium.org205fef32011-11-22 20:50:02 +00004182 {
4183 (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 +00004184 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004185 break;
4186
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004187 case 182:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004188
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004189 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004190 break;
4191
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004192 case 183:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004193
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004194 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004195 break;
4196
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004197 case 184:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004198
4199 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004200 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4201 context->recover();
4202 (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 +00004203 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004204 break;
4205
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004206 case 185:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004207
4208 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004209 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4210 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004211 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004212 break;
4213
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004214 case 186:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004215
4216 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004217 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4218 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004219 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004220 break;
4221
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004222 case 187:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004223
4224 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004225 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4226 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4227 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004228 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004229 break;
4230
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004231 case 188:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004232
4233 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004234 TIntermNode* intermNode;
4235 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4236 context->recover();
4237 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4238 context->recover();
4239
4240 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4241 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4242 else {
4243 context->recover();
4244 (yyval.interm.intermTypedNode) = 0;
4245 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004246 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004247 break;
4248
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004249 case 189:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004250
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004251 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004252 break;
4253
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004254 case 190:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004255
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004256 {
4257 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004258 (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 +00004259 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004260 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004261 break;
4262
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004263 case 191:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004264
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004265 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004266 break;
4267
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004268 case 192:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004269
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004270 {
4271 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4272 context->recover();
4273
alokp@chromium.org52813552010-11-16 18:36:09 +00004274 (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 +00004275 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004276 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004277 break;
4278
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004279 case 193:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004280
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004281 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004282 break;
4283
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004284 case 194:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004285
4286 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004287 context->symbolTable.pop();
4288 (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);
4289 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004290 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004291 break;
4292
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004293 case 195:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004294
4295 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004296 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004297 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004298 break;
4299
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004300 case 196:
zmo@google.com09c323a2011-08-12 18:22:25 +00004301
4302 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004303 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004304 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004305 break;
4306
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004307 case 197:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004308
4309 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004310 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004311 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004312 break;
4313
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004314 case 198:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004315
4316 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004317 (yyval.interm.intermTypedNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004318 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004319 break;
4320
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004321 case 199:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004322
4323 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004324 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4325 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004326 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004327 break;
4328
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004329 case 200:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004330
4331 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004332 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4333 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004334 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004335 break;
4336
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004337 case 201:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004338
4339 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004340 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004341 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004342 context->recover();
4343 }
4344 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004345 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004346 break;
4347
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004348 case 202:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004349
4350 {
4351 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004352 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004353 context->recover();
4354 }
4355 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004356 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004357 break;
4358
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004359 case 203:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004360
4361 {
4362 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4363 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004364 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004365 context->recover();
4366 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004367 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004368 break;
4369
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004370 case 204:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004371
4372 {
4373 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4374 context->functionReturnsValue = true;
4375 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004376 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004377 context->recover();
4378 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004379 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004380 context->recover();
4381 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004382 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004383 break;
4384
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004385 case 205:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004386
4387 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004388 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4389 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004390 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004391 break;
4392
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004393 case 206:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004394
4395 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004396 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004397 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004398 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004399 break;
4400
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004401 case 207:
zmo@google.com09c323a2011-08-12 18:22:25 +00004402
4403 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004404 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4405 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004406 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004407 break;
4408
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004409 case 208:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004410
4411 {
4412 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004413 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004414 break;
4415
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004416 case 209:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004417
4418 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004419 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004420 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004421 break;
4422
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004423 case 210:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004424
4425 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004426 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004427
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004428 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004429
4430 if (builtIn)
4431 {
4432 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4433 context->recover();
4434 }
4435
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004436 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004437 //
4438 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4439 // as it would have just been put in the symbol table. Otherwise, we're looking up
4440 // an earlier occurance.
4441 //
4442 if (prevDec->isDefined()) {
4443 //
4444 // Then this function already has a body.
4445 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004446 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004447 context->recover();
4448 }
4449 prevDec->setDefined();
4450
4451 //
4452 // Raise error message if main function takes any parameters or return anything other than void
4453 //
4454 if (function->getName() == "main") {
4455 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004456 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 +00004457 context->recover();
4458 }
4459 if (function->getReturnType().getBasicType() != EbtVoid) {
4460 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4461 context->recover();
4462 }
4463 }
4464
4465 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004466 // Remember the return type for later checking for RETURN statements.
4467 //
4468 context->currentFunctionType = &(prevDec->getReturnType());
4469 context->functionReturnsValue = false;
4470
4471 //
4472 // Insert parameters into the symbol table.
4473 // If the parameter has no name, it's not an error, just don't insert it
4474 // (could be used for unused args).
4475 //
4476 // Also, accumulate the list of parameters into the HIL, so lower level code
4477 // knows where to find parameters.
4478 //
4479 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004480 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004481 const TParameter& param = function->getParam(i);
4482 if (param.name != 0) {
4483 TVariable *variable = new TVariable(param.name, *param.type);
4484 //
4485 // Insert the parameters with name in the symbol table.
4486 //
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004487 if (! context->symbolTable.declare(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004488 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004489 context->recover();
4490 delete variable;
4491 }
4492
4493 //
4494 // Add the parameter to the HIL
4495 //
4496 paramNodes = context->intermediate.growAggregate(
4497 paramNodes,
4498 context->intermediate.addSymbol(variable->getUniqueId(),
4499 variable->getName(),
4500 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4501 (yyvsp[(1) - (1)].interm).line);
4502 } else {
4503 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4504 }
4505 }
4506 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4507 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4508 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004509 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004510 break;
4511
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004512 case 211:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004513
4514 {
4515 //?? Check that all paths return a value if return type != void ?
4516 // May be best done as post process phase on intermediate code
4517 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4518 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4519 context->recover();
4520 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004521
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004522 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4523 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4524 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4525 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4526
4527 // store the pragma information for debug and optimize and other vendor specific
4528 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004529 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4530 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004531
4532 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4533 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004534
4535 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004536 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004537 break;
4538
4539
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004540
4541 default: break;
4542 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004543 /* User semantic actions sometimes alter yychar, and that requires
4544 that yytoken be updated with the new translation. We take the
4545 approach of translating immediately before every use of yytoken.
4546 One alternative is translating here after every semantic action,
4547 but that translation would be missed if the semantic action invokes
4548 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4549 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4550 incorrect destructor might then be invoked immediately. In the
4551 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4552 to an incorrect destructor call or verbose syntax error message
4553 before the lookahead is translated. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004554 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4555
4556 YYPOPSTACK (yylen);
4557 yylen = 0;
4558 YY_STACK_PRINT (yyss, yyssp);
4559
4560 *++yyvsp = yyval;
4561
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004562 /* Now `shift' the result of the reduction. Determine what state
4563 that goes to, based on the state we popped back to and the rule
4564 number reduced by. */
4565
4566 yyn = yyr1[yyn];
4567
4568 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4569 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4570 yystate = yytable[yystate];
4571 else
4572 yystate = yydefgoto[yyn - YYNTOKENS];
4573
4574 goto yynewstate;
4575
4576
4577/*------------------------------------.
4578| yyerrlab -- here on detecting error |
4579`------------------------------------*/
4580yyerrlab:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004581 /* Make sure we have latest lookahead translation. See comments at
4582 user semantic actions for why this is necessary. */
4583 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4584
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004585 /* If not already recovering from an error, report this error. */
4586 if (!yyerrstatus)
4587 {
4588 ++yynerrs;
4589#if ! YYERROR_VERBOSE
4590 yyerror (context, YY_("syntax error"));
4591#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004592# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4593 yyssp, yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004594 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004595 char const *yymsgp = YY_("syntax error");
4596 int yysyntax_error_status;
4597 yysyntax_error_status = YYSYNTAX_ERROR;
4598 if (yysyntax_error_status == 0)
4599 yymsgp = yymsg;
4600 else if (yysyntax_error_status == 1)
4601 {
4602 if (yymsg != yymsgbuf)
4603 YYSTACK_FREE (yymsg);
4604 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4605 if (!yymsg)
4606 {
4607 yymsg = yymsgbuf;
4608 yymsg_alloc = sizeof yymsgbuf;
4609 yysyntax_error_status = 2;
4610 }
4611 else
4612 {
4613 yysyntax_error_status = YYSYNTAX_ERROR;
4614 yymsgp = yymsg;
4615 }
4616 }
4617 yyerror (context, yymsgp);
4618 if (yysyntax_error_status == 2)
4619 goto yyexhaustedlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004620 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004621# undef YYSYNTAX_ERROR
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004622#endif
4623 }
4624
4625
4626
4627 if (yyerrstatus == 3)
4628 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004629 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004630 error, discard it. */
4631
4632 if (yychar <= YYEOF)
4633 {
4634 /* Return failure if at end of input. */
4635 if (yychar == YYEOF)
4636 YYABORT;
4637 }
4638 else
4639 {
4640 yydestruct ("Error: discarding",
4641 yytoken, &yylval, context);
4642 yychar = YYEMPTY;
4643 }
4644 }
4645
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004646 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004647 token. */
4648 goto yyerrlab1;
4649
4650
4651/*---------------------------------------------------.
4652| yyerrorlab -- error raised explicitly by YYERROR. |
4653`---------------------------------------------------*/
4654yyerrorlab:
4655
4656 /* Pacify compilers like GCC when the user code never invokes
4657 YYERROR and the label yyerrorlab therefore never appears in user
4658 code. */
4659 if (/*CONSTCOND*/ 0)
4660 goto yyerrorlab;
4661
4662 /* Do not reclaim the symbols of the rule which action triggered
4663 this YYERROR. */
4664 YYPOPSTACK (yylen);
4665 yylen = 0;
4666 YY_STACK_PRINT (yyss, yyssp);
4667 yystate = *yyssp;
4668 goto yyerrlab1;
4669
4670
4671/*-------------------------------------------------------------.
4672| yyerrlab1 -- common code for both syntax error and YYERROR. |
4673`-------------------------------------------------------------*/
4674yyerrlab1:
4675 yyerrstatus = 3; /* Each real token shifted decrements this. */
4676
4677 for (;;)
4678 {
4679 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004680 if (!yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004681 {
4682 yyn += YYTERROR;
4683 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4684 {
4685 yyn = yytable[yyn];
4686 if (0 < yyn)
4687 break;
4688 }
4689 }
4690
4691 /* Pop the current state because it cannot handle the error token. */
4692 if (yyssp == yyss)
4693 YYABORT;
4694
4695
4696 yydestruct ("Error: popping",
4697 yystos[yystate], yyvsp, context);
4698 YYPOPSTACK (1);
4699 yystate = *yyssp;
4700 YY_STACK_PRINT (yyss, yyssp);
4701 }
4702
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004703 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004704 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004705 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004706
4707
4708 /* Shift the error token. */
4709 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4710
4711 yystate = yyn;
4712 goto yynewstate;
4713
4714
4715/*-------------------------------------.
4716| yyacceptlab -- YYACCEPT comes here. |
4717`-------------------------------------*/
4718yyacceptlab:
4719 yyresult = 0;
4720 goto yyreturn;
4721
4722/*-----------------------------------.
4723| yyabortlab -- YYABORT comes here. |
4724`-----------------------------------*/
4725yyabortlab:
4726 yyresult = 1;
4727 goto yyreturn;
4728
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004729#if !defined yyoverflow || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004730/*-------------------------------------------------.
4731| yyexhaustedlab -- memory exhaustion comes here. |
4732`-------------------------------------------------*/
4733yyexhaustedlab:
4734 yyerror (context, YY_("memory exhausted"));
4735 yyresult = 2;
4736 /* Fall through. */
4737#endif
4738
4739yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004740 if (yychar != YYEMPTY)
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004741 {
4742 /* Make sure we have latest lookahead translation. See comments at
4743 user semantic actions for why this is necessary. */
4744 yytoken = YYTRANSLATE (yychar);
4745 yydestruct ("Cleanup: discarding lookahead",
4746 yytoken, &yylval, context);
4747 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004748 /* Do not reclaim the symbols of the rule which action triggered
4749 this YYABORT or YYACCEPT. */
4750 YYPOPSTACK (yylen);
4751 YY_STACK_PRINT (yyss, yyssp);
4752 while (yyssp != yyss)
4753 {
4754 yydestruct ("Cleanup: popping",
4755 yystos[*yyssp], yyvsp, context);
4756 YYPOPSTACK (1);
4757 }
4758#ifndef yyoverflow
4759 if (yyss != yyssa)
4760 YYSTACK_FREE (yyss);
4761#endif
4762#if YYERROR_VERBOSE
4763 if (yymsg != yymsgbuf)
4764 YYSTACK_FREE (yymsg);
4765#endif
4766 /* Make sure YYID is used. */
4767 return YYID (yyresult);
4768}
4769
4770
4771
4772
4773
4774int glslang_parse(TParseContext* context) {
4775 return yyparse(context);
4776}