blob: a01fce8ba43d49e1281b1ed10b2a4b73ea92e3ca [file] [log] [blame]
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001/* A Bison parser, made by GNU Bison 2.4.2. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002
3/* Skeleton implementation for Bison's Yacc-like parsers in C
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004
5 Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
6 Foundation, Inc.
7
8 This program is free software: you can redistribute it and/or modify
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00009 it under the terms of the GNU General Public License as published by
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000010 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000013 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000017
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000018 You should have received a copy of the GNU General Public License
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000019 along with this program. If not, see <http://www.gnu.org/licenses/>. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000020
21/* As a special exception, you may create a larger work that contains
22 part or all of the Bison parser skeleton and distribute that work
23 under terms of your choice, so long as that work isn't itself a
24 parser generator using the skeleton or a modified version thereof
25 as a parser skeleton. Alternatively, if you modify or redistribute
26 the parser skeleton itself, you may (at your option) remove this
27 special exception, which will cause the skeleton and the resulting
28 Bison output files to be licensed under the GNU General Public
29 License without this special exception.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000030
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000031 This special exception was added by the Free Software Foundation in
32 version 2.2 of Bison. */
33
34/* C LALR(1) parser skeleton written by Richard Stallman, by
35 simplifying the original so-called "semantic" parser. */
36
37/* All symbols defined below should begin with yy or YY, to avoid
38 infringing on user name space. This should be done even for local
39 variables, as they might otherwise be expanded by user macros.
40 There are some unavoidable exceptions within include files to
41 define necessary library symbols; they are noted "INFRINGES ON
42 USER NAME SPACE" below. */
43
44/* Identify Bison output. */
45#define YYBISON 1
46
47/* Bison version. */
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000048#define YYBISON_VERSION "2.4.2"
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000049
50/* Skeleton name. */
51#define YYSKELETON_NAME "yacc.c"
52
53/* Pure parsers. */
54#define YYPURE 1
55
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000056/* Push parsers. */
57#define YYPUSH 0
58
59/* Pull parsers. */
60#define YYPULL 1
61
alokp@chromium.org044a5cf2010-11-12 15:42:16 +000062/* Using locations. */
63#define YYLSP_NEEDED 0
64
65
66
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000067/* Copy the first part of user declarations. */
68
69
70//
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +000071// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000072// Use of this source code is governed by a BSD-style license that can be
73// found in the LICENSE file.
74//
75
76// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
77
78// Ignore errors in auto-generated code.
79#if defined(__GNUC__)
80#pragma GCC diagnostic ignored "-Wunused-function"
81#pragma GCC diagnostic ignored "-Wunused-variable"
82#pragma GCC diagnostic ignored "-Wswitch-enum"
83#elif defined(_MSC_VER)
84#pragma warning(disable: 4065)
85#pragma warning(disable: 4189)
86#pragma warning(disable: 4505)
87#pragma warning(disable: 4701)
88#endif
89
90#include "compiler/SymbolTable.h"
91#include "compiler/ParseHelper.h"
92#include "GLSLANG/ShaderLang.h"
93
daniel@transgaming.comb3077d02013-01-11 04:12:09 +000094#define YYENABLE_NLS 0
95#define YYLTYPE_IS_TRIVIAL 1
96
daniel@transgaming.com05bc2042012-03-09 21:56:58 +000097#define YYLEX_PARAM context->scanner
98
99
100
101/* Enabling traces. */
102#ifndef YYDEBUG
103# define YYDEBUG 0
104#endif
105
106/* Enabling verbose error messages. */
107#ifdef YYERROR_VERBOSE
108# undef YYERROR_VERBOSE
109# define YYERROR_VERBOSE 1
110#else
111# define YYERROR_VERBOSE 0
112#endif
113
114/* Enabling the token table. */
115#ifndef YYTOKEN_TABLE
116# define YYTOKEN_TABLE 0
117#endif
118
119
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000120/* Tokens. */
121#ifndef YYTOKENTYPE
122# define YYTOKENTYPE
123 /* Put the tokens into the symbol table, so that GDB and other debuggers
124 know about them. */
125 enum yytokentype {
126 INVARIANT = 258,
127 HIGH_PRECISION = 259,
128 MEDIUM_PRECISION = 260,
129 LOW_PRECISION = 261,
130 PRECISION = 262,
131 ATTRIBUTE = 263,
132 CONST_QUAL = 264,
133 BOOL_TYPE = 265,
134 FLOAT_TYPE = 266,
135 INT_TYPE = 267,
136 BREAK = 268,
137 CONTINUE = 269,
138 DO = 270,
139 ELSE = 271,
140 FOR = 272,
141 IF = 273,
142 DISCARD = 274,
143 RETURN = 275,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000144 SWITCH = 276,
145 CASE = 277,
146 DEFAULT = 278,
147 BVEC2 = 279,
148 BVEC3 = 280,
149 BVEC4 = 281,
150 IVEC2 = 282,
151 IVEC3 = 283,
152 IVEC4 = 284,
153 VEC2 = 285,
154 VEC3 = 286,
155 VEC4 = 287,
156 MATRIX2 = 288,
157 MATRIX3 = 289,
158 MATRIX4 = 290,
159 IN_QUAL = 291,
160 OUT_QUAL = 292,
161 INOUT_QUAL = 293,
162 UNIFORM = 294,
163 VARYING = 295,
164 CENTROID = 296,
165 FLAT = 297,
166 SMOOTH = 298,
167 STRUCT = 299,
168 VOID_TYPE = 300,
169 WHILE = 301,
170 SAMPLER2D = 302,
171 SAMPLERCUBE = 303,
172 SAMPLER_EXTERNAL_OES = 304,
173 SAMPLER2DRECT = 305,
174 SAMPLER3D = 306,
175 SAMPLER3DRECT = 307,
176 SAMPLER2DSHADOW = 308,
177 IDENTIFIER = 309,
178 TYPE_NAME = 310,
179 FLOATCONSTANT = 311,
180 INTCONSTANT = 312,
181 BOOLCONSTANT = 313,
182 FIELD_SELECTION = 314,
183 LEFT_OP = 315,
184 RIGHT_OP = 316,
185 INC_OP = 317,
186 DEC_OP = 318,
187 LE_OP = 319,
188 GE_OP = 320,
189 EQ_OP = 321,
190 NE_OP = 322,
191 AND_OP = 323,
192 OR_OP = 324,
193 XOR_OP = 325,
194 MUL_ASSIGN = 326,
195 DIV_ASSIGN = 327,
196 ADD_ASSIGN = 328,
197 MOD_ASSIGN = 329,
198 LEFT_ASSIGN = 330,
199 RIGHT_ASSIGN = 331,
200 AND_ASSIGN = 332,
201 XOR_ASSIGN = 333,
202 OR_ASSIGN = 334,
203 SUB_ASSIGN = 335,
204 LEFT_PAREN = 336,
205 RIGHT_PAREN = 337,
206 LEFT_BRACKET = 338,
207 RIGHT_BRACKET = 339,
208 LEFT_BRACE = 340,
209 RIGHT_BRACE = 341,
210 DOT = 342,
211 COMMA = 343,
212 COLON = 344,
213 EQUAL = 345,
214 SEMICOLON = 346,
215 BANG = 347,
216 DASH = 348,
217 TILDE = 349,
218 PLUS = 350,
219 STAR = 351,
220 SLASH = 352,
221 PERCENT = 353,
222 LEFT_ANGLE = 354,
223 RIGHT_ANGLE = 355,
224 VERTICAL_BAR = 356,
225 CARET = 357,
226 AMPERSAND = 358,
227 QUESTION = 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000228 };
229#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000230
231
232
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000233#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
234typedef union YYSTYPE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000235{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000236
237
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000238 struct {
239 TSourceLoc line;
240 union {
241 TString *string;
242 float f;
243 int i;
244 bool b;
245 };
246 TSymbol* symbol;
247 } lex;
248 struct {
249 TSourceLoc line;
250 TOperator op;
251 union {
252 TIntermNode* intermNode;
253 TIntermNodePair nodePair;
254 TIntermTyped* intermTypedNode;
255 TIntermAggregate* intermAggregate;
256 };
257 union {
258 TPublicType type;
259 TPrecision precision;
260 TQualifier qualifier;
261 TFunction* function;
262 TParameter param;
263 TTypeLine typeLine;
264 TTypeList* typeList;
265 };
266 } interm;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000267
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000268
269
270} YYSTYPE;
271# define YYSTYPE_IS_TRIVIAL 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000272# define yystype YYSTYPE /* obsolescent; will be withdrawn */
273# define YYSTYPE_IS_DECLARED 1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000274#endif
275
276
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000277/* Copy the second part of user declarations. */
278
279
280extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
281extern void yyerror(TParseContext* context, const char* reason);
282
283#define FRAG_VERT_ONLY(S, L) { \
284 if (context->shaderType != SH_FRAGMENT_SHADER && \
285 context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000286 context->error(L, " supported in vertex/fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000287 context->recover(); \
288 } \
289}
290
291#define VERTEX_ONLY(S, L) { \
292 if (context->shaderType != SH_VERTEX_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000293 context->error(L, " supported in vertex shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000294 context->recover(); \
295 } \
296}
297
298#define FRAG_ONLY(S, L) { \
299 if (context->shaderType != SH_FRAGMENT_SHADER) { \
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +0000300 context->error(L, " supported in fragment shaders only ", S); \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000301 context->recover(); \
302 } \
303}
304
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000305#define ES2_ONLY(S, L) { \
306 if (context->shaderVersion != 100) { \
307 context->error(L, " supported in GLSL ES 1.00 only ", S); \
308 context->recover(); \
309 } \
310}
311
312#define ES3_ONLY(S, L) { \
313 if (context->shaderVersion != 300) { \
314 context->error(L, " supported in GLSL ES 3.00 only ", S); \
315 context->recover(); \
316 } \
317}
318
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000319
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000320
321#ifdef short
322# undef short
323#endif
324
325#ifdef YYTYPE_UINT8
326typedef YYTYPE_UINT8 yytype_uint8;
327#else
328typedef unsigned char yytype_uint8;
329#endif
330
331#ifdef YYTYPE_INT8
332typedef YYTYPE_INT8 yytype_int8;
333#elif (defined __STDC__ || defined __C99__FUNC__ \
334 || defined __cplusplus || defined _MSC_VER)
335typedef signed char yytype_int8;
336#else
337typedef short int yytype_int8;
338#endif
339
340#ifdef YYTYPE_UINT16
341typedef YYTYPE_UINT16 yytype_uint16;
342#else
343typedef unsigned short int yytype_uint16;
344#endif
345
346#ifdef YYTYPE_INT16
347typedef YYTYPE_INT16 yytype_int16;
348#else
349typedef short int yytype_int16;
350#endif
351
352#ifndef YYSIZE_T
353# ifdef __SIZE_TYPE__
354# define YYSIZE_T __SIZE_TYPE__
355# elif defined size_t
356# define YYSIZE_T size_t
357# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
358 || defined __cplusplus || defined _MSC_VER)
359# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
360# define YYSIZE_T size_t
361# else
362# define YYSIZE_T unsigned int
363# endif
364#endif
365
366#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
367
368#ifndef YY_
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000369# if defined YYENABLE_NLS && YYENABLE_NLS
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000370# if ENABLE_NLS
371# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
372# define YY_(msgid) dgettext ("bison-runtime", msgid)
373# endif
374# endif
375# ifndef YY_
376# define YY_(msgid) msgid
377# endif
378#endif
379
380/* Suppress unused-variable warnings by "using" E. */
381#if ! defined lint || defined __GNUC__
382# define YYUSE(e) ((void) (e))
383#else
384# define YYUSE(e) /* empty */
385#endif
386
387/* Identity function, used to suppress warnings about constant conditions. */
388#ifndef lint
389# define YYID(n) (n)
390#else
391#if (defined __STDC__ || defined __C99__FUNC__ \
392 || defined __cplusplus || defined _MSC_VER)
393static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000394YYID (int yyi)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000395#else
396static int
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000397YYID (yyi)
398 int yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000399#endif
400{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000401 return yyi;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000402}
403#endif
404
405#if ! defined yyoverflow || YYERROR_VERBOSE
406
407/* The parser invokes alloca or malloc; define the necessary symbols. */
408
409# ifdef YYSTACK_USE_ALLOCA
410# if YYSTACK_USE_ALLOCA
411# ifdef __GNUC__
412# define YYSTACK_ALLOC __builtin_alloca
413# elif defined __BUILTIN_VA_ARG_INCR
414# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
415# elif defined _AIX
416# define YYSTACK_ALLOC __alloca
417# elif defined _MSC_VER
418# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
419# define alloca _alloca
420# else
421# define YYSTACK_ALLOC alloca
422# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
423 || defined __cplusplus || defined _MSC_VER)
424# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
425# ifndef _STDLIB_H
426# define _STDLIB_H 1
427# endif
428# endif
429# endif
430# endif
431# endif
432
433# ifdef YYSTACK_ALLOC
434 /* Pacify GCC's `empty if-body' warning. */
435# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
436# ifndef YYSTACK_ALLOC_MAXIMUM
437 /* The OS might guarantee only one guard page at the bottom of the stack,
438 and a page size can be as small as 4096 bytes. So we cannot safely
439 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
440 to allow for a few compiler-allocated temporary stack slots. */
441# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
442# endif
443# else
444# define YYSTACK_ALLOC YYMALLOC
445# define YYSTACK_FREE YYFREE
446# ifndef YYSTACK_ALLOC_MAXIMUM
447# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
448# endif
449# if (defined __cplusplus && ! defined _STDLIB_H \
450 && ! ((defined YYMALLOC || defined malloc) \
451 && (defined YYFREE || defined free)))
452# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
453# ifndef _STDLIB_H
454# define _STDLIB_H 1
455# endif
456# endif
457# ifndef YYMALLOC
458# define YYMALLOC malloc
459# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
460 || defined __cplusplus || defined _MSC_VER)
461void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
462# endif
463# endif
464# ifndef YYFREE
465# define YYFREE free
466# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
467 || defined __cplusplus || defined _MSC_VER)
468void free (void *); /* INFRINGES ON USER NAME SPACE */
469# endif
470# endif
471# endif
472#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
473
474
475#if (! defined yyoverflow \
476 && (! defined __cplusplus \
477 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
478
479/* A type that is properly aligned for any stack member. */
480union yyalloc
481{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000482 yytype_int16 yyss_alloc;
483 YYSTYPE yyvs_alloc;
484};
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000485
486/* The size of the maximum gap between one aligned stack and the next. */
487# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
488
489/* The size of an array large to enough to hold all stacks, each with
490 N elements. */
491# define YYSTACK_BYTES(N) \
492 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
493 + YYSTACK_GAP_MAXIMUM)
494
495/* Copy COUNT objects from FROM to TO. The source and destination do
496 not overlap. */
497# ifndef YYCOPY
498# if defined __GNUC__ && 1 < __GNUC__
499# define YYCOPY(To, From, Count) \
500 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
501# else
502# define YYCOPY(To, From, Count) \
503 do \
504 { \
505 YYSIZE_T yyi; \
506 for (yyi = 0; yyi < (Count); yyi++) \
507 (To)[yyi] = (From)[yyi]; \
508 } \
509 while (YYID (0))
510# endif
511# endif
512
513/* Relocate STACK from its old location to the new one. The
514 local variables YYSIZE and YYSTACKSIZE give the old and new number of
515 elements in the stack, and YYPTR gives the new location of the
516 stack. Advance YYPTR to a properly aligned location for the next
517 stack. */
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000518# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000519 do \
520 { \
521 YYSIZE_T yynewbytes; \
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000522 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
523 Stack = &yyptr->Stack_alloc; \
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000524 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
525 yyptr += yynewbytes / sizeof (*yyptr); \
526 } \
527 while (YYID (0))
528
529#endif
530
531/* YYFINAL -- State number of the termination state. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000532#define YYFINAL 81
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000533/* YYLAST -- Last index in YYTABLE. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000534#define YYLAST 1551
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000535
536/* YYNTOKENS -- Number of terminals. */
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000537#define YYNTOKENS 105
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000538/* YYNNTS -- Number of nonterminals. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000539#define YYNNTS 86
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000540/* YYNRULES -- Number of rules. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000541#define YYNRULES 211
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000542/* YYNRULES -- Number of states. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000543#define YYNSTATES 315
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000544
545/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
546#define YYUNDEFTOK 2
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000547#define YYMAXUTOK 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000548
549#define YYTRANSLATE(YYX) \
550 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
551
552/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
553static const yytype_uint8 yytranslate[] =
554{
555 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
556 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
557 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
558 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
559 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
560 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
561 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
562 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
563 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
564 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
565 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
566 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
567 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
568 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
569 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
570 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
571 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
572 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
573 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
574 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
575 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
576 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
577 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
578 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
579 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
580 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
581 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
582 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
583 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
584 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
585 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
586 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
587 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
588 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000589 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000590 95, 96, 97, 98, 99, 100, 101, 102, 103, 104
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000591};
592
593#if YYDEBUG
594/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
595 YYRHS. */
596static const yytype_uint16 yyprhs[] =
597{
598 0, 0, 3, 5, 7, 9, 11, 13, 17, 19,
599 24, 26, 30, 33, 36, 38, 40, 42, 46, 49,
600 52, 55, 57, 60, 64, 67, 69, 71, 73, 75,
601 78, 81, 84, 86, 88, 90, 92, 96, 100, 102,
602 106, 110, 112, 114, 118, 122, 126, 130, 132, 136,
603 140, 142, 144, 146, 148, 152, 154, 158, 160, 164,
604 166, 172, 174, 178, 180, 182, 184, 186, 188, 190,
605 194, 196, 199, 202, 207, 210, 212, 214, 217, 221,
606 225, 228, 234, 238, 241, 245, 248, 249, 251, 253,
607 255, 257, 259, 263, 269, 276, 282, 284, 287, 292,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000608 298, 303, 306, 308, 311, 313, 315, 317, 319, 321,
609 324, 326, 329, 331, 333, 335, 337, 340, 343, 345,
610 347, 350, 352, 354, 356, 358, 363, 365, 367, 369,
611 371, 373, 375, 377, 379, 381, 383, 385, 387, 389,
612 391, 393, 395, 397, 399, 401, 403, 405, 407, 408,
613 415, 416, 422, 424, 427, 431, 433, 437, 439, 444,
614 446, 448, 450, 452, 454, 456, 458, 460, 462, 465,
615 466, 467, 473, 475, 477, 478, 481, 482, 485, 488,
616 492, 494, 497, 499, 502, 508, 512, 514, 516, 521,
617 522, 529, 530, 539, 540, 548, 550, 552, 554, 555,
618 558, 562, 565, 568, 571, 575, 578, 580, 583, 585,
619 587, 588
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000620};
621
622/* YYRHS -- A `-1'-separated list of the rules' RHS. */
623static const yytype_int16 yyrhs[] =
624{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000625 187, 0, -1, 54, -1, 106, -1, 57, -1, 56,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000626 -1, 58, -1, 81, 133, 82, -1, 107, -1, 108,
627 83, 109, 84, -1, 110, -1, 108, 87, 59, -1,
628 108, 62, -1, 108, 63, -1, 133, -1, 111, -1,
629 112, -1, 108, 87, 112, -1, 114, 82, -1, 113,
630 82, -1, 115, 45, -1, 115, -1, 115, 131, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000631 114, 88, 131, -1, 116, 81, -1, 154, -1, 54,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000632 -1, 59, -1, 108, -1, 62, 117, -1, 63, 117,
633 -1, 118, 117, -1, 95, -1, 93, -1, 92, -1,
634 117, -1, 119, 96, 117, -1, 119, 97, 117, -1,
635 119, -1, 120, 95, 119, -1, 120, 93, 119, -1,
636 120, -1, 121, -1, 122, 99, 121, -1, 122, 100,
637 121, -1, 122, 64, 121, -1, 122, 65, 121, -1,
638 122, -1, 123, 66, 122, -1, 123, 67, 122, -1,
639 123, -1, 124, -1, 125, -1, 126, -1, 127, 68,
640 126, -1, 127, -1, 128, 70, 127, -1, 128, -1,
641 129, 69, 128, -1, 129, -1, 129, 104, 133, 89,
642 131, -1, 130, -1, 117, 132, 131, -1, 90, -1,
643 71, -1, 72, -1, 73, -1, 80, -1, 131, -1,
644 133, 88, 131, -1, 130, -1, 136, 91, -1, 144,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000645 91, -1, 7, 152, 153, 91, -1, 137, 82, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000646 139, -1, 138, -1, 139, 141, -1, 138, 88, 141,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000647 -1, 146, 54, 81, -1, 151, 54, -1, 151, 54,
648 83, 134, 84, -1, 148, 142, 140, -1, 142, 140,
649 -1, 148, 142, 143, -1, 142, 143, -1, -1, 36,
650 -1, 37, -1, 38, -1, 151, -1, 145, -1, 144,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000651 88, 54, -1, 144, 88, 54, 83, 84, -1, 144,
652 88, 54, 83, 134, 84, -1, 144, 88, 54, 90,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000653 162, -1, 146, -1, 146, 54, -1, 146, 54, 83,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000654 84, -1, 146, 54, 83, 134, 84, -1, 146, 54,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000655 90, 162, -1, 3, 54, -1, 151, -1, 149, 151,
656 -1, 43, -1, 42, -1, 9, -1, 8, -1, 40,
657 -1, 3, 40, -1, 150, -1, 147, 150, -1, 147,
658 -1, 9, -1, 36, -1, 37, -1, 41, 36, -1,
659 41, 37, -1, 39, -1, 153, -1, 152, 153, -1,
660 4, -1, 5, -1, 6, -1, 154, -1, 154, 83,
661 134, 84, -1, 45, -1, 11, -1, 12, -1, 10,
662 -1, 30, -1, 31, -1, 32, -1, 24, -1, 25,
663 -1, 26, -1, 27, -1, 28, -1, 29, -1, 33,
664 -1, 34, -1, 35, -1, 47, -1, 48, -1, 49,
665 -1, 50, -1, 155, -1, 55, -1, -1, 44, 54,
666 85, 156, 158, 86, -1, -1, 44, 85, 157, 158,
667 86, -1, 159, -1, 158, 159, -1, 151, 160, 91,
668 -1, 161, -1, 160, 88, 161, -1, 54, -1, 54,
669 83, 134, 84, -1, 131, -1, 135, -1, 166, -1,
670 165, -1, 163, -1, 175, -1, 176, -1, 179, -1,
671 186, -1, 85, 86, -1, -1, -1, 85, 167, 174,
672 168, 86, -1, 173, -1, 165, -1, -1, 171, 173,
673 -1, -1, 172, 165, -1, 85, 86, -1, 85, 174,
674 86, -1, 164, -1, 174, 164, -1, 91, -1, 133,
675 91, -1, 18, 81, 133, 82, 177, -1, 170, 16,
676 170, -1, 170, -1, 133, -1, 146, 54, 90, 162,
677 -1, -1, 46, 81, 180, 178, 82, 169, -1, -1,
678 15, 181, 170, 46, 81, 133, 82, 91, -1, -1,
679 17, 81, 182, 183, 185, 82, 169, -1, 175, -1,
680 163, -1, 178, -1, -1, 184, 91, -1, 184, 91,
681 133, -1, 14, 91, -1, 13, 91, -1, 20, 91,
682 -1, 20, 133, 91, -1, 19, 91, -1, 188, -1,
683 187, 188, -1, 189, -1, 135, -1, -1, 136, 190,
684 173, -1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000685};
686
687/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
688static const yytype_uint16 yyrline[] =
689{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000690 0, 184, 184, 219, 222, 235, 240, 245, 251, 254,
691 333, 336, 437, 447, 460, 468, 568, 571, 579, 583,
692 590, 594, 601, 607, 616, 624, 679, 686, 696, 699,
693 709, 719, 740, 741, 742, 747, 748, 757, 769, 770,
694 778, 789, 793, 794, 804, 814, 824, 837, 838, 848,
695 861, 865, 869, 873, 874, 887, 888, 901, 902, 915,
696 916, 933, 934, 947, 948, 949, 950, 951, 955, 958,
697 969, 977, 1004, 1009, 1023, 1061, 1064, 1071, 1079, 1100,
698 1121, 1132, 1161, 1166, 1176, 1181, 1191, 1194, 1197, 1200,
699 1206, 1213, 1216, 1238, 1256, 1280, 1303, 1307, 1325, 1333,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000700 1365, 1385, 1474, 1483, 1506, 1510, 1517, 1523, 1530, 1539,
701 1548, 1551, 1587, 1597, 1601, 1606, 1611, 1616, 1621, 1630,
702 1640, 1647, 1650, 1653, 1659, 1662, 1677, 1681, 1685, 1689,
703 1698, 1703, 1708, 1713, 1718, 1723, 1728, 1733, 1738, 1743,
704 1749, 1755, 1761, 1766, 1771, 1780, 1789, 1794, 1807, 1807,
705 1821, 1821, 1830, 1833, 1848, 1884, 1888, 1894, 1902, 1918,
706 1922, 1926, 1927, 1933, 1934, 1935, 1936, 1937, 1941, 1942,
707 1942, 1942, 1952, 1953, 1957, 1957, 1958, 1958, 1963, 1966,
708 1976, 1979, 1985, 1986, 1990, 1998, 2002, 2012, 2017, 2034,
709 2034, 2039, 2039, 2046, 2046, 2054, 2057, 2063, 2066, 2072,
710 2076, 2083, 2090, 2097, 2104, 2115, 2124, 2128, 2135, 2138,
711 2144, 2144
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000712};
713#endif
714
715#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
716/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
717 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
718static const char *const yytname[] =
719{
720 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
721 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
722 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE",
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000723 "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE",
724 "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2",
725 "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL",
726 "INOUT_QUAL", "UNIFORM", "VARYING", "CENTROID", "FLAT", "SMOOTH",
727 "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE",
728 "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "SAMPLER3D", "SAMPLER3DRECT",
729 "SAMPLER2DSHADOW", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
730 "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
731 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
732 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
733 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
734 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
735 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
736 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
737 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
738 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000739 "primary_expression", "postfix_expression", "integer_expression",
740 "function_call", "function_call_or_method", "function_call_generic",
741 "function_call_header_no_parameters",
742 "function_call_header_with_parameters", "function_call_header",
743 "function_identifier", "unary_expression", "unary_operator",
744 "multiplicative_expression", "additive_expression", "shift_expression",
745 "relational_expression", "equality_expression", "and_expression",
746 "exclusive_or_expression", "inclusive_or_expression",
747 "logical_and_expression", "logical_xor_expression",
748 "logical_or_expression", "conditional_expression",
749 "assignment_expression", "assignment_operator", "expression",
750 "constant_expression", "declaration", "function_prototype",
751 "function_declarator", "function_header_with_parameters",
752 "function_header", "parameter_declarator", "parameter_declaration",
753 "parameter_qualifier", "parameter_type_specifier",
754 "init_declarator_list", "single_declaration", "fully_specified_type",
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000755 "interpolation_qualifier", "parameter_type_qualifier", "type_qualifier",
756 "storage_qualifier", "type_specifier", "precision_qualifier",
757 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
758 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000759 "struct_declarator_list", "struct_declarator", "initializer",
760 "declaration_statement", "statement", "simple_statement",
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000761 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000762 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
763 "statement_list", "expression_statement", "selection_statement",
764 "selection_rest_statement", "condition", "iteration_statement", "$@7",
765 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000766 "jump_statement", "translation_unit", "external_declaration",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000767 "function_definition", "$@10", 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000768};
769#endif
770
771# ifdef YYPRINT
772/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
773 token YYLEX-NUM. */
774static const yytype_uint16 yytoknum[] =
775{
776 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
777 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
778 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
779 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
780 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
781 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
782 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
783 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
784 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000785 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
786 355, 356, 357, 358, 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000787};
788# endif
789
790/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
791static const yytype_uint8 yyr1[] =
792{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000793 0, 105, 106, 107, 107, 107, 107, 107, 108, 108,
794 108, 108, 108, 108, 109, 110, 111, 111, 112, 112,
795 113, 113, 114, 114, 115, 116, 116, 116, 117, 117,
796 117, 117, 118, 118, 118, 119, 119, 119, 120, 120,
797 120, 121, 122, 122, 122, 122, 122, 123, 123, 123,
798 124, 125, 126, 127, 127, 128, 128, 129, 129, 130,
799 130, 131, 131, 132, 132, 132, 132, 132, 133, 133,
800 134, 135, 135, 135, 136, 137, 137, 138, 138, 139,
801 140, 140, 141, 141, 141, 141, 142, 142, 142, 142,
802 143, 144, 144, 144, 144, 144, 145, 145, 145, 145,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000803 145, 145, 146, 146, 147, 147, 148, 149, 149, 149,
804 149, 149, 149, 150, 150, 150, 150, 150, 150, 151,
805 151, 152, 152, 152, 153, 153, 154, 154, 154, 154,
806 154, 154, 154, 154, 154, 154, 154, 154, 154, 154,
807 154, 154, 154, 154, 154, 154, 154, 154, 156, 155,
808 157, 155, 158, 158, 159, 160, 160, 161, 161, 162,
809 163, 164, 164, 165, 165, 165, 165, 165, 166, 167,
810 168, 166, 169, 169, 171, 170, 172, 170, 173, 173,
811 174, 174, 175, 175, 176, 177, 177, 178, 178, 180,
812 179, 181, 179, 182, 179, 183, 183, 184, 184, 185,
813 185, 186, 186, 186, 186, 186, 187, 187, 188, 188,
814 190, 189
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000815};
816
817/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
818static const yytype_uint8 yyr2[] =
819{
820 0, 2, 1, 1, 1, 1, 1, 3, 1, 4,
821 1, 3, 2, 2, 1, 1, 1, 3, 2, 2,
822 2, 1, 2, 3, 2, 1, 1, 1, 1, 2,
823 2, 2, 1, 1, 1, 1, 3, 3, 1, 3,
824 3, 1, 1, 3, 3, 3, 3, 1, 3, 3,
825 1, 1, 1, 1, 3, 1, 3, 1, 3, 1,
826 5, 1, 3, 1, 1, 1, 1, 1, 1, 3,
827 1, 2, 2, 4, 2, 1, 1, 2, 3, 3,
828 2, 5, 3, 2, 3, 2, 0, 1, 1, 1,
829 1, 1, 3, 5, 6, 5, 1, 2, 4, 5,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000830 4, 2, 1, 2, 1, 1, 1, 1, 1, 2,
831 1, 2, 1, 1, 1, 1, 2, 2, 1, 1,
832 2, 1, 1, 1, 1, 4, 1, 1, 1, 1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000833 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000834 1, 1, 1, 1, 1, 1, 1, 1, 0, 6,
835 0, 5, 1, 2, 3, 1, 3, 1, 4, 1,
836 1, 1, 1, 1, 1, 1, 1, 1, 2, 0,
837 0, 5, 1, 1, 0, 2, 0, 2, 2, 3,
838 1, 2, 1, 2, 5, 3, 1, 1, 4, 0,
839 6, 0, 8, 0, 7, 1, 1, 1, 0, 2,
840 3, 2, 2, 2, 3, 2, 1, 2, 1, 1,
841 0, 3
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000842};
843
844/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
845 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
846 means the default is an error. */
847static const yytype_uint8 yydefact[] =
848{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000849 0, 0, 121, 122, 123, 0, 107, 113, 129, 127,
850 128, 133, 134, 135, 136, 137, 138, 130, 131, 132,
851 139, 140, 141, 114, 115, 118, 108, 0, 105, 104,
852 0, 126, 142, 143, 144, 145, 147, 209, 210, 0,
853 76, 86, 0, 91, 96, 112, 0, 110, 102, 0,
854 119, 124, 146, 0, 206, 208, 109, 101, 0, 116,
855 117, 0, 150, 71, 0, 74, 86, 106, 87, 88,
856 89, 77, 0, 86, 0, 72, 97, 111, 103, 120,
857 0, 1, 207, 0, 148, 0, 0, 211, 78, 83,
858 85, 90, 0, 92, 79, 0, 0, 2, 5, 4,
859 6, 27, 0, 0, 0, 34, 33, 32, 3, 8,
860 28, 10, 15, 16, 0, 0, 21, 0, 35, 0,
861 38, 41, 42, 47, 50, 51, 52, 53, 55, 57,
862 59, 70, 0, 25, 73, 0, 0, 0, 152, 0,
863 0, 191, 0, 0, 0, 0, 0, 169, 178, 182,
864 35, 61, 68, 0, 160, 0, 124, 163, 180, 162,
865 161, 0, 164, 165, 166, 167, 80, 82, 84, 0,
866 0, 98, 0, 159, 100, 29, 30, 0, 12, 13,
867 0, 0, 19, 18, 0, 20, 22, 24, 31, 0,
868 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
869 0, 0, 0, 125, 0, 157, 0, 155, 151, 153,
870 202, 201, 176, 193, 0, 205, 203, 0, 189, 168,
871 0, 64, 65, 66, 67, 63, 0, 0, 183, 179,
872 181, 0, 93, 0, 95, 99, 7, 0, 14, 26,
873 11, 17, 23, 36, 37, 40, 39, 45, 46, 43,
874 44, 48, 49, 54, 56, 58, 0, 149, 0, 0,
875 154, 0, 0, 0, 0, 0, 204, 0, 170, 62,
876 69, 0, 94, 9, 0, 0, 156, 0, 175, 177,
877 196, 195, 198, 176, 0, 187, 0, 0, 0, 81,
878 60, 158, 0, 197, 0, 0, 186, 184, 0, 0,
879 171, 0, 199, 0, 176, 0, 173, 190, 172, 0,
880 200, 194, 185, 188, 192
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000881};
882
883/* YYDEFGOTO[NTERM-NUM]. */
884static const yytype_int16 yydefgoto[] =
885{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000886 -1, 108, 109, 110, 237, 111, 112, 113, 114, 115,
887 116, 117, 150, 119, 120, 121, 122, 123, 124, 125,
888 126, 127, 128, 129, 130, 151, 152, 226, 153, 132,
889 154, 155, 39, 40, 41, 89, 71, 72, 90, 42,
890 43, 44, 45, 73, 46, 47, 48, 49, 50, 133,
891 52, 135, 85, 137, 138, 206, 207, 174, 157, 158,
892 159, 160, 220, 288, 307, 261, 262, 263, 308, 161,
893 162, 163, 297, 287, 164, 267, 212, 264, 282, 294,
894 295, 165, 53, 54, 55, 64
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000895};
896
897/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
898 STATE-NUM. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000899#define YYPACT_NINF -270
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000900static const yytype_int16 yypact[] =
901{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000902 1367, -24, -270, -270, -270, 141, -270, -270, -270, -270,
903 -270, -270, -270, -270, -270, -270, -270, -270, -270, -270,
904 -270, -270, -270, -270, -270, -270, -270, 30, -270, -270,
905 -28, -270, -270, -270, -270, -270, -270, -270, -62, -32,
906 -26, 1, -9, -270, 34, 32, 1414, -270, -270, 1496,
907 -270, 15, -270, 1314, -270, -270, -270, -270, 1496, -270,
908 -270, 6, -270, -270, 17, -270, 67, -270, -270, -270,
909 -270, -270, 1414, 113, 57, -270, -20, -270, -270, -270,
910 1060, -270, -270, 37, -270, 1414, 301, -270, -270, -270,
911 -270, 80, 1414, -6, -270, 838, 1060, 62, -270, -270,
912 -270, -270, 1060, 1060, 1060, -270, -270, -270, -270, -270,
913 -31, -270, -270, -270, 56, -65, 1132, 72, -270, 1060,
914 63, -53, -270, -40, 96, -270, -270, -270, 89, 94,
915 -56, -270, 90, -270, -270, 1414, 121, 1204, -270, 85,
916 86, -270, 97, 100, 93, 913, 104, 101, -270, -270,
917 68, -270, -270, 22, -270, -62, 71, -270, -270, -270,
918 -270, 394, -270, -270, -270, -270, 103, -270, -270, 985,
919 1060, -270, 105, -270, -270, -270, -270, -1, -270, -270,
920 1060, 1455, -270, -270, 1060, 107, -270, -270, -270, 1060,
921 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060,
922 1060, 1060, 1060, -270, 1251, 108, 39, -270, -270, -270,
923 -270, -270, 109, -270, 1060, -270, -270, 45, -270, -270,
924 487, -270, -270, -270, -270, -270, 1060, 1060, -270, -270,
925 -270, 1060, -270, 111, -270, -270, -270, 112, 110, -270,
926 116, -270, -270, -270, -270, 63, 63, -270, -270, -270,
927 -270, -40, -40, -270, 89, 94, 79, -270, 1060, 121,
928 -270, 146, 17, 673, 766, 8, -270, 203, 487, -270,
929 -270, 115, -270, -270, 1060, 118, -270, 122, -270, -270,
930 -270, -270, 203, 109, 153, 110, 151, 134, 131, -270,
931 -270, -270, 1060, -270, 127, 137, 205, -270, 132, 580,
932 -270, 13, 1060, 580, 109, 1060, -270, -270, -270, 133,
933 110, -270, -270, -270, -270
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000934};
935
936/* YYPGOTO[NTERM-NUM]. */
937static const yytype_int16 yypgoto[] =
938{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000939 -270, -270, -270, -270, -270, -270, -270, 42, -270, -270,
940 -270, -270, -75, -270, -21, -270, -87, -25, -270, -270,
941 -270, 26, 41, 25, -270, -76, -95, -270, -102, -89,
942 11, 12, -270, -270, -270, 157, 188, 182, 164, -270,
943 -270, -249, -270, -270, -270, 224, -38, 265, -13, 0,
944 -270, -270, -270, 136, -130, -270, 14, -161, 10, -139,
945 -248, -270, -270, -270, -27, -269, -270, -270, -61, 52,
946 16, -270, -270, -7, -270, -270, -270, -270, -270, -270,
947 -270, -270, -270, 225, -270, -270
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000948};
949
950/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
951 positive, shift that token. If negative, reduce the rule which
952 number is the opposite. If zero, do what YYDEFACT says.
953 If YYTABLE_NINF, syntax error. */
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000954#define YYTABLE_NINF -175
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000955static const yytype_int16 yytable[] =
956{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000957 51, 173, 177, 87, 131, 118, 172, 209, 78, 234,
958 67, 37, 38, 201, 296, 279, 56, 183, 286, 131,
959 118, 186, 230, 184, 193, 194, 61, 175, 176, 63,
960 57, 178, 179, 286, 91, 312, 79, 68, 69, 70,
961 191, 7, 192, 217, 188, 83, 51, 136, 202, 51,
962 65, 306, 180, 51, 91, 306, 181, 62, 51, 195,
963 196, 94, 66, 95, 37, 38, 59, 60, 23, 24,
964 96, 25, 51, 27, 209, 173, 67, 169, 238, 74,
965 233, 236, 75, -75, 170, 51, 156, 227, 76, 242,
966 283, 84, 51, 131, 118, 309, 227, 136, 80, 136,
967 256, 227, 86, 68, 69, 70, 247, 248, 249, 250,
968 227, 93, 265, 228, 243, 244, 118, 118, 118, 118,
969 118, 118, 118, 118, 118, 118, 118, 259, 134, 230,
970 260, 269, 270, 227, 166, 51, 266, 51, 182, 221,
971 222, 223, 271, -26, 313, 2, 3, 4, 224, 68,
972 69, 70, -25, 187, 80, 131, 118, 199, 225, 189,
973 190, 156, 197, 198, 200, 285, 136, 227, 274, 275,
974 245, 246, 251, 252, 203, 205, 210, 211, 213, 290,
975 285, 214, 131, 118, 215, 218, 231, 219, -126, 235,
976 301, 258, 277, 56, -174, 272, 273, -27, 227, 289,
977 310, 278, 291, 292, 51, 298, 284, 2, 3, 4,
978 173, 6, 7, 8, 9, 10, 299, 300, 302, 303,
979 156, 304, 305, 241, 314, 253, 255, 11, 12, 13,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000980 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000981 24, 254, 25, 26, 27, 28, 29, 30, 31, 167,
982 32, 33, 34, 35, 88, 92, 168, 97, 36, 98,
983 99, 100, 101, 156, 156, 102, 103, 156, 156, 77,
984 58, 204, 268, 276, 280, 293, 311, 0, 82, 0,
985 281, 0, 156, 0, 104, 0, 0, 0, 0, 0,
986 0, 0, 0, 0, 0, 105, 106, 0, 107, 156,
987 0, 0, 0, 156, 1, 2, 3, 4, 5, 6,
988 7, 8, 9, 10, 139, 140, 141, 0, 142, 143,
989 144, 145, 0, 0, 0, 11, 12, 13, 14, 15,
990 16, 17, 18, 19, 20, 21, 22, 23, 24, 0,
991 25, 26, 27, 28, 29, 30, 31, 146, 32, 33,
992 34, 35, 0, 0, 0, 97, 36, 98, 99, 100,
993 101, 0, 0, 102, 103, 0, 0, 0, 0, 0,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000994 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +0000995 0, 0, 104, 0, 0, 0, 147, 148, 0, 0,
996 0, 0, 149, 105, 106, 0, 107, 1, 2, 3,
997 4, 5, 6, 7, 8, 9, 10, 139, 140, 141,
998 0, 142, 143, 144, 145, 0, 0, 0, 11, 12,
999 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1000 23, 24, 0, 25, 26, 27, 28, 29, 30, 31,
1001 146, 32, 33, 34, 35, 0, 0, 0, 97, 36,
1002 98, 99, 100, 101, 0, 0, 102, 103, 0, 0,
1003 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1004 0, 0, 0, 0, 0, 104, 0, 0, 0, 147,
1005 229, 0, 0, 0, 0, 149, 105, 106, 0, 107,
1006 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1007 139, 140, 141, 0, 142, 143, 144, 145, 0, 0,
1008 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1009 20, 21, 22, 23, 24, 0, 25, 26, 27, 28,
1010 29, 30, 31, 146, 32, 33, 34, 35, 0, 0,
1011 0, 97, 36, 98, 99, 100, 101, 0, 0, 102,
1012 103, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1013 0, 0, 0, 0, 0, 0, 0, 0, 104, 0,
1014 0, 0, 147, 0, 0, 0, 0, 0, 149, 105,
1015 106, 0, 107, 1, 2, 3, 4, 5, 6, 7,
1016 8, 9, 10, 139, 140, 141, 0, 142, 143, 144,
1017 145, 0, 0, 0, 11, 12, 13, 14, 15, 16,
1018 17, 18, 19, 20, 21, 22, 23, 24, 0, 25,
1019 26, 27, 28, 29, 30, 31, 146, 32, 33, 34,
1020 35, 0, 0, 0, 97, 36, 98, 99, 100, 101,
1021 0, 0, 102, 103, 0, 0, 0, 0, 0, 0,
1022 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1023 0, 104, 0, 0, 0, 86, 0, 0, 0, 0,
1024 0, 149, 105, 106, 0, 107, 1, 2, 3, 4,
1025 5, 6, 7, 8, 9, 10, 139, 140, 141, 0,
1026 142, 143, 144, 145, 0, 0, 0, 11, 12, 13,
1027 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1028 24, 0, 25, 26, 27, 28, 29, 30, 31, 146,
1029 32, 33, 34, 35, 0, 0, 0, 97, 36, 98,
1030 99, 100, 101, 0, 0, 102, 103, 0, 0, 0,
1031 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1032 0, 0, 0, 0, 104, 0, 0, 0, 0, 0,
1033 0, 0, 0, 0, 149, 105, 106, 0, 107, 1,
1034 2, 3, 4, 5, 6, 7, 8, 9, 10, 0,
1035 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001036 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001037 21, 22, 23, 24, 0, 25, 26, 27, 28, 29,
1038 30, 31, 0, 32, 33, 34, 35, 0, 0, 0,
1039 97, 36, 98, 99, 100, 101, 0, 0, 102, 103,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001040 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001041 0, 0, 0, 0, 0, 0, 0, 104, 8, 9,
1042 10, 0, 0, 0, 0, 0, 0, 149, 105, 106,
1043 0, 107, 11, 12, 13, 14, 15, 16, 17, 18,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001044 19, 20, 21, 22, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001045 0, 0, 30, 31, 0, 32, 33, 34, 35, 0,
1046 0, 0, 97, 36, 98, 99, 100, 101, 0, 0,
1047 102, 103, 0, 0, 0, 0, 0, 0, 0, 0,
1048 0, 0, 0, 0, 0, 0, 0, 0, 0, 104,
1049 0, 0, 171, 8, 9, 10, 0, 0, 0, 0,
1050 105, 106, 0, 107, 0, 0, 0, 11, 12, 13,
1051 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
1052 0, 0, 0, 0, 0, 0, 0, 30, 31, 0,
1053 32, 33, 34, 35, 0, 0, 0, 97, 36, 98,
1054 99, 100, 101, 0, 0, 102, 103, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001055 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001056 0, 0, 0, 0, 104, 8, 9, 10, 0, 0,
1057 0, 0, 0, 0, 216, 105, 106, 0, 107, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001058 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001059 22, 0, 0, 0, 0, 0, 0, 0, 0, 30,
1060 31, 0, 32, 33, 34, 35, 0, 0, 0, 97,
1061 36, 98, 99, 100, 101, 0, 0, 102, 103, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001062 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001063 0, 0, 0, 0, 0, 0, 104, 0, 0, 232,
1064 8, 9, 10, 0, 0, 0, 0, 105, 106, 0,
1065 107, 0, 0, 0, 11, 12, 13, 14, 15, 16,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001066 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001067 0, 0, 0, 0, 30, 31, 0, 32, 33, 34,
1068 35, 0, 0, 0, 97, 36, 98, 99, 100, 101,
1069 0, 0, 102, 103, 0, 0, 0, 0, 0, 0,
1070 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1071 0, 104, 8, 9, 10, 0, 0, 0, 0, 0,
1072 0, 0, 105, 106, 0, 107, 11, 12, 13, 14,
1073 15, 16, 17, 18, 19, 20, 21, 22, 0, 0,
1074 0, 0, 0, 0, 0, 0, 30, 185, 0, 32,
1075 33, 34, 35, 0, 0, 0, 97, 36, 98, 99,
1076 100, 101, 0, 0, 102, 103, 0, 0, 0, 0,
1077 0, 0, 0, 0, 0, 0, 0, 0, 2, 3,
1078 4, 0, 0, 104, 8, 9, 10, 0, 0, 0,
1079 0, 0, 0, 0, 105, 106, 0, 107, 11, 12,
1080 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1081 0, 0, 0, 0, 0, 0, 0, 0, 30, 31,
1082 0, 32, 33, 34, 35, 2, 3, 4, 0, 36,
1083 0, 8, 9, 10, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001084 0, 0, 0, 0, 0, 11, 12, 13, 14, 15,
1085 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001086 208, 0, 0, 0, 0, 30, 31, 0, 32, 33,
1087 34, 35, 0, 0, 0, 0, 36, 0, 0, 0,
1088 0, 0, 0, 0, 81, 0, 0, 1, 2, 3,
1089 4, 5, 6, 7, 8, 9, 10, 0, 0, 0,
1090 0, 0, 0, 0, 0, 0, 0, 257, 11, 12,
1091 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1092 23, 24, 0, 25, 26, 27, 28, 29, 30, 31,
1093 0, 32, 33, 34, 35, 0, 0, 0, 0, 36,
1094 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1095 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1096 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1097 20, 21, 22, 23, 24, 0, 25, 26, 27, 28,
1098 29, 30, 31, 0, 32, 33, 34, 35, 2, 3,
1099 4, 0, 36, 0, 8, 9, 10, 0, 0, 0,
1100 0, 0, 0, 0, 0, 0, 0, 0, 11, 12,
1101 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1102 0, 0, 0, 0, 0, 0, 0, 0, 30, 31,
1103 0, 32, 33, 34, 35, 8, 9, 10, 0, 36,
1104 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1105 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1106 22, 0, 0, 0, 0, 0, 0, 0, 0, 30,
1107 31, 0, 32, 33, 34, 35, 8, 9, 10, 239,
1108 36, 0, 0, 0, 240, 0, 0, 0, 0, 0,
1109 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1110 21, 22, 0, 0, 0, 0, 0, 0, 0, 0,
1111 30, 31, 0, 32, 33, 34, 35, 0, 0, 0,
1112 0, 36
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001113};
1114
1115static const yytype_int16 yycheck[] =
1116{
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001117 0, 96, 104, 64, 80, 80, 95, 137, 46, 170,
1118 9, 0, 0, 69, 283, 263, 40, 82, 267, 95,
1119 95, 116, 161, 88, 64, 65, 54, 102, 103, 91,
1120 54, 62, 63, 282, 72, 304, 49, 36, 37, 38,
1121 93, 9, 95, 145, 119, 58, 46, 85, 104, 49,
1122 82, 299, 83, 53, 92, 303, 87, 85, 58, 99,
1123 100, 81, 88, 83, 53, 53, 36, 37, 36, 37,
1124 90, 39, 72, 41, 204, 170, 9, 83, 180, 88,
1125 169, 82, 91, 82, 90, 85, 86, 88, 54, 184,
1126 82, 85, 92, 169, 169, 82, 88, 135, 83, 137,
1127 202, 88, 85, 36, 37, 38, 193, 194, 195, 196,
1128 88, 54, 214, 91, 189, 190, 191, 192, 193, 194,
1129 195, 196, 197, 198, 199, 200, 201, 88, 91, 268,
1130 91, 226, 227, 88, 54, 135, 91, 137, 82, 71,
1131 72, 73, 231, 81, 305, 4, 5, 6, 80, 36,
1132 37, 38, 81, 81, 83, 231, 231, 68, 90, 96,
1133 97, 161, 66, 67, 70, 267, 204, 88, 89, 258,
1134 191, 192, 197, 198, 84, 54, 91, 91, 81, 274,
1135 282, 81, 258, 258, 91, 81, 83, 86, 81, 84,
1136 292, 83, 46, 40, 85, 84, 84, 81, 88, 84,
1137 302, 262, 84, 81, 204, 54, 3, 4, 5, 6,
1138 305, 8, 9, 10, 11, 12, 82, 86, 91, 82,
1139 220, 16, 90, 181, 91, 199, 201, 24, 25, 26,
1140 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1141 37, 200, 39, 40, 41, 42, 43, 44, 45, 92,
1142 47, 48, 49, 50, 66, 73, 92, 54, 55, 56,
1143 57, 58, 59, 263, 264, 62, 63, 267, 268, 45,
1144 5, 135, 220, 259, 264, 282, 303, -1, 53, -1,
1145 264, -1, 282, -1, 81, -1, -1, -1, -1, -1,
1146 -1, -1, -1, -1, -1, 92, 93, -1, 95, 299,
1147 -1, -1, -1, 303, 3, 4, 5, 6, 7, 8,
1148 9, 10, 11, 12, 13, 14, 15, -1, 17, 18,
1149 19, 20, -1, -1, -1, 24, 25, 26, 27, 28,
1150 29, 30, 31, 32, 33, 34, 35, 36, 37, -1,
1151 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
1152 49, 50, -1, -1, -1, 54, 55, 56, 57, 58,
1153 59, -1, -1, 62, 63, -1, -1, -1, -1, -1,
1154 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1155 -1, -1, 81, -1, -1, -1, 85, 86, -1, -1,
1156 -1, -1, 91, 92, 93, -1, 95, 3, 4, 5,
1157 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1158 -1, 17, 18, 19, 20, -1, -1, -1, 24, 25,
1159 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1160 36, 37, -1, 39, 40, 41, 42, 43, 44, 45,
1161 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1162 56, 57, 58, 59, -1, -1, 62, 63, -1, -1,
1163 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1164 -1, -1, -1, -1, -1, 81, -1, -1, -1, 85,
1165 86, -1, -1, -1, -1, 91, 92, 93, -1, 95,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001166 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1167 13, 14, 15, -1, 17, 18, 19, 20, -1, -1,
1168 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001169 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1170 43, 44, 45, 46, 47, 48, 49, 50, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001171 -1, 54, 55, 56, 57, 58, 59, -1, -1, 62,
1172 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1173 -1, -1, -1, -1, -1, -1, -1, -1, 81, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001174 -1, -1, 85, -1, -1, -1, -1, -1, 91, 92,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001175 93, -1, 95, 3, 4, 5, 6, 7, 8, 9,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001176 10, 11, 12, 13, 14, 15, -1, 17, 18, 19,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001177 20, -1, -1, -1, 24, 25, 26, 27, 28, 29,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001178 30, 31, 32, 33, 34, 35, 36, 37, -1, 39,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001179 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001180 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1181 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001182 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001183 -1, 81, -1, -1, -1, 85, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001184 -1, 91, 92, 93, -1, 95, 3, 4, 5, 6,
1185 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
1186 17, 18, 19, 20, -1, -1, -1, 24, 25, 26,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001187 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001188 37, -1, 39, 40, 41, 42, 43, 44, 45, 46,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001189 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1190 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
zmo@google.com09c323a2011-08-12 18:22:25 +00001191 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001192 -1, -1, -1, -1, 81, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001193 -1, -1, -1, -1, 91, 92, 93, -1, 95, 3,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001194 4, 5, 6, 7, 8, 9, 10, 11, 12, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001195 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001196 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001197 34, 35, 36, 37, -1, 39, 40, 41, 42, 43,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001198 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1199 54, 55, 56, 57, 58, 59, -1, -1, 62, 63,
1200 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1201 -1, -1, -1, -1, -1, -1, -1, 81, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001202 12, -1, -1, -1, -1, -1, -1, 91, 92, 93,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001203 -1, 95, 24, 25, 26, 27, 28, 29, 30, 31,
1204 32, 33, 34, 35, -1, -1, -1, -1, -1, -1,
1205 -1, -1, 44, 45, -1, 47, 48, 49, 50, -1,
1206 -1, -1, 54, 55, 56, 57, 58, 59, -1, -1,
1207 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
1208 -1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001209 -1, -1, 84, 10, 11, 12, -1, -1, -1, -1,
1210 92, 93, -1, 95, -1, -1, -1, 24, 25, 26,
1211 27, 28, 29, 30, 31, 32, 33, 34, 35, -1,
1212 -1, -1, -1, -1, -1, -1, -1, 44, 45, -1,
1213 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1214 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001215 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001216 -1, -1, -1, -1, 81, 10, 11, 12, -1, -1,
1217 -1, -1, -1, -1, 91, 92, 93, -1, 95, 24,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001218 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1219 35, -1, -1, -1, -1, -1, -1, -1, -1, 44,
1220 45, -1, 47, 48, 49, 50, -1, -1, -1, 54,
1221 55, 56, 57, 58, 59, -1, -1, 62, 63, -1,
1222 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001223 -1, -1, -1, -1, -1, -1, 81, -1, -1, 84,
1224 10, 11, 12, -1, -1, -1, -1, 92, 93, -1,
1225 95, -1, -1, -1, 24, 25, 26, 27, 28, 29,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001226 30, 31, 32, 33, 34, 35, -1, -1, -1, -1,
1227 -1, -1, -1, -1, 44, 45, -1, 47, 48, 49,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001228 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1229 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
1230 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1231 -1, 81, 10, 11, 12, -1, -1, -1, -1, -1,
1232 -1, -1, 92, 93, -1, 95, 24, 25, 26, 27,
1233 28, 29, 30, 31, 32, 33, 34, 35, -1, -1,
1234 -1, -1, -1, -1, -1, -1, 44, 45, -1, 47,
1235 48, 49, 50, -1, -1, -1, 54, 55, 56, 57,
1236 58, 59, -1, -1, 62, 63, -1, -1, -1, -1,
1237 -1, -1, -1, -1, -1, -1, -1, -1, 4, 5,
1238 6, -1, -1, 81, 10, 11, 12, -1, -1, -1,
1239 -1, -1, -1, -1, 92, 93, -1, 95, 24, 25,
1240 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1241 -1, -1, -1, -1, -1, -1, -1, -1, 44, 45,
1242 -1, 47, 48, 49, 50, 4, 5, 6, -1, 55,
1243 -1, 10, 11, 12, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001244 -1, -1, -1, -1, -1, 24, 25, 26, 27, 28,
1245 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001246 86, -1, -1, -1, -1, 44, 45, -1, 47, 48,
1247 49, 50, -1, -1, -1, -1, 55, -1, -1, -1,
1248 -1, -1, -1, -1, 0, -1, -1, 3, 4, 5,
1249 6, 7, 8, 9, 10, 11, 12, -1, -1, -1,
1250 -1, -1, -1, -1, -1, -1, -1, 86, 24, 25,
1251 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1252 36, 37, -1, 39, 40, 41, 42, 43, 44, 45,
1253 -1, 47, 48, 49, 50, -1, -1, -1, -1, 55,
1254 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1255 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1256 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1257 33, 34, 35, 36, 37, -1, 39, 40, 41, 42,
1258 43, 44, 45, -1, 47, 48, 49, 50, 4, 5,
1259 6, -1, 55, -1, 10, 11, 12, -1, -1, -1,
1260 -1, -1, -1, -1, -1, -1, -1, -1, 24, 25,
1261 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1262 -1, -1, -1, -1, -1, -1, -1, -1, 44, 45,
1263 -1, 47, 48, 49, 50, 10, 11, 12, -1, 55,
1264 -1, -1, -1, -1, -1, -1, -1, -1, -1, 24,
1265 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1266 35, -1, -1, -1, -1, -1, -1, -1, -1, 44,
1267 45, -1, 47, 48, 49, 50, 10, 11, 12, 54,
1268 55, -1, -1, -1, 59, -1, -1, -1, -1, -1,
1269 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1270 34, 35, -1, -1, -1, -1, -1, -1, -1, -1,
1271 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1272 -1, 55
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001273};
1274
1275/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1276 symbol of state STATE-NUM. */
1277static const yytype_uint8 yystos[] =
1278{
1279 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001280 12, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00001281 33, 34, 35, 36, 37, 39, 40, 41, 42, 43,
1282 44, 45, 47, 48, 49, 50, 55, 135, 136, 137,
1283 138, 139, 144, 145, 146, 147, 149, 150, 151, 152,
1284 153, 154, 155, 187, 188, 189, 40, 54, 152, 36,
1285 37, 54, 85, 91, 190, 82, 88, 9, 36, 37,
1286 38, 141, 142, 148, 88, 91, 54, 150, 151, 153,
1287 83, 0, 188, 153, 85, 157, 85, 173, 141, 140,
1288 143, 151, 142, 54, 81, 83, 90, 54, 56, 57,
1289 58, 59, 62, 63, 81, 92, 93, 95, 106, 107,
1290 108, 110, 111, 112, 113, 114, 115, 116, 117, 118,
1291 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
1292 129, 130, 134, 154, 91, 156, 151, 158, 159, 13,
1293 14, 15, 17, 18, 19, 20, 46, 85, 86, 91,
1294 117, 130, 131, 133, 135, 136, 154, 163, 164, 165,
1295 166, 174, 175, 176, 179, 186, 54, 140, 143, 83,
1296 90, 84, 134, 131, 162, 117, 117, 133, 62, 63,
1297 83, 87, 82, 82, 88, 45, 131, 81, 117, 96,
1298 97, 93, 95, 64, 65, 99, 100, 66, 67, 68,
1299 70, 69, 104, 84, 158, 54, 160, 161, 86, 159,
1300 91, 91, 181, 81, 81, 91, 91, 133, 81, 86,
1301 167, 71, 72, 73, 80, 90, 132, 88, 91, 86,
1302 164, 83, 84, 134, 162, 84, 82, 109, 133, 54,
1303 59, 112, 131, 117, 117, 119, 119, 121, 121, 121,
1304 121, 122, 122, 126, 127, 128, 133, 86, 83, 88,
1305 91, 170, 171, 172, 182, 133, 91, 180, 174, 131,
1306 131, 134, 84, 84, 89, 134, 161, 46, 173, 165,
1307 163, 175, 183, 82, 3, 133, 146, 178, 168, 84,
1308 131, 84, 81, 178, 184, 185, 170, 177, 54, 82,
1309 86, 133, 91, 82, 16, 90, 165, 169, 173, 82,
1310 133, 169, 170, 162, 91
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001311};
1312
1313#define yyerrok (yyerrstatus = 0)
1314#define yyclearin (yychar = YYEMPTY)
1315#define YYEMPTY (-2)
1316#define YYEOF 0
1317
1318#define YYACCEPT goto yyacceptlab
1319#define YYABORT goto yyabortlab
1320#define YYERROR goto yyerrorlab
1321
1322
1323/* Like YYERROR except do call yyerror. This remains here temporarily
1324 to ease the transition to the new meaning of YYERROR, for GCC.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001325 Once GCC version 2 has supplanted version 1, this can go. However,
1326 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1327 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1328 discussed. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001329
1330#define YYFAIL goto yyerrlab
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001331#if defined YYFAIL
1332 /* This is here to suppress warnings from the GCC cpp's
1333 -Wunused-macros. Normally we don't worry about that warning, but
1334 some users do, and we want to make it easy for users to remove
1335 YYFAIL uses, which will produce warnings from Bison 2.5. */
1336#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001337
1338#define YYRECOVERING() (!!yyerrstatus)
1339
1340#define YYBACKUP(Token, Value) \
1341do \
1342 if (yychar == YYEMPTY && yylen == 1) \
1343 { \
1344 yychar = (Token); \
1345 yylval = (Value); \
1346 yytoken = YYTRANSLATE (yychar); \
1347 YYPOPSTACK (1); \
1348 goto yybackup; \
1349 } \
1350 else \
1351 { \
1352 yyerror (context, YY_("syntax error: cannot back up")); \
1353 YYERROR; \
1354 } \
1355while (YYID (0))
1356
1357
1358#define YYTERROR 1
1359#define YYERRCODE 256
1360
1361
1362/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1363 If N is 0, then set CURRENT to the empty location which ends
1364 the previous symbol: RHS[0] (always defined). */
1365
1366#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1367#ifndef YYLLOC_DEFAULT
1368# define YYLLOC_DEFAULT(Current, Rhs, N) \
1369 do \
1370 if (YYID (N)) \
1371 { \
1372 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1373 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1374 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1375 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1376 } \
1377 else \
1378 { \
1379 (Current).first_line = (Current).last_line = \
1380 YYRHSLOC (Rhs, 0).last_line; \
1381 (Current).first_column = (Current).last_column = \
1382 YYRHSLOC (Rhs, 0).last_column; \
1383 } \
1384 while (YYID (0))
1385#endif
1386
1387
1388/* YY_LOCATION_PRINT -- Print the location on the stream.
1389 This macro was not mandated originally: define only if we know
1390 we won't break user code: when these are the locations we know. */
1391
1392#ifndef YY_LOCATION_PRINT
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001393# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001394# define YY_LOCATION_PRINT(File, Loc) \
1395 fprintf (File, "%d.%d-%d.%d", \
1396 (Loc).first_line, (Loc).first_column, \
1397 (Loc).last_line, (Loc).last_column)
1398# else
1399# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1400# endif
1401#endif
1402
1403
1404/* YYLEX -- calling `yylex' with the right arguments. */
1405
1406#ifdef YYLEX_PARAM
1407# define YYLEX yylex (&yylval, YYLEX_PARAM)
1408#else
1409# define YYLEX yylex (&yylval)
1410#endif
1411
1412/* Enable debugging if requested. */
1413#if YYDEBUG
1414
1415# ifndef YYFPRINTF
1416# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1417# define YYFPRINTF fprintf
1418# endif
1419
1420# define YYDPRINTF(Args) \
1421do { \
1422 if (yydebug) \
1423 YYFPRINTF Args; \
1424} while (YYID (0))
1425
1426# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1427do { \
1428 if (yydebug) \
1429 { \
1430 YYFPRINTF (stderr, "%s ", Title); \
1431 yy_symbol_print (stderr, \
1432 Type, Value, context); \
1433 YYFPRINTF (stderr, "\n"); \
1434 } \
1435} while (YYID (0))
1436
1437
1438/*--------------------------------.
1439| Print this symbol on YYOUTPUT. |
1440`--------------------------------*/
1441
1442/*ARGSUSED*/
1443#if (defined __STDC__ || defined __C99__FUNC__ \
1444 || defined __cplusplus || defined _MSC_VER)
1445static void
1446yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1447#else
1448static void
1449yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1450 FILE *yyoutput;
1451 int yytype;
1452 YYSTYPE const * const yyvaluep;
1453 TParseContext* context;
1454#endif
1455{
1456 if (!yyvaluep)
1457 return;
1458 YYUSE (context);
1459# ifdef YYPRINT
1460 if (yytype < YYNTOKENS)
1461 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1462# else
1463 YYUSE (yyoutput);
1464# endif
1465 switch (yytype)
1466 {
1467 default:
1468 break;
1469 }
1470}
1471
1472
1473/*--------------------------------.
1474| Print this symbol on YYOUTPUT. |
1475`--------------------------------*/
1476
1477#if (defined __STDC__ || defined __C99__FUNC__ \
1478 || defined __cplusplus || defined _MSC_VER)
1479static void
1480yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1481#else
1482static void
1483yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1484 FILE *yyoutput;
1485 int yytype;
1486 YYSTYPE const * const yyvaluep;
1487 TParseContext* context;
1488#endif
1489{
1490 if (yytype < YYNTOKENS)
1491 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1492 else
1493 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1494
1495 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1496 YYFPRINTF (yyoutput, ")");
1497}
1498
1499/*------------------------------------------------------------------.
1500| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1501| TOP (included). |
1502`------------------------------------------------------------------*/
1503
1504#if (defined __STDC__ || defined __C99__FUNC__ \
1505 || defined __cplusplus || defined _MSC_VER)
1506static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001507yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001508#else
1509static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001510yy_stack_print (yybottom, yytop)
1511 yytype_int16 *yybottom;
1512 yytype_int16 *yytop;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001513#endif
1514{
1515 YYFPRINTF (stderr, "Stack now");
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001516 for (; yybottom <= yytop; yybottom++)
1517 {
1518 int yybot = *yybottom;
1519 YYFPRINTF (stderr, " %d", yybot);
1520 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001521 YYFPRINTF (stderr, "\n");
1522}
1523
1524# define YY_STACK_PRINT(Bottom, Top) \
1525do { \
1526 if (yydebug) \
1527 yy_stack_print ((Bottom), (Top)); \
1528} while (YYID (0))
1529
1530
1531/*------------------------------------------------.
1532| Report that the YYRULE is going to be reduced. |
1533`------------------------------------------------*/
1534
1535#if (defined __STDC__ || defined __C99__FUNC__ \
1536 || defined __cplusplus || defined _MSC_VER)
1537static void
1538yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1539#else
1540static void
1541yy_reduce_print (yyvsp, yyrule, context)
1542 YYSTYPE *yyvsp;
1543 int yyrule;
1544 TParseContext* context;
1545#endif
1546{
1547 int yynrhs = yyr2[yyrule];
1548 int yyi;
1549 unsigned long int yylno = yyrline[yyrule];
1550 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1551 yyrule - 1, yylno);
1552 /* The symbols being reduced. */
1553 for (yyi = 0; yyi < yynrhs; yyi++)
1554 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001555 YYFPRINTF (stderr, " $%d = ", yyi + 1);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001556 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1557 &(yyvsp[(yyi + 1) - (yynrhs)])
1558 , context);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001559 YYFPRINTF (stderr, "\n");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001560 }
1561}
1562
1563# define YY_REDUCE_PRINT(Rule) \
1564do { \
1565 if (yydebug) \
1566 yy_reduce_print (yyvsp, Rule, context); \
1567} while (YYID (0))
1568
1569/* Nonzero means print parse trace. It is left uninitialized so that
1570 multiple parsers can coexist. */
1571int yydebug;
1572#else /* !YYDEBUG */
1573# define YYDPRINTF(Args)
1574# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1575# define YY_STACK_PRINT(Bottom, Top)
1576# define YY_REDUCE_PRINT(Rule)
1577#endif /* !YYDEBUG */
1578
1579
1580/* YYINITDEPTH -- initial size of the parser's stacks. */
1581#ifndef YYINITDEPTH
1582# define YYINITDEPTH 200
1583#endif
1584
1585/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1586 if the built-in stack extension method is used).
1587
1588 Do not make this value too large; the results are undefined if
1589 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1590 evaluated with infinite-precision integer arithmetic. */
1591
1592#ifndef YYMAXDEPTH
1593# define YYMAXDEPTH 10000
1594#endif
1595
1596
1597
1598#if YYERROR_VERBOSE
1599
1600# ifndef yystrlen
1601# if defined __GLIBC__ && defined _STRING_H
1602# define yystrlen strlen
1603# else
1604/* Return the length of YYSTR. */
1605#if (defined __STDC__ || defined __C99__FUNC__ \
1606 || defined __cplusplus || defined _MSC_VER)
1607static YYSIZE_T
1608yystrlen (const char *yystr)
1609#else
1610static YYSIZE_T
1611yystrlen (yystr)
1612 const char *yystr;
1613#endif
1614{
1615 YYSIZE_T yylen;
1616 for (yylen = 0; yystr[yylen]; yylen++)
1617 continue;
1618 return yylen;
1619}
1620# endif
1621# endif
1622
1623# ifndef yystpcpy
1624# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1625# define yystpcpy stpcpy
1626# else
1627/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1628 YYDEST. */
1629#if (defined __STDC__ || defined __C99__FUNC__ \
1630 || defined __cplusplus || defined _MSC_VER)
1631static char *
1632yystpcpy (char *yydest, const char *yysrc)
1633#else
1634static char *
1635yystpcpy (yydest, yysrc)
1636 char *yydest;
1637 const char *yysrc;
1638#endif
1639{
1640 char *yyd = yydest;
1641 const char *yys = yysrc;
1642
1643 while ((*yyd++ = *yys++) != '\0')
1644 continue;
1645
1646 return yyd - 1;
1647}
1648# endif
1649# endif
1650
1651# ifndef yytnamerr
1652/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1653 quotes and backslashes, so that it's suitable for yyerror. The
1654 heuristic is that double-quoting is unnecessary unless the string
1655 contains an apostrophe, a comma, or backslash (other than
1656 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1657 null, do not copy; instead, return the length of what the result
1658 would have been. */
1659static YYSIZE_T
1660yytnamerr (char *yyres, const char *yystr)
1661{
1662 if (*yystr == '"')
1663 {
1664 YYSIZE_T yyn = 0;
1665 char const *yyp = yystr;
1666
1667 for (;;)
1668 switch (*++yyp)
1669 {
1670 case '\'':
1671 case ',':
1672 goto do_not_strip_quotes;
1673
1674 case '\\':
1675 if (*++yyp != '\\')
1676 goto do_not_strip_quotes;
1677 /* Fall through. */
1678 default:
1679 if (yyres)
1680 yyres[yyn] = *yyp;
1681 yyn++;
1682 break;
1683
1684 case '"':
1685 if (yyres)
1686 yyres[yyn] = '\0';
1687 return yyn;
1688 }
1689 do_not_strip_quotes: ;
1690 }
1691
1692 if (! yyres)
1693 return yystrlen (yystr);
1694
1695 return yystpcpy (yyres, yystr) - yyres;
1696}
1697# endif
1698
1699/* Copy into YYRESULT an error message about the unexpected token
1700 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1701 including the terminating null byte. If YYRESULT is null, do not
1702 copy anything; just return the number of bytes that would be
1703 copied. As a special case, return 0 if an ordinary "syntax error"
1704 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1705 size calculation. */
1706static YYSIZE_T
1707yysyntax_error (char *yyresult, int yystate, int yychar)
1708{
1709 int yyn = yypact[yystate];
1710
1711 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1712 return 0;
1713 else
1714 {
1715 int yytype = YYTRANSLATE (yychar);
1716 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1717 YYSIZE_T yysize = yysize0;
1718 YYSIZE_T yysize1;
1719 int yysize_overflow = 0;
1720 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1721 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1722 int yyx;
1723
1724# if 0
1725 /* This is so xgettext sees the translatable formats that are
1726 constructed on the fly. */
1727 YY_("syntax error, unexpected %s");
1728 YY_("syntax error, unexpected %s, expecting %s");
1729 YY_("syntax error, unexpected %s, expecting %s or %s");
1730 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1731 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1732# endif
1733 char *yyfmt;
1734 char const *yyf;
1735 static char const yyunexpected[] = "syntax error, unexpected %s";
1736 static char const yyexpecting[] = ", expecting %s";
1737 static char const yyor[] = " or %s";
1738 char yyformat[sizeof yyunexpected
1739 + sizeof yyexpecting - 1
1740 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1741 * (sizeof yyor - 1))];
1742 char const *yyprefix = yyexpecting;
1743
1744 /* Start YYX at -YYN if negative to avoid negative indexes in
1745 YYCHECK. */
1746 int yyxbegin = yyn < 0 ? -yyn : 0;
1747
1748 /* Stay within bounds of both yycheck and yytname. */
1749 int yychecklim = YYLAST - yyn + 1;
1750 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1751 int yycount = 1;
1752
1753 yyarg[0] = yytname[yytype];
1754 yyfmt = yystpcpy (yyformat, yyunexpected);
1755
1756 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1757 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1758 {
1759 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1760 {
1761 yycount = 1;
1762 yysize = yysize0;
1763 yyformat[sizeof yyunexpected - 1] = '\0';
1764 break;
1765 }
1766 yyarg[yycount++] = yytname[yyx];
1767 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1768 yysize_overflow |= (yysize1 < yysize);
1769 yysize = yysize1;
1770 yyfmt = yystpcpy (yyfmt, yyprefix);
1771 yyprefix = yyor;
1772 }
1773
1774 yyf = YY_(yyformat);
1775 yysize1 = yysize + yystrlen (yyf);
1776 yysize_overflow |= (yysize1 < yysize);
1777 yysize = yysize1;
1778
1779 if (yysize_overflow)
1780 return YYSIZE_MAXIMUM;
1781
1782 if (yyresult)
1783 {
1784 /* Avoid sprintf, as that infringes on the user's name space.
1785 Don't have undefined behavior even if the translation
1786 produced a string with the wrong number of "%s"s. */
1787 char *yyp = yyresult;
1788 int yyi = 0;
1789 while ((*yyp = *yyf) != '\0')
1790 {
1791 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1792 {
1793 yyp += yytnamerr (yyp, yyarg[yyi++]);
1794 yyf += 2;
1795 }
1796 else
1797 {
1798 yyp++;
1799 yyf++;
1800 }
1801 }
1802 }
1803 return yysize;
1804 }
1805}
1806#endif /* YYERROR_VERBOSE */
1807
1808
1809/*-----------------------------------------------.
1810| Release the memory associated to this symbol. |
1811`-----------------------------------------------*/
1812
1813/*ARGSUSED*/
1814#if (defined __STDC__ || defined __C99__FUNC__ \
1815 || defined __cplusplus || defined _MSC_VER)
1816static void
1817yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1818#else
1819static void
1820yydestruct (yymsg, yytype, yyvaluep, context)
1821 const char *yymsg;
1822 int yytype;
1823 YYSTYPE *yyvaluep;
1824 TParseContext* context;
1825#endif
1826{
1827 YYUSE (yyvaluep);
1828 YYUSE (context);
1829
1830 if (!yymsg)
1831 yymsg = "Deleting";
1832 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1833
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001834 switch (yytype)
1835 {
1836
1837 default:
1838 break;
1839 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001840}
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001841
1842/* Prevent warnings from -Wmissing-prototypes. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001843#ifdef YYPARSE_PARAM
1844#if defined __STDC__ || defined __cplusplus
1845int yyparse (void *YYPARSE_PARAM);
1846#else
1847int yyparse ();
1848#endif
1849#else /* ! YYPARSE_PARAM */
1850#if defined __STDC__ || defined __cplusplus
1851int yyparse (TParseContext* context);
1852#else
1853int yyparse ();
1854#endif
1855#endif /* ! YYPARSE_PARAM */
1856
1857
1858
1859
1860
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001861/*-------------------------.
1862| yyparse or yypush_parse. |
1863`-------------------------*/
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001864
1865#ifdef YYPARSE_PARAM
1866#if (defined __STDC__ || defined __C99__FUNC__ \
1867 || defined __cplusplus || defined _MSC_VER)
1868int
1869yyparse (void *YYPARSE_PARAM)
1870#else
1871int
1872yyparse (YYPARSE_PARAM)
1873 void *YYPARSE_PARAM;
1874#endif
1875#else /* ! YYPARSE_PARAM */
1876#if (defined __STDC__ || defined __C99__FUNC__ \
1877 || defined __cplusplus || defined _MSC_VER)
1878int
1879yyparse (TParseContext* context)
1880#else
1881int
1882yyparse (context)
1883 TParseContext* context;
1884#endif
1885#endif
1886{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001887/* The lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001888int yychar;
1889
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001890/* The semantic value of the lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001891YYSTYPE yylval;
1892
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001893 /* Number of syntax errors so far. */
1894 int yynerrs;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001895
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001896 int yystate;
1897 /* Number of tokens to shift before error messages enabled. */
1898 int yyerrstatus;
1899
1900 /* The stacks and their tools:
1901 `yyss': related to states.
1902 `yyvs': related to semantic values.
1903
1904 Refer to the stacks thru separate pointers, to allow yyoverflow
1905 to reallocate them elsewhere. */
1906
1907 /* The state stack. */
1908 yytype_int16 yyssa[YYINITDEPTH];
1909 yytype_int16 *yyss;
1910 yytype_int16 *yyssp;
1911
1912 /* The semantic value stack. */
1913 YYSTYPE yyvsa[YYINITDEPTH];
1914 YYSTYPE *yyvs;
1915 YYSTYPE *yyvsp;
1916
1917 YYSIZE_T yystacksize;
1918
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001919 int yyn;
1920 int yyresult;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001921 /* Lookahead token as an internal (translated) token number. */
1922 int yytoken;
1923 /* The variables used to return semantic value and location from the
1924 action routines. */
1925 YYSTYPE yyval;
1926
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001927#if YYERROR_VERBOSE
1928 /* Buffer for error messages, and its allocated size. */
1929 char yymsgbuf[128];
1930 char *yymsg = yymsgbuf;
1931 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1932#endif
1933
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001934#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1935
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001936 /* The number of symbols on the RHS of the reduced rule.
1937 Keep to zero when no symbol should be popped. */
1938 int yylen = 0;
1939
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001940 yytoken = 0;
1941 yyss = yyssa;
1942 yyvs = yyvsa;
1943 yystacksize = YYINITDEPTH;
1944
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001945 YYDPRINTF ((stderr, "Starting parse\n"));
1946
1947 yystate = 0;
1948 yyerrstatus = 0;
1949 yynerrs = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001950 yychar = YYEMPTY; /* Cause a token to be read. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001951
1952 /* Initialize stack pointers.
1953 Waste one element of value and location stack
1954 so that they stay on the same level as the state stack.
1955 The wasted elements are never initialized. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001956 yyssp = yyss;
1957 yyvsp = yyvs;
1958
1959 goto yysetstate;
1960
1961/*------------------------------------------------------------.
1962| yynewstate -- Push a new state, which is found in yystate. |
1963`------------------------------------------------------------*/
1964 yynewstate:
1965 /* In all cases, when you get here, the value and location stacks
1966 have just been pushed. So pushing a state here evens the stacks. */
1967 yyssp++;
1968
1969 yysetstate:
1970 *yyssp = yystate;
1971
1972 if (yyss + yystacksize - 1 <= yyssp)
1973 {
1974 /* Get the current used size of the three stacks, in elements. */
1975 YYSIZE_T yysize = yyssp - yyss + 1;
1976
1977#ifdef yyoverflow
1978 {
1979 /* Give user a chance to reallocate the stack. Use copies of
1980 these so that the &'s don't force the real ones into
1981 memory. */
1982 YYSTYPE *yyvs1 = yyvs;
1983 yytype_int16 *yyss1 = yyss;
1984
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001985 /* Each stack pointer address is followed by the size of the
1986 data in use in that stack, in bytes. This used to be a
1987 conditional around just the two extra args, but that might
1988 be undefined if yyoverflow is a macro. */
1989 yyoverflow (YY_("memory exhausted"),
1990 &yyss1, yysize * sizeof (*yyssp),
1991 &yyvs1, yysize * sizeof (*yyvsp),
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001992 &yystacksize);
1993
1994 yyss = yyss1;
1995 yyvs = yyvs1;
1996 }
1997#else /* no yyoverflow */
1998# ifndef YYSTACK_RELOCATE
1999 goto yyexhaustedlab;
2000# else
2001 /* Extend the stack our own way. */
2002 if (YYMAXDEPTH <= yystacksize)
2003 goto yyexhaustedlab;
2004 yystacksize *= 2;
2005 if (YYMAXDEPTH < yystacksize)
2006 yystacksize = YYMAXDEPTH;
2007
2008 {
2009 yytype_int16 *yyss1 = yyss;
2010 union yyalloc *yyptr =
2011 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2012 if (! yyptr)
2013 goto yyexhaustedlab;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002014 YYSTACK_RELOCATE (yyss_alloc, yyss);
2015 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002016# undef YYSTACK_RELOCATE
2017 if (yyss1 != yyssa)
2018 YYSTACK_FREE (yyss1);
2019 }
2020# endif
2021#endif /* no yyoverflow */
2022
2023 yyssp = yyss + yysize - 1;
2024 yyvsp = yyvs + yysize - 1;
2025
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002026 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2027 (unsigned long int) yystacksize));
2028
2029 if (yyss + yystacksize - 1 <= yyssp)
2030 YYABORT;
2031 }
2032
2033 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2034
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002035 if (yystate == YYFINAL)
2036 YYACCEPT;
2037
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002038 goto yybackup;
2039
2040/*-----------.
2041| yybackup. |
2042`-----------*/
2043yybackup:
2044
2045 /* Do appropriate processing given the current state. Read a
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002046 lookahead token if we need one and don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002047
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002048 /* First try to decide what to do without reference to lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002049 yyn = yypact[yystate];
2050 if (yyn == YYPACT_NINF)
2051 goto yydefault;
2052
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002053 /* Not known => get a lookahead token if don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002054
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002055 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002056 if (yychar == YYEMPTY)
2057 {
2058 YYDPRINTF ((stderr, "Reading a token: "));
2059 yychar = YYLEX;
2060 }
2061
2062 if (yychar <= YYEOF)
2063 {
2064 yychar = yytoken = YYEOF;
2065 YYDPRINTF ((stderr, "Now at end of input.\n"));
2066 }
2067 else
2068 {
2069 yytoken = YYTRANSLATE (yychar);
2070 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2071 }
2072
2073 /* If the proper action on seeing token YYTOKEN is to reduce or to
2074 detect an error, take that action. */
2075 yyn += yytoken;
2076 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2077 goto yydefault;
2078 yyn = yytable[yyn];
2079 if (yyn <= 0)
2080 {
2081 if (yyn == 0 || yyn == YYTABLE_NINF)
2082 goto yyerrlab;
2083 yyn = -yyn;
2084 goto yyreduce;
2085 }
2086
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002087 /* Count tokens shifted since error; after three, turn off error
2088 status. */
2089 if (yyerrstatus)
2090 yyerrstatus--;
2091
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002092 /* Shift the lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002093 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2094
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002095 /* Discard the shifted token. */
2096 yychar = YYEMPTY;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002097
2098 yystate = yyn;
2099 *++yyvsp = yylval;
2100
2101 goto yynewstate;
2102
2103
2104/*-----------------------------------------------------------.
2105| yydefault -- do the default action for the current state. |
2106`-----------------------------------------------------------*/
2107yydefault:
2108 yyn = yydefact[yystate];
2109 if (yyn == 0)
2110 goto yyerrlab;
2111 goto yyreduce;
2112
2113
2114/*-----------------------------.
2115| yyreduce -- Do a reduction. |
2116`-----------------------------*/
2117yyreduce:
2118 /* yyn is the number of a rule to reduce with. */
2119 yylen = yyr2[yyn];
2120
2121 /* If YYLEN is nonzero, implement the default value of the action:
2122 `$$ = $1'.
2123
2124 Otherwise, the following line sets YYVAL to garbage.
2125 This behavior is undocumented and Bison
2126 users should not rely upon it. Assigning to YYVAL
2127 unconditionally makes the parser a bit smaller, and it avoids a
2128 GCC warning that YYVAL may be used uninitialized. */
2129 yyval = yyvsp[1-yylen];
2130
2131
2132 YY_REDUCE_PRINT (yyn);
2133 switch (yyn)
2134 {
2135 case 2:
2136
2137 {
2138 // The symbol table search was done in the lexical phase
2139 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2140 const TVariable* variable;
2141 if (symbol == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002142 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002143 context->recover();
2144 TType type(EbtFloat, EbpUndefined);
2145 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00002146 context->symbolTable.declare(*fakeVariable);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002147 variable = fakeVariable;
2148 } else {
2149 // This identifier can only be a variable type symbol
2150 if (! symbol->isVariable()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002151 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002152 context->recover();
2153 }
2154 variable = static_cast<const TVariable*>(symbol);
2155 }
2156
2157 // don't delete $1.string, it's used by error recovery, and the pool
2158 // pop will reclaim the memory
2159
2160 if (variable->getType().getQualifier() == EvqConst ) {
2161 ConstantUnion* constArray = variable->getConstPointer();
2162 TType t(variable->getType());
2163 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2164 } else
2165 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2166 variable->getName(),
2167 variable->getType(), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002168 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002169 break;
2170
2171 case 3:
2172
2173 {
2174 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002175 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002176 break;
2177
2178 case 4:
2179
2180 {
2181 //
2182 // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
2183 // check for overflow for constants
2184 //
2185 if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002186 context->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002187 context->recover();
2188 }
2189 ConstantUnion *unionArray = new ConstantUnion[1];
2190 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2191 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002192 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002193 break;
2194
2195 case 5:
2196
2197 {
2198 ConstantUnion *unionArray = new ConstantUnion[1];
2199 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2200 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002201 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002202 break;
2203
2204 case 6:
2205
2206 {
2207 ConstantUnion *unionArray = new ConstantUnion[1];
2208 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2209 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002210 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002211 break;
2212
2213 case 7:
2214
2215 {
2216 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002217 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002218 break;
2219
2220 case 8:
2221
2222 {
2223 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002224 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002225 break;
2226
2227 case 9:
2228
2229 {
2230 if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) {
2231 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode())
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002232 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", (yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()->getSymbol().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002233 else
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002234 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", "expression");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002235 context->recover();
2236 }
2237 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
2238 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002239 (yyval.interm.intermTypedNode) = context->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002240 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors
2241 TVectorFields fields;
2242 fields.num = 1;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002243 fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0); // need to do it this way because v.xy sends fields integer array
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002244 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2245 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002246 (yyval.interm.intermTypedNode) = context->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002247 }
2248 } else {
2249 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002250 if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() ) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002251 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002252 extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002253 std::string extraInfo = extraInfoStream.str();
2254 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002255 context->recover();
2256 } else {
2257 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2258 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002259 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0)) {
2260 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), true, (yyvsp[(2) - (4)].lex).line))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002261 context->recover();
2262 } else {
2263 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line))
2264 context->recover();
2265 }
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002266 } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002267 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002268 extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002269 std::string extraInfo = extraInfoStream.str();
2270 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002271 context->recover();
2272 }
2273 }
2274 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2275 }
2276 } else {
2277 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
2278 context->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable");
2279 context->recover();
2280 }
2281
2282 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2283 }
2284 }
2285 if ((yyval.interm.intermTypedNode) == 0) {
2286 ConstantUnion *unionArray = new ConstantUnion[1];
2287 unionArray->setFConst(0.0f);
2288 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), (yyvsp[(2) - (4)].lex).line);
2289 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2290 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct())
2291 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName()));
2292 else
2293 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize(), (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()));
2294
2295 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2296 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2297 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2298 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
2299 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())
2300 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
2301 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2302 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst));
2303 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector())
2304 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary));
2305 else
2306 (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002307 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002308 break;
2309
2310 case 10:
2311
2312 {
2313 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002314 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002315 break;
2316
2317 case 11:
2318
2319 {
2320 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002321 context->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002322 context->recover();
2323 }
2324
2325 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) {
2326 TVectorFields fields;
2327 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2328 fields.num = 1;
2329 fields.offsets[0] = 0;
2330 context->recover();
2331 }
2332
2333 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { // constant folding for vector fields
2334 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line);
2335 if ((yyval.interm.intermTypedNode) == 0) {
2336 context->recover();
2337 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2338 }
2339 else
2340 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqConst, (int) (*(yyvsp[(3) - (3)].lex).string).size()));
2341 } else {
alokp@chromium.orgab8c0262012-08-13 17:36:25 +00002342 TString vectorString = *(yyvsp[(3) - (3)].lex).string;
2343 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line);
2344 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2345 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (int) vectorString.size()));
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002346 }
2347 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) {
2348 TMatrixFields fields;
2349 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2350 fields.wholeRow = false;
2351 fields.wholeCol = false;
2352 fields.row = 0;
2353 fields.col = 0;
2354 context->recover();
2355 }
2356
2357 if (fields.wholeRow || fields.wholeCol) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002358 context->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002359 context->recover();
2360 ConstantUnion *unionArray = new ConstantUnion[1];
2361 unionArray->setIConst(0);
2362 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2363 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2364 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize()));
2365 } else {
2366 ConstantUnion *unionArray = new ConstantUnion[1];
2367 unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row);
2368 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2369 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2370 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision()));
2371 }
2372 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) {
2373 bool fieldFound = false;
2374 const TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct();
2375 if (fields == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002376 context->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002377 context->recover();
2378 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2379 } else {
2380 unsigned int i;
2381 for (i = 0; i < fields->size(); ++i) {
2382 if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
2383 fieldFound = true;
2384 break;
2385 }
2386 }
2387 if (fieldFound) {
2388 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) {
2389 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2390 if ((yyval.interm.intermTypedNode) == 0) {
2391 context->recover();
2392 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2393 }
2394 else {
2395 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2396 // change the qualifier of the return type, not of the structure field
2397 // as the structure definition is shared between various structures.
2398 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2399 }
2400 } else {
2401 ConstantUnion *unionArray = new ConstantUnion[1];
2402 unionArray->setIConst(i);
2403 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line);
2404 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2405 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2406 }
2407 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002408 context->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002409 context->recover();
2410 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2411 }
2412 }
2413 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002414 context->error((yyvsp[(2) - (3)].lex).line, " field selection requires structure, vector, or matrix on left hand side", (yyvsp[(3) - (3)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002415 context->recover();
2416 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2417 }
2418 // don't delete $3.string, it's from the pool
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002419 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002420 break;
2421
2422 case 12:
2423
2424 {
2425 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2426 context->recover();
2427 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2428 if ((yyval.interm.intermTypedNode) == 0) {
2429 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2430 context->recover();
2431 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2432 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002433 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002434 break;
2435
2436 case 13:
2437
2438 {
2439 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2440 context->recover();
2441 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2442 if ((yyval.interm.intermTypedNode) == 0) {
2443 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2444 context->recover();
2445 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2446 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002447 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002448 break;
2449
2450 case 14:
2451
2452 {
2453 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2454 context->recover();
2455 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002456 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002457 break;
2458
2459 case 15:
2460
2461 {
2462 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2463 TOperator op = fnCall->getBuiltInOp();
2464
2465 if (op != EOpNull)
2466 {
2467 //
2468 // Then this should be a constructor.
2469 // Don't go through the symbol table for constructors.
2470 // Their parameters will be verified algorithmically.
2471 //
2472 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2473 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2474 (yyval.interm.intermTypedNode) = 0;
2475 } else {
2476 //
2477 // It's a constructor, of type 'type'.
2478 //
2479 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2480 }
2481
2482 if ((yyval.interm.intermTypedNode) == 0) {
2483 context->recover();
2484 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2485 }
2486 (yyval.interm.intermTypedNode)->setType(type);
2487 } else {
2488 //
2489 // Not a constructor. Find it in the symbol table.
2490 //
2491 const TFunction* fnCandidate;
2492 bool builtIn;
2493 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn);
2494 if (fnCandidate) {
2495 //
2496 // A declared function.
2497 //
2498 if (builtIn && !fnCandidate->getExtension().empty() &&
2499 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2500 context->recover();
2501 }
2502 op = fnCandidate->getBuiltInOp();
2503 if (builtIn && op != EOpNull) {
2504 //
2505 // A function call mapped to a built-in operation.
2506 //
2507 if (fnCandidate->getParamCount() == 1) {
2508 //
2509 // Treat it like a built-in unary operator.
2510 //
2511 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2512 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002513 std::stringstream extraInfoStream;
2514 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2515 std::string extraInfo = extraInfoStream.str();
2516 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002517 YYERROR;
2518 }
2519 } else {
2520 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2521 }
2522 } else {
2523 // This is a real function call
2524
2525 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2526 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2527
2528 // this is how we know whether the given function is a builtIn function or a user defined function
2529 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2530 // if builtIn == true, it's definitely a builtIn function with EOpNull
2531 if (!builtIn)
2532 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2533 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2534
2535 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002536 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002537 qual = fnCandidate->getParam(i).type->getQualifier();
2538 if (qual == EvqOut || qual == EvqInOut) {
2539 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002540 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 +00002541 context->recover();
2542 }
2543 }
2544 }
2545 }
2546 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2547 } else {
2548 // error message was put out by PaFindFunction()
2549 // Put on a dummy node for error recovery
2550 ConstantUnion *unionArray = new ConstantUnion[1];
2551 unionArray->setFConst(0.0f);
2552 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2553 context->recover();
2554 }
2555 }
2556 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002557 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002558 break;
2559
2560 case 16:
2561
2562 {
2563 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002564 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002565 break;
2566
2567 case 17:
2568
2569 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002570 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002571 context->recover();
2572 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002573 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002574 break;
2575
2576 case 18:
2577
2578 {
2579 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2580 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002581 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002582 break;
2583
2584 case 19:
2585
2586 {
2587 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2588 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002589 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002590 break;
2591
2592 case 20:
2593
2594 {
2595 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2596 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002597 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002598 break;
2599
2600 case 21:
2601
2602 {
2603 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2604 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002605 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002606 break;
2607
2608 case 22:
2609
2610 {
2611 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2612 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2613 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2614 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002615 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002616 break;
2617
2618 case 23:
2619
2620 {
2621 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2622 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2623 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2624 (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 +00002625 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002626 break;
2627
2628 case 24:
2629
2630 {
2631 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002632 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002633 break;
2634
2635 case 25:
2636
2637 {
2638 //
2639 // Constructor
2640 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002641 TOperator op = EOpNull;
2642 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2643 op = EOpConstructStruct;
2644 } else {
2645 switch ((yyvsp[(1) - (1)].interm.type).type) {
2646 case EbtFloat:
2647 if ((yyvsp[(1) - (1)].interm.type).matrix) {
2648 switch((yyvsp[(1) - (1)].interm.type).size) {
2649 case 2: op = EOpConstructMat2; break;
2650 case 3: op = EOpConstructMat3; break;
2651 case 4: op = EOpConstructMat4; break;
2652 }
2653 } else {
2654 switch((yyvsp[(1) - (1)].interm.type).size) {
2655 case 1: op = EOpConstructFloat; break;
2656 case 2: op = EOpConstructVec2; break;
2657 case 3: op = EOpConstructVec3; break;
2658 case 4: op = EOpConstructVec4; break;
2659 }
2660 }
2661 break;
2662 case EbtInt:
2663 switch((yyvsp[(1) - (1)].interm.type).size) {
2664 case 1: op = EOpConstructInt; break;
2665 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2666 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2667 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2668 }
2669 break;
2670 case EbtBool:
2671 switch((yyvsp[(1) - (1)].interm.type).size) {
2672 case 1: op = EOpConstructBool; break;
2673 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2674 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2675 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2676 }
2677 break;
2678 default: break;
2679 }
2680 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002681 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 +00002682 context->recover();
2683 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2684 op = EOpConstructFloat;
2685 }
2686 }
2687 TString tempString;
2688 TType type((yyvsp[(1) - (1)].interm.type));
2689 TFunction *function = new TFunction(&tempString, type, op);
2690 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002691 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002692 break;
2693
2694 case 26:
2695
2696 {
2697 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2698 context->recover();
2699 TType type(EbtVoid, EbpUndefined);
2700 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2701 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002702 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002703 break;
2704
2705 case 27:
2706
2707 {
2708 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2709 context->recover();
2710 TType type(EbtVoid, EbpUndefined);
2711 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2712 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002713 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002714 break;
2715
2716 case 28:
2717
2718 {
2719 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002720 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002721 break;
2722
2723 case 29:
2724
2725 {
2726 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2727 context->recover();
2728 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2729 if ((yyval.interm.intermTypedNode) == 0) {
2730 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2731 context->recover();
2732 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2733 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002734 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002735 break;
2736
2737 case 30:
2738
2739 {
2740 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2741 context->recover();
2742 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2743 if ((yyval.interm.intermTypedNode) == 0) {
2744 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2745 context->recover();
2746 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2747 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002748 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002749 break;
2750
2751 case 31:
2752
2753 {
2754 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2755 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2756 if ((yyval.interm.intermTypedNode) == 0) {
2757 const char* errorOp = "";
2758 switch((yyvsp[(1) - (2)].interm).op) {
2759 case EOpNegative: errorOp = "-"; break;
2760 case EOpLogicalNot: errorOp = "!"; break;
2761 default: break;
2762 }
2763 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2764 context->recover();
2765 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2766 }
2767 } else
2768 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002769 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002770 break;
2771
2772 case 32:
2773
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002774 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002775 break;
2776
2777 case 33:
2778
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002779 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002780 break;
2781
2782 case 34:
2783
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002784 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002785 break;
2786
2787 case 35:
2788
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002789 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002790 break;
2791
2792 case 36:
2793
2794 {
2795 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2796 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2797 if ((yyval.interm.intermTypedNode) == 0) {
2798 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2799 context->recover();
2800 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2801 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002802 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002803 break;
2804
2805 case 37:
2806
2807 {
2808 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2809 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2810 if ((yyval.interm.intermTypedNode) == 0) {
2811 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2812 context->recover();
2813 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2814 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002815 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002816 break;
2817
2818 case 38:
2819
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002820 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002821 break;
2822
2823 case 39:
2824
2825 {
2826 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2827 if ((yyval.interm.intermTypedNode) == 0) {
2828 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2829 context->recover();
2830 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2831 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002832 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002833 break;
2834
2835 case 40:
2836
2837 {
2838 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2839 if ((yyval.interm.intermTypedNode) == 0) {
2840 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2841 context->recover();
2842 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2843 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002844 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002845 break;
2846
2847 case 41:
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 42:
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 43:
2858
2859 {
2860 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2861 if ((yyval.interm.intermTypedNode) == 0) {
2862 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2863 context->recover();
2864 ConstantUnion *unionArray = new ConstantUnion[1];
2865 unionArray->setBConst(false);
2866 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2867 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002868 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002869 break;
2870
2871 case 44:
2872
2873 {
2874 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2875 if ((yyval.interm.intermTypedNode) == 0) {
2876 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2877 context->recover();
2878 ConstantUnion *unionArray = new ConstantUnion[1];
2879 unionArray->setBConst(false);
2880 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2881 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002882 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002883 break;
2884
2885 case 45:
2886
2887 {
2888 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2889 if ((yyval.interm.intermTypedNode) == 0) {
2890 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2891 context->recover();
2892 ConstantUnion *unionArray = new ConstantUnion[1];
2893 unionArray->setBConst(false);
2894 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2895 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002896 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002897 break;
2898
2899 case 46:
2900
2901 {
2902 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2903 if ((yyval.interm.intermTypedNode) == 0) {
2904 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2905 context->recover();
2906 ConstantUnion *unionArray = new ConstantUnion[1];
2907 unionArray->setBConst(false);
2908 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2909 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002910 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002911 break;
2912
2913 case 47:
2914
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002915 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002916 break;
2917
2918 case 48:
2919
2920 {
2921 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2922 if ((yyval.interm.intermTypedNode) == 0) {
2923 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2924 context->recover();
2925 ConstantUnion *unionArray = new ConstantUnion[1];
2926 unionArray->setBConst(false);
2927 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2928 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002929 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002930 break;
2931
2932 case 49:
2933
2934 {
2935 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2936 if ((yyval.interm.intermTypedNode) == 0) {
2937 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2938 context->recover();
2939 ConstantUnion *unionArray = new ConstantUnion[1];
2940 unionArray->setBConst(false);
2941 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2942 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002943 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002944 break;
2945
2946 case 50:
2947
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002948 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002949 break;
2950
2951 case 51:
2952
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002953 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002954 break;
2955
2956 case 52:
2957
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002958 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002959 break;
2960
2961 case 53:
2962
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002963 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002964 break;
2965
2966 case 54:
2967
2968 {
2969 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2970 if ((yyval.interm.intermTypedNode) == 0) {
2971 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2972 context->recover();
2973 ConstantUnion *unionArray = new ConstantUnion[1];
2974 unionArray->setBConst(false);
2975 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2976 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002977 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002978 break;
2979
2980 case 55:
2981
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002982 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002983 break;
2984
2985 case 56:
2986
2987 {
2988 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2989 if ((yyval.interm.intermTypedNode) == 0) {
2990 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2991 context->recover();
2992 ConstantUnion *unionArray = new ConstantUnion[1];
2993 unionArray->setBConst(false);
2994 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2995 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002996 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002997 break;
2998
2999 case 57:
3000
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003001 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003002 break;
3003
3004 case 58:
3005
3006 {
3007 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
3008 if ((yyval.interm.intermTypedNode) == 0) {
3009 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3010 context->recover();
3011 ConstantUnion *unionArray = new ConstantUnion[1];
3012 unionArray->setBConst(false);
3013 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
3014 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003015 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003016 break;
3017
3018 case 59:
3019
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003020 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003021 break;
3022
3023 case 60:
3024
3025 {
3026 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3027 context->recover();
3028
3029 (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);
3030 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3031 (yyval.interm.intermTypedNode) = 0;
3032
3033 if ((yyval.interm.intermTypedNode) == 0) {
3034 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3035 context->recover();
3036 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3037 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003038 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003039 break;
3040
3041 case 61:
3042
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003043 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003044 break;
3045
3046 case 62:
3047
3048 {
3049 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3050 context->recover();
3051 (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);
3052 if ((yyval.interm.intermTypedNode) == 0) {
3053 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3054 context->recover();
3055 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3056 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003057 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003058 break;
3059
3060 case 63:
3061
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003062 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003063 break;
3064
3065 case 64:
3066
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003067 { 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 +00003068 break;
3069
3070 case 65:
3071
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003072 { 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 +00003073 break;
3074
3075 case 66:
3076
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003077 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003078 break;
3079
3080 case 67:
3081
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003082 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003083 break;
3084
3085 case 68:
3086
3087 {
3088 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003089 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003090 break;
3091
3092 case 69:
3093
3094 {
3095 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3096 if ((yyval.interm.intermTypedNode) == 0) {
3097 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3098 context->recover();
3099 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3100 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003101 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003102 break;
3103
3104 case 70:
3105
3106 {
3107 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3108 context->recover();
3109 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003110 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003111 break;
3112
3113 case 71:
3114
3115 {
3116 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3117
3118 TIntermAggregate *prototype = new TIntermAggregate;
3119 prototype->setType(function.getReturnType());
3120 prototype->setName(function.getName());
3121
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003122 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003123 {
3124 const TParameter &param = function.getParam(i);
3125 if (param.name != 0)
3126 {
3127 TVariable *variable = new TVariable(param.name, *param.type);
3128
3129 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3130 }
3131 else
3132 {
3133 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3134 }
3135 }
3136
3137 prototype->setOp(EOpPrototype);
3138 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003139
3140 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003141 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003142 break;
3143
3144 case 72:
3145
3146 {
3147 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3148 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3149 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003150 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003151 break;
3152
3153 case 73:
3154
3155 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003156 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3157 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3158 context->recover();
3159 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003160 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3161 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3162 context->recover();
3163 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003164 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003165 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003166 break;
3167
3168 case 74:
3169
3170 {
3171 //
3172 // Multiple declarations of the same function are allowed.
3173 //
3174 // If this is a definition, the definition production code will check for redefinitions
3175 // (we don't know at this point if it's a definition or not).
3176 //
3177 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3178 //
3179 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName()));
3180 if (prevDec) {
3181 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003182 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 +00003183 context->recover();
3184 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003185 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003186 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003187 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 +00003188 context->recover();
3189 }
3190 }
3191 }
3192
3193 //
3194 // If this is a redeclaration, it could also be a definition,
3195 // in which case, we want to use the variable names from this one, and not the one that's
3196 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3197 //
3198 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3199 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3200
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003201 // We're at the inner scope level of the function's arguments and body statement.
3202 // Add the function prototype to the surrounding scope instead.
3203 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003204 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003205 break;
3206
3207 case 75:
3208
3209 {
3210 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003211 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003212 break;
3213
3214 case 76:
3215
3216 {
3217 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003218 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003219 break;
3220
3221 case 77:
3222
3223 {
3224 // Add the parameter
3225 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3226 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3227 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3228 else
3229 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003230 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003231 break;
3232
3233 case 78:
3234
3235 {
3236 //
3237 // Only first parameter of one-parameter functions can be void
3238 // The check for named parameters not being void is done in parameter_declarator
3239 //
3240 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3241 //
3242 // This parameter > first is void
3243 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003244 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003245 context->recover();
3246 delete (yyvsp[(3) - (3)].interm).param.type;
3247 } else {
3248 // Add the parameter
3249 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3250 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3251 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003252 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003253 break;
3254
3255 case 79:
3256
3257 {
3258 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003259 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 +00003260 context->recover();
3261 }
3262 // make sure a sampler is not involved as well...
3263 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3264 context->recover();
3265
3266 // Add the function as a prototype after parsing it (we do not support recursion)
3267 TFunction *function;
3268 TType type((yyvsp[(1) - (3)].interm.type));
3269 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3270 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003271
3272 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003273 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003274 break;
3275
3276 case 80:
3277
3278 {
3279 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003280 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 +00003281 context->recover();
3282 }
3283 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3284 context->recover();
3285 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3286 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3287 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003288 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003289 break;
3290
3291 case 81:
3292
3293 {
3294 // Check that we can make an array out of this type
3295 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3296 context->recover();
3297
3298 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3299 context->recover();
3300
3301 int size;
3302 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3303 context->recover();
3304 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3305
3306 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3307 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3308 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3309 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003310 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003311 break;
3312
3313 case 82:
3314
3315 {
3316 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003317 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003318 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003319 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003320 break;
3321
3322 case 83:
3323
3324 {
3325 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3326 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3327 context->recover();
3328 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3329 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003330 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003331 break;
3332
3333 case 84:
3334
3335 {
3336 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003337 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003338 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003339 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003340 break;
3341
3342 case 85:
3343
3344 {
3345 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3346 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3347 context->recover();
3348 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3349 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003350 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003351 break;
3352
3353 case 86:
3354
3355 {
3356 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003357 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003358 break;
3359
3360 case 87:
3361
3362 {
3363 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003364 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003365 break;
3366
3367 case 88:
3368
3369 {
3370 (yyval.interm.qualifier) = EvqOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003371 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003372 break;
3373
3374 case 89:
3375
3376 {
3377 (yyval.interm.qualifier) = EvqInOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003378 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003379 break;
3380
3381 case 90:
3382
3383 {
3384 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3385 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003386 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003387 break;
3388
3389 case 91:
3390
3391 {
3392 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003393 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003394 break;
3395
3396 case 92:
3397
3398 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003399 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3400 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003401 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 +00003402 context->recover();
3403 }
3404
zmo@google.comfd747b82011-04-23 01:30:07 +00003405 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3406 (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 +00003407
3408 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3409 context->recover();
3410
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003411 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 +00003412 context->recover();
3413
zmo@google.comfd747b82011-04-23 01:30:07 +00003414 TVariable* variable = 0;
3415 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 +00003416 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003417 if (symbol && variable)
3418 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003419 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003420 break;
3421
3422 case 93:
3423
3424 {
3425 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3426 context->recover();
3427
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003428 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 +00003429 context->recover();
3430
3431 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3432
3433 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))
3434 context->recover();
3435 else {
3436 (yyvsp[(1) - (5)].interm).type.setArray(true);
3437 TVariable* variable;
3438 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3439 context->recover();
3440 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003441 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003442 break;
3443
3444 case 94:
3445
3446 {
3447 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3448 context->recover();
3449
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003450 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 +00003451 context->recover();
3452
3453 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3454
3455 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))
3456 context->recover();
3457 else {
3458 int size;
3459 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3460 context->recover();
3461 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003462 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003463 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3464 context->recover();
3465 TType type = TType((yyvsp[(1) - (6)].interm).type);
3466 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003467 (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 +00003468 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003469 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003470 break;
3471
3472 case 95:
3473
3474 {
3475 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3476 context->recover();
3477
3478 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3479
3480 TIntermNode* intermNode;
3481 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3482 //
3483 // build the intermediate representation
3484 //
3485 if (intermNode)
3486 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3487 else
3488 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3489 } else {
3490 context->recover();
3491 (yyval.interm).intermAggregate = 0;
3492 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003493 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003494 break;
3495
3496 case 96:
3497
3498 {
3499 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3500 (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 +00003501 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003502 break;
3503
3504 case 97:
3505
3506 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003507 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3508 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003509
3510 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3511 context->recover();
3512
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003513 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 +00003514 context->recover();
3515
3516 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3517
zmo@google.comfd747b82011-04-23 01:30:07 +00003518 TVariable* variable = 0;
3519 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 +00003520 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003521 if (variable && symbol)
3522 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003523 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003524 break;
3525
3526 case 98:
3527
3528 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003529 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 +00003530 context->recover();
3531
zmo@google.comfd747b82011-04-23 01:30:07 +00003532 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3533 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003534 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003535 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003536 break;
3537
3538 case 99:
3539
3540 {
3541 TType type = TType((yyvsp[(1) - (5)].interm.type));
3542 int size;
3543 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3544 context->recover();
3545 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003546 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3547 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003548
3549 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3550 context->recover();
3551
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003552 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 +00003553 context->recover();
3554
3555 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3556
3557 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)))
3558 context->recover();
3559 else {
3560 int size;
3561 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3562 context->recover();
3563
3564 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003565 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003566 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3567 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003568 if (variable && symbol)
3569 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003570 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003571 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003572 break;
3573
3574 case 100:
3575
3576 {
3577 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3578 context->recover();
3579
3580 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3581
3582 TIntermNode* intermNode;
3583 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3584 //
3585 // Build intermediate representation
3586 //
3587 if(intermNode)
3588 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3589 else
3590 (yyval.interm).intermAggregate = 0;
3591 } else {
3592 context->recover();
3593 (yyval.interm).intermAggregate = 0;
3594 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003595 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003596 break;
3597
3598 case 101:
3599
3600 {
3601 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003602 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3603 context->recover();
3604 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3605 if (!(yyvsp[(2) - (2)].lex).symbol)
3606 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003607 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 +00003608 context->recover();
3609
3610 (yyval.interm).intermAggregate = 0;
3611 }
3612 else
3613 {
3614 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3615 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3616 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003617 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003618 break;
3619
3620 case 102:
3621
3622 {
3623 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3624
3625 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003626 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003627 context->recover();
3628 (yyvsp[(1) - (1)].interm.type).setArray(false);
3629 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003630 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003631 break;
3632
3633 case 103:
3634
3635 {
3636 if ((yyvsp[(2) - (2)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003637 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003638 context->recover();
3639 (yyvsp[(2) - (2)].interm.type).setArray(false);
3640 }
3641
3642 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3643 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003644 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 +00003645 context->recover();
3646 }
3647 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3648 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003649 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 +00003650 context->recover();
3651 }
3652 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3653 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003654 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003655 break;
3656
3657 case 104:
3658
3659 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003660 (yyval.interm.type).qualifier = EvqSmooth;
3661 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003662 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003663 break;
3664
3665 case 105:
3666
3667 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003668 (yyval.interm.type).qualifier = EvqFlat;
3669 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003670 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003671 break;
3672
3673 case 106:
3674
3675 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003676 (yyval.interm.qualifier) = EvqConst;
3677 }
3678 break;
3679
3680 case 107:
3681
3682 {
3683 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3684 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
3685 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3686 context->recover();
3687 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3688 }
3689 break;
3690
3691 case 108:
3692
3693 {
3694 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003695 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3696 context->recover();
3697 if (context->shaderType == SH_VERTEX_SHADER)
3698 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3699 else
3700 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003701 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003702 break;
3703
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003704 case 109:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003705
3706 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003707 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003708 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3709 context->recover();
3710 if (context->shaderType == SH_VERTEX_SHADER)
3711 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3712 else
3713 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003714 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003715 break;
3716
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003717 case 110:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003718
3719 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003720 (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 +00003721 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003722 break;
3723
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003724 case 111:
3725
3726 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003727 if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothIn) {
3728 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3729 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothIn, (yyvsp[(2) - (2)].interm.type).line);
3730 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3731 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3732 else UNREACHABLE();
3733 }
3734 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidIn) {
3735 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3736 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidIn, (yyvsp[(2) - (2)].interm.type).line);
3737 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3738 (yyval.interm.type).setBasic(EbtVoid, EvqFlatIn, (yyvsp[(2) - (2)].interm.type).line);
3739 else UNREACHABLE();
3740 }
3741 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqSmoothOut) {
3742 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3743 (yyval.interm.type).setBasic(EbtVoid, EvqSmoothOut, (yyvsp[(2) - (2)].interm.type).line);
3744 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3745 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3746 else UNREACHABLE();
3747 }
3748 else if ((yyvsp[(2) - (2)].interm.type).qualifier == EvqCentroidOut) {
3749 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqSmooth)
3750 (yyval.interm.type).setBasic(EbtVoid, EvqCentroidOut, (yyvsp[(2) - (2)].interm.type).line);
3751 else if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqFlat)
3752 (yyval.interm.type).setBasic(EbtVoid, EvqFlatOut, (yyvsp[(2) - (2)].interm.type).line);
3753 else UNREACHABLE();
3754 }
3755 else {
3756 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));
3757 context->recover();
3758
3759 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
3760 }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003761 }
3762 break;
3763
3764 case 112:
3765
3766 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003767 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));
3768 context->recover();
3769
3770 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3771 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003772 }
3773 break;
3774
3775 case 113:
3776
3777 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003778 (yyval.interm.type).qualifier = EvqConst;
3779 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003780 }
3781 break;
3782
3783 case 114:
3784
3785 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003786 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
3787 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqSmoothIn : EvqAttribute;
3788 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003789 }
3790 break;
3791
3792 case 115:
3793
3794 {
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003795 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
3796 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqSmoothOut;
3797 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3798 }
3799 break;
3800
3801 case 116:
3802
3803 {
3804 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line);
3805 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqCentroidIn : EvqAttribute;
3806 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3807 }
3808 break;
3809
3810 case 117:
3811
3812 {
3813 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line);
3814 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqCentroidOut;
3815 (yyval.interm.type).line = (yyvsp[(1) - (2)].lex).line;
3816 }
3817 break;
3818
3819 case 118:
3820
3821 {
3822 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3823 context->recover();
3824 (yyval.interm.type).qualifier = EvqUniform;
3825 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3826 }
3827 break;
3828
3829 case 119:
3830
3831 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003832 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003833
3834 if ((yyval.interm.type).precision == EbpUndefined) {
3835 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3836 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3837 context->recover();
3838 }
3839 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003840 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003841 break;
3842
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003843 case 120:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003844
3845 {
3846 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3847 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003848 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003849 break;
3850
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003851 case 121:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003852
3853 {
3854 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003855 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003856 break;
3857
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003858 case 122:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003859
3860 {
3861 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003862 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003863 break;
3864
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003865 case 123:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003866
3867 {
3868 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003869 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003870 break;
3871
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003872 case 124:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003873
3874 {
3875 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003876 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003877 break;
3878
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003879 case 125:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003880
3881 {
3882 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3883
3884 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3885 context->recover();
3886 else {
3887 int size;
3888 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3889 context->recover();
3890 (yyval.interm.type).setArray(true, size);
3891 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003892 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003893 break;
3894
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003895 case 126:
3896
3897 {
3898 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003899 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003900 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003901 break;
3902
3903 case 127:
3904
3905 {
3906 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003907 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003908 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003909 break;
3910
3911 case 128:
3912
3913 {
3914 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003915 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003916 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003917 break;
3918
3919 case 129:
3920
3921 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003922 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3923 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003924 }
3925 break;
3926
3927 case 130:
3928
3929 {
3930 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003931 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3932 (yyval.interm.type).setAggregate(2);
3933 }
3934 break;
3935
3936 case 131:
3937
3938 {
3939 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3940 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3941 (yyval.interm.type).setAggregate(3);
3942 }
3943 break;
3944
3945 case 132:
3946
3947 {
3948 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3949 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3950 (yyval.interm.type).setAggregate(4);
3951 }
3952 break;
3953
3954 case 133:
3955
3956 {
3957 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3958 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3959 (yyval.interm.type).setAggregate(2);
3960 }
3961 break;
3962
3963 case 134:
3964
3965 {
3966 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003967 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3968 (yyval.interm.type).setAggregate(3);
3969 }
3970 break;
3971
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003972 case 135:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003973
3974 {
3975 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3976 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3977 (yyval.interm.type).setAggregate(4);
3978 }
3979 break;
3980
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003981 case 136:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003982
3983 {
3984 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3985 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3986 (yyval.interm.type).setAggregate(2);
3987 }
3988 break;
3989
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003990 case 137:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003991
3992 {
3993 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3994 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3995 (yyval.interm.type).setAggregate(3);
3996 }
3997 break;
3998
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00003999 case 138:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004000
4001 {
4002 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4003 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4004 (yyval.interm.type).setAggregate(4);
4005 }
4006 break;
4007
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004008 case 139:
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004009
4010 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004011 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
4012 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4013 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4014 (yyval.interm.type).setAggregate(2, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004015 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004016 break;
4017
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004018 case 140:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004019
4020 {
4021 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
4022 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4023 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4024 (yyval.interm.type).setAggregate(3, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004025 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004026 break;
4027
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004028 case 141:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004029
4030 {
4031 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
4032 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4033 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4034 (yyval.interm.type).setAggregate(4, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004035 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004036 break;
4037
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004038 case 142:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004039
4040 {
4041 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4042 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4043 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004044 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004045 break;
4046
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004047 case 143:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004048
4049 {
4050 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4051 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4052 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004053 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004054 break;
4055
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004056 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004057
4058 {
zmo@google.com09c323a2011-08-12 18:22:25 +00004059 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004060 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00004061 context->recover();
4062 }
4063 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4064 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4065 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004066 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004067 break;
4068
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004069 case 145:
zmo@google.com09c323a2011-08-12 18:22:25 +00004070
4071 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004072 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004073 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00004074 context->recover();
4075 }
4076 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
4077 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4078 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004079 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004080 break;
4081
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004082 case 146:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004083
4084 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004085 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4086 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4087 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004088 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004089 break;
4090
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004091 case 147:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004092
4093 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004094 //
4095 // This is for user defined type names. The lexical phase looked up the
4096 // type.
4097 //
4098 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4099 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4100 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4101 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004102 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004103 break;
4104
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004105 case 148:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004106
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004107 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004108 break;
4109
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004110 case 149:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004111
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004112 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004113 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
4114 context->recover();
4115
4116 TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
4117 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004118 if (! context->symbolTable.declare(*userTypeDef)) {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004119 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
4120 context->recover();
4121 }
4122 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004123 (yyval.interm.type).userDef = structure;
kbr@chromium.org476541f2011-10-27 21:14:51 +00004124 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004125 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004126 break;
4127
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004128 case 150:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004129
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004130 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004131 break;
4132
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004133 case 151:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004134
kbr@chromium.org476541f2011-10-27 21:14:51 +00004135 {
4136 TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
4137 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
4138 (yyval.interm.type).userDef = structure;
4139 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004140 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004141 break;
4142
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004143 case 152:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004144
4145 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004146 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004147 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004148 break;
4149
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004150 case 153:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004151
4152 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004153 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4154 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4155 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4156 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4157 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());
4158 context->recover();
4159 }
4160 }
4161 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4162 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004163 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004164 break;
4165
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004166 case 154:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004167
4168 {
4169 (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
4170
4171 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
4172 context->recover();
4173 }
4174 for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) {
4175 //
4176 // Careful not to replace already known aspects of type, like array-ness
4177 //
4178 TType* type = (*(yyval.interm.typeList))[i].type;
4179 type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
4180 type->setNominalSize((yyvsp[(1) - (3)].interm.type).size);
4181 type->setMatrix((yyvsp[(1) - (3)].interm.type).matrix);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00004182 type->setPrecision((yyvsp[(1) - (3)].interm.type).precision);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004183
4184 // don't allow arrays of arrays
4185 if (type->isArray()) {
4186 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type)))
4187 context->recover();
4188 }
4189 if ((yyvsp[(1) - (3)].interm.type).array)
4190 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize);
4191 if ((yyvsp[(1) - (3)].interm.type).userDef) {
4192 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
4193 type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName());
4194 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004195
4196 if (context->structNestingErrorCheck((yyvsp[(1) - (3)].interm.type).line, *type)) {
4197 context->recover();
4198 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004199 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004200 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004201 break;
4202
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004203 case 155:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004204
4205 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004206 (yyval.interm.typeList) = NewPoolTTypeList();
4207 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004208 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004209 break;
4210
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004211 case 156:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004212
4213 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004214 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004215 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004216 break;
4217
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004218 case 157:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004219
4220 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004221 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4222 context->recover();
4223
4224 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4225 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4226 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004227 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004228 break;
4229
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004230 case 158:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004231
4232 {
4233 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4234 context->recover();
4235
4236 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4237 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4238 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4239
4240 int size;
4241 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4242 context->recover();
4243 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004244 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004245 break;
4246
kbr@chromium.org476541f2011-10-27 21:14:51 +00004247 case 159:
4248
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004249 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004250 break;
4251
4252 case 160:
4253
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004254 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004255 break;
4256
4257 case 161:
4258
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004259 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004260 break;
4261
4262 case 162:
4263
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004264 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004265 break;
4266
4267 case 163:
4268
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004269 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004270 break;
4271
kbr@chromium.org476541f2011-10-27 21:14:51 +00004272 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004273
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004274 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004275 break;
4276
4277 case 165:
4278
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004279 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004280 break;
4281
4282 case 166:
4283
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004284 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004285 break;
4286
4287 case 167:
4288
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004289 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4290 break;
4291
4292 case 168:
4293
4294 { (yyval.interm.intermAggregate) = 0; }
4295 break;
4296
4297 case 169:
4298
4299 { context->symbolTable.push(); }
4300 break;
4301
4302 case 170:
4303
4304 { context->symbolTable.pop(); }
4305 break;
4306
4307 case 171:
4308
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004309 {
4310 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4311 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4312 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4313 }
4314 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4315 }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004316 break;
4317
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004318 case 172:
4319
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004320 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004321 break;
4322
4323 case 173:
4324
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004325 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004326 break;
4327
4328 case 174:
4329
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004330 { context->symbolTable.push(); }
4331 break;
4332
4333 case 175:
4334
4335 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4336 break;
4337
4338 case 176:
4339
4340 { context->symbolTable.push(); }
4341 break;
4342
4343 case 177:
4344
4345 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4346 break;
4347
4348 case 178:
4349
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004350 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004351 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004352 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004353 break;
4354
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004355 case 179:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004356
4357 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004358 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004359 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004360 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4361 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004362 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004363 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004364 break;
4365
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004366 case 180:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004367
4368 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004369 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004370 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004371 break;
4372
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004373 case 181:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004374
kbr@chromium.org205fef32011-11-22 20:50:02 +00004375 {
4376 (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 +00004377 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004378 break;
4379
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004380 case 182:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004381
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004382 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004383 break;
4384
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004385 case 183:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004386
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004387 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004388 break;
4389
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004390 case 184:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004391
4392 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004393 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4394 context->recover();
4395 (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 +00004396 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004397 break;
4398
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004399 case 185:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004400
4401 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004402 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4403 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004404 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004405 break;
4406
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004407 case 186:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004408
4409 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004410 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4411 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004412 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004413 break;
4414
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004415 case 187:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004416
4417 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004418 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4419 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4420 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004421 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004422 break;
4423
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004424 case 188:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004425
4426 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004427 TIntermNode* intermNode;
4428 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4429 context->recover();
4430 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4431 context->recover();
4432
4433 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4434 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4435 else {
4436 context->recover();
4437 (yyval.interm.intermTypedNode) = 0;
4438 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004439 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004440 break;
4441
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004442 case 189:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004443
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004444 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004445 break;
4446
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004447 case 190:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004448
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004449 {
4450 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004451 (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 +00004452 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004453 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004454 break;
4455
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004456 case 191:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004457
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004458 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004459 break;
4460
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004461 case 192:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004462
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004463 {
4464 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4465 context->recover();
4466
alokp@chromium.org52813552010-11-16 18:36:09 +00004467 (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 +00004468 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004469 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004470 break;
4471
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004472 case 193:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004473
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004474 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004475 break;
4476
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004477 case 194:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004478
4479 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004480 context->symbolTable.pop();
4481 (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);
4482 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004483 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004484 break;
4485
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004486 case 195:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004487
4488 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004489 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004490 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004491 break;
4492
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004493 case 196:
zmo@google.com09c323a2011-08-12 18:22:25 +00004494
4495 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004496 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004497 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004498 break;
4499
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004500 case 197:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004501
4502 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004503 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004504 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004505 break;
4506
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004507 case 198:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004508
4509 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004510 (yyval.interm.intermTypedNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004511 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004512 break;
4513
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004514 case 199:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004515
4516 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004517 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4518 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004519 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004520 break;
4521
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004522 case 200:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004523
4524 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004525 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4526 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004527 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004528 break;
4529
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004530 case 201:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004531
4532 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004533 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004534 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004535 context->recover();
4536 }
4537 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004538 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004539 break;
4540
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004541 case 202:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004542
4543 {
4544 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004545 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004546 context->recover();
4547 }
4548 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004549 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004550 break;
4551
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004552 case 203:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004553
4554 {
4555 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4556 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004557 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004558 context->recover();
4559 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004560 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004561 break;
4562
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004563 case 204:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004564
4565 {
4566 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4567 context->functionReturnsValue = true;
4568 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004569 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004570 context->recover();
4571 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004572 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004573 context->recover();
4574 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004575 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004576 break;
4577
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004578 case 205:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004579
4580 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004581 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4582 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004583 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004584 break;
4585
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004586 case 206:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004587
4588 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004589 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004590 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004591 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004592 break;
4593
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004594 case 207:
zmo@google.com09c323a2011-08-12 18:22:25 +00004595
4596 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004597 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4598 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004599 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004600 break;
4601
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004602 case 208:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004603
4604 {
4605 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004606 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004607 break;
4608
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004609 case 209:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004610
4611 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004612 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004613 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004614 break;
4615
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004616 case 210:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004617
4618 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004619 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004620
4621 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName());
4622
4623 if (builtIn)
4624 {
4625 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4626 context->recover();
4627 }
4628
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004629 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName()));
4630 //
4631 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4632 // as it would have just been put in the symbol table. Otherwise, we're looking up
4633 // an earlier occurance.
4634 //
4635 if (prevDec->isDefined()) {
4636 //
4637 // Then this function already has a body.
4638 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004639 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004640 context->recover();
4641 }
4642 prevDec->setDefined();
4643
4644 //
4645 // Raise error message if main function takes any parameters or return anything other than void
4646 //
4647 if (function->getName() == "main") {
4648 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004649 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 +00004650 context->recover();
4651 }
4652 if (function->getReturnType().getBasicType() != EbtVoid) {
4653 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4654 context->recover();
4655 }
4656 }
4657
4658 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004659 // Remember the return type for later checking for RETURN statements.
4660 //
4661 context->currentFunctionType = &(prevDec->getReturnType());
4662 context->functionReturnsValue = false;
4663
4664 //
4665 // Insert parameters into the symbol table.
4666 // If the parameter has no name, it's not an error, just don't insert it
4667 // (could be used for unused args).
4668 //
4669 // Also, accumulate the list of parameters into the HIL, so lower level code
4670 // knows where to find parameters.
4671 //
4672 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004673 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004674 const TParameter& param = function->getParam(i);
4675 if (param.name != 0) {
4676 TVariable *variable = new TVariable(param.name, *param.type);
4677 //
4678 // Insert the parameters with name in the symbol table.
4679 //
shannonwoods@chromium.org1c848092013-05-30 00:02:34 +00004680 if (! context->symbolTable.declare(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004681 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004682 context->recover();
4683 delete variable;
4684 }
4685
4686 //
4687 // Add the parameter to the HIL
4688 //
4689 paramNodes = context->intermediate.growAggregate(
4690 paramNodes,
4691 context->intermediate.addSymbol(variable->getUniqueId(),
4692 variable->getName(),
4693 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4694 (yyvsp[(1) - (1)].interm).line);
4695 } else {
4696 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4697 }
4698 }
4699 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4700 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4701 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004702 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004703 break;
4704
shannon.woods%transgaming.com@gtempaccount.com6f273e32013-04-13 03:41:15 +00004705 case 211:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004706
4707 {
4708 //?? Check that all paths return a value if return type != void ?
4709 // May be best done as post process phase on intermediate code
4710 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4711 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4712 context->recover();
4713 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004714
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004715 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4716 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4717 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4718 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4719
4720 // store the pragma information for debug and optimize and other vendor specific
4721 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004722 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4723 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004724
4725 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4726 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004727
4728 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004729 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004730 break;
4731
4732
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004733
4734 default: break;
4735 }
4736 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4737
4738 YYPOPSTACK (yylen);
4739 yylen = 0;
4740 YY_STACK_PRINT (yyss, yyssp);
4741
4742 *++yyvsp = yyval;
4743
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004744 /* Now `shift' the result of the reduction. Determine what state
4745 that goes to, based on the state we popped back to and the rule
4746 number reduced by. */
4747
4748 yyn = yyr1[yyn];
4749
4750 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4751 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4752 yystate = yytable[yystate];
4753 else
4754 yystate = yydefgoto[yyn - YYNTOKENS];
4755
4756 goto yynewstate;
4757
4758
4759/*------------------------------------.
4760| yyerrlab -- here on detecting error |
4761`------------------------------------*/
4762yyerrlab:
4763 /* If not already recovering from an error, report this error. */
4764 if (!yyerrstatus)
4765 {
4766 ++yynerrs;
4767#if ! YYERROR_VERBOSE
4768 yyerror (context, YY_("syntax error"));
4769#else
4770 {
4771 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4772 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4773 {
4774 YYSIZE_T yyalloc = 2 * yysize;
4775 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4776 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4777 if (yymsg != yymsgbuf)
4778 YYSTACK_FREE (yymsg);
4779 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4780 if (yymsg)
4781 yymsg_alloc = yyalloc;
4782 else
4783 {
4784 yymsg = yymsgbuf;
4785 yymsg_alloc = sizeof yymsgbuf;
4786 }
4787 }
4788
4789 if (0 < yysize && yysize <= yymsg_alloc)
4790 {
4791 (void) yysyntax_error (yymsg, yystate, yychar);
4792 yyerror (context, yymsg);
4793 }
4794 else
4795 {
4796 yyerror (context, YY_("syntax error"));
4797 if (yysize != 0)
4798 goto yyexhaustedlab;
4799 }
4800 }
4801#endif
4802 }
4803
4804
4805
4806 if (yyerrstatus == 3)
4807 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004808 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004809 error, discard it. */
4810
4811 if (yychar <= YYEOF)
4812 {
4813 /* Return failure if at end of input. */
4814 if (yychar == YYEOF)
4815 YYABORT;
4816 }
4817 else
4818 {
4819 yydestruct ("Error: discarding",
4820 yytoken, &yylval, context);
4821 yychar = YYEMPTY;
4822 }
4823 }
4824
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004825 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004826 token. */
4827 goto yyerrlab1;
4828
4829
4830/*---------------------------------------------------.
4831| yyerrorlab -- error raised explicitly by YYERROR. |
4832`---------------------------------------------------*/
4833yyerrorlab:
4834
4835 /* Pacify compilers like GCC when the user code never invokes
4836 YYERROR and the label yyerrorlab therefore never appears in user
4837 code. */
4838 if (/*CONSTCOND*/ 0)
4839 goto yyerrorlab;
4840
4841 /* Do not reclaim the symbols of the rule which action triggered
4842 this YYERROR. */
4843 YYPOPSTACK (yylen);
4844 yylen = 0;
4845 YY_STACK_PRINT (yyss, yyssp);
4846 yystate = *yyssp;
4847 goto yyerrlab1;
4848
4849
4850/*-------------------------------------------------------------.
4851| yyerrlab1 -- common code for both syntax error and YYERROR. |
4852`-------------------------------------------------------------*/
4853yyerrlab1:
4854 yyerrstatus = 3; /* Each real token shifted decrements this. */
4855
4856 for (;;)
4857 {
4858 yyn = yypact[yystate];
4859 if (yyn != YYPACT_NINF)
4860 {
4861 yyn += YYTERROR;
4862 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4863 {
4864 yyn = yytable[yyn];
4865 if (0 < yyn)
4866 break;
4867 }
4868 }
4869
4870 /* Pop the current state because it cannot handle the error token. */
4871 if (yyssp == yyss)
4872 YYABORT;
4873
4874
4875 yydestruct ("Error: popping",
4876 yystos[yystate], yyvsp, context);
4877 YYPOPSTACK (1);
4878 yystate = *yyssp;
4879 YY_STACK_PRINT (yyss, yyssp);
4880 }
4881
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004882 *++yyvsp = yylval;
4883
4884
4885 /* Shift the error token. */
4886 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4887
4888 yystate = yyn;
4889 goto yynewstate;
4890
4891
4892/*-------------------------------------.
4893| yyacceptlab -- YYACCEPT comes here. |
4894`-------------------------------------*/
4895yyacceptlab:
4896 yyresult = 0;
4897 goto yyreturn;
4898
4899/*-----------------------------------.
4900| yyabortlab -- YYABORT comes here. |
4901`-----------------------------------*/
4902yyabortlab:
4903 yyresult = 1;
4904 goto yyreturn;
4905
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004906#if !defined(yyoverflow) || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004907/*-------------------------------------------------.
4908| yyexhaustedlab -- memory exhaustion comes here. |
4909`-------------------------------------------------*/
4910yyexhaustedlab:
4911 yyerror (context, YY_("memory exhausted"));
4912 yyresult = 2;
4913 /* Fall through. */
4914#endif
4915
4916yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004917 if (yychar != YYEMPTY)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004918 yydestruct ("Cleanup: discarding lookahead",
4919 yytoken, &yylval, context);
4920 /* Do not reclaim the symbols of the rule which action triggered
4921 this YYABORT or YYACCEPT. */
4922 YYPOPSTACK (yylen);
4923 YY_STACK_PRINT (yyss, yyssp);
4924 while (yyssp != yyss)
4925 {
4926 yydestruct ("Cleanup: popping",
4927 yystos[*yyssp], yyvsp, context);
4928 YYPOPSTACK (1);
4929 }
4930#ifndef yyoverflow
4931 if (yyss != yyssa)
4932 YYSTACK_FREE (yyss);
4933#endif
4934#if YYERROR_VERBOSE
4935 if (yymsg != yymsgbuf)
4936 YYSTACK_FREE (yymsg);
4937#endif
4938 /* Make sure YYID is used. */
4939 return YYID (yyresult);
4940}
4941
4942
4943
4944
4945
4946int glslang_parse(TParseContext* context) {
4947 return yyparse(context);
4948}
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00004949