blob: 7504bcafc0338ff883c2c51d76f0e4c113612929 [file] [log] [blame]
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001/* A Bison parser, made by GNU Bison 2.7. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00003/* Bison implementation for Yacc-like parsers in C
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00005 Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00006
7 This program is free software: you can redistribute it and/or modify
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00008 it under the terms of the GNU General Public License as published by
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00009 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000012 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000016
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000017 You should have received a copy of the GNU General Public License
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000018 along with this program. If not, see <http://www.gnu.org/licenses/>. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000019
20/* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000029
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000030 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
32
33/* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
35
36/* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
42
43/* Identify Bison output. */
44#define YYBISON 1
45
46/* Bison version. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +000047#define YYBISON_VERSION "2.7"
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000048
49/* Skeleton name. */
50#define YYSKELETON_NAME "yacc.c"
51
52/* Pure parsers. */
53#define YYPURE 1
54
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000055/* Push parsers. */
56#define YYPUSH 0
57
58/* Pull parsers. */
59#define YYPULL 1
60
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000061
62
63
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000064/* Copy the first part of user declarations. */
65
66
67//
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +000068// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000069// Use of this source code is governed by a BSD-style license that can be
70// found in the LICENSE file.
71//
72
73// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
74
75// Ignore errors in auto-generated code.
76#if defined(__GNUC__)
77#pragma GCC diagnostic ignored "-Wunused-function"
78#pragma GCC diagnostic ignored "-Wunused-variable"
79#pragma GCC diagnostic ignored "-Wswitch-enum"
80#elif defined(_MSC_VER)
81#pragma warning(disable: 4065)
82#pragma warning(disable: 4189)
83#pragma warning(disable: 4505)
84#pragma warning(disable: 4701)
85#endif
86
87#include "compiler/SymbolTable.h"
88#include "compiler/ParseHelper.h"
89#include "GLSLANG/ShaderLang.h"
90
daniel@transgaming.comb3077d02013-01-11 04:12:09 +000091#define YYENABLE_NLS 0
92#define YYLTYPE_IS_TRIVIAL 1
93
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000094#define YYLEX_PARAM context->scanner
95
96
97
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +000098
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +000099# ifndef YY_NULL
100# if defined __cplusplus && 201103L <= __cplusplus
101# define YY_NULL nullptr
102# else
103# define YY_NULL 0
104# endif
105# endif
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000106
107/* Enabling verbose error messages. */
108#ifdef YYERROR_VERBOSE
109# undef YYERROR_VERBOSE
110# define YYERROR_VERBOSE 1
111#else
112# define YYERROR_VERBOSE 0
113#endif
114
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000115/* In a future release of Bison, this section will be replaced
116 by #include "glslang_tab.h". */
117#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
118# define YY_YY_GLSLANG_TAB_H_INCLUDED
119/* Enabling traces. */
120#ifndef YYDEBUG
121# define YYDEBUG 0
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000122#endif
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000123#if YYDEBUG
124extern int yydebug;
125#endif
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000126
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000127/* Tokens. */
128#ifndef YYTOKENTYPE
129# define YYTOKENTYPE
130 /* Put the tokens into the symbol table, so that GDB and other debuggers
131 know about them. */
132 enum yytokentype {
133 INVARIANT = 258,
134 HIGH_PRECISION = 259,
135 MEDIUM_PRECISION = 260,
136 LOW_PRECISION = 261,
137 PRECISION = 262,
138 ATTRIBUTE = 263,
139 CONST_QUAL = 264,
140 BOOL_TYPE = 265,
141 FLOAT_TYPE = 266,
142 INT_TYPE = 267,
143 BREAK = 268,
144 CONTINUE = 269,
145 DO = 270,
146 ELSE = 271,
147 FOR = 272,
148 IF = 273,
149 DISCARD = 274,
150 RETURN = 275,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000151 SWITCH = 276,
152 CASE = 277,
153 DEFAULT = 278,
154 BVEC2 = 279,
155 BVEC3 = 280,
156 BVEC4 = 281,
157 IVEC2 = 282,
158 IVEC3 = 283,
159 IVEC4 = 284,
160 VEC2 = 285,
161 VEC3 = 286,
162 VEC4 = 287,
163 MATRIX2 = 288,
164 MATRIX3 = 289,
165 MATRIX4 = 290,
166 IN_QUAL = 291,
167 OUT_QUAL = 292,
168 INOUT_QUAL = 293,
169 UNIFORM = 294,
170 VARYING = 295,
171 CENTROID = 296,
172 FLAT = 297,
173 SMOOTH = 298,
174 STRUCT = 299,
175 VOID_TYPE = 300,
176 WHILE = 301,
177 SAMPLER2D = 302,
178 SAMPLERCUBE = 303,
179 SAMPLER_EXTERNAL_OES = 304,
180 SAMPLER2DRECT = 305,
181 SAMPLER3D = 306,
182 SAMPLER3DRECT = 307,
183 SAMPLER2DSHADOW = 308,
184 IDENTIFIER = 309,
185 TYPE_NAME = 310,
186 FLOATCONSTANT = 311,
187 INTCONSTANT = 312,
188 BOOLCONSTANT = 313,
189 FIELD_SELECTION = 314,
190 LEFT_OP = 315,
191 RIGHT_OP = 316,
192 INC_OP = 317,
193 DEC_OP = 318,
194 LE_OP = 319,
195 GE_OP = 320,
196 EQ_OP = 321,
197 NE_OP = 322,
198 AND_OP = 323,
199 OR_OP = 324,
200 XOR_OP = 325,
201 MUL_ASSIGN = 326,
202 DIV_ASSIGN = 327,
203 ADD_ASSIGN = 328,
204 MOD_ASSIGN = 329,
205 LEFT_ASSIGN = 330,
206 RIGHT_ASSIGN = 331,
207 AND_ASSIGN = 332,
208 XOR_ASSIGN = 333,
209 OR_ASSIGN = 334,
210 SUB_ASSIGN = 335,
211 LEFT_PAREN = 336,
212 RIGHT_PAREN = 337,
213 LEFT_BRACKET = 338,
214 RIGHT_BRACKET = 339,
215 LEFT_BRACE = 340,
216 RIGHT_BRACE = 341,
217 DOT = 342,
218 COMMA = 343,
219 COLON = 344,
220 EQUAL = 345,
221 SEMICOLON = 346,
222 BANG = 347,
223 DASH = 348,
224 TILDE = 349,
225 PLUS = 350,
226 STAR = 351,
227 SLASH = 352,
228 PERCENT = 353,
229 LEFT_ANGLE = 354,
230 RIGHT_ANGLE = 355,
231 VERTICAL_BAR = 356,
232 CARET = 357,
233 AMPERSAND = 358,
234 QUESTION = 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000235 };
236#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000237
238
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000239#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
240typedef union YYSTYPE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000241{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000242
243
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000244 struct {
245 TSourceLoc line;
246 union {
247 TString *string;
248 float f;
249 int i;
250 bool b;
251 };
252 TSymbol* symbol;
253 } lex;
254 struct {
255 TSourceLoc line;
256 TOperator op;
257 union {
258 TIntermNode* intermNode;
259 TIntermNodePair nodePair;
260 TIntermTyped* intermTypedNode;
261 TIntermAggregate* intermAggregate;
262 };
263 union {
264 TPublicType type;
265 TPrecision precision;
266 TQualifier qualifier;
267 TFunction* function;
268 TParameter param;
269 TTypeLine typeLine;
270 TTypeList* typeList;
271 };
272 } interm;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000273
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000274
275
276} YYSTYPE;
277# define YYSTYPE_IS_TRIVIAL 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000278# define yystype YYSTYPE /* obsolescent; will be withdrawn */
279# define YYSTYPE_IS_DECLARED 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000280#endif
281
282
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000283#ifdef YYPARSE_PARAM
284#if defined __STDC__ || defined __cplusplus
285int yyparse (void *YYPARSE_PARAM);
286#else
287int yyparse ();
288#endif
289#else /* ! YYPARSE_PARAM */
290#if defined __STDC__ || defined __cplusplus
291int yyparse (TParseContext* context);
292#else
293int yyparse ();
294#endif
295#endif /* ! YYPARSE_PARAM */
296
297#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
298
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000299/* Copy the second part of user declarations. */
300
301
302extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
303extern void yyerror(TParseContext* context, const char* reason);
304
305#define FRAG_VERT_ONLY(S, L) { \
306 if (context->shaderType != SH_FRAGMENT_SHADER && \
307 context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000308 context->error(L, " supported in vertex/fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000309 context->recover(); \
310 } \
311}
312
313#define VERTEX_ONLY(S, L) { \
314 if (context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000315 context->error(L, " supported in vertex shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000316 context->recover(); \
317 } \
318}
319
320#define FRAG_ONLY(S, L) { \
321 if (context->shaderType != SH_FRAGMENT_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000322 context->error(L, " supported in fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000323 context->recover(); \
324 } \
325}
326
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000327#define ES2_ONLY(S, L) { \
328 if (context->shaderVersion != 100) { \
329 context->error(L, " supported in GLSL ES 1.00 only ", S); \
330 context->recover(); \
331 } \
332}
333
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000334#define ES3_ONLY(TOKEN, LINE, REASON) { \
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000335 if (context->shaderVersion != 300) { \
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000336 context->error(LINE, REASON " supported in GLSL ES 3.00 only ", TOKEN); \
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000337 context->recover(); \
338 } \
339}
340
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000341
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000342
343#ifdef short
344# undef short
345#endif
346
347#ifdef YYTYPE_UINT8
348typedef YYTYPE_UINT8 yytype_uint8;
349#else
350typedef unsigned char yytype_uint8;
351#endif
352
353#ifdef YYTYPE_INT8
354typedef YYTYPE_INT8 yytype_int8;
355#elif (defined __STDC__ || defined __C99__FUNC__ \
356 || defined __cplusplus || defined _MSC_VER)
357typedef signed char yytype_int8;
358#else
359typedef short int yytype_int8;
360#endif
361
362#ifdef YYTYPE_UINT16
363typedef YYTYPE_UINT16 yytype_uint16;
364#else
365typedef unsigned short int yytype_uint16;
366#endif
367
368#ifdef YYTYPE_INT16
369typedef YYTYPE_INT16 yytype_int16;
370#else
371typedef short int yytype_int16;
372#endif
373
374#ifndef YYSIZE_T
375# ifdef __SIZE_TYPE__
376# define YYSIZE_T __SIZE_TYPE__
377# elif defined size_t
378# define YYSIZE_T size_t
379# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
380 || defined __cplusplus || defined _MSC_VER)
381# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
382# define YYSIZE_T size_t
383# else
384# define YYSIZE_T unsigned int
385# endif
386#endif
387
388#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
389
390#ifndef YY_
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000391# if defined YYENABLE_NLS && YYENABLE_NLS
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000392# if ENABLE_NLS
393# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000394# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000395# endif
396# endif
397# ifndef YY_
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000398# define YY_(Msgid) Msgid
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000399# endif
400#endif
401
402/* Suppress unused-variable warnings by "using" E. */
403#if ! defined lint || defined __GNUC__
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000404# define YYUSE(E) ((void) (E))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000405#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000406# define YYUSE(E) /* empty */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000407#endif
408
409/* Identity function, used to suppress warnings about constant conditions. */
410#ifndef lint
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000411# define YYID(N) (N)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000412#else
413#if (defined __STDC__ || defined __C99__FUNC__ \
414 || defined __cplusplus || defined _MSC_VER)
415static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000416YYID (int yyi)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000417#else
418static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000419YYID (yyi)
420 int yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000421#endif
422{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000423 return yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000424}
425#endif
426
427#if ! defined yyoverflow || YYERROR_VERBOSE
428
429/* The parser invokes alloca or malloc; define the necessary symbols. */
430
431# ifdef YYSTACK_USE_ALLOCA
432# if YYSTACK_USE_ALLOCA
433# ifdef __GNUC__
434# define YYSTACK_ALLOC __builtin_alloca
435# elif defined __BUILTIN_VA_ARG_INCR
436# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
437# elif defined _AIX
438# define YYSTACK_ALLOC __alloca
439# elif defined _MSC_VER
440# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
441# define alloca _alloca
442# else
443# define YYSTACK_ALLOC alloca
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000444# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000445 || defined __cplusplus || defined _MSC_VER)
446# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000447 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
448# ifndef EXIT_SUCCESS
449# define EXIT_SUCCESS 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000450# endif
451# endif
452# endif
453# endif
454# endif
455
456# ifdef YYSTACK_ALLOC
457 /* Pacify GCC's `empty if-body' warning. */
458# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
459# ifndef YYSTACK_ALLOC_MAXIMUM
460 /* The OS might guarantee only one guard page at the bottom of the stack,
461 and a page size can be as small as 4096 bytes. So we cannot safely
462 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
463 to allow for a few compiler-allocated temporary stack slots. */
464# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
465# endif
466# else
467# define YYSTACK_ALLOC YYMALLOC
468# define YYSTACK_FREE YYFREE
469# ifndef YYSTACK_ALLOC_MAXIMUM
470# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
471# endif
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000472# if (defined __cplusplus && ! defined EXIT_SUCCESS \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000473 && ! ((defined YYMALLOC || defined malloc) \
474 && (defined YYFREE || defined free)))
475# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000476# ifndef EXIT_SUCCESS
477# define EXIT_SUCCESS 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000478# endif
479# endif
480# ifndef YYMALLOC
481# define YYMALLOC malloc
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000482# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000483 || defined __cplusplus || defined _MSC_VER)
484void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
485# endif
486# endif
487# ifndef YYFREE
488# define YYFREE free
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000489# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000490 || defined __cplusplus || defined _MSC_VER)
491void free (void *); /* INFRINGES ON USER NAME SPACE */
492# endif
493# endif
494# endif
495#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
496
497
498#if (! defined yyoverflow \
499 && (! defined __cplusplus \
500 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
501
502/* A type that is properly aligned for any stack member. */
503union yyalloc
504{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000505 yytype_int16 yyss_alloc;
506 YYSTYPE yyvs_alloc;
507};
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000508
509/* The size of the maximum gap between one aligned stack and the next. */
510# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
511
512/* The size of an array large to enough to hold all stacks, each with
513 N elements. */
514# define YYSTACK_BYTES(N) \
515 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
516 + YYSTACK_GAP_MAXIMUM)
517
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000518# define YYCOPY_NEEDED 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000519
520/* Relocate STACK from its old location to the new one. The
521 local variables YYSIZE and YYSTACKSIZE give the old and new number of
522 elements in the stack, and YYPTR gives the new location of the
523 stack. Advance YYPTR to a properly aligned location for the next
524 stack. */
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000525# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000526 do \
527 { \
528 YYSIZE_T yynewbytes; \
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000529 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
530 Stack = &yyptr->Stack_alloc; \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000531 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
532 yyptr += yynewbytes / sizeof (*yyptr); \
533 } \
534 while (YYID (0))
535
536#endif
537
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000538#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
539/* Copy COUNT objects from SRC to DST. The source and destination do
540 not overlap. */
541# ifndef YYCOPY
542# if defined __GNUC__ && 1 < __GNUC__
543# define YYCOPY(Dst, Src, Count) \
544 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
545# else
546# define YYCOPY(Dst, Src, Count) \
547 do \
548 { \
549 YYSIZE_T yyi; \
550 for (yyi = 0; yyi < (Count); yyi++) \
551 (Dst)[yyi] = (Src)[yyi]; \
552 } \
553 while (YYID (0))
554# endif
555# endif
556#endif /* !YYCOPY_NEEDED */
557
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000558/* YYFINAL -- State number of the termination state. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000559#define YYFINAL 83
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000560/* YYLAST -- Last index in YYTABLE. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000561#define YYLAST 1721
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000562
563/* YYNTOKENS -- Number of terminals. */
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000564#define YYNTOKENS 105
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000565/* YYNNTS -- Number of nonterminals. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000566#define YYNNTS 87
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000567/* YYNRULES -- Number of rules. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000568#define YYNRULES 216
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000569/* YYNRULES -- Number of states. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000570#define YYNSTATES 332
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000571
572/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
573#define YYUNDEFTOK 2
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000574#define YYMAXUTOK 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000575
576#define YYTRANSLATE(YYX) \
577 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
578
579/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
580static const yytype_uint8 yytranslate[] =
581{
582 0, 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, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
608 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
609 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
610 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
611 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
612 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
613 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
614 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
615 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000616 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000617 95, 96, 97, 98, 99, 100, 101, 102, 103, 104
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000618};
619
620#if YYDEBUG
621/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
622 YYRHS. */
623static const yytype_uint16 yyprhs[] =
624{
625 0, 0, 3, 5, 7, 9, 11, 13, 17, 19,
626 24, 26, 30, 33, 36, 38, 40, 42, 46, 49,
627 52, 55, 57, 60, 64, 67, 69, 71, 73, 75,
628 78, 81, 84, 86, 88, 90, 92, 96, 100, 102,
629 106, 110, 112, 114, 118, 122, 126, 130, 132, 136,
630 140, 142, 144, 146, 148, 152, 154, 158, 160, 164,
631 166, 172, 174, 178, 180, 182, 184, 186, 188, 190,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000632 194, 196, 199, 202, 205, 210, 216, 223, 233, 236,
633 238, 240, 243, 247, 251, 254, 260, 264, 267, 271,
634 274, 275, 277, 279, 281, 283, 285, 289, 295, 302,
635 308, 310, 313, 318, 324, 329, 332, 334, 337, 339,
636 341, 343, 345, 347, 350, 352, 355, 357, 359, 361,
637 363, 366, 369, 371, 373, 376, 378, 380, 382, 384,
638 389, 391, 393, 395, 397, 399, 401, 403, 405, 407,
639 409, 411, 413, 415, 417, 419, 421, 423, 425, 427,
640 429, 431, 433, 434, 441, 442, 448, 450, 453, 457,
641 462, 464, 468, 470, 475, 477, 479, 481, 483, 485,
642 487, 489, 491, 493, 496, 497, 498, 504, 506, 508,
643 509, 512, 513, 516, 519, 523, 525, 528, 530, 533,
644 539, 543, 545, 547, 552, 553, 560, 561, 570, 571,
645 579, 581, 583, 585, 586, 589, 593, 596, 599, 602,
646 606, 609, 611, 614, 616, 618, 619
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000647};
648
649/* YYRHS -- A `-1'-separated list of the rules' RHS. */
650static const yytype_int16 yyrhs[] =
651{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000652 188, 0, -1, 54, -1, 106, -1, 57, -1, 56,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000653 -1, 58, -1, 81, 133, 82, -1, 107, -1, 108,
654 83, 109, 84, -1, 110, -1, 108, 87, 59, -1,
655 108, 62, -1, 108, 63, -1, 133, -1, 111, -1,
656 112, -1, 108, 87, 112, -1, 114, 82, -1, 113,
657 82, -1, 115, 45, -1, 115, -1, 115, 131, -1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000658 114, 88, 131, -1, 116, 81, -1, 155, -1, 54,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000659 -1, 59, -1, 108, -1, 62, 117, -1, 63, 117,
660 -1, 118, 117, -1, 95, -1, 93, -1, 92, -1,
661 117, -1, 119, 96, 117, -1, 119, 97, 117, -1,
662 119, -1, 120, 95, 119, -1, 120, 93, 119, -1,
663 120, -1, 121, -1, 122, 99, 121, -1, 122, 100,
664 121, -1, 122, 64, 121, -1, 122, 65, 121, -1,
665 122, -1, 123, 66, 122, -1, 123, 67, 122, -1,
666 123, -1, 124, -1, 125, -1, 126, -1, 127, 68,
667 126, -1, 127, -1, 128, 70, 127, -1, 128, -1,
668 129, 69, 128, -1, 129, -1, 129, 104, 133, 89,
669 131, -1, 130, -1, 117, 132, 131, -1, 90, -1,
670 71, -1, 72, -1, 73, -1, 80, -1, 131, -1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000671 133, 88, 131, -1, 130, -1, 54, 85, -1, 137,
672 91, -1, 145, 91, -1, 7, 153, 154, 91, -1,
673 150, 135, 159, 86, 91, -1, 150, 135, 159, 86,
674 54, 91, -1, 150, 135, 159, 86, 54, 83, 134,
675 84, 91, -1, 138, 82, -1, 140, -1, 139, -1,
676 140, 142, -1, 139, 88, 142, -1, 147, 54, 81,
677 -1, 152, 54, -1, 152, 54, 83, 134, 84, -1,
678 149, 143, 141, -1, 143, 141, -1, 149, 143, 144,
679 -1, 143, 144, -1, -1, 36, -1, 37, -1, 38,
680 -1, 152, -1, 146, -1, 145, 88, 54, -1, 145,
681 88, 54, 83, 84, -1, 145, 88, 54, 83, 134,
682 84, -1, 145, 88, 54, 90, 163, -1, 147, -1,
683 147, 54, -1, 147, 54, 83, 84, -1, 147, 54,
684 83, 134, 84, -1, 147, 54, 90, 163, -1, 3,
685 54, -1, 152, -1, 150, 152, -1, 43, -1, 42,
686 -1, 9, -1, 8, -1, 40, -1, 3, 40, -1,
687 151, -1, 148, 151, -1, 148, -1, 9, -1, 36,
688 -1, 37, -1, 41, 36, -1, 41, 37, -1, 39,
689 -1, 154, -1, 153, 154, -1, 4, -1, 5, -1,
690 6, -1, 155, -1, 155, 83, 134, 84, -1, 45,
691 -1, 11, -1, 12, -1, 10, -1, 30, -1, 31,
692 -1, 32, -1, 24, -1, 25, -1, 26, -1, 27,
693 -1, 28, -1, 29, -1, 33, -1, 34, -1, 35,
694 -1, 47, -1, 48, -1, 49, -1, 50, -1, 156,
695 -1, 55, -1, -1, 44, 54, 85, 157, 159, 86,
696 -1, -1, 44, 85, 158, 159, 86, -1, 160, -1,
697 159, 160, -1, 152, 161, 91, -1, 150, 152, 161,
698 91, -1, 162, -1, 161, 88, 162, -1, 54, -1,
699 54, 83, 134, 84, -1, 131, -1, 136, -1, 167,
700 -1, 166, -1, 164, -1, 176, -1, 177, -1, 180,
701 -1, 187, -1, 85, 86, -1, -1, -1, 85, 168,
702 175, 169, 86, -1, 174, -1, 166, -1, -1, 172,
703 174, -1, -1, 173, 166, -1, 85, 86, -1, 85,
704 175, 86, -1, 165, -1, 175, 165, -1, 91, -1,
705 133, 91, -1, 18, 81, 133, 82, 178, -1, 171,
706 16, 171, -1, 171, -1, 133, -1, 147, 54, 90,
707 163, -1, -1, 46, 81, 181, 179, 82, 170, -1,
708 -1, 15, 182, 171, 46, 81, 133, 82, 91, -1,
709 -1, 17, 81, 183, 184, 186, 82, 170, -1, 176,
710 -1, 164, -1, 179, -1, -1, 185, 91, -1, 185,
711 91, 133, -1, 14, 91, -1, 13, 91, -1, 20,
712 91, -1, 20, 133, 91, -1, 19, 91, -1, 189,
713 -1, 188, 189, -1, 190, -1, 136, -1, -1, 137,
714 191, 174, -1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000715};
716
717/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
718static const yytype_uint16 yyrline[] =
719{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000720 0, 186, 186, 221, 224, 237, 242, 247, 253, 256,
721 259, 262, 265, 275, 288, 296, 396, 399, 407, 411,
722 418, 422, 429, 435, 444, 452, 507, 514, 524, 527,
723 537, 547, 568, 569, 570, 575, 576, 585, 597, 598,
724 606, 617, 621, 622, 632, 642, 652, 665, 666, 676,
725 689, 693, 697, 701, 702, 715, 716, 729, 730, 743,
726 744, 761, 762, 775, 776, 777, 778, 779, 783, 786,
727 797, 805, 813, 840, 845, 856, 860, 864, 871, 909,
728 912, 919, 927, 948, 969, 980, 1009, 1014, 1024, 1029,
729 1039, 1042, 1045, 1048, 1054, 1061, 1064, 1086, 1104, 1128,
730 1151, 1155, 1173, 1181, 1213, 1233, 1322, 1331, 1354, 1358,
731 1365, 1371, 1378, 1387, 1396, 1399, 1435, 1445, 1449, 1454,
732 1459, 1464, 1469, 1478, 1488, 1495, 1498, 1501, 1507, 1510,
733 1525, 1529, 1533, 1537, 1546, 1551, 1556, 1561, 1566, 1571,
734 1576, 1581, 1586, 1591, 1597, 1603, 1609, 1614, 1619, 1628,
735 1637, 1642, 1655, 1655, 1658, 1658, 1664, 1667, 1682, 1685,
736 1693, 1697, 1703, 1711, 1727, 1731, 1735, 1736, 1742, 1743,
737 1744, 1745, 1746, 1750, 1751, 1751, 1751, 1761, 1762, 1766,
738 1766, 1767, 1767, 1772, 1775, 1785, 1788, 1794, 1795, 1799,
739 1807, 1811, 1821, 1826, 1843, 1843, 1848, 1848, 1855, 1855,
740 1863, 1866, 1872, 1875, 1881, 1885, 1892, 1899, 1906, 1913,
741 1924, 1933, 1937, 1944, 1947, 1953, 1953
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000742};
743#endif
744
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000745#if YYDEBUG || YYERROR_VERBOSE || 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000746/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
747 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
748static const char *const yytname[] =
749{
750 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
751 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
752 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE",
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000753 "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE",
754 "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2",
755 "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL",
756 "INOUT_QUAL", "UNIFORM", "VARYING", "CENTROID", "FLAT", "SMOOTH",
757 "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE",
758 "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "SAMPLER3D", "SAMPLER3DRECT",
759 "SAMPLER2DSHADOW", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
760 "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
761 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
762 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
763 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
764 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
765 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
766 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
767 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
768 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000769 "primary_expression", "postfix_expression", "integer_expression",
770 "function_call", "function_call_or_method", "function_call_generic",
771 "function_call_header_no_parameters",
772 "function_call_header_with_parameters", "function_call_header",
773 "function_identifier", "unary_expression", "unary_operator",
774 "multiplicative_expression", "additive_expression", "shift_expression",
775 "relational_expression", "equality_expression", "and_expression",
776 "exclusive_or_expression", "inclusive_or_expression",
777 "logical_and_expression", "logical_xor_expression",
778 "logical_or_expression", "conditional_expression",
779 "assignment_expression", "assignment_operator", "expression",
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000780 "constant_expression", "enter_struct", "declaration",
781 "function_prototype", "function_declarator",
782 "function_header_with_parameters", "function_header",
783 "parameter_declarator", "parameter_declaration", "parameter_qualifier",
784 "parameter_type_specifier", "init_declarator_list", "single_declaration",
785 "fully_specified_type", "interpolation_qualifier",
786 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
787 "type_specifier", "precision_qualifier", "type_specifier_no_prec",
788 "type_specifier_nonarray", "struct_specifier", "$@1", "$@2",
789 "struct_declaration_list", "struct_declaration",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000790 "struct_declarator_list", "struct_declarator", "initializer",
791 "declaration_statement", "statement", "simple_statement",
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000792 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000793 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
794 "statement_list", "expression_statement", "selection_statement",
795 "selection_rest_statement", "condition", "iteration_statement", "$@7",
796 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000797 "jump_statement", "translation_unit", "external_declaration",
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000798 "function_definition", "$@10", YY_NULL
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000799};
800#endif
801
802# ifdef YYPRINT
803/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
804 token YYLEX-NUM. */
805static const yytype_uint16 yytoknum[] =
806{
807 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
808 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
809 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
810 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
811 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
812 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
813 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
814 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
815 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000816 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
817 355, 356, 357, 358, 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000818};
819# endif
820
821/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
822static const yytype_uint8 yyr1[] =
823{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000824 0, 105, 106, 107, 107, 107, 107, 107, 108, 108,
825 108, 108, 108, 108, 109, 110, 111, 111, 112, 112,
826 113, 113, 114, 114, 115, 116, 116, 116, 117, 117,
827 117, 117, 118, 118, 118, 119, 119, 119, 120, 120,
828 120, 121, 122, 122, 122, 122, 122, 123, 123, 123,
829 124, 125, 126, 127, 127, 128, 128, 129, 129, 130,
830 130, 131, 131, 132, 132, 132, 132, 132, 133, 133,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000831 134, 135, 136, 136, 136, 136, 136, 136, 137, 138,
832 138, 139, 139, 140, 141, 141, 142, 142, 142, 142,
833 143, 143, 143, 143, 144, 145, 145, 145, 145, 145,
834 146, 146, 146, 146, 146, 146, 147, 147, 148, 148,
835 149, 150, 150, 150, 150, 150, 150, 151, 151, 151,
836 151, 151, 151, 152, 152, 153, 153, 153, 154, 154,
837 155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
838 155, 155, 155, 155, 155, 155, 155, 155, 155, 155,
839 155, 155, 157, 156, 158, 156, 159, 159, 160, 160,
840 161, 161, 162, 162, 163, 164, 165, 165, 166, 166,
841 166, 166, 166, 167, 168, 169, 167, 170, 170, 172,
842 171, 173, 171, 174, 174, 175, 175, 176, 176, 177,
843 178, 178, 179, 179, 181, 180, 182, 180, 183, 180,
844 184, 184, 185, 185, 186, 186, 187, 187, 187, 187,
845 187, 188, 188, 189, 189, 191, 190
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000846};
847
848/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
849static const yytype_uint8 yyr2[] =
850{
851 0, 2, 1, 1, 1, 1, 1, 3, 1, 4,
852 1, 3, 2, 2, 1, 1, 1, 3, 2, 2,
853 2, 1, 2, 3, 2, 1, 1, 1, 1, 2,
854 2, 2, 1, 1, 1, 1, 3, 3, 1, 3,
855 3, 1, 1, 3, 3, 3, 3, 1, 3, 3,
856 1, 1, 1, 1, 3, 1, 3, 1, 3, 1,
857 5, 1, 3, 1, 1, 1, 1, 1, 1, 3,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000858 1, 2, 2, 2, 4, 5, 6, 9, 2, 1,
859 1, 2, 3, 3, 2, 5, 3, 2, 3, 2,
860 0, 1, 1, 1, 1, 1, 3, 5, 6, 5,
861 1, 2, 4, 5, 4, 2, 1, 2, 1, 1,
862 1, 1, 1, 2, 1, 2, 1, 1, 1, 1,
863 2, 2, 1, 1, 2, 1, 1, 1, 1, 4,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000864 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000865 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
866 1, 1, 0, 6, 0, 5, 1, 2, 3, 4,
867 1, 3, 1, 4, 1, 1, 1, 1, 1, 1,
868 1, 1, 1, 2, 0, 0, 5, 1, 1, 0,
869 2, 0, 2, 2, 3, 1, 2, 1, 2, 5,
870 3, 1, 1, 4, 0, 6, 0, 8, 0, 7,
871 1, 1, 1, 0, 2, 3, 2, 2, 2, 3,
872 2, 1, 2, 1, 1, 0, 3
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000873};
874
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000875/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
876 Performed when YYTABLE doesn't specify something else to do. Zero
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000877 means the default is an error. */
878static const yytype_uint8 yydefact[] =
879{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000880 0, 0, 125, 126, 127, 0, 111, 117, 133, 131,
881 132, 137, 138, 139, 140, 141, 142, 134, 135, 136,
882 143, 144, 145, 118, 119, 122, 112, 0, 109, 108,
883 0, 130, 146, 147, 148, 149, 151, 214, 215, 0,
884 80, 90, 0, 95, 100, 116, 0, 114, 106, 0,
885 123, 128, 150, 0, 211, 213, 113, 105, 0, 120,
886 121, 0, 154, 72, 0, 78, 90, 110, 91, 92,
887 93, 81, 0, 90, 0, 73, 101, 115, 0, 0,
888 107, 124, 0, 1, 212, 0, 152, 0, 0, 216,
889 82, 87, 89, 94, 0, 96, 83, 0, 0, 71,
890 0, 0, 0, 0, 156, 2, 5, 4, 6, 27,
891 0, 0, 0, 34, 33, 32, 3, 8, 28, 10,
892 15, 16, 0, 0, 21, 0, 35, 0, 38, 41,
893 42, 47, 50, 51, 52, 53, 55, 57, 59, 70,
894 0, 25, 74, 0, 0, 0, 0, 196, 0, 0,
895 0, 0, 0, 174, 183, 187, 35, 61, 68, 0,
896 165, 0, 128, 168, 185, 167, 166, 0, 169, 170,
897 171, 172, 84, 86, 88, 0, 0, 102, 0, 164,
898 104, 0, 162, 0, 160, 0, 157, 29, 30, 0,
899 12, 13, 0, 0, 19, 18, 0, 20, 22, 24,
900 31, 0, 0, 0, 0, 0, 0, 0, 0, 0,
901 0, 0, 0, 0, 0, 129, 0, 155, 207, 206,
902 181, 198, 0, 210, 208, 0, 194, 173, 0, 64,
903 65, 66, 67, 63, 0, 0, 188, 184, 186, 0,
904 97, 0, 99, 103, 0, 0, 0, 158, 0, 75,
905 7, 0, 14, 26, 11, 17, 23, 36, 37, 40,
906 39, 45, 46, 43, 44, 48, 49, 54, 56, 58,
907 0, 153, 0, 0, 0, 0, 0, 209, 0, 175,
908 62, 69, 0, 98, 159, 0, 161, 0, 76, 9,
909 0, 0, 180, 182, 201, 200, 203, 181, 192, 0,
910 0, 0, 0, 85, 163, 0, 60, 0, 202, 0,
911 0, 191, 189, 0, 0, 176, 0, 0, 204, 0,
912 181, 0, 178, 195, 177, 77, 0, 205, 199, 190,
913 193, 197
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000914};
915
916/* YYDEFGOTO[NTERM-NUM]. */
917static const yytype_int16 yydefgoto[] =
918{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000919 -1, 116, 117, 118, 251, 119, 120, 121, 122, 123,
920 124, 125, 156, 127, 128, 129, 130, 131, 132, 133,
921 134, 135, 136, 137, 138, 157, 158, 234, 159, 140,
922 79, 160, 161, 39, 40, 41, 91, 71, 72, 92,
923 42, 43, 44, 45, 73, 46, 47, 48, 49, 50,
924 141, 52, 143, 87, 103, 104, 183, 184, 180, 163,
925 164, 165, 166, 228, 302, 323, 272, 273, 274, 324,
926 167, 168, 169, 312, 301, 170, 278, 220, 275, 296,
927 309, 310, 171, 53, 54, 55, 64
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000928};
929
930/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
931 STATE-NUM. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000932#define YYPACT_NINF -277
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000933static const yytype_int16 yypact[] =
934{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000935 1489, -22, -277, -277, -277, 129, -277, -277, -277, -277,
936 -277, -277, -277, -277, -277, -277, -277, -277, -277, -277,
937 -277, -277, -277, -277, -277, -277, -277, 60, -277, -277,
938 -25, -277, -277, -277, -277, -277, -277, -277, -64, -31,
939 -52, 2, -15, -277, 10, 71, 236, -277, -277, 1666,
940 -277, 7, -277, 1436, -277, -277, -277, -277, 1666, -277,
941 -277, 28, -277, -277, 51, -277, 80, -277, -277, -277,
942 -277, -277, 1584, 133, 88, -277, -59, -277, 73, 1537,
943 -277, -277, 1131, -277, -277, 70, -277, 1537, 298, -277,
944 -277, -277, -277, 112, 1584, -9, -277, 909, 1131, -277,
945 136, 1584, 141, 1277, -277, 106, -277, -277, -277, -277,
946 1131, 1131, 1131, -277, -277, -277, -277, -277, 101, -277,
947 -277, -277, 116, -5, 1203, 118, -277, 1131, 81, 31,
948 -277, 5, 114, -277, -277, -277, 134, 131, -57, -277,
949 119, -277, -277, 1537, 1325, 113, 115, -277, 124, 128,
950 120, 984, 132, 135, -277, -277, 102, -277, -277, -13,
951 -277, -64, 56, -277, -277, -277, -277, 391, -277, -277,
952 -277, -277, 137, -277, -277, 1056, 1131, -277, 130, -277,
953 -277, 141, 139, 18, -277, -35, -277, -277, -277, 3,
954 -277, -277, 1131, 1625, -277, -277, 1131, 142, -277, -277,
955 -277, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131, 1131,
956 1131, 1131, 1131, 1131, 1131, -277, 1373, -277, -277, -277,
957 140, -277, 1131, -277, -277, 23, -277, -277, 484, -277,
958 -277, -277, -277, -277, 1131, 1131, -277, -277, -277, 1131,
959 -277, 145, -277, -277, 37, 1131, 141, -277, -46, -277,
960 -277, 146, 127, -277, 143, -277, -277, -277, -277, 81,
961 81, -277, -277, -277, -277, 5, 5, -277, 134, 131,
962 97, -277, 171, 51, 670, 763, 4, -277, 837, 484,
963 -277, -277, 148, -277, -277, 149, -277, 1131, -277, -277,
964 1131, 153, -277, -277, -277, -277, 837, 140, 127, 172,
965 1584, 154, 151, -277, -277, 155, -277, 1131, -277, 144,
966 156, 227, -277, 159, 577, -277, 160, 39, 1131, 577,
967 140, 1131, -277, -277, -277, -277, 161, 127, -277, -277,
968 -277, -277
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000969};
970
971/* YYPGOTO[NTERM-NUM]. */
972static const yytype_int16 yypgoto[] =
973{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000974 -277, -277, -277, -277, -277, -277, -277, 52, -277, -277,
975 -277, -277, -56, -277, -10, -277, -76, -19, -277, -277,
976 -277, 33, 38, 40, -277, -77, -94, -277, -99, -80,
977 -277, 8, 14, -277, -277, -277, 163, 188, 182, 164,
978 -277, -277, -262, -277, -277, -78, 214, -44, 267, -16,
979 0, -277, -277, -277, -81, -96, 92, 30, -161, 12,
980 -157, -251, -277, -277, -277, -42, -276, -277, -277, -61,
981 54, 13, -277, -277, -7, -277, -277, -277, -277, -277,
982 -277, -277, -277, -277, 239, -277, -277
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000983};
984
985/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
986 positive, shift that token. If negative, reduce the rule which
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +0000987 number is the opposite. If YYTABLE_NINF, syntax error. */
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000988#define YYTABLE_NINF -180
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000989static const yytype_int16 yytable[] =
990{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000991 51, 101, 80, 89, 179, 139, 144, 186, 37, 101,
992 238, 67, 213, 189, 38, 242, 299, 178, 56, 248,
993 139, 311, 96, 293, 97, 101, 126, 63, 93, 61,
994 198, 98, 57, 81, 299, 102, 66, 287, 68, 69,
995 70, 126, 85, 102, 329, 288, 51, 214, 186, 51,
996 93, 65, 225, 51, 187, 188, 249, 181, 51, 102,
997 62, 37, 216, 322, 76, 101, 101, 38, 322, 205,
998 206, 200, 51, 74, 175, 235, 75, 195, 236, 51,
999 7, 176, 179, 196, -79, 250, 297, 51, 162, 67,
1000 82, 235, 235, 252, 51, 241, 59, 60, 139, 102,
1001 102, 51, 256, 51, 207, 208, 246, 23, 24, 247,
1002 25, 235, 27, 86, 277, 270, 68, 69, 70, 126,
1003 186, 326, 238, 276, 203, 246, 204, 235, 284, 261,
1004 262, 263, 264, 2, 3, 4, 88, -25, 101, 82,
1005 280, 281, 95, 51, 51, 257, 258, 126, 126, 126,
1006 126, 126, 126, 126, 126, 126, 126, 126, 99, 282,
1007 330, 142, 139, 190, 191, 285, 172, 162, 139, 68,
1008 69, 70, 102, 229, 230, 231, 56, 201, 202, 298,
1009 209, 210, 232, 126, 192, 235, 290, -26, 193, 126,
1010 265, 266, 233, 259, 260, 182, 306, 298, 194, 199,
1011 300, 212, 211, 215, 218, 221, 219, 305, 317, 222,
1012 139, 223, 292, 226, 243, 235, 51, 291, 300, 327,
1013 239, 227, 245, -130, -27, -179, 313, 179, 162, 283,
1014 289, 126, 303, 304, 307, 318, 314, 315, 319, 316,
1015 2, 3, 4, 320, 267, 255, 8, 9, 10, 321,
1016 268, 325, 331, 269, 90, 94, 80, 173, 174, 77,
1017 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1018 21, 22, 58, 244, 162, 162, 286, 328, 162, 162,
1019 30, 31, 279, 32, 33, 34, 35, 294, 295, 308,
1020 78, 36, 84, 0, 0, 0, 162, 0, 0, 0,
1021 51, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1022 10, 145, 146, 147, 162, 148, 149, 150, 151, 162,
1023 0, 0, 11, 12, 13, 14, 15, 16, 17, 18,
1024 19, 20, 21, 22, 23, 24, 0, 25, 26, 27,
1025 28, 29, 30, 31, 152, 32, 33, 34, 35, 0,
1026 0, 0, 105, 36, 106, 107, 108, 109, 0, 0,
1027 110, 111, 0, 0, 0, 0, 0, 0, 0, 0,
1028 0, 0, 0, 0, 0, 0, 0, 0, 0, 112,
1029 0, 0, 0, 153, 154, 0, 0, 0, 0, 155,
1030 113, 114, 0, 115, 1, 2, 3, 4, 5, 6,
1031 7, 8, 9, 10, 145, 146, 147, 0, 148, 149,
1032 150, 151, 0, 0, 0, 11, 12, 13, 14, 15,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001033 16, 17, 18, 19, 20, 21, 22, 23, 24, 0,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001034 25, 26, 27, 28, 29, 30, 31, 152, 32, 33,
1035 34, 35, 0, 0, 0, 105, 36, 106, 107, 108,
1036 109, 0, 0, 110, 111, 0, 0, 0, 0, 0,
kbr@chromium.org205fef32011-11-22 20:50:02 +00001037 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001038 0, 0, 112, 0, 0, 0, 153, 237, 0, 0,
1039 0, 0, 155, 113, 114, 0, 115, 1, 2, 3,
1040 4, 5, 6, 7, 8, 9, 10, 145, 146, 147,
1041 0, 148, 149, 150, 151, 0, 0, 0, 11, 12,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001042 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1043 23, 24, 0, 25, 26, 27, 28, 29, 30, 31,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001044 152, 32, 33, 34, 35, 0, 0, 0, 105, 36,
1045 106, 107, 108, 109, 0, 0, 110, 111, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001046 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001047 0, 0, 0, 0, 0, 112, 0, 0, 0, 153,
1048 0, 0, 0, 0, 0, 155, 113, 114, 0, 115,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001049 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001050 145, 146, 147, 0, 148, 149, 150, 151, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001051 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1052 20, 21, 22, 23, 24, 0, 25, 26, 27, 28,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001053 29, 30, 31, 152, 32, 33, 34, 35, 0, 0,
1054 0, 105, 36, 106, 107, 108, 109, 0, 0, 110,
1055 111, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1056 0, 0, 0, 0, 0, 0, 0, 0, 112, 0,
1057 0, 0, 88, 0, 0, 0, 0, 0, 155, 113,
1058 114, 0, 115, 1, 2, 3, 4, 5, 6, 7,
1059 8, 9, 10, 145, 146, 147, 0, 148, 149, 150,
1060 151, 0, 0, 0, 11, 12, 13, 14, 15, 16,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001061 17, 18, 19, 20, 21, 22, 23, 24, 0, 25,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001062 26, 27, 28, 29, 30, 31, 152, 32, 33, 34,
1063 35, 0, 0, 0, 105, 36, 106, 107, 108, 109,
1064 0, 0, 110, 111, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001066 0, 112, 0, 0, 0, 0, 0, 0, 0, 0,
1067 0, 155, 113, 114, 0, 115, 1, 2, 3, 4,
1068 5, 6, 7, 8, 9, 10, 0, 0, 0, 0,
1069 0, 0, 0, 0, 0, 0, 0, 11, 12, 13,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001070 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001071 24, 0, 25, 26, 27, 28, 29, 30, 31, 0,
1072 32, 33, 34, 35, 0, 0, 0, 105, 36, 106,
1073 107, 108, 109, 0, 0, 110, 111, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001074 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001075 100, 2, 3, 4, 112, 6, 7, 8, 9, 10,
1076 0, 0, 0, 0, 155, 113, 114, 0, 115, 0,
1077 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1078 20, 21, 22, 23, 24, 0, 25, 26, 27, 28,
1079 29, 30, 31, 0, 32, 33, 34, 35, 0, 0,
1080 0, 105, 36, 106, 107, 108, 109, 0, 0, 110,
1081 111, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1082 0, 0, 0, 0, 0, 0, 0, 0, 112, 8,
1083 9, 10, 0, 0, 0, 0, 0, 0, 0, 113,
1084 114, 0, 115, 11, 12, 13, 14, 15, 16, 17,
1085 18, 19, 20, 21, 22, 0, 0, 0, 0, 0,
1086 0, 0, 0, 30, 31, 0, 32, 33, 34, 35,
1087 0, 0, 0, 105, 36, 106, 107, 108, 109, 0,
1088 0, 110, 111, 0, 0, 0, 0, 0, 0, 0,
1089 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1090 112, 0, 0, 177, 8, 9, 10, 0, 0, 0,
1091 0, 113, 114, 0, 115, 0, 0, 0, 11, 12,
1092 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1093 0, 0, 0, 0, 0, 0, 0, 0, 30, 31,
1094 0, 32, 33, 34, 35, 0, 0, 0, 105, 36,
1095 106, 107, 108, 109, 0, 0, 110, 111, 0, 0,
1096 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1097 0, 0, 0, 0, 0, 112, 8, 9, 10, 0,
1098 0, 0, 0, 0, 0, 224, 113, 114, 0, 115,
1099 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1100 21, 22, 0, 0, 0, 0, 0, 0, 0, 0,
1101 30, 31, 0, 32, 33, 34, 35, 0, 0, 0,
1102 105, 36, 106, 107, 108, 109, 0, 0, 110, 111,
1103 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1104 0, 0, 0, 0, 0, 0, 0, 112, 0, 0,
1105 240, 8, 9, 10, 0, 0, 0, 0, 113, 114,
1106 0, 115, 0, 0, 0, 11, 12, 13, 14, 15,
1107 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
1108 0, 0, 0, 0, 0, 30, 31, 0, 32, 33,
1109 34, 35, 0, 0, 0, 105, 36, 106, 107, 108,
1110 109, 0, 0, 110, 111, 0, 0, 0, 0, 0,
1111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1112 0, 0, 112, 8, 9, 10, 0, 0, 0, 0,
1113 0, 0, 0, 113, 114, 0, 115, 11, 12, 13,
1114 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
1115 0, 0, 0, 0, 0, 0, 0, 30, 197, 0,
1116 32, 33, 34, 35, 0, 0, 0, 105, 36, 106,
1117 107, 108, 109, 0, 0, 110, 111, 0, 0, 0,
1118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1119 100, 2, 3, 4, 112, 6, 7, 8, 9, 10,
1120 0, 0, 0, 0, 0, 113, 114, 0, 115, 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, 100, 2,
1124 3, 4, 36, 6, 7, 8, 9, 10, 0, 0,
1125 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1126 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1127 22, 23, 24, 185, 25, 26, 27, 28, 29, 30,
1128 31, 0, 32, 33, 34, 35, 100, 2, 3, 4,
1129 36, 6, 7, 8, 9, 10, 0, 0, 0, 0,
1130 0, 0, 0, 0, 0, 0, 0, 11, 12, 13,
1131 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1132 24, 217, 25, 26, 27, 28, 29, 30, 31, 0,
1133 32, 33, 34, 35, 0, 0, 0, 0, 36, 0,
1134 0, 0, 0, 0, 0, 0, 83, 0, 0, 1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001135 2, 3, 4, 5, 6, 7, 8, 9, 10, 0,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001136 0, 0, 0, 0, 0, 0, 0, 0, 0, 271,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001137 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001138 21, 22, 23, 24, 0, 25, 26, 27, 28, 29,
1139 30, 31, 0, 32, 33, 34, 35, 0, 0, 0,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001140 0, 36, 1, 2, 3, 4, 5, 6, 7, 8,
1141 9, 10, 0, 0, 0, 0, 0, 0, 0, 0,
1142 0, 0, 0, 11, 12, 13, 14, 15, 16, 17,
1143 18, 19, 20, 21, 22, 23, 24, 0, 25, 26,
1144 27, 28, 29, 30, 31, 0, 32, 33, 34, 35,
1145 100, 2, 3, 4, 36, 6, 7, 8, 9, 10,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001146 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1147 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1148 20, 21, 22, 23, 24, 0, 25, 26, 27, 28,
1149 29, 30, 31, 0, 32, 33, 34, 35, 2, 3,
1150 4, 0, 36, 0, 8, 9, 10, 0, 0, 0,
1151 0, 0, 0, 0, 0, 0, 0, 0, 11, 12,
1152 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1153 0, 0, 0, 0, 0, 0, 0, 0, 30, 31,
1154 0, 32, 33, 34, 35, 8, 9, 10, 0, 36,
1155 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1156 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1157 22, 0, 0, 0, 0, 0, 0, 0, 0, 30,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001158 31, 0, 32, 33, 34, 35, 8, 9, 10, 253,
1159 36, 0, 0, 0, 254, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001160 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1161 21, 22, 0, 0, 0, 0, 0, 0, 0, 0,
1162 30, 31, 0, 32, 33, 34, 35, 0, 0, 0,
1163 0, 36
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001164};
1165
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001166#define yypact_value_is_default(Yystate) \
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001167 (!!((Yystate) == (-277)))
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001168
1169#define yytable_value_is_error(Yytable_value) \
1170 YYID (0)
1171
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001172static const yytype_int16 yycheck[] =
1173{
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001174 0, 79, 46, 64, 98, 82, 87, 103, 0, 87,
1175 167, 9, 69, 112, 0, 176, 278, 97, 40, 54,
1176 97, 297, 81, 274, 83, 103, 82, 91, 72, 54,
1177 124, 90, 54, 49, 296, 79, 88, 83, 36, 37,
1178 38, 97, 58, 87, 320, 91, 46, 104, 144, 49,
1179 94, 82, 151, 53, 110, 111, 91, 101, 58, 103,
1180 85, 53, 143, 314, 54, 143, 144, 53, 319, 64,
1181 65, 127, 72, 88, 83, 88, 91, 82, 91, 79,
1182 9, 90, 176, 88, 82, 82, 82, 87, 88, 9,
1183 83, 88, 88, 192, 94, 175, 36, 37, 175, 143,
1184 144, 101, 196, 103, 99, 100, 88, 36, 37, 91,
1185 39, 88, 41, 85, 91, 214, 36, 37, 38, 175,
1186 216, 82, 279, 222, 93, 88, 95, 88, 91, 205,
1187 206, 207, 208, 4, 5, 6, 85, 81, 216, 83,
1188 234, 235, 54, 143, 144, 201, 202, 203, 204, 205,
1189 206, 207, 208, 209, 210, 211, 212, 213, 85, 239,
1190 321, 91, 239, 62, 63, 245, 54, 167, 245, 36,
1191 37, 38, 216, 71, 72, 73, 40, 96, 97, 278,
1192 66, 67, 80, 239, 83, 88, 89, 81, 87, 245,
1193 209, 210, 90, 203, 204, 54, 290, 296, 82, 81,
1194 278, 70, 68, 84, 91, 81, 91, 287, 307, 81,
1195 287, 91, 273, 81, 84, 88, 216, 46, 296, 318,
1196 83, 86, 83, 81, 81, 85, 54, 321, 228, 84,
1197 84, 287, 84, 84, 81, 91, 82, 86, 82, 84,
1198 4, 5, 6, 16, 211, 193, 10, 11, 12, 90,
1199 212, 91, 91, 213, 66, 73, 300, 94, 94, 45,
1200 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1201 34, 35, 5, 181, 274, 275, 246, 319, 278, 279,
1202 44, 45, 228, 47, 48, 49, 50, 275, 275, 296,
1203 54, 55, 53, -1, -1, -1, 296, -1, -1, -1,
1204 300, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1205 12, 13, 14, 15, 314, 17, 18, 19, 20, 319,
1206 -1, -1, 24, 25, 26, 27, 28, 29, 30, 31,
1207 32, 33, 34, 35, 36, 37, -1, 39, 40, 41,
1208 42, 43, 44, 45, 46, 47, 48, 49, 50, -1,
1209 -1, -1, 54, 55, 56, 57, 58, 59, -1, -1,
1210 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
1211 -1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
1212 -1, -1, -1, 85, 86, -1, -1, -1, -1, 91,
1213 92, 93, -1, 95, 3, 4, 5, 6, 7, 8,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001214 9, 10, 11, 12, 13, 14, 15, -1, 17, 18,
1215 19, 20, -1, -1, -1, 24, 25, 26, 27, 28,
1216 29, 30, 31, 32, 33, 34, 35, 36, 37, -1,
1217 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
1218 49, 50, -1, -1, -1, 54, 55, 56, 57, 58,
1219 59, -1, -1, 62, 63, -1, -1, -1, -1, -1,
1220 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1221 -1, -1, 81, -1, -1, -1, 85, 86, -1, -1,
1222 -1, -1, 91, 92, 93, -1, 95, 3, 4, 5,
1223 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1224 -1, 17, 18, 19, 20, -1, -1, -1, 24, 25,
1225 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1226 36, 37, -1, 39, 40, 41, 42, 43, 44, 45,
1227 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1228 56, 57, 58, 59, -1, -1, 62, 63, -1, -1,
1229 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1230 -1, -1, -1, -1, -1, 81, -1, -1, -1, 85,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001231 -1, -1, -1, -1, -1, 91, 92, 93, -1, 95,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001232 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1233 13, 14, 15, -1, 17, 18, 19, 20, -1, -1,
1234 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001235 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1236 43, 44, 45, 46, 47, 48, 49, 50, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001237 -1, 54, 55, 56, 57, 58, 59, -1, -1, 62,
1238 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1239 -1, -1, -1, -1, -1, -1, -1, -1, 81, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001240 -1, -1, 85, -1, -1, -1, -1, -1, 91, 92,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001241 93, -1, 95, 3, 4, 5, 6, 7, 8, 9,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001242 10, 11, 12, 13, 14, 15, -1, 17, 18, 19,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001243 20, -1, -1, -1, 24, 25, 26, 27, 28, 29,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001244 30, 31, 32, 33, 34, 35, 36, 37, -1, 39,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001245 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001246 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1247 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001248 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001249 -1, 81, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001250 -1, 91, 92, 93, -1, 95, 3, 4, 5, 6,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001251 7, 8, 9, 10, 11, 12, -1, -1, -1, -1,
1252 -1, -1, -1, -1, -1, -1, -1, 24, 25, 26,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001253 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001254 37, -1, 39, 40, 41, 42, 43, 44, 45, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001255 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1256 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
zmo@google.com09c323a2011-08-12 18:22:25 +00001257 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001258 3, 4, 5, 6, 81, 8, 9, 10, 11, 12,
1259 -1, -1, -1, -1, 91, 92, 93, -1, 95, -1,
1260 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1261 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1262 43, 44, 45, -1, 47, 48, 49, 50, -1, -1,
1263 -1, 54, 55, 56, 57, 58, 59, -1, -1, 62,
1264 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1265 -1, -1, -1, -1, -1, -1, -1, -1, 81, 10,
1266 11, 12, -1, -1, -1, -1, -1, -1, -1, 92,
1267 93, -1, 95, 24, 25, 26, 27, 28, 29, 30,
1268 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,
1269 -1, -1, -1, 44, 45, -1, 47, 48, 49, 50,
1270 -1, -1, -1, 54, 55, 56, 57, 58, 59, -1,
1271 -1, 62, 63, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001272 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001273 81, -1, -1, 84, 10, 11, 12, -1, -1, -1,
1274 -1, 92, 93, -1, 95, -1, -1, -1, 24, 25,
1275 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1276 -1, -1, -1, -1, -1, -1, -1, -1, 44, 45,
1277 -1, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1278 56, 57, 58, 59, -1, -1, 62, 63, -1, -1,
1279 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1280 -1, -1, -1, -1, -1, 81, 10, 11, 12, -1,
1281 -1, -1, -1, -1, -1, 91, 92, 93, -1, 95,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001282 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001283 34, 35, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001284 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1285 54, 55, 56, 57, 58, 59, -1, -1, 62, 63,
1286 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001287 -1, -1, -1, -1, -1, -1, -1, 81, -1, -1,
1288 84, 10, 11, 12, -1, -1, -1, -1, 92, 93,
1289 -1, 95, -1, -1, -1, 24, 25, 26, 27, 28,
1290 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
1291 -1, -1, -1, -1, -1, 44, 45, -1, 47, 48,
1292 49, 50, -1, -1, -1, 54, 55, 56, 57, 58,
1293 59, -1, -1, 62, 63, -1, -1, -1, -1, -1,
1294 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1295 -1, -1, 81, 10, 11, 12, -1, -1, -1, -1,
1296 -1, -1, -1, 92, 93, -1, 95, 24, 25, 26,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001297 27, 28, 29, 30, 31, 32, 33, 34, 35, -1,
1298 -1, -1, -1, -1, -1, -1, -1, 44, 45, -1,
1299 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1300 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001301 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001302 3, 4, 5, 6, 81, 8, 9, 10, 11, 12,
1303 -1, -1, -1, -1, -1, 92, 93, -1, 95, -1,
1304 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1305 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1306 43, 44, 45, -1, 47, 48, 49, 50, 3, 4,
1307 5, 6, 55, 8, 9, 10, 11, 12, -1, -1,
1308 -1, -1, -1, -1, -1, -1, -1, -1, -1, 24,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001309 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001310 35, 36, 37, 86, 39, 40, 41, 42, 43, 44,
1311 45, -1, 47, 48, 49, 50, 3, 4, 5, 6,
1312 55, 8, 9, 10, 11, 12, -1, -1, -1, -1,
1313 -1, -1, -1, -1, -1, -1, -1, 24, 25, 26,
1314 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1315 37, 86, 39, 40, 41, 42, 43, 44, 45, -1,
1316 47, 48, 49, 50, -1, -1, -1, -1, 55, -1,
1317 -1, -1, -1, -1, -1, -1, 0, -1, -1, 3,
1318 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
1319 -1, -1, -1, -1, -1, -1, -1, -1, -1, 86,
1320 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1321 34, 35, 36, 37, -1, 39, 40, 41, 42, 43,
1322 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1323 -1, 55, 3, 4, 5, 6, 7, 8, 9, 10,
1324 11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
1325 -1, -1, -1, 24, 25, 26, 27, 28, 29, 30,
1326 31, 32, 33, 34, 35, 36, 37, -1, 39, 40,
1327 41, 42, 43, 44, 45, -1, 47, 48, 49, 50,
1328 3, 4, 5, 6, 55, 8, 9, 10, 11, 12,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001329 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1330 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1331 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1332 43, 44, 45, -1, 47, 48, 49, 50, 4, 5,
1333 6, -1, 55, -1, 10, 11, 12, -1, -1, -1,
1334 -1, -1, -1, -1, -1, -1, -1, -1, 24, 25,
1335 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1336 -1, -1, -1, -1, -1, -1, -1, -1, 44, 45,
1337 -1, 47, 48, 49, 50, 10, 11, 12, -1, 55,
1338 -1, -1, -1, -1, -1, -1, -1, -1, -1, 24,
1339 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1340 35, -1, -1, -1, -1, -1, -1, -1, -1, 44,
1341 45, -1, 47, 48, 49, 50, 10, 11, 12, 54,
1342 55, -1, -1, -1, 59, -1, -1, -1, -1, -1,
1343 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1344 34, 35, -1, -1, -1, -1, -1, -1, -1, -1,
1345 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1346 -1, 55
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001347};
1348
1349/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1350 symbol of state STATE-NUM. */
1351static const yytype_uint8 yystos[] =
1352{
1353 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001354 12, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001355 33, 34, 35, 36, 37, 39, 40, 41, 42, 43,
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00001356 44, 45, 47, 48, 49, 50, 55, 136, 137, 138,
1357 139, 140, 145, 146, 147, 148, 150, 151, 152, 153,
1358 154, 155, 156, 188, 189, 190, 40, 54, 153, 36,
1359 37, 54, 85, 91, 191, 82, 88, 9, 36, 37,
1360 38, 142, 143, 149, 88, 91, 54, 151, 54, 135,
1361 152, 154, 83, 0, 189, 154, 85, 158, 85, 174,
1362 142, 141, 144, 152, 143, 54, 81, 83, 90, 85,
1363 3, 150, 152, 159, 160, 54, 56, 57, 58, 59,
1364 62, 63, 81, 92, 93, 95, 106, 107, 108, 110,
1365 111, 112, 113, 114, 115, 116, 117, 118, 119, 120,
1366 121, 122, 123, 124, 125, 126, 127, 128, 129, 130,
1367 134, 155, 91, 157, 159, 13, 14, 15, 17, 18,
1368 19, 20, 46, 85, 86, 91, 117, 130, 131, 133,
1369 136, 137, 155, 164, 165, 166, 167, 175, 176, 177,
1370 180, 187, 54, 141, 144, 83, 90, 84, 134, 131,
1371 163, 152, 54, 161, 162, 86, 160, 117, 117, 133,
1372 62, 63, 83, 87, 82, 82, 88, 45, 131, 81,
1373 117, 96, 97, 93, 95, 64, 65, 99, 100, 66,
1374 67, 68, 70, 69, 104, 84, 159, 86, 91, 91,
1375 182, 81, 81, 91, 91, 133, 81, 86, 168, 71,
1376 72, 73, 80, 90, 132, 88, 91, 86, 165, 83,
1377 84, 134, 163, 84, 161, 83, 88, 91, 54, 91,
1378 82, 109, 133, 54, 59, 112, 131, 117, 117, 119,
1379 119, 121, 121, 121, 121, 122, 122, 126, 127, 128,
1380 133, 86, 171, 172, 173, 183, 133, 91, 181, 175,
1381 131, 131, 134, 84, 91, 134, 162, 83, 91, 84,
1382 89, 46, 174, 166, 164, 176, 184, 82, 133, 147,
1383 150, 179, 169, 84, 84, 134, 131, 81, 179, 185,
1384 186, 171, 178, 54, 82, 86, 84, 133, 91, 82,
1385 16, 90, 166, 170, 174, 91, 82, 133, 170, 171,
1386 163, 91
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001387};
1388
1389#define yyerrok (yyerrstatus = 0)
1390#define yyclearin (yychar = YYEMPTY)
1391#define YYEMPTY (-2)
1392#define YYEOF 0
1393
1394#define YYACCEPT goto yyacceptlab
1395#define YYABORT goto yyabortlab
1396#define YYERROR goto yyerrorlab
1397
1398
1399/* Like YYERROR except do call yyerror. This remains here temporarily
1400 to ease the transition to the new meaning of YYERROR, for GCC.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001401 Once GCC version 2 has supplanted version 1, this can go. However,
1402 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1403 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1404 discussed. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001405
1406#define YYFAIL goto yyerrlab
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001407#if defined YYFAIL
1408 /* This is here to suppress warnings from the GCC cpp's
1409 -Wunused-macros. Normally we don't worry about that warning, but
1410 some users do, and we want to make it easy for users to remove
1411 YYFAIL uses, which will produce warnings from Bison 2.5. */
1412#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001413
1414#define YYRECOVERING() (!!yyerrstatus)
1415
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001416#define YYBACKUP(Token, Value) \
1417do \
1418 if (yychar == YYEMPTY) \
1419 { \
1420 yychar = (Token); \
1421 yylval = (Value); \
1422 YYPOPSTACK (yylen); \
1423 yystate = *yyssp; \
1424 goto yybackup; \
1425 } \
1426 else \
1427 { \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001428 yyerror (context, YY_("syntax error: cannot back up")); \
1429 YYERROR; \
1430 } \
1431while (YYID (0))
1432
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001433/* Error token number */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001434#define YYTERROR 1
1435#define YYERRCODE 256
1436
1437
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001438/* This macro is provided for backward compatibility. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001439#ifndef YY_LOCATION_PRINT
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001440# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001441#endif
1442
1443
1444/* YYLEX -- calling `yylex' with the right arguments. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001445#ifdef YYLEX_PARAM
1446# define YYLEX yylex (&yylval, YYLEX_PARAM)
1447#else
1448# define YYLEX yylex (&yylval)
1449#endif
1450
1451/* Enable debugging if requested. */
1452#if YYDEBUG
1453
1454# ifndef YYFPRINTF
1455# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1456# define YYFPRINTF fprintf
1457# endif
1458
1459# define YYDPRINTF(Args) \
1460do { \
1461 if (yydebug) \
1462 YYFPRINTF Args; \
1463} while (YYID (0))
1464
1465# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1466do { \
1467 if (yydebug) \
1468 { \
1469 YYFPRINTF (stderr, "%s ", Title); \
1470 yy_symbol_print (stderr, \
1471 Type, Value, context); \
1472 YYFPRINTF (stderr, "\n"); \
1473 } \
1474} while (YYID (0))
1475
1476
1477/*--------------------------------.
1478| Print this symbol on YYOUTPUT. |
1479`--------------------------------*/
1480
1481/*ARGSUSED*/
1482#if (defined __STDC__ || defined __C99__FUNC__ \
1483 || defined __cplusplus || defined _MSC_VER)
1484static void
1485yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1486#else
1487static void
1488yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1489 FILE *yyoutput;
1490 int yytype;
1491 YYSTYPE const * const yyvaluep;
1492 TParseContext* context;
1493#endif
1494{
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001495 FILE *yyo = yyoutput;
1496 YYUSE (yyo);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001497 if (!yyvaluep)
1498 return;
1499 YYUSE (context);
1500# ifdef YYPRINT
1501 if (yytype < YYNTOKENS)
1502 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1503# else
1504 YYUSE (yyoutput);
1505# endif
1506 switch (yytype)
1507 {
1508 default:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001509 break;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001510 }
1511}
1512
1513
1514/*--------------------------------.
1515| Print this symbol on YYOUTPUT. |
1516`--------------------------------*/
1517
1518#if (defined __STDC__ || defined __C99__FUNC__ \
1519 || defined __cplusplus || defined _MSC_VER)
1520static void
1521yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1522#else
1523static void
1524yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1525 FILE *yyoutput;
1526 int yytype;
1527 YYSTYPE const * const yyvaluep;
1528 TParseContext* context;
1529#endif
1530{
1531 if (yytype < YYNTOKENS)
1532 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1533 else
1534 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1535
1536 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1537 YYFPRINTF (yyoutput, ")");
1538}
1539
1540/*------------------------------------------------------------------.
1541| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1542| TOP (included). |
1543`------------------------------------------------------------------*/
1544
1545#if (defined __STDC__ || defined __C99__FUNC__ \
1546 || defined __cplusplus || defined _MSC_VER)
1547static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001548yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001549#else
1550static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001551yy_stack_print (yybottom, yytop)
1552 yytype_int16 *yybottom;
1553 yytype_int16 *yytop;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001554#endif
1555{
1556 YYFPRINTF (stderr, "Stack now");
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001557 for (; yybottom <= yytop; yybottom++)
1558 {
1559 int yybot = *yybottom;
1560 YYFPRINTF (stderr, " %d", yybot);
1561 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001562 YYFPRINTF (stderr, "\n");
1563}
1564
1565# define YY_STACK_PRINT(Bottom, Top) \
1566do { \
1567 if (yydebug) \
1568 yy_stack_print ((Bottom), (Top)); \
1569} while (YYID (0))
1570
1571
1572/*------------------------------------------------.
1573| Report that the YYRULE is going to be reduced. |
1574`------------------------------------------------*/
1575
1576#if (defined __STDC__ || defined __C99__FUNC__ \
1577 || defined __cplusplus || defined _MSC_VER)
1578static void
1579yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1580#else
1581static void
1582yy_reduce_print (yyvsp, yyrule, context)
1583 YYSTYPE *yyvsp;
1584 int yyrule;
1585 TParseContext* context;
1586#endif
1587{
1588 int yynrhs = yyr2[yyrule];
1589 int yyi;
1590 unsigned long int yylno = yyrline[yyrule];
1591 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1592 yyrule - 1, yylno);
1593 /* The symbols being reduced. */
1594 for (yyi = 0; yyi < yynrhs; yyi++)
1595 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001596 YYFPRINTF (stderr, " $%d = ", yyi + 1);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001597 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1598 &(yyvsp[(yyi + 1) - (yynrhs)])
1599 , context);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001600 YYFPRINTF (stderr, "\n");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001601 }
1602}
1603
1604# define YY_REDUCE_PRINT(Rule) \
1605do { \
1606 if (yydebug) \
1607 yy_reduce_print (yyvsp, Rule, context); \
1608} while (YYID (0))
1609
1610/* Nonzero means print parse trace. It is left uninitialized so that
1611 multiple parsers can coexist. */
1612int yydebug;
1613#else /* !YYDEBUG */
1614# define YYDPRINTF(Args)
1615# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1616# define YY_STACK_PRINT(Bottom, Top)
1617# define YY_REDUCE_PRINT(Rule)
1618#endif /* !YYDEBUG */
1619
1620
1621/* YYINITDEPTH -- initial size of the parser's stacks. */
1622#ifndef YYINITDEPTH
1623# define YYINITDEPTH 200
1624#endif
1625
1626/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1627 if the built-in stack extension method is used).
1628
1629 Do not make this value too large; the results are undefined if
1630 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1631 evaluated with infinite-precision integer arithmetic. */
1632
1633#ifndef YYMAXDEPTH
1634# define YYMAXDEPTH 10000
1635#endif
1636
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001637
1638#if YYERROR_VERBOSE
1639
1640# ifndef yystrlen
1641# if defined __GLIBC__ && defined _STRING_H
1642# define yystrlen strlen
1643# else
1644/* Return the length of YYSTR. */
1645#if (defined __STDC__ || defined __C99__FUNC__ \
1646 || defined __cplusplus || defined _MSC_VER)
1647static YYSIZE_T
1648yystrlen (const char *yystr)
1649#else
1650static YYSIZE_T
1651yystrlen (yystr)
1652 const char *yystr;
1653#endif
1654{
1655 YYSIZE_T yylen;
1656 for (yylen = 0; yystr[yylen]; yylen++)
1657 continue;
1658 return yylen;
1659}
1660# endif
1661# endif
1662
1663# ifndef yystpcpy
1664# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1665# define yystpcpy stpcpy
1666# else
1667/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1668 YYDEST. */
1669#if (defined __STDC__ || defined __C99__FUNC__ \
1670 || defined __cplusplus || defined _MSC_VER)
1671static char *
1672yystpcpy (char *yydest, const char *yysrc)
1673#else
1674static char *
1675yystpcpy (yydest, yysrc)
1676 char *yydest;
1677 const char *yysrc;
1678#endif
1679{
1680 char *yyd = yydest;
1681 const char *yys = yysrc;
1682
1683 while ((*yyd++ = *yys++) != '\0')
1684 continue;
1685
1686 return yyd - 1;
1687}
1688# endif
1689# endif
1690
1691# ifndef yytnamerr
1692/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1693 quotes and backslashes, so that it's suitable for yyerror. The
1694 heuristic is that double-quoting is unnecessary unless the string
1695 contains an apostrophe, a comma, or backslash (other than
1696 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1697 null, do not copy; instead, return the length of what the result
1698 would have been. */
1699static YYSIZE_T
1700yytnamerr (char *yyres, const char *yystr)
1701{
1702 if (*yystr == '"')
1703 {
1704 YYSIZE_T yyn = 0;
1705 char const *yyp = yystr;
1706
1707 for (;;)
1708 switch (*++yyp)
1709 {
1710 case '\'':
1711 case ',':
1712 goto do_not_strip_quotes;
1713
1714 case '\\':
1715 if (*++yyp != '\\')
1716 goto do_not_strip_quotes;
1717 /* Fall through. */
1718 default:
1719 if (yyres)
1720 yyres[yyn] = *yyp;
1721 yyn++;
1722 break;
1723
1724 case '"':
1725 if (yyres)
1726 yyres[yyn] = '\0';
1727 return yyn;
1728 }
1729 do_not_strip_quotes: ;
1730 }
1731
1732 if (! yyres)
1733 return yystrlen (yystr);
1734
1735 return yystpcpy (yyres, yystr) - yyres;
1736}
1737# endif
1738
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001739/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
1740 about the unexpected token YYTOKEN for the state stack whose top is
1741 YYSSP.
1742
1743 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
1744 not large enough to hold the message. In that case, also set
1745 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
1746 required number of bytes is too large to store. */
1747static int
1748yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
1749 yytype_int16 *yyssp, int yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001750{
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001751 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
1752 YYSIZE_T yysize = yysize0;
1753 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1754 /* Internationalized format string. */
1755 const char *yyformat = YY_NULL;
1756 /* Arguments of yyformat. */
1757 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1758 /* Number of reported tokens (one for the "unexpected", one per
1759 "expected"). */
1760 int yycount = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001761
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001762 /* There are many possibilities here to consider:
1763 - Assume YYFAIL is not used. It's too flawed to consider. See
1764 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
1765 for details. YYERROR is fine as it does not invoke this
1766 function.
1767 - If this state is a consistent state with a default action, then
1768 the only way this function was invoked is if the default action
1769 is an error action. In that case, don't check for expected
1770 tokens because there are none.
1771 - The only way there can be no lookahead present (in yychar) is if
1772 this state is a consistent state with a default action. Thus,
1773 detecting the absence of a lookahead is sufficient to determine
1774 that there is no unexpected or expected token to report. In that
1775 case, just report a simple "syntax error".
1776 - Don't assume there isn't a lookahead just because this state is a
1777 consistent state with a default action. There might have been a
1778 previous inconsistent state, consistent state with a non-default
1779 action, or user semantic action that manipulated yychar.
1780 - Of course, the expected token list depends on states to have
1781 correct lookahead information, and it depends on the parser not
1782 to perform extra reductions after fetching a lookahead from the
1783 scanner and before detecting a syntax error. Thus, state merging
1784 (from LALR or IELR) and default reductions corrupt the expected
1785 token list. However, the list is correct for canonical LR with
1786 one exception: it will still contain any token that will not be
1787 accepted due to an error action in a later state.
1788 */
1789 if (yytoken != YYEMPTY)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001790 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001791 int yyn = yypact[*yyssp];
1792 yyarg[yycount++] = yytname[yytoken];
1793 if (!yypact_value_is_default (yyn))
1794 {
1795 /* Start YYX at -YYN if negative to avoid negative indexes in
1796 YYCHECK. In other words, skip the first -YYN actions for
1797 this state because they are default actions. */
1798 int yyxbegin = yyn < 0 ? -yyn : 0;
1799 /* Stay within bounds of both yycheck and yytname. */
1800 int yychecklim = YYLAST - yyn + 1;
1801 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1802 int yyx;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001803
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001804 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1805 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
1806 && !yytable_value_is_error (yytable[yyx + yyn]))
1807 {
1808 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1809 {
1810 yycount = 1;
1811 yysize = yysize0;
1812 break;
1813 }
1814 yyarg[yycount++] = yytname[yyx];
1815 {
1816 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
1817 if (! (yysize <= yysize1
1818 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1819 return 2;
1820 yysize = yysize1;
1821 }
1822 }
1823 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001824 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001825
1826 switch (yycount)
1827 {
1828# define YYCASE_(N, S) \
1829 case N: \
1830 yyformat = S; \
1831 break
1832 YYCASE_(0, YY_("syntax error"));
1833 YYCASE_(1, YY_("syntax error, unexpected %s"));
1834 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
1835 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
1836 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
1837 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
1838# undef YYCASE_
1839 }
1840
1841 {
1842 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
1843 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
1844 return 2;
1845 yysize = yysize1;
1846 }
1847
1848 if (*yymsg_alloc < yysize)
1849 {
1850 *yymsg_alloc = 2 * yysize;
1851 if (! (yysize <= *yymsg_alloc
1852 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
1853 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
1854 return 1;
1855 }
1856
1857 /* Avoid sprintf, as that infringes on the user's name space.
1858 Don't have undefined behavior even if the translation
1859 produced a string with the wrong number of "%s"s. */
1860 {
1861 char *yyp = *yymsg;
1862 int yyi = 0;
1863 while ((*yyp = *yyformat) != '\0')
1864 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
1865 {
1866 yyp += yytnamerr (yyp, yyarg[yyi++]);
1867 yyformat += 2;
1868 }
1869 else
1870 {
1871 yyp++;
1872 yyformat++;
1873 }
1874 }
1875 return 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001876}
1877#endif /* YYERROR_VERBOSE */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001878
1879/*-----------------------------------------------.
1880| Release the memory associated to this symbol. |
1881`-----------------------------------------------*/
1882
1883/*ARGSUSED*/
1884#if (defined __STDC__ || defined __C99__FUNC__ \
1885 || defined __cplusplus || defined _MSC_VER)
1886static void
1887yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1888#else
1889static void
1890yydestruct (yymsg, yytype, yyvaluep, context)
1891 const char *yymsg;
1892 int yytype;
1893 YYSTYPE *yyvaluep;
1894 TParseContext* context;
1895#endif
1896{
1897 YYUSE (yyvaluep);
1898 YYUSE (context);
1899
1900 if (!yymsg)
1901 yymsg = "Deleting";
1902 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1903
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001904 switch (yytype)
1905 {
1906
1907 default:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001908 break;
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001909 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001910}
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001911
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001912
1913
1914
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001915/*----------.
1916| yyparse. |
1917`----------*/
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001918
1919#ifdef YYPARSE_PARAM
1920#if (defined __STDC__ || defined __C99__FUNC__ \
1921 || defined __cplusplus || defined _MSC_VER)
1922int
1923yyparse (void *YYPARSE_PARAM)
1924#else
1925int
1926yyparse (YYPARSE_PARAM)
1927 void *YYPARSE_PARAM;
1928#endif
1929#else /* ! YYPARSE_PARAM */
1930#if (defined __STDC__ || defined __C99__FUNC__ \
1931 || defined __cplusplus || defined _MSC_VER)
1932int
1933yyparse (TParseContext* context)
1934#else
1935int
1936yyparse (context)
1937 TParseContext* context;
1938#endif
1939#endif
1940{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001941/* The lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001942int yychar;
1943
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001944
1945#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
1946/* Suppress an incorrect diagnostic about yylval being uninitialized. */
1947# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
1948 _Pragma ("GCC diagnostic push") \
1949 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
1950 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
1951# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
1952 _Pragma ("GCC diagnostic pop")
1953#else
1954/* Default value used for initialization, for pacifying older GCCs
1955 or non-GCC compilers. */
1956static YYSTYPE yyval_default;
1957# define YY_INITIAL_VALUE(Value) = Value
1958#endif
1959#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1960# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1961# define YY_IGNORE_MAYBE_UNINITIALIZED_END
1962#endif
1963#ifndef YY_INITIAL_VALUE
1964# define YY_INITIAL_VALUE(Value) /* Nothing. */
1965#endif
1966
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001967/* The semantic value of the lookahead symbol. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001968YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001969
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001970 /* Number of syntax errors so far. */
1971 int yynerrs;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001972
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001973 int yystate;
1974 /* Number of tokens to shift before error messages enabled. */
1975 int yyerrstatus;
1976
1977 /* The stacks and their tools:
1978 `yyss': related to states.
1979 `yyvs': related to semantic values.
1980
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001981 Refer to the stacks through separate pointers, to allow yyoverflow
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001982 to reallocate them elsewhere. */
1983
1984 /* The state stack. */
1985 yytype_int16 yyssa[YYINITDEPTH];
1986 yytype_int16 *yyss;
1987 yytype_int16 *yyssp;
1988
1989 /* The semantic value stack. */
1990 YYSTYPE yyvsa[YYINITDEPTH];
1991 YYSTYPE *yyvs;
1992 YYSTYPE *yyvsp;
1993
1994 YYSIZE_T yystacksize;
1995
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001996 int yyn;
1997 int yyresult;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001998 /* Lookahead token as an internal (translated) token number. */
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00001999 int yytoken = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002000 /* The variables used to return semantic value and location from the
2001 action routines. */
2002 YYSTYPE yyval;
2003
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002004#if YYERROR_VERBOSE
2005 /* Buffer for error messages, and its allocated size. */
2006 char yymsgbuf[128];
2007 char *yymsg = yymsgbuf;
2008 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2009#endif
2010
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002011#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2012
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002013 /* The number of symbols on the RHS of the reduced rule.
2014 Keep to zero when no symbol should be popped. */
2015 int yylen = 0;
2016
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002017 yyssp = yyss = yyssa;
2018 yyvsp = yyvs = yyvsa;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002019 yystacksize = YYINITDEPTH;
2020
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002021 YYDPRINTF ((stderr, "Starting parse\n"));
2022
2023 yystate = 0;
2024 yyerrstatus = 0;
2025 yynerrs = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002026 yychar = YYEMPTY; /* Cause a token to be read. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002027 goto yysetstate;
2028
2029/*------------------------------------------------------------.
2030| yynewstate -- Push a new state, which is found in yystate. |
2031`------------------------------------------------------------*/
2032 yynewstate:
2033 /* In all cases, when you get here, the value and location stacks
2034 have just been pushed. So pushing a state here evens the stacks. */
2035 yyssp++;
2036
2037 yysetstate:
2038 *yyssp = yystate;
2039
2040 if (yyss + yystacksize - 1 <= yyssp)
2041 {
2042 /* Get the current used size of the three stacks, in elements. */
2043 YYSIZE_T yysize = yyssp - yyss + 1;
2044
2045#ifdef yyoverflow
2046 {
2047 /* Give user a chance to reallocate the stack. Use copies of
2048 these so that the &'s don't force the real ones into
2049 memory. */
2050 YYSTYPE *yyvs1 = yyvs;
2051 yytype_int16 *yyss1 = yyss;
2052
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002053 /* Each stack pointer address is followed by the size of the
2054 data in use in that stack, in bytes. This used to be a
2055 conditional around just the two extra args, but that might
2056 be undefined if yyoverflow is a macro. */
2057 yyoverflow (YY_("memory exhausted"),
2058 &yyss1, yysize * sizeof (*yyssp),
2059 &yyvs1, yysize * sizeof (*yyvsp),
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002060 &yystacksize);
2061
2062 yyss = yyss1;
2063 yyvs = yyvs1;
2064 }
2065#else /* no yyoverflow */
2066# ifndef YYSTACK_RELOCATE
2067 goto yyexhaustedlab;
2068# else
2069 /* Extend the stack our own way. */
2070 if (YYMAXDEPTH <= yystacksize)
2071 goto yyexhaustedlab;
2072 yystacksize *= 2;
2073 if (YYMAXDEPTH < yystacksize)
2074 yystacksize = YYMAXDEPTH;
2075
2076 {
2077 yytype_int16 *yyss1 = yyss;
2078 union yyalloc *yyptr =
2079 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2080 if (! yyptr)
2081 goto yyexhaustedlab;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002082 YYSTACK_RELOCATE (yyss_alloc, yyss);
2083 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002084# undef YYSTACK_RELOCATE
2085 if (yyss1 != yyssa)
2086 YYSTACK_FREE (yyss1);
2087 }
2088# endif
2089#endif /* no yyoverflow */
2090
2091 yyssp = yyss + yysize - 1;
2092 yyvsp = yyvs + yysize - 1;
2093
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002094 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2095 (unsigned long int) yystacksize));
2096
2097 if (yyss + yystacksize - 1 <= yyssp)
2098 YYABORT;
2099 }
2100
2101 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2102
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002103 if (yystate == YYFINAL)
2104 YYACCEPT;
2105
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002106 goto yybackup;
2107
2108/*-----------.
2109| yybackup. |
2110`-----------*/
2111yybackup:
2112
2113 /* Do appropriate processing given the current state. Read a
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002114 lookahead token if we need one and don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002115
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002116 /* First try to decide what to do without reference to lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002117 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002118 if (yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002119 goto yydefault;
2120
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002121 /* Not known => get a lookahead token if don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002122
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002123 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002124 if (yychar == YYEMPTY)
2125 {
2126 YYDPRINTF ((stderr, "Reading a token: "));
2127 yychar = YYLEX;
2128 }
2129
2130 if (yychar <= YYEOF)
2131 {
2132 yychar = yytoken = YYEOF;
2133 YYDPRINTF ((stderr, "Now at end of input.\n"));
2134 }
2135 else
2136 {
2137 yytoken = YYTRANSLATE (yychar);
2138 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2139 }
2140
2141 /* If the proper action on seeing token YYTOKEN is to reduce or to
2142 detect an error, take that action. */
2143 yyn += yytoken;
2144 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2145 goto yydefault;
2146 yyn = yytable[yyn];
2147 if (yyn <= 0)
2148 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002149 if (yytable_value_is_error (yyn))
2150 goto yyerrlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002151 yyn = -yyn;
2152 goto yyreduce;
2153 }
2154
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002155 /* Count tokens shifted since error; after three, turn off error
2156 status. */
2157 if (yyerrstatus)
2158 yyerrstatus--;
2159
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002160 /* Shift the lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002161 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2162
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002163 /* Discard the shifted token. */
2164 yychar = YYEMPTY;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002165
2166 yystate = yyn;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002167 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002168 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00002169 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002170
2171 goto yynewstate;
2172
2173
2174/*-----------------------------------------------------------.
2175| yydefault -- do the default action for the current state. |
2176`-----------------------------------------------------------*/
2177yydefault:
2178 yyn = yydefact[yystate];
2179 if (yyn == 0)
2180 goto yyerrlab;
2181 goto yyreduce;
2182
2183
2184/*-----------------------------.
2185| yyreduce -- Do a reduction. |
2186`-----------------------------*/
2187yyreduce:
2188 /* yyn is the number of a rule to reduce with. */
2189 yylen = yyr2[yyn];
2190
2191 /* If YYLEN is nonzero, implement the default value of the action:
2192 `$$ = $1'.
2193
2194 Otherwise, the following line sets YYVAL to garbage.
2195 This behavior is undocumented and Bison
2196 users should not rely upon it. Assigning to YYVAL
2197 unconditionally makes the parser a bit smaller, and it avoids a
2198 GCC warning that YYVAL may be used uninitialized. */
2199 yyval = yyvsp[1-yylen];
2200
2201
2202 YY_REDUCE_PRINT (yyn);
2203 switch (yyn)
2204 {
2205 case 2:
2206
2207 {
2208 // The symbol table search was done in the lexical phase
2209 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2210 const TVariable* variable;
2211 if (symbol == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002212 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002213 context->recover();
2214 TType type(EbtFloat, EbpUndefined);
2215 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00002216 context->symbolTable.declare(*fakeVariable);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002217 variable = fakeVariable;
2218 } else {
2219 // This identifier can only be a variable type symbol
2220 if (! symbol->isVariable()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002221 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002222 context->recover();
2223 }
2224 variable = static_cast<const TVariable*>(symbol);
2225 }
2226
2227 // don't delete $1.string, it's used by error recovery, and the pool
2228 // pop will reclaim the memory
2229
2230 if (variable->getType().getQualifier() == EvqConst ) {
2231 ConstantUnion* constArray = variable->getConstPointer();
2232 TType t(variable->getType());
2233 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2234 } else
2235 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2236 variable->getName(),
2237 variable->getType(), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002238 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002239 break;
2240
2241 case 3:
2242
2243 {
2244 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002245 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002246 break;
2247
2248 case 4:
2249
2250 {
2251 //
2252 // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
2253 // check for overflow for constants
2254 //
2255 if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002256 context->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002257 context->recover();
2258 }
2259 ConstantUnion *unionArray = new ConstantUnion[1];
2260 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2261 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002262 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002263 break;
2264
2265 case 5:
2266
2267 {
2268 ConstantUnion *unionArray = new ConstantUnion[1];
2269 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2270 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002271 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002272 break;
2273
2274 case 6:
2275
2276 {
2277 ConstantUnion *unionArray = new ConstantUnion[1];
2278 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2279 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002280 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002281 break;
2282
2283 case 7:
2284
2285 {
2286 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002287 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002288 break;
2289
2290 case 8:
2291
2292 {
2293 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002294 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002295 break;
2296
2297 case 9:
2298
2299 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002300 (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 +00002301 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002302 break;
2303
2304 case 10:
2305
2306 {
2307 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002308 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002309 break;
2310
2311 case 11:
2312
2313 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00002314 (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 +00002315 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002316 break;
2317
2318 case 12:
2319
2320 {
2321 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2322 context->recover();
2323 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2324 if ((yyval.interm.intermTypedNode) == 0) {
2325 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2326 context->recover();
2327 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2328 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002329 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002330 break;
2331
2332 case 13:
2333
2334 {
2335 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2336 context->recover();
2337 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2338 if ((yyval.interm.intermTypedNode) == 0) {
2339 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2340 context->recover();
2341 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2342 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002343 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002344 break;
2345
2346 case 14:
2347
2348 {
2349 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2350 context->recover();
2351 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002352 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002353 break;
2354
2355 case 15:
2356
2357 {
2358 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2359 TOperator op = fnCall->getBuiltInOp();
2360
2361 if (op != EOpNull)
2362 {
2363 //
2364 // Then this should be a constructor.
2365 // Don't go through the symbol table for constructors.
2366 // Their parameters will be verified algorithmically.
2367 //
2368 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2369 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2370 (yyval.interm.intermTypedNode) = 0;
2371 } else {
2372 //
2373 // It's a constructor, of type 'type'.
2374 //
2375 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2376 }
2377
2378 if ((yyval.interm.intermTypedNode) == 0) {
2379 context->recover();
2380 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2381 }
2382 (yyval.interm.intermTypedNode)->setType(type);
2383 } else {
2384 //
2385 // Not a constructor. Find it in the symbol table.
2386 //
2387 const TFunction* fnCandidate;
2388 bool builtIn;
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00002389 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, context->shaderVersion, &builtIn);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002390 if (fnCandidate) {
2391 //
2392 // A declared function.
2393 //
2394 if (builtIn && !fnCandidate->getExtension().empty() &&
2395 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2396 context->recover();
2397 }
2398 op = fnCandidate->getBuiltInOp();
2399 if (builtIn && op != EOpNull) {
2400 //
2401 // A function call mapped to a built-in operation.
2402 //
2403 if (fnCandidate->getParamCount() == 1) {
2404 //
2405 // Treat it like a built-in unary operator.
2406 //
2407 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2408 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002409 std::stringstream extraInfoStream;
2410 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2411 std::string extraInfo = extraInfoStream.str();
2412 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002413 YYERROR;
2414 }
2415 } else {
2416 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2417 }
2418 } else {
2419 // This is a real function call
2420
2421 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2422 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2423
2424 // this is how we know whether the given function is a builtIn function or a user defined function
2425 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2426 // if builtIn == true, it's definitely a builtIn function with EOpNull
2427 if (!builtIn)
2428 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2429 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2430
2431 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002432 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002433 qual = fnCandidate->getParam(i).type->getQualifier();
2434 if (qual == EvqOut || qual == EvqInOut) {
2435 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002436 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 +00002437 context->recover();
2438 }
2439 }
2440 }
2441 }
2442 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2443 } else {
2444 // error message was put out by PaFindFunction()
2445 // Put on a dummy node for error recovery
2446 ConstantUnion *unionArray = new ConstantUnion[1];
2447 unionArray->setFConst(0.0f);
2448 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2449 context->recover();
2450 }
2451 }
2452 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002453 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002454 break;
2455
2456 case 16:
2457
2458 {
2459 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002460 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002461 break;
2462
2463 case 17:
2464
2465 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002466 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002467 context->recover();
2468 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002469 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002470 break;
2471
2472 case 18:
2473
2474 {
2475 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2476 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002477 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002478 break;
2479
2480 case 19:
2481
2482 {
2483 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2484 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002485 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002486 break;
2487
2488 case 20:
2489
2490 {
2491 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2492 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002493 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002494 break;
2495
2496 case 21:
2497
2498 {
2499 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2500 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002501 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002502 break;
2503
2504 case 22:
2505
2506 {
2507 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2508 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2509 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2510 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002511 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002512 break;
2513
2514 case 23:
2515
2516 {
2517 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2518 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2519 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2520 (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 +00002521 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002522 break;
2523
2524 case 24:
2525
2526 {
2527 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002528 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002529 break;
2530
2531 case 25:
2532
2533 {
2534 //
2535 // Constructor
2536 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002537 TOperator op = EOpNull;
2538 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2539 op = EOpConstructStruct;
2540 } else {
2541 switch ((yyvsp[(1) - (1)].interm.type).type) {
2542 case EbtFloat:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002543 if ((yyvsp[(1) - (1)].interm.type).isMatrix()) {
2544 switch((yyvsp[(1) - (1)].interm.type).getCols()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002545 case 2: op = EOpConstructMat2; break;
2546 case 3: op = EOpConstructMat3; break;
2547 case 4: op = EOpConstructMat4; break;
2548 }
2549 } else {
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002550 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002551 case 1: op = EOpConstructFloat; break;
2552 case 2: op = EOpConstructVec2; break;
2553 case 3: op = EOpConstructVec3; break;
2554 case 4: op = EOpConstructVec4; break;
2555 }
2556 }
2557 break;
2558 case EbtInt:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002559 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002560 case 1: op = EOpConstructInt; break;
2561 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2562 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2563 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2564 }
2565 break;
2566 case EbtBool:
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00002567 switch((yyvsp[(1) - (1)].interm.type).getNominalSize()) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002568 case 1: op = EOpConstructBool; break;
2569 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2570 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2571 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2572 }
2573 break;
2574 default: break;
2575 }
2576 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002577 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 +00002578 context->recover();
2579 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2580 op = EOpConstructFloat;
2581 }
2582 }
2583 TString tempString;
2584 TType type((yyvsp[(1) - (1)].interm.type));
2585 TFunction *function = new TFunction(&tempString, type, op);
2586 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002587 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002588 break;
2589
2590 case 26:
2591
2592 {
2593 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2594 context->recover();
2595 TType type(EbtVoid, EbpUndefined);
2596 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2597 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002598 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002599 break;
2600
2601 case 27:
2602
2603 {
2604 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2605 context->recover();
2606 TType type(EbtVoid, EbpUndefined);
2607 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2608 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002609 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002610 break;
2611
2612 case 28:
2613
2614 {
2615 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002616 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002617 break;
2618
2619 case 29:
2620
2621 {
2622 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2623 context->recover();
2624 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2625 if ((yyval.interm.intermTypedNode) == 0) {
2626 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2627 context->recover();
2628 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2629 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002630 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002631 break;
2632
2633 case 30:
2634
2635 {
2636 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2637 context->recover();
2638 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2639 if ((yyval.interm.intermTypedNode) == 0) {
2640 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2641 context->recover();
2642 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2643 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002644 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002645 break;
2646
2647 case 31:
2648
2649 {
2650 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2651 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2652 if ((yyval.interm.intermTypedNode) == 0) {
2653 const char* errorOp = "";
2654 switch((yyvsp[(1) - (2)].interm).op) {
2655 case EOpNegative: errorOp = "-"; break;
2656 case EOpLogicalNot: errorOp = "!"; break;
2657 default: break;
2658 }
2659 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2660 context->recover();
2661 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2662 }
2663 } else
2664 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002665 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002666 break;
2667
2668 case 32:
2669
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002670 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002671 break;
2672
2673 case 33:
2674
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002675 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002676 break;
2677
2678 case 34:
2679
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002680 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002681 break;
2682
2683 case 35:
2684
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002685 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002686 break;
2687
2688 case 36:
2689
2690 {
2691 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2692 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2693 if ((yyval.interm.intermTypedNode) == 0) {
2694 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2695 context->recover();
2696 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2697 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002698 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002699 break;
2700
2701 case 37:
2702
2703 {
2704 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2705 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2706 if ((yyval.interm.intermTypedNode) == 0) {
2707 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2708 context->recover();
2709 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2710 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002711 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002712 break;
2713
2714 case 38:
2715
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002716 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002717 break;
2718
2719 case 39:
2720
2721 {
2722 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2723 if ((yyval.interm.intermTypedNode) == 0) {
2724 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2725 context->recover();
2726 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2727 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002728 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002729 break;
2730
2731 case 40:
2732
2733 {
2734 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2735 if ((yyval.interm.intermTypedNode) == 0) {
2736 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2737 context->recover();
2738 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2739 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002740 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002741 break;
2742
2743 case 41:
2744
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002745 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002746 break;
2747
2748 case 42:
2749
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002750 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002751 break;
2752
2753 case 43:
2754
2755 {
2756 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2757 if ((yyval.interm.intermTypedNode) == 0) {
2758 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2759 context->recover();
2760 ConstantUnion *unionArray = new ConstantUnion[1];
2761 unionArray->setBConst(false);
2762 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2763 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002764 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002765 break;
2766
2767 case 44:
2768
2769 {
2770 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2771 if ((yyval.interm.intermTypedNode) == 0) {
2772 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2773 context->recover();
2774 ConstantUnion *unionArray = new ConstantUnion[1];
2775 unionArray->setBConst(false);
2776 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2777 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002778 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002779 break;
2780
2781 case 45:
2782
2783 {
2784 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2785 if ((yyval.interm.intermTypedNode) == 0) {
2786 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2787 context->recover();
2788 ConstantUnion *unionArray = new ConstantUnion[1];
2789 unionArray->setBConst(false);
2790 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2791 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002792 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002793 break;
2794
2795 case 46:
2796
2797 {
2798 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2799 if ((yyval.interm.intermTypedNode) == 0) {
2800 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2801 context->recover();
2802 ConstantUnion *unionArray = new ConstantUnion[1];
2803 unionArray->setBConst(false);
2804 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2805 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002806 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002807 break;
2808
2809 case 47:
2810
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002811 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002812 break;
2813
2814 case 48:
2815
2816 {
2817 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2818 if ((yyval.interm.intermTypedNode) == 0) {
2819 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2820 context->recover();
2821 ConstantUnion *unionArray = new ConstantUnion[1];
2822 unionArray->setBConst(false);
2823 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2824 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002825 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002826 break;
2827
2828 case 49:
2829
2830 {
2831 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2832 if ((yyval.interm.intermTypedNode) == 0) {
2833 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2834 context->recover();
2835 ConstantUnion *unionArray = new ConstantUnion[1];
2836 unionArray->setBConst(false);
2837 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2838 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002839 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002840 break;
2841
2842 case 50:
2843
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002844 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002845 break;
2846
2847 case 51:
2848
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002849 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002850 break;
2851
2852 case 52:
2853
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002854 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002855 break;
2856
2857 case 53:
2858
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002859 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002860 break;
2861
2862 case 54:
2863
2864 {
2865 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2866 if ((yyval.interm.intermTypedNode) == 0) {
2867 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2868 context->recover();
2869 ConstantUnion *unionArray = new ConstantUnion[1];
2870 unionArray->setBConst(false);
2871 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2872 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002873 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002874 break;
2875
2876 case 55:
2877
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002878 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002879 break;
2880
2881 case 56:
2882
2883 {
2884 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2885 if ((yyval.interm.intermTypedNode) == 0) {
2886 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2887 context->recover();
2888 ConstantUnion *unionArray = new ConstantUnion[1];
2889 unionArray->setBConst(false);
2890 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2891 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002892 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002893 break;
2894
2895 case 57:
2896
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002897 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002898 break;
2899
2900 case 58:
2901
2902 {
2903 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2904 if ((yyval.interm.intermTypedNode) == 0) {
2905 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2906 context->recover();
2907 ConstantUnion *unionArray = new ConstantUnion[1];
2908 unionArray->setBConst(false);
2909 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2910 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002911 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002912 break;
2913
2914 case 59:
2915
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002916 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002917 break;
2918
2919 case 60:
2920
2921 {
2922 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
2923 context->recover();
2924
2925 (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);
2926 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
2927 (yyval.interm.intermTypedNode) = 0;
2928
2929 if ((yyval.interm.intermTypedNode) == 0) {
2930 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
2931 context->recover();
2932 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
2933 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002934 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002935 break;
2936
2937 case 61:
2938
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002939 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002940 break;
2941
2942 case 62:
2943
2944 {
2945 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
2946 context->recover();
2947 (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);
2948 if ((yyval.interm.intermTypedNode) == 0) {
2949 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2950 context->recover();
2951 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2952 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002953 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002954 break;
2955
2956 case 63:
2957
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002958 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002959 break;
2960
2961 case 64:
2962
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002963 { 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 +00002964 break;
2965
2966 case 65:
2967
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002968 { 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 +00002969 break;
2970
2971 case 66:
2972
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002973 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002974 break;
2975
2976 case 67:
2977
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002978 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002979 break;
2980
2981 case 68:
2982
2983 {
2984 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002985 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002986 break;
2987
2988 case 69:
2989
2990 {
2991 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2992 if ((yyval.interm.intermTypedNode) == 0) {
2993 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2994 context->recover();
2995 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
2996 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002997 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002998 break;
2999
3000 case 70:
3001
3002 {
3003 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3004 context->recover();
3005 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003006 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003007 break;
3008
3009 case 71:
3010
3011 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003012 if (context->enterStructDeclaration((yyvsp[(1) - (2)].lex).line, *(yyvsp[(1) - (2)].lex).string))
3013 context->recover();
3014 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3015 }
3016 break;
3017
3018 case 72:
3019
3020 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003021 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3022
3023 TIntermAggregate *prototype = new TIntermAggregate;
3024 prototype->setType(function.getReturnType());
3025 prototype->setName(function.getName());
3026
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003027 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003028 {
3029 const TParameter &param = function.getParam(i);
3030 if (param.name != 0)
3031 {
3032 TVariable *variable = new TVariable(param.name, *param.type);
3033
3034 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3035 }
3036 else
3037 {
3038 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3039 }
3040 }
3041
3042 prototype->setOp(EOpPrototype);
3043 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003044
3045 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003046 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003047 break;
3048
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003049 case 73:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003050
3051 {
3052 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3053 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3054 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003055 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003056 break;
3057
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003058 case 74:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003059
3060 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003061 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3062 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3063 context->recover();
3064 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003065 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3066 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3067 context->recover();
3068 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003069 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003070 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003071 break;
3072
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003073 case 75:
3074
3075 {
3076 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yyvsp[(1) - (5)].interm.type).line, "interface blocks");
3077 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (5)].interm.type), (yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].interm.typeList), "", 0, NULL, 0);
3078 }
3079 break;
3080
3081 case 76:
3082
3083 {
3084 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yyvsp[(1) - (6)].interm.type).line, "interface blocks");
3085 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (6)].interm.type), (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].interm.typeList), *(yyvsp[(5) - (6)].lex).string, (yyvsp[(5) - (6)].lex).line, NULL, 0);
3086 }
3087 break;
3088
3089 case 77:
3090
3091 {
3092 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yyvsp[(1) - (9)].interm.type).line, "interface blocks");
3093 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (9)].interm.type), (yyvsp[(2) - (9)].lex).line, *(yyvsp[(2) - (9)].lex).string, (yyvsp[(3) - (9)].interm.typeList), *(yyvsp[(5) - (9)].lex).string, (yyvsp[(5) - (9)].lex).line, (yyvsp[(7) - (9)].interm.intermTypedNode), (yyvsp[(6) - (9)].lex).line);
3094 }
3095 break;
3096
3097 case 78:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003098
3099 {
3100 //
3101 // Multiple declarations of the same function are allowed.
3102 //
3103 // If this is a definition, the definition production code will check for redefinitions
3104 // (we don't know at this point if it's a definition or not).
3105 //
3106 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3107 //
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00003108 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003109 if (prevDec) {
3110 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003111 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 +00003112 context->recover();
3113 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003114 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003115 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003116 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 +00003117 context->recover();
3118 }
3119 }
3120 }
3121
3122 //
3123 // If this is a redeclaration, it could also be a definition,
3124 // in which case, we want to use the variable names from this one, and not the one that's
3125 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3126 //
3127 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3128 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3129
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003130 // We're at the inner scope level of the function's arguments and body statement.
3131 // Add the function prototype to the surrounding scope instead.
3132 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003133 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003134 break;
3135
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003136 case 79:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003137
3138 {
3139 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003140 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003141 break;
3142
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003143 case 80:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003144
3145 {
3146 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003147 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003148 break;
3149
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003150 case 81:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003151
3152 {
3153 // Add the parameter
3154 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3155 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3156 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3157 else
3158 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003159 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003160 break;
3161
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003162 case 82:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003163
3164 {
3165 //
3166 // Only first parameter of one-parameter functions can be void
3167 // The check for named parameters not being void is done in parameter_declarator
3168 //
3169 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3170 //
3171 // This parameter > first is void
3172 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003173 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003174 context->recover();
3175 delete (yyvsp[(3) - (3)].interm).param.type;
3176 } else {
3177 // Add the parameter
3178 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3179 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3180 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003181 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003182 break;
3183
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003184 case 83:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003185
3186 {
3187 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003188 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 +00003189 context->recover();
3190 }
3191 // make sure a sampler is not involved as well...
3192 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3193 context->recover();
3194
3195 // Add the function as a prototype after parsing it (we do not support recursion)
3196 TFunction *function;
3197 TType type((yyvsp[(1) - (3)].interm.type));
3198 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3199 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003200
3201 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003202 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003203 break;
3204
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003205 case 84:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003206
3207 {
3208 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003209 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 +00003210 context->recover();
3211 }
3212 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3213 context->recover();
3214 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3215 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3216 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003217 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003218 break;
3219
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003220 case 85:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003221
3222 {
3223 // Check that we can make an array out of this type
3224 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3225 context->recover();
3226
3227 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3228 context->recover();
3229
3230 int size;
3231 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3232 context->recover();
3233 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3234
3235 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3236 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3237 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3238 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003239 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003240 break;
3241
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003242 case 86:
3243
3244 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003245 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3246 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3247 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003248 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003249 break;
3250
3251 case 87:
3252
3253 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003254 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3255 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3256 context->recover();
3257 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3258 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003259 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003260 break;
3261
3262 case 88:
3263
3264 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003265 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3266 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3267 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003268 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003269 break;
3270
3271 case 89:
3272
3273 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003274 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3275 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3276 context->recover();
3277 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3278 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003279 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003280 break;
3281
3282 case 90:
3283
3284 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003285 (yyval.interm.qualifier) = EvqIn;
3286 }
3287 break;
3288
3289 case 91:
3290
3291 {
3292 (yyval.interm.qualifier) = EvqIn;
3293 }
3294 break;
3295
3296 case 92:
3297
3298 {
3299 (yyval.interm.qualifier) = EvqOut;
3300 }
3301 break;
3302
3303 case 93:
3304
3305 {
3306 (yyval.interm.qualifier) = EvqInOut;
3307 }
3308 break;
3309
3310 case 94:
3311
3312 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003313 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3314 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003315 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003316 break;
3317
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003318 case 95:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003319
3320 {
3321 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003322 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003323 break;
3324
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003325 case 96:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003326
3327 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003328 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3329 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003330 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 +00003331 context->recover();
3332 }
3333
zmo@google.comfd747b82011-04-23 01:30:07 +00003334 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3335 (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 +00003336
3337 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3338 context->recover();
3339
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003340 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 +00003341 context->recover();
3342
zmo@google.comfd747b82011-04-23 01:30:07 +00003343 TVariable* variable = 0;
3344 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 +00003345 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003346 if (symbol && variable)
3347 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003348 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003349 break;
3350
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003351 case 97:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003352
3353 {
3354 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3355 context->recover();
3356
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003357 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 +00003358 context->recover();
3359
3360 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3361
3362 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))
3363 context->recover();
3364 else {
3365 (yyvsp[(1) - (5)].interm).type.setArray(true);
3366 TVariable* variable;
3367 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3368 context->recover();
3369 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003370 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003371 break;
3372
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003373 case 98:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003374
3375 {
3376 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3377 context->recover();
3378
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003379 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 +00003380 context->recover();
3381
3382 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3383
3384 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))
3385 context->recover();
3386 else {
3387 int size;
3388 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3389 context->recover();
3390 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003391 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003392 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3393 context->recover();
3394 TType type = TType((yyvsp[(1) - (6)].interm).type);
3395 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003396 (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 +00003397 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003398 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003399 break;
3400
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003401 case 99:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003402
3403 {
3404 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3405 context->recover();
3406
3407 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3408
3409 TIntermNode* intermNode;
3410 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3411 //
3412 // build the intermediate representation
3413 //
3414 if (intermNode)
3415 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3416 else
3417 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3418 } else {
3419 context->recover();
3420 (yyval.interm).intermAggregate = 0;
3421 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003422 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003423 break;
3424
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003425 case 100:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003426
3427 {
3428 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3429 (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 +00003430 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003431 break;
3432
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003433 case 101:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003434
3435 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003436 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3437 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003438
3439 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3440 context->recover();
3441
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003442 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 +00003443 context->recover();
3444
3445 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3446
zmo@google.comfd747b82011-04-23 01:30:07 +00003447 TVariable* variable = 0;
3448 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 +00003449 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003450 if (variable && symbol)
3451 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003452 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003453 break;
3454
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003455 case 102:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003456
3457 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003458 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 +00003459 context->recover();
3460
zmo@google.comfd747b82011-04-23 01:30:07 +00003461 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3462 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003463 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003464 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003465 break;
3466
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003467 case 103:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003468
3469 {
3470 TType type = TType((yyvsp[(1) - (5)].interm.type));
3471 int size;
3472 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3473 context->recover();
3474 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003475 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3476 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003477
3478 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3479 context->recover();
3480
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003481 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 +00003482 context->recover();
3483
3484 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3485
3486 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)))
3487 context->recover();
3488 else {
3489 int size;
3490 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3491 context->recover();
3492
3493 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003494 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003495 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3496 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003497 if (variable && symbol)
3498 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003499 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003500 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003501 break;
3502
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003503 case 104:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003504
3505 {
3506 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3507 context->recover();
3508
3509 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3510
3511 TIntermNode* intermNode;
3512 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3513 //
3514 // Build intermediate representation
3515 //
3516 if(intermNode)
3517 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3518 else
3519 (yyval.interm).intermAggregate = 0;
3520 } else {
3521 context->recover();
3522 (yyval.interm).intermAggregate = 0;
3523 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003524 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003525 break;
3526
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003527 case 105:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003528
3529 {
3530 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003531 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3532 context->recover();
3533 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3534 if (!(yyvsp[(2) - (2)].lex).symbol)
3535 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003536 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 +00003537 context->recover();
3538
3539 (yyval.interm).intermAggregate = 0;
3540 }
3541 else
3542 {
3543 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3544 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3545 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003546 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003547 break;
3548
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003549 case 106:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003550
3551 {
3552 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3553
3554 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003555 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003556 context->recover();
3557 (yyvsp[(1) - (1)].interm.type).setArray(false);
3558 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003559 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003560 break;
3561
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003562 case 107:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003563
3564 {
3565 if ((yyvsp[(2) - (2)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003566 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003567 context->recover();
3568 (yyvsp[(2) - (2)].interm.type).setArray(false);
3569 }
3570
3571 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3572 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003573 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 +00003574 context->recover();
3575 }
3576 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3577 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003578 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 +00003579 context->recover();
3580 }
3581 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3582 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003583 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003584 break;
3585
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003586 case 108:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003587
3588 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003589 (yyval.interm.type).qualifier = EvqSmooth;
3590 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003591 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003592 break;
3593
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003594 case 109:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003595
3596 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003597 (yyval.interm.type).qualifier = EvqFlat;
3598 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003599 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003600 break;
3601
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003602 case 110:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003603
3604 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003605 (yyval.interm.qualifier) = EvqConst;
3606 }
3607 break;
3608
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003609 case 111:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003610
3611 {
3612 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3613 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3614 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3615 context->recover();
3616 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3617 }
3618 break;
3619
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003620 case 112:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003621
3622 {
3623 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003624 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3625 context->recover();
3626 if (context->shaderType == SH_VERTEX_SHADER)
3627 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3628 else
3629 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003630 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003631 break;
3632
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003633 case 113:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003634
3635 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003636 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003637 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3638 context->recover();
3639 if (context->shaderType == SH_VERTEX_SHADER)
3640 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3641 else
3642 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003643 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003644 break;
3645
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003646 case 114:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003647
3648 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003649 (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 +00003650 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003651 break;
3652
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003653 case 115:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003654
3655 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003656 if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothIn) {
3657 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3658 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothIn, (yyvsp[(2) - (2)].interm.type).line);
3659 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3660 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3661 else UNREACHABLE();
3662 }
3663 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidIn) {
3664 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3665 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidIn, (yyvsp[(2) - (2)].interm.type).line);
3666 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3667 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3668 else UNREACHABLE();
3669 }
3670 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothOut) {
3671 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3672 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothOut, (yyvsp[(2) - (2)].interm.type).line);
3673 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3674 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3675 else UNREACHABLE();
3676 }
3677 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidOut) {
3678 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3679 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidOut, (yyvsp[(2) - (2)].interm.type).line);
3680 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3681 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3682 else UNREACHABLE();
3683 }
3684 else {
3685 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));
3686 context->recover();
3687
3688 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
3689 }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003690 }
3691 break;
3692
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003693 case 116:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003694
3695 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003696 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));
3697 context->recover();
3698
3699 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3700 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003701 }
3702 break;
3703
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003704 case 117:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003705
3706 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003707 (yyval.interm.type).qualifier = EvqConst;
3708 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003709 }
3710 break;
3711
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003712 case 118:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003713
3714 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003715 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003716 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqSmoothIn : EvqAttribute;
3717 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003718 }
3719 break;
3720
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003721 case 119:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003722
3723 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003724 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003725 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqSmoothOut;
3726 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3727 }
3728 break;
3729
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003730 case 120:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003731
3732 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003733 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003734 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqAttribute;
3735 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3736 }
3737 break;
3738
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003739 case 121:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003740
3741 {
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003742 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line, "storage qualifier");
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003743 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqCentroidOut;
3744 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3745 }
3746 break;
3747
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003748 case 122:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003749
3750 {
3751 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3752 context->recover();
3753 (yyval.interm.type).qualifier = EvqUniform;
3754 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3755 }
3756 break;
3757
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003758 case 123:
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003759
3760 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003761 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003762
3763 if ((yyval.interm.type).precision == EbpUndefined) {
3764 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3765 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3766 context->recover();
3767 }
3768 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003769 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003770 break;
3771
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003772 case 124:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003773
3774 {
3775 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3776 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003777 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003778 break;
3779
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003780 case 125:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003781
3782 {
3783 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003784 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003785 break;
3786
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003787 case 126:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003788
3789 {
3790 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003791 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003792 break;
3793
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003794 case 127:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003795
3796 {
3797 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003798 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003799 break;
3800
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003801 case 128:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003802
3803 {
3804 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003805 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003806 break;
3807
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003808 case 129:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003809
3810 {
3811 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3812
3813 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3814 context->recover();
3815 else {
3816 int size;
3817 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3818 context->recover();
3819 (yyval.interm.type).setArray(true, size);
3820 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003821 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003822 break;
3823
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003824 case 130:
3825
3826 {
3827 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003828 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003829 }
3830 break;
3831
3832 case 131:
3833
3834 {
3835 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3836 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003837 }
3838 break;
3839
3840 case 132:
3841
3842 {
3843 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003844 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003845 }
3846 break;
3847
3848 case 133:
3849
3850 {
3851 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3852 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003853 }
3854 break;
3855
3856 case 134:
3857
3858 {
3859 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003860 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3861 (yyval.interm.type).setAggregate(2);
3862 }
3863 break;
3864
3865 case 135:
3866
3867 {
3868 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3869 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3870 (yyval.interm.type).setAggregate(3);
3871 }
3872 break;
3873
3874 case 136:
3875
3876 {
3877 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3878 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3879 (yyval.interm.type).setAggregate(4);
3880 }
3881 break;
3882
3883 case 137:
3884
3885 {
3886 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3887 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3888 (yyval.interm.type).setAggregate(2);
3889 }
3890 break;
3891
3892 case 138:
3893
3894 {
3895 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003896 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3897 (yyval.interm.type).setAggregate(3);
3898 }
3899 break;
3900
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003901 case 139:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003902
3903 {
3904 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3905 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3906 (yyval.interm.type).setAggregate(4);
3907 }
3908 break;
3909
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003910 case 140:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003911
3912 {
3913 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3914 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3915 (yyval.interm.type).setAggregate(2);
3916 }
3917 break;
3918
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003919 case 141:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003920
3921 {
3922 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3923 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3924 (yyval.interm.type).setAggregate(3);
3925 }
3926 break;
3927
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003928 case 142:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003929
3930 {
3931 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3932 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3933 (yyval.interm.type).setAggregate(4);
3934 }
3935 break;
3936
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003937 case 143:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003938
3939 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003940 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
3941 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3942 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00003943 (yyval.interm.type).setMatrix(2, 2);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003944 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003945 break;
3946
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003947 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003948
3949 {
3950 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
3951 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3952 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00003953 (yyval.interm.type).setMatrix(3, 3);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003954 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003955 break;
3956
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003957 case 145:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003958
3959 {
3960 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
3961 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3962 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
shannonwoods@chromium.org09e09882013-05-30 00:18:25 +00003963 (yyval.interm.type).setMatrix(4, 4);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003964 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003965 break;
3966
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003967 case 146:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003968
3969 {
3970 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
3971 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3972 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003973 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003974 break;
3975
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003976 case 147:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003977
3978 {
3979 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
3980 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3981 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003982 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003983 break;
3984
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003985 case 148:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003986
3987 {
zmo@google.com09c323a2011-08-12 18:22:25 +00003988 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003989 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00003990 context->recover();
3991 }
3992 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
3993 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3994 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003995 }
zmo@google.com09c323a2011-08-12 18:22:25 +00003996 break;
3997
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00003998 case 149:
zmo@google.com09c323a2011-08-12 18:22:25 +00003999
4000 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004001 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004002 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00004003 context->recover();
4004 }
4005 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
4006 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4007 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004008 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004009 break;
4010
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004011 case 150:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004012
4013 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004014 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4015 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4016 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004017 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004018 break;
4019
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004020 case 151:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004021
4022 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004023 //
4024 // This is for user defined type names. The lexical phase looked up the
4025 // type.
4026 //
4027 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4028 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4029 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4030 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004031 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004032 break;
4033
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004034 case 152:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004035
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004036 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004037 break;
4038
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004039 case 153:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004040
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004041 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004042 (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 +00004043 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004044 break;
4045
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004046 case 154:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004047
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004048 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004049 break;
4050
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004051 case 155:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004052
kbr@chromium.org476541f2011-10-27 21:14:51 +00004053 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004054 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (5)].lex).line, 0, "", (yyvsp[(4) - (5)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004055 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004056 break;
4057
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004058 case 156:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004059
4060 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004061 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004062 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004063 break;
4064
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004065 case 157:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004066
4067 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004068 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4069 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4070 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4071 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4072 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());
4073 context->recover();
4074 }
4075 }
4076 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4077 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004078 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004079 break;
4080
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004081 case 158:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004082
4083 {
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +00004084 (yyval.interm.typeList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.typeList));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004085 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004086 break;
4087
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004088 case 159:
4089
4090 {
4091 // ES3 Only, but errors should be handled elsewhere
4092 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4093 (yyval.interm.typeList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.typeList));
4094 }
4095 break;
4096
4097 case 160:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004098
4099 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004100 (yyval.interm.typeList) = NewPoolTTypeList();
4101 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004102 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004103 break;
4104
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004105 case 161:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004106
4107 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004108 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004109 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004110 break;
4111
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004112 case 162:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004113
4114 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004115 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4116 context->recover();
4117
4118 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4119 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4120 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004121 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004122 break;
4123
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004124 case 163:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004125
4126 {
4127 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4128 context->recover();
4129
4130 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4131 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4132 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4133
4134 int size;
4135 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4136 context->recover();
4137 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004138 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004139 break;
4140
kbr@chromium.org476541f2011-10-27 21:14:51 +00004141 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004142
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004143 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004144 break;
4145
4146 case 165:
4147
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004148 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004149 break;
4150
4151 case 166:
4152
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004153 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004154 break;
4155
4156 case 167:
4157
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004158 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4159 break;
4160
4161 case 168:
4162
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004163 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004164 break;
4165
4166 case 169:
4167
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004168 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004169 break;
4170
4171 case 170:
4172
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004173 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004174 break;
4175
4176 case 171:
4177
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004178 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4179 break;
4180
4181 case 172:
4182
4183 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4184 break;
4185
4186 case 173:
4187
4188 { (yyval.interm.intermAggregate) = 0; }
4189 break;
4190
4191 case 174:
4192
4193 { context->symbolTable.push(); }
4194 break;
4195
4196 case 175:
4197
4198 { context->symbolTable.pop(); }
4199 break;
4200
4201 case 176:
4202
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004203 {
4204 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4205 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4206 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4207 }
4208 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4209 }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004210 break;
4211
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004212 case 177:
4213
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004214 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004215 break;
4216
4217 case 178:
4218
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004219 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4220 break;
4221
4222 case 179:
4223
4224 { context->symbolTable.push(); }
4225 break;
4226
4227 case 180:
4228
4229 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4230 break;
4231
4232 case 181:
4233
4234 { context->symbolTable.push(); }
4235 break;
4236
4237 case 182:
4238
4239 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4240 break;
4241
4242 case 183:
4243
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004244 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004245 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004246 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004247 break;
4248
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004249 case 184:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004250
4251 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004252 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004253 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004254 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4255 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004256 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004257 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004258 break;
4259
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004260 case 185:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004261
4262 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004263 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004264 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004265 break;
4266
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004267 case 186:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004268
kbr@chromium.org205fef32011-11-22 20:50:02 +00004269 {
4270 (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 +00004271 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004272 break;
4273
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004274 case 187:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004275
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004276 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004277 break;
4278
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004279 case 188:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004280
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004281 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004282 break;
4283
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004284 case 189:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004285
4286 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004287 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4288 context->recover();
4289 (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 +00004290 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004291 break;
4292
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004293 case 190:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004294
4295 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004296 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4297 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004298 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004299 break;
4300
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004301 case 191:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004302
4303 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004304 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4305 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004306 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004307 break;
4308
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004309 case 192:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004310
4311 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004312 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4313 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4314 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004315 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004316 break;
4317
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004318 case 193:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004319
4320 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004321 TIntermNode* intermNode;
4322 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4323 context->recover();
4324 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4325 context->recover();
4326
4327 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4328 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4329 else {
4330 context->recover();
4331 (yyval.interm.intermTypedNode) = 0;
4332 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004333 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004334 break;
4335
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004336 case 194:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004337
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004338 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004339 break;
4340
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004341 case 195:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004342
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004343 {
4344 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004345 (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 +00004346 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004347 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004348 break;
4349
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004350 case 196:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004351
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004352 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004353 break;
4354
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004355 case 197:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004356
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004357 {
4358 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4359 context->recover();
4360
alokp@chromium.org52813552010-11-16 18:36:09 +00004361 (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 +00004362 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004363 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004364 break;
4365
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004366 case 198:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004367
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004368 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004369 break;
4370
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004371 case 199:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004372
4373 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004374 context->symbolTable.pop();
4375 (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);
4376 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004377 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004378 break;
4379
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004380 case 200:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004381
4382 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004383 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004384 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004385 break;
4386
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004387 case 201:
zmo@google.com09c323a2011-08-12 18:22:25 +00004388
4389 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004390 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004391 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004392 break;
4393
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004394 case 202:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004395
4396 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004397 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004398 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004399 break;
4400
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004401 case 203:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004402
4403 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004404 (yyval.interm.intermTypedNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004405 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004406 break;
4407
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004408 case 204:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004409
4410 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004411 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4412 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004413 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004414 break;
4415
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004416 case 205:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004417
4418 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004419 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4420 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004421 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004422 break;
4423
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004424 case 206:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004425
4426 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004427 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004428 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004429 context->recover();
4430 }
4431 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004432 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004433 break;
4434
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004435 case 207:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004436
4437 {
4438 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004439 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004440 context->recover();
4441 }
4442 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004443 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004444 break;
4445
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004446 case 208:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004447
4448 {
4449 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4450 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004451 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004452 context->recover();
4453 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004454 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004455 break;
4456
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004457 case 209:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004458
4459 {
4460 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4461 context->functionReturnsValue = true;
4462 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004463 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004464 context->recover();
4465 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004466 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004467 context->recover();
4468 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004469 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004470 break;
4471
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004472 case 210:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004473
4474 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004475 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4476 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004477 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004478 break;
4479
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004480 case 211:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004481
4482 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004483 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004484 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004485 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004486 break;
4487
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004488 case 212:
zmo@google.com09c323a2011-08-12 18:22:25 +00004489
4490 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004491 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4492 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004493 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004494 break;
4495
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004496 case 213:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004497
4498 {
4499 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004500 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004501 break;
4502
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004503 case 214:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004504
4505 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004506 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004507 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004508 break;
4509
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004510 case 215:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004511
4512 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004513 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004514
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004515 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004516
4517 if (builtIn)
4518 {
4519 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4520 context->recover();
4521 }
4522
shannonwoods@chromium.org96e7ba12013-05-30 00:02:41 +00004523 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004524 //
4525 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4526 // as it would have just been put in the symbol table. Otherwise, we're looking up
4527 // an earlier occurance.
4528 //
4529 if (prevDec->isDefined()) {
4530 //
4531 // Then this function already has a body.
4532 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004533 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004534 context->recover();
4535 }
4536 prevDec->setDefined();
4537
4538 //
4539 // Raise error message if main function takes any parameters or return anything other than void
4540 //
4541 if (function->getName() == "main") {
4542 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004543 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 +00004544 context->recover();
4545 }
4546 if (function->getReturnType().getBasicType() != EbtVoid) {
4547 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4548 context->recover();
4549 }
4550 }
4551
4552 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004553 // Remember the return type for later checking for RETURN statements.
4554 //
4555 context->currentFunctionType = &(prevDec->getReturnType());
4556 context->functionReturnsValue = false;
4557
4558 //
4559 // Insert parameters into the symbol table.
4560 // If the parameter has no name, it's not an error, just don't insert it
4561 // (could be used for unused args).
4562 //
4563 // Also, accumulate the list of parameters into the HIL, so lower level code
4564 // knows where to find parameters.
4565 //
4566 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004567 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004568 const TParameter& param = function->getParam(i);
4569 if (param.name != 0) {
4570 TVariable *variable = new TVariable(param.name, *param.type);
4571 //
4572 // Insert the parameters with name in the symbol table.
4573 //
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004574 if (! context->symbolTable.declare(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004575 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004576 context->recover();
4577 delete variable;
4578 }
4579
4580 //
4581 // Add the parameter to the HIL
4582 //
4583 paramNodes = context->intermediate.growAggregate(
4584 paramNodes,
4585 context->intermediate.addSymbol(variable->getUniqueId(),
4586 variable->getName(),
4587 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4588 (yyvsp[(1) - (1)].interm).line);
4589 } else {
4590 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4591 }
4592 }
4593 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4594 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4595 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004596 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004597 break;
4598
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +00004599 case 216:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004600
4601 {
4602 //?? Check that all paths return a value if return type != void ?
4603 // May be best done as post process phase on intermediate code
4604 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4605 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4606 context->recover();
4607 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004608
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004609 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4610 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4611 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4612 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4613
4614 // store the pragma information for debug and optimize and other vendor specific
4615 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004616 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4617 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004618
4619 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4620 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004621
4622 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004623 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004624 break;
4625
4626
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004627
4628 default: break;
4629 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004630 /* User semantic actions sometimes alter yychar, and that requires
4631 that yytoken be updated with the new translation. We take the
4632 approach of translating immediately before every use of yytoken.
4633 One alternative is translating here after every semantic action,
4634 but that translation would be missed if the semantic action invokes
4635 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4636 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4637 incorrect destructor might then be invoked immediately. In the
4638 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4639 to an incorrect destructor call or verbose syntax error message
4640 before the lookahead is translated. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004641 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4642
4643 YYPOPSTACK (yylen);
4644 yylen = 0;
4645 YY_STACK_PRINT (yyss, yyssp);
4646
4647 *++yyvsp = yyval;
4648
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004649 /* Now `shift' the result of the reduction. Determine what state
4650 that goes to, based on the state we popped back to and the rule
4651 number reduced by. */
4652
4653 yyn = yyr1[yyn];
4654
4655 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4656 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4657 yystate = yytable[yystate];
4658 else
4659 yystate = yydefgoto[yyn - YYNTOKENS];
4660
4661 goto yynewstate;
4662
4663
4664/*------------------------------------.
4665| yyerrlab -- here on detecting error |
4666`------------------------------------*/
4667yyerrlab:
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004668 /* Make sure we have latest lookahead translation. See comments at
4669 user semantic actions for why this is necessary. */
4670 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
4671
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004672 /* If not already recovering from an error, report this error. */
4673 if (!yyerrstatus)
4674 {
4675 ++yynerrs;
4676#if ! YYERROR_VERBOSE
4677 yyerror (context, YY_("syntax error"));
4678#else
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004679# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
4680 yyssp, yytoken)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004681 {
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004682 char const *yymsgp = YY_("syntax error");
4683 int yysyntax_error_status;
4684 yysyntax_error_status = YYSYNTAX_ERROR;
4685 if (yysyntax_error_status == 0)
4686 yymsgp = yymsg;
4687 else if (yysyntax_error_status == 1)
4688 {
4689 if (yymsg != yymsgbuf)
4690 YYSTACK_FREE (yymsg);
4691 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
4692 if (!yymsg)
4693 {
4694 yymsg = yymsgbuf;
4695 yymsg_alloc = sizeof yymsgbuf;
4696 yysyntax_error_status = 2;
4697 }
4698 else
4699 {
4700 yysyntax_error_status = YYSYNTAX_ERROR;
4701 yymsgp = yymsg;
4702 }
4703 }
4704 yyerror (context, yymsgp);
4705 if (yysyntax_error_status == 2)
4706 goto yyexhaustedlab;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004707 }
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004708# undef YYSYNTAX_ERROR
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004709#endif
4710 }
4711
4712
4713
4714 if (yyerrstatus == 3)
4715 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004716 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004717 error, discard it. */
4718
4719 if (yychar <= YYEOF)
4720 {
4721 /* Return failure if at end of input. */
4722 if (yychar == YYEOF)
4723 YYABORT;
4724 }
4725 else
4726 {
4727 yydestruct ("Error: discarding",
4728 yytoken, &yylval, context);
4729 yychar = YYEMPTY;
4730 }
4731 }
4732
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004733 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004734 token. */
4735 goto yyerrlab1;
4736
4737
4738/*---------------------------------------------------.
4739| yyerrorlab -- error raised explicitly by YYERROR. |
4740`---------------------------------------------------*/
4741yyerrorlab:
4742
4743 /* Pacify compilers like GCC when the user code never invokes
4744 YYERROR and the label yyerrorlab therefore never appears in user
4745 code. */
4746 if (/*CONSTCOND*/ 0)
4747 goto yyerrorlab;
4748
4749 /* Do not reclaim the symbols of the rule which action triggered
4750 this YYERROR. */
4751 YYPOPSTACK (yylen);
4752 yylen = 0;
4753 YY_STACK_PRINT (yyss, yyssp);
4754 yystate = *yyssp;
4755 goto yyerrlab1;
4756
4757
4758/*-------------------------------------------------------------.
4759| yyerrlab1 -- common code for both syntax error and YYERROR. |
4760`-------------------------------------------------------------*/
4761yyerrlab1:
4762 yyerrstatus = 3; /* Each real token shifted decrements this. */
4763
4764 for (;;)
4765 {
4766 yyn = yypact[yystate];
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004767 if (!yypact_value_is_default (yyn))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004768 {
4769 yyn += YYTERROR;
4770 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4771 {
4772 yyn = yytable[yyn];
4773 if (0 < yyn)
4774 break;
4775 }
4776 }
4777
4778 /* Pop the current state because it cannot handle the error token. */
4779 if (yyssp == yyss)
4780 YYABORT;
4781
4782
4783 yydestruct ("Error: popping",
4784 yystos[yystate], yyvsp, context);
4785 YYPOPSTACK (1);
4786 yystate = *yyssp;
4787 YY_STACK_PRINT (yyss, yyssp);
4788 }
4789
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004790 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004791 *++yyvsp = yylval;
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004792 YY_IGNORE_MAYBE_UNINITIALIZED_END
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004793
4794
4795 /* Shift the error token. */
4796 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4797
4798 yystate = yyn;
4799 goto yynewstate;
4800
4801
4802/*-------------------------------------.
4803| yyacceptlab -- YYACCEPT comes here. |
4804`-------------------------------------*/
4805yyacceptlab:
4806 yyresult = 0;
4807 goto yyreturn;
4808
4809/*-----------------------------------.
4810| yyabortlab -- YYABORT comes here. |
4811`-----------------------------------*/
4812yyabortlab:
4813 yyresult = 1;
4814 goto yyreturn;
4815
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004816#if !defined yyoverflow || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004817/*-------------------------------------------------.
4818| yyexhaustedlab -- memory exhaustion comes here. |
4819`-------------------------------------------------*/
4820yyexhaustedlab:
4821 yyerror (context, YY_("memory exhausted"));
4822 yyresult = 2;
4823 /* Fall through. */
4824#endif
4825
4826yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004827 if (yychar != YYEMPTY)
shannonwoods@chromium.org98c01b62013-05-30 00:06:25 +00004828 {
4829 /* Make sure we have latest lookahead translation. See comments at
4830 user semantic actions for why this is necessary. */
4831 yytoken = YYTRANSLATE (yychar);
4832 yydestruct ("Cleanup: discarding lookahead",
4833 yytoken, &yylval, context);
4834 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004835 /* Do not reclaim the symbols of the rule which action triggered
4836 this YYABORT or YYACCEPT. */
4837 YYPOPSTACK (yylen);
4838 YY_STACK_PRINT (yyss, yyssp);
4839 while (yyssp != yyss)
4840 {
4841 yydestruct ("Cleanup: popping",
4842 yystos[*yyssp], yyvsp, context);
4843 YYPOPSTACK (1);
4844 }
4845#ifndef yyoverflow
4846 if (yyss != yyssa)
4847 YYSTACK_FREE (yyss);
4848#endif
4849#if YYERROR_VERBOSE
4850 if (yymsg != yymsgbuf)
4851 YYSTACK_FREE (yymsg);
4852#endif
4853 /* Make sure YYID is used. */
4854 return YYID (yyresult);
4855}
4856
4857
4858
4859
4860
4861int glslang_parse(TParseContext* context) {
4862 return yyparse(context);
4863}