blob: 035e2a828118391d590a841bf0a5391ad75e30d5 [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.com2226e042013-04-13 03:38:26 +0000532#define YYFINAL 77
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000533/* YYLAST -- Last index in YYTABLE. */
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000534#define YYLAST 1546
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.com2226e042013-04-13 03:38:26 +0000539#define YYNNTS 85
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000540/* YYNRULES -- Number of rules. */
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000541#define YYNRULES 207
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000542/* YYNRULES -- Number of states. */
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000543#define YYNSTATES 311
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,
608 298, 303, 306, 308, 311, 313, 315, 317, 320, 322,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000609 324, 326, 328, 331, 334, 336, 338, 341, 343, 345,
610 347, 349, 354, 356, 358, 360, 362, 364, 366, 368,
611 370, 372, 374, 376, 378, 380, 382, 384, 386, 388,
612 390, 392, 394, 396, 398, 399, 406, 407, 413, 415,
613 418, 422, 424, 428, 430, 435, 437, 439, 441, 443,
614 445, 447, 449, 451, 453, 456, 457, 458, 464, 466,
615 468, 469, 472, 473, 476, 479, 483, 485, 488, 490,
616 493, 499, 503, 505, 507, 512, 513, 520, 521, 530,
617 531, 539, 541, 543, 545, 546, 549, 553, 556, 559,
618 562, 566, 569, 571, 574, 576, 578, 579
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000619};
620
621/* YYRHS -- A `-1'-separated list of the rules' RHS. */
622static const yytype_int16 yyrhs[] =
623{
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000624 186, 0, -1, 54, -1, 106, -1, 57, -1, 56,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000625 -1, 58, -1, 81, 133, 82, -1, 107, -1, 108,
626 83, 109, 84, -1, 110, -1, 108, 87, 59, -1,
627 108, 62, -1, 108, 63, -1, 133, -1, 111, -1,
628 112, -1, 108, 87, 112, -1, 114, 82, -1, 113,
629 82, -1, 115, 45, -1, 115, -1, 115, 131, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000630 114, 88, 131, -1, 116, 81, -1, 153, -1, 54,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000631 -1, 59, -1, 108, -1, 62, 117, -1, 63, 117,
632 -1, 118, 117, -1, 95, -1, 93, -1, 92, -1,
633 117, -1, 119, 96, 117, -1, 119, 97, 117, -1,
634 119, -1, 120, 95, 119, -1, 120, 93, 119, -1,
635 120, -1, 121, -1, 122, 99, 121, -1, 122, 100,
636 121, -1, 122, 64, 121, -1, 122, 65, 121, -1,
637 122, -1, 123, 66, 122, -1, 123, 67, 122, -1,
638 123, -1, 124, -1, 125, -1, 126, -1, 127, 68,
639 126, -1, 127, -1, 128, 70, 127, -1, 128, -1,
640 129, 69, 128, -1, 129, -1, 129, 104, 133, 89,
641 131, -1, 130, -1, 117, 132, 131, -1, 90, -1,
642 71, -1, 72, -1, 73, -1, 80, -1, 131, -1,
643 133, 88, 131, -1, 130, -1, 136, 91, -1, 144,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000644 91, -1, 7, 151, 152, 91, -1, 137, 82, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000645 139, -1, 138, -1, 139, 141, -1, 138, 88, 141,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000646 -1, 146, 54, 81, -1, 150, 54, -1, 150, 54,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000647 83, 134, 84, -1, 147, 142, 140, -1, 142, 140,
648 -1, 147, 142, 143, -1, 142, 143, -1, -1, 36,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000649 -1, 37, -1, 38, -1, 150, -1, 145, -1, 144,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000650 88, 54, -1, 144, 88, 54, 83, 84, -1, 144,
651 88, 54, 83, 134, 84, -1, 144, 88, 54, 90,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000652 161, -1, 146, -1, 146, 54, -1, 146, 54, 83,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000653 84, -1, 146, 54, 83, 134, 84, -1, 146, 54,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000654 90, 161, -1, 3, 54, -1, 150, -1, 148, 150,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000655 -1, 9, -1, 8, -1, 40, -1, 3, 40, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000656 149, -1, 9, -1, 36, -1, 37, -1, 41, 36,
657 -1, 41, 37, -1, 39, -1, 152, -1, 151, 152,
658 -1, 4, -1, 5, -1, 6, -1, 153, -1, 153,
659 83, 134, 84, -1, 45, -1, 11, -1, 12, -1,
660 10, -1, 30, -1, 31, -1, 32, -1, 24, -1,
661 25, -1, 26, -1, 27, -1, 28, -1, 29, -1,
662 33, -1, 34, -1, 35, -1, 47, -1, 48, -1,
663 49, -1, 50, -1, 154, -1, 55, -1, -1, 44,
664 54, 85, 155, 157, 86, -1, -1, 44, 85, 156,
665 157, 86, -1, 158, -1, 157, 158, -1, 150, 159,
666 91, -1, 160, -1, 159, 88, 160, -1, 54, -1,
667 54, 83, 134, 84, -1, 131, -1, 135, -1, 165,
668 -1, 164, -1, 162, -1, 174, -1, 175, -1, 178,
669 -1, 185, -1, 85, 86, -1, -1, -1, 85, 166,
670 173, 167, 86, -1, 172, -1, 164, -1, -1, 170,
671 172, -1, -1, 171, 164, -1, 85, 86, -1, 85,
672 173, 86, -1, 163, -1, 173, 163, -1, 91, -1,
673 133, 91, -1, 18, 81, 133, 82, 176, -1, 169,
674 16, 169, -1, 169, -1, 133, -1, 146, 54, 90,
675 161, -1, -1, 46, 81, 179, 177, 82, 168, -1,
676 -1, 15, 180, 169, 46, 81, 133, 82, 91, -1,
677 -1, 17, 81, 181, 182, 184, 82, 168, -1, 174,
678 -1, 162, -1, 177, -1, -1, 183, 91, -1, 183,
679 91, 133, -1, 14, 91, -1, 13, 91, -1, 20,
680 91, -1, 20, 133, 91, -1, 19, 91, -1, 187,
681 -1, 186, 187, -1, 188, -1, 135, -1, -1, 136,
682 189, 172, -1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000683};
684
685/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
686static const yytype_uint16 yyrline[] =
687{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000688 0, 184, 184, 219, 222, 235, 240, 245, 251, 254,
689 333, 336, 437, 447, 460, 468, 568, 571, 579, 583,
690 590, 594, 601, 607, 616, 624, 679, 686, 696, 699,
691 709, 719, 740, 741, 742, 747, 748, 757, 769, 770,
692 778, 789, 793, 794, 804, 814, 824, 837, 838, 848,
693 861, 865, 869, 873, 874, 887, 888, 901, 902, 915,
694 916, 933, 934, 947, 948, 949, 950, 951, 955, 958,
695 969, 977, 1004, 1009, 1023, 1061, 1064, 1071, 1079, 1100,
696 1121, 1132, 1161, 1166, 1176, 1181, 1191, 1194, 1197, 1200,
697 1206, 1213, 1216, 1238, 1256, 1280, 1303, 1307, 1325, 1333,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000698 1365, 1385, 1474, 1483, 1506, 1512, 1519, 1528, 1537, 1543,
699 1547, 1552, 1557, 1563, 1569, 1578, 1588, 1595, 1598, 1601,
700 1607, 1610, 1625, 1629, 1633, 1637, 1646, 1651, 1656, 1661,
701 1666, 1671, 1676, 1681, 1686, 1691, 1697, 1703, 1709, 1714,
702 1719, 1728, 1737, 1742, 1755, 1755, 1769, 1769, 1778, 1781,
703 1796, 1832, 1836, 1842, 1850, 1866, 1870, 1874, 1875, 1881,
704 1882, 1883, 1884, 1885, 1889, 1890, 1890, 1890, 1900, 1901,
705 1905, 1905, 1906, 1906, 1911, 1914, 1924, 1927, 1933, 1934,
706 1938, 1946, 1950, 1960, 1965, 1982, 1982, 1987, 1987, 1994,
707 1994, 2002, 2005, 2011, 2014, 2020, 2024, 2031, 2038, 2045,
708 2052, 2063, 2072, 2076, 2083, 2086, 2092, 2092
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000709};
710#endif
711
712#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
713/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
714 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
715static const char *const yytname[] =
716{
717 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
718 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
719 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE",
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000720 "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE",
721 "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2",
722 "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL",
723 "INOUT_QUAL", "UNIFORM", "VARYING", "CENTROID", "FLAT", "SMOOTH",
724 "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE",
725 "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "SAMPLER3D", "SAMPLER3DRECT",
726 "SAMPLER2DSHADOW", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
727 "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
728 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
729 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
730 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
731 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
732 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
733 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
734 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
735 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000736 "primary_expression", "postfix_expression", "integer_expression",
737 "function_call", "function_call_or_method", "function_call_generic",
738 "function_call_header_no_parameters",
739 "function_call_header_with_parameters", "function_call_header",
740 "function_identifier", "unary_expression", "unary_operator",
741 "multiplicative_expression", "additive_expression", "shift_expression",
742 "relational_expression", "equality_expression", "and_expression",
743 "exclusive_or_expression", "inclusive_or_expression",
744 "logical_and_expression", "logical_xor_expression",
745 "logical_or_expression", "conditional_expression",
746 "assignment_expression", "assignment_operator", "expression",
747 "constant_expression", "declaration", "function_prototype",
748 "function_declarator", "function_header_with_parameters",
749 "function_header", "parameter_declarator", "parameter_declaration",
750 "parameter_qualifier", "parameter_type_specifier",
751 "init_declarator_list", "single_declaration", "fully_specified_type",
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000752 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
753 "type_specifier", "precision_qualifier", "type_specifier_no_prec",
754 "type_specifier_nonarray", "struct_specifier", "$@1", "$@2",
755 "struct_declaration_list", "struct_declaration",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000756 "struct_declarator_list", "struct_declarator", "initializer",
757 "declaration_statement", "statement", "simple_statement",
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000758 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000759 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
760 "statement_list", "expression_statement", "selection_statement",
761 "selection_rest_statement", "condition", "iteration_statement", "$@7",
762 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000763 "jump_statement", "translation_unit", "external_declaration",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000764 "function_definition", "$@10", 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000765};
766#endif
767
768# ifdef YYPRINT
769/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
770 token YYLEX-NUM. */
771static const yytype_uint16 yytoknum[] =
772{
773 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
774 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
775 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
776 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
777 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
778 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
779 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
780 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
781 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000782 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
783 355, 356, 357, 358, 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000784};
785# endif
786
787/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
788static const yytype_uint8 yyr1[] =
789{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000790 0, 105, 106, 107, 107, 107, 107, 107, 108, 108,
791 108, 108, 108, 108, 109, 110, 111, 111, 112, 112,
792 113, 113, 114, 114, 115, 116, 116, 116, 117, 117,
793 117, 117, 118, 118, 118, 119, 119, 119, 120, 120,
794 120, 121, 122, 122, 122, 122, 122, 123, 123, 123,
795 124, 125, 126, 127, 127, 128, 128, 129, 129, 130,
796 130, 131, 131, 132, 132, 132, 132, 132, 133, 133,
797 134, 135, 135, 135, 136, 137, 137, 138, 138, 139,
798 140, 140, 141, 141, 141, 141, 142, 142, 142, 142,
799 143, 144, 144, 144, 144, 144, 145, 145, 145, 145,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000800 145, 145, 146, 146, 147, 148, 148, 148, 148, 149,
801 149, 149, 149, 149, 149, 150, 150, 151, 151, 151,
802 152, 152, 153, 153, 153, 153, 153, 153, 153, 153,
803 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
804 153, 153, 153, 153, 155, 154, 156, 154, 157, 157,
805 158, 159, 159, 160, 160, 161, 162, 163, 163, 164,
806 164, 164, 164, 164, 165, 166, 167, 165, 168, 168,
807 170, 169, 171, 169, 172, 172, 173, 173, 174, 174,
808 175, 176, 176, 177, 177, 179, 178, 180, 178, 181,
809 178, 182, 182, 183, 183, 184, 184, 185, 185, 185,
810 185, 185, 186, 186, 187, 187, 189, 188
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000811};
812
813/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
814static const yytype_uint8 yyr2[] =
815{
816 0, 2, 1, 1, 1, 1, 1, 3, 1, 4,
817 1, 3, 2, 2, 1, 1, 1, 3, 2, 2,
818 2, 1, 2, 3, 2, 1, 1, 1, 1, 2,
819 2, 2, 1, 1, 1, 1, 3, 3, 1, 3,
820 3, 1, 1, 3, 3, 3, 3, 1, 3, 3,
821 1, 1, 1, 1, 3, 1, 3, 1, 3, 1,
822 5, 1, 3, 1, 1, 1, 1, 1, 1, 3,
823 1, 2, 2, 4, 2, 1, 1, 2, 3, 3,
824 2, 5, 3, 2, 3, 2, 0, 1, 1, 1,
825 1, 1, 3, 5, 6, 5, 1, 2, 4, 5,
826 4, 2, 1, 2, 1, 1, 1, 2, 1, 1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000827 1, 1, 2, 2, 1, 1, 2, 1, 1, 1,
828 1, 4, 1, 1, 1, 1, 1, 1, 1, 1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000829 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000830 1, 1, 1, 1, 0, 6, 0, 5, 1, 2,
831 3, 1, 3, 1, 4, 1, 1, 1, 1, 1,
832 1, 1, 1, 1, 2, 0, 0, 5, 1, 1,
833 0, 2, 0, 2, 2, 3, 1, 2, 1, 2,
834 5, 3, 1, 1, 4, 0, 6, 0, 8, 0,
835 7, 1, 1, 1, 0, 2, 3, 2, 2, 2,
836 3, 2, 1, 2, 1, 1, 0, 3
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000837};
838
839/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
840 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
841 means the default is an error. */
842static const yytype_uint8 yydefact[] =
843{
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000844 0, 0, 117, 118, 119, 0, 105, 109, 125, 123,
845 124, 129, 130, 131, 132, 133, 134, 126, 127, 128,
846 135, 136, 137, 110, 111, 114, 106, 0, 0, 122,
847 138, 139, 140, 141, 143, 205, 206, 0, 76, 86,
848 0, 91, 96, 0, 108, 102, 0, 115, 120, 142,
849 0, 202, 204, 107, 101, 0, 112, 113, 0, 146,
850 71, 0, 74, 86, 104, 87, 88, 89, 77, 0,
851 86, 0, 72, 97, 103, 116, 0, 1, 203, 0,
852 144, 0, 0, 207, 78, 83, 85, 90, 0, 92,
853 79, 0, 0, 2, 5, 4, 6, 27, 0, 0,
854 0, 34, 33, 32, 3, 8, 28, 10, 15, 16,
855 0, 0, 21, 0, 35, 0, 38, 41, 42, 47,
856 50, 51, 52, 53, 55, 57, 59, 70, 0, 25,
857 73, 0, 0, 0, 148, 0, 0, 187, 0, 0,
858 0, 0, 0, 165, 174, 178, 35, 61, 68, 0,
859 156, 0, 120, 159, 176, 158, 157, 0, 160, 161,
860 162, 163, 80, 82, 84, 0, 0, 98, 0, 155,
861 100, 29, 30, 0, 12, 13, 0, 0, 19, 18,
862 0, 20, 22, 24, 31, 0, 0, 0, 0, 0,
863 0, 0, 0, 0, 0, 0, 0, 0, 0, 121,
864 0, 153, 0, 151, 147, 149, 198, 197, 172, 189,
865 0, 201, 199, 0, 185, 164, 0, 64, 65, 66,
866 67, 63, 0, 0, 179, 175, 177, 0, 93, 0,
867 95, 99, 7, 0, 14, 26, 11, 17, 23, 36,
868 37, 40, 39, 45, 46, 43, 44, 48, 49, 54,
869 56, 58, 0, 145, 0, 0, 150, 0, 0, 0,
870 0, 0, 200, 0, 166, 62, 69, 0, 94, 9,
871 0, 0, 152, 0, 171, 173, 192, 191, 194, 172,
872 0, 183, 0, 0, 0, 81, 60, 154, 0, 193,
873 0, 0, 182, 180, 0, 0, 167, 0, 195, 0,
874 172, 0, 169, 186, 168, 0, 196, 190, 181, 184,
875 188
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000876};
877
878/* YYDEFGOTO[NTERM-NUM]. */
879static const yytype_int16 yydefgoto[] =
880{
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000881 -1, 104, 105, 106, 233, 107, 108, 109, 110, 111,
882 112, 113, 146, 115, 116, 117, 118, 119, 120, 121,
883 122, 123, 124, 125, 126, 147, 148, 222, 149, 128,
884 150, 151, 37, 38, 39, 85, 68, 69, 86, 40,
885 41, 42, 70, 43, 44, 45, 46, 47, 129, 49,
886 131, 81, 133, 134, 202, 203, 170, 153, 154, 155,
887 156, 216, 284, 303, 257, 258, 259, 304, 157, 158,
888 159, 293, 283, 160, 263, 208, 260, 278, 290, 291,
889 161, 50, 51, 52, 61
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000890};
891
892/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
893 STATE-NUM. */
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000894#define YYPACT_NINF -268
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000895static const yytype_int16 yypact[] =
896{
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000897 1362, -6, -268, -268, -268, 135, -268, -268, -268, -268,
898 -268, -268, -268, -268, -268, -268, -268, -268, -268, -268,
899 -268, -268, -268, -268, -268, -268, -268, -21, -26, -268,
900 -268, -268, -268, -268, -268, -268, -51, -47, 6, 16,
901 -20, -268, 46, 1409, -268, -268, 1491, -268, 29, -268,
902 1309, -268, -268, -268, -268, 1491, -268, -268, 31, -268,
903 -268, 67, -268, 27, -268, -268, -268, -268, -268, 1409,
904 111, 102, -268, -11, -268, -268, 1055, -268, -268, 69,
905 -268, 1409, 297, -268, -268, -268, -268, 104, 1409, -45,
906 -268, 193, 1055, 80, -268, -268, -268, -268, 1055, 1055,
907 1055, -268, -268, -268, -268, -268, 21, -268, -268, -268,
908 81, -15, 1127, 84, -268, 1055, -22, 20, -268, -43,
909 70, -268, -268, -268, 94, 96, -55, -268, 83, -268,
910 -268, 1409, 114, 1199, -268, 82, 85, -268, 90, 91,
911 86, 908, 93, 89, -268, -268, -53, -268, -268, 14,
912 -268, -51, 49, -268, -268, -268, -268, 390, -268, -268,
913 -268, -268, 95, -268, -268, 980, 1055, -268, 97, -268,
914 -268, -268, -268, 5, -268, -268, 1055, 1450, -268, -268,
915 1055, 103, -268, -268, -268, 1055, 1055, 1055, 1055, 1055,
916 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, 1055, -268,
917 1246, 100, 18, -268, -268, -268, -268, -268, 105, -268,
918 1055, -268, -268, 19, -268, -268, 483, -268, -268, -268,
919 -268, -268, 1055, 1055, -268, -268, -268, 1055, -268, 101,
920 -268, -268, -268, 107, 99, -268, 112, -268, -268, -268,
921 -268, -22, -22, -268, -268, -268, -268, -43, -43, -268,
922 94, 96, -3, -268, 1055, 114, -268, 142, 67, 669,
923 762, 7, -268, 836, 483, -268, -268, 108, -268, -268,
924 1055, 110, -268, 115, -268, -268, -268, -268, 836, 105,
925 155, 99, 143, 116, 120, -268, -268, -268, 1055, -268,
926 117, 119, 191, -268, 121, 576, -268, 8, 1055, 576,
927 105, 1055, -268, -268, -268, 118, 99, -268, -268, -268,
928 -268
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000929};
930
931/* YYPGOTO[NTERM-NUM]. */
932static const yytype_int16 yypgoto[] =
933{
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000934 -268, -268, -268, -268, -268, -268, -268, 33, -268, -268,
935 -268, -268, -68, -268, -37, -268, -46, -39, -268, -268,
936 -268, 17, 34, 32, -268, -74, -88, -268, -99, -85,
937 10, 11, -268, -268, -268, 126, 152, 161, 144, -268,
938 -268, -234, -268, -268, -268, -30, 228, -14, 0, -268,
939 -268, -268, 113, -124, -268, -19, -163, -25, -150, -233,
940 -268, -268, -268, -65, -267, -268, -268, -56, 23, -7,
941 -268, -268, -33, -268, -268, -268, -268, -268, -268, -268,
942 -268, -268, 196, -268, -268
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000943};
944
945/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
946 positive, shift that token. If negative, reduce the rule which
947 number is the opposite. If zero, do what YYDEFACT says.
948 If YYTABLE_NINF, syntax error. */
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000949#define YYTABLE_NINF -171
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000950static const yytype_int16 yytable[] =
951{
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000952 48, 173, 127, 230, 169, 83, 168, 226, 114, 205,
953 35, 36, 292, 74, 197, 56, 57, 127, 217, 218,
954 219, 189, 190, 114, 182, 64, 275, 220, 58, 282,
955 171, 172, 75, 308, 53, 62, 64, 221, 165, 87,
956 60, 79, 213, 48, 282, 166, 48, 184, 54, 198,
957 48, 132, 65, 66, 67, 48, 191, 192, 87, 59,
958 35, 36, 302, 65, 66, 67, 302, 179, 71, 48,
959 90, 72, 91, 180, 185, 186, 205, 234, 169, 92,
960 229, 48, 152, 174, 175, 223, 270, 232, 48, 279,
961 305, 127, 238, 223, 63, 223, 223, 114, -75, 252,
962 73, 132, 223, 132, 176, 224, 255, 223, 177, 256,
963 262, 261, 76, 187, 226, 188, 80, 239, 240, 114,
964 114, 114, 114, 114, 114, 114, 114, 114, 114, 114,
965 -25, 48, 76, 48, 265, 266, 193, 194, 309, 2,
966 3, 4, 267, 243, 244, 245, 246, 65, 66, 67,
967 241, 242, 82, 127, 247, 248, 89, 152, 162, 114,
968 130, -26, 195, 178, 281, 183, 196, 199, 201, 271,
969 132, 209, 210, 206, 214, 215, 207, 211, 227, 281,
970 127, 231, 286, 254, -122, 268, 114, 223, 273, 297,
971 -170, 269, 285, -27, 287, 53, 288, 294, 295, 306,
972 48, 299, 274, 8, 9, 10, 296, 300, 298, 310,
973 237, 301, 249, 169, 163, 84, 152, 11, 12, 13,
974 14, 15, 16, 17, 18, 19, 20, 21, 22, 251,
975 250, 88, 164, 55, 307, 276, 272, 28, 29, 264,
976 30, 31, 32, 33, 200, 289, 78, 93, 34, 94,
977 95, 96, 97, 277, 0, 98, 99, 0, 0, 152,
978 152, 0, 0, 152, 152, 0, 0, 0, 0, 0,
979 0, 0, 0, 0, 100, 0, 0, 167, 152, 0,
980 0, 0, 0, 0, 0, 101, 102, 0, 103, 0,
981 0, 0, 0, 0, 0, 152, 0, 0, 0, 152,
982 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
983 135, 136, 137, 0, 138, 139, 140, 141, 0, 0,
984 0, 11, 12, 13, 14, 15, 16, 17, 18, 19,
985 20, 21, 22, 23, 24, 0, 25, 26, 27, 0,
986 0, 28, 29, 142, 30, 31, 32, 33, 0, 0,
987 0, 93, 34, 94, 95, 96, 97, 0, 0, 98,
988 99, 0, 0, 0, 0, 0, 0, 0, 0, 0,
989 0, 0, 0, 0, 0, 0, 0, 0, 100, 0,
990 0, 0, 143, 144, 0, 0, 0, 0, 145, 101,
991 102, 0, 103, 1, 2, 3, 4, 5, 6, 7,
992 8, 9, 10, 135, 136, 137, 0, 138, 139, 140,
993 141, 0, 0, 0, 11, 12, 13, 14, 15, 16,
994 17, 18, 19, 20, 21, 22, 23, 24, 0, 25,
995 26, 27, 0, 0, 28, 29, 142, 30, 31, 32,
996 33, 0, 0, 0, 93, 34, 94, 95, 96, 97,
997 0, 0, 98, 99, 0, 0, 0, 0, 0, 0,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000998 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +0000999 0, 100, 0, 0, 0, 143, 225, 0, 0, 0,
1000 0, 145, 101, 102, 0, 103, 1, 2, 3, 4,
1001 5, 6, 7, 8, 9, 10, 135, 136, 137, 0,
1002 138, 139, 140, 141, 0, 0, 0, 11, 12, 13,
1003 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1004 24, 0, 25, 26, 27, 0, 0, 28, 29, 142,
1005 30, 31, 32, 33, 0, 0, 0, 93, 34, 94,
1006 95, 96, 97, 0, 0, 98, 99, 0, 0, 0,
kbr@chromium.org205fef32011-11-22 20:50:02 +00001007 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001008 0, 0, 0, 0, 100, 0, 0, 0, 143, 0,
1009 0, 0, 0, 0, 145, 101, 102, 0, 103, 1,
1010 2, 3, 4, 5, 6, 7, 8, 9, 10, 135,
1011 136, 137, 0, 138, 139, 140, 141, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001012 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001013 21, 22, 23, 24, 0, 25, 26, 27, 0, 0,
1014 28, 29, 142, 30, 31, 32, 33, 0, 0, 0,
1015 93, 34, 94, 95, 96, 97, 0, 0, 98, 99,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001016 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001017 0, 0, 0, 0, 0, 0, 0, 100, 0, 0,
1018 0, 82, 0, 0, 0, 0, 0, 145, 101, 102,
1019 0, 103, 1, 2, 3, 4, 5, 6, 7, 8,
1020 9, 10, 135, 136, 137, 0, 138, 139, 140, 141,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001021 0, 0, 0, 11, 12, 13, 14, 15, 16, 17,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001022 18, 19, 20, 21, 22, 23, 24, 0, 25, 26,
1023 27, 0, 0, 28, 29, 142, 30, 31, 32, 33,
1024 0, 0, 0, 93, 34, 94, 95, 96, 97, 0,
1025 0, 98, 99, 0, 0, 0, 0, 0, 0, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001026 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001027 100, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1028 145, 101, 102, 0, 103, 1, 2, 3, 4, 5,
1029 6, 7, 8, 9, 10, 0, 0, 0, 0, 0,
1030 0, 0, 0, 0, 0, 0, 11, 12, 13, 14,
1031 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1032 0, 25, 26, 27, 0, 0, 28, 29, 0, 30,
1033 31, 32, 33, 0, 0, 0, 93, 34, 94, 95,
1034 96, 97, 0, 0, 98, 99, 0, 0, 0, 0,
1035 0, 0, 0, 0, 0, 0, 0, 0, 0, 280,
1036 2, 3, 4, 100, 6, 7, 8, 9, 10, 0,
1037 0, 0, 0, 145, 101, 102, 0, 103, 0, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001038 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001039 21, 22, 23, 24, 0, 25, 26, 27, 0, 0,
1040 28, 29, 0, 30, 31, 32, 33, 0, 0, 0,
1041 93, 34, 94, 95, 96, 97, 0, 0, 98, 99,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001042 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001043 0, 0, 0, 0, 0, 0, 0, 100, 8, 9,
1044 10, 0, 0, 0, 0, 0, 0, 0, 101, 102,
1045 0, 103, 11, 12, 13, 14, 15, 16, 17, 18,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001046 19, 20, 21, 22, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001047 0, 0, 28, 29, 0, 30, 31, 32, 33, 0,
1048 0, 0, 93, 34, 94, 95, 96, 97, 0, 0,
1049 98, 99, 0, 0, 0, 0, 0, 0, 0, 0,
1050 0, 0, 0, 0, 0, 0, 0, 0, 0, 100,
1051 8, 9, 10, 0, 0, 0, 0, 0, 0, 212,
1052 101, 102, 0, 103, 11, 12, 13, 14, 15, 16,
1053 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
1054 0, 0, 0, 0, 28, 29, 0, 30, 31, 32,
1055 33, 0, 0, 0, 93, 34, 94, 95, 96, 97,
1056 0, 0, 98, 99, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001057 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001058 0, 100, 0, 0, 228, 8, 9, 10, 0, 0,
1059 0, 0, 101, 102, 0, 103, 0, 0, 0, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001060 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001061 22, 0, 0, 0, 0, 0, 0, 0, 0, 28,
1062 29, 0, 30, 31, 32, 33, 0, 0, 0, 93,
1063 34, 94, 95, 96, 97, 0, 0, 98, 99, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001064 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001065 0, 0, 0, 0, 0, 0, 100, 8, 9, 10,
1066 0, 0, 0, 0, 0, 0, 0, 101, 102, 0,
1067 103, 11, 12, 13, 14, 15, 16, 17, 18, 19,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001068 20, 21, 22, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001069 0, 28, 181, 0, 30, 31, 32, 33, 0, 0,
1070 0, 93, 34, 94, 95, 96, 97, 0, 0, 98,
1071 99, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1072 0, 0, 0, 2, 3, 4, 0, 0, 100, 8,
1073 9, 10, 0, 0, 0, 0, 0, 0, 0, 101,
1074 102, 0, 103, 11, 12, 13, 14, 15, 16, 17,
1075 18, 19, 20, 21, 22, 0, 0, 0, 0, 0,
1076 0, 0, 0, 28, 29, 0, 30, 31, 32, 33,
1077 2, 3, 4, 0, 34, 0, 8, 9, 10, 0,
1078 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1079 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1080 21, 22, 0, 0, 0, 204, 0, 0, 0, 0,
1081 28, 29, 0, 30, 31, 32, 33, 0, 0, 0,
1082 0, 34, 0, 0, 0, 0, 0, 0, 0, 77,
1083 0, 0, 1, 2, 3, 4, 5, 6, 7, 8,
1084 9, 10, 0, 0, 0, 0, 0, 0, 0, 0,
1085 0, 0, 253, 11, 12, 13, 14, 15, 16, 17,
1086 18, 19, 20, 21, 22, 23, 24, 0, 25, 26,
1087 27, 0, 0, 28, 29, 0, 30, 31, 32, 33,
1088 0, 0, 0, 0, 34, 1, 2, 3, 4, 5,
1089 6, 7, 8, 9, 10, 0, 0, 0, 0, 0,
1090 0, 0, 0, 0, 0, 0, 11, 12, 13, 14,
1091 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1092 0, 25, 26, 27, 0, 0, 28, 29, 0, 30,
1093 31, 32, 33, 2, 3, 4, 0, 34, 0, 8,
1094 9, 10, 0, 0, 0, 0, 0, 0, 0, 0,
1095 0, 0, 0, 11, 12, 13, 14, 15, 16, 17,
1096 18, 19, 20, 21, 22, 0, 0, 0, 0, 0,
1097 0, 0, 0, 28, 29, 0, 30, 31, 32, 33,
1098 8, 9, 10, 0, 34, 0, 0, 0, 0, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001099 0, 0, 0, 0, 11, 12, 13, 14, 15, 16,
1100 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001101 0, 0, 0, 0, 28, 29, 0, 30, 31, 32,
1102 33, 8, 9, 10, 235, 34, 0, 0, 0, 236,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001103 0, 0, 0, 0, 0, 11, 12, 13, 14, 15,
1104 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001105 0, 0, 0, 0, 0, 28, 29, 0, 30, 31,
1106 32, 33, 0, 0, 0, 0, 34
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001107};
1108
1109static const yytype_int16 yycheck[] =
1110{
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001111 0, 100, 76, 166, 92, 61, 91, 157, 76, 133,
1112 0, 0, 279, 43, 69, 36, 37, 91, 71, 72,
1113 73, 64, 65, 91, 112, 9, 259, 80, 54, 263,
1114 98, 99, 46, 300, 40, 82, 9, 90, 83, 69,
1115 91, 55, 141, 43, 278, 90, 46, 115, 54, 104,
1116 50, 81, 36, 37, 38, 55, 99, 100, 88, 85,
1117 50, 50, 295, 36, 37, 38, 299, 82, 88, 69,
1118 81, 91, 83, 88, 96, 97, 200, 176, 166, 90,
1119 165, 81, 82, 62, 63, 88, 89, 82, 88, 82,
1120 82, 165, 180, 88, 88, 88, 88, 165, 82, 198,
1121 54, 131, 88, 133, 83, 91, 88, 88, 87, 91,
1122 91, 210, 83, 93, 264, 95, 85, 185, 186, 187,
1123 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
1124 81, 131, 83, 133, 222, 223, 66, 67, 301, 4,
1125 5, 6, 227, 189, 190, 191, 192, 36, 37, 38,
1126 187, 188, 85, 227, 193, 194, 54, 157, 54, 227,
1127 91, 81, 68, 82, 263, 81, 70, 84, 54, 254,
1128 200, 81, 81, 91, 81, 86, 91, 91, 83, 278,
1129 254, 84, 270, 83, 81, 84, 254, 88, 46, 288,
1130 85, 84, 84, 81, 84, 40, 81, 54, 82, 298,
1131 200, 82, 258, 10, 11, 12, 86, 16, 91, 91,
1132 177, 90, 195, 301, 88, 63, 216, 24, 25, 26,
1133 27, 28, 29, 30, 31, 32, 33, 34, 35, 197,
1134 196, 70, 88, 5, 299, 260, 255, 44, 45, 216,
1135 47, 48, 49, 50, 131, 278, 50, 54, 55, 56,
1136 57, 58, 59, 260, -1, 62, 63, -1, -1, 259,
1137 260, -1, -1, 263, 264, -1, -1, -1, -1, -1,
1138 -1, -1, -1, -1, 81, -1, -1, 84, 278, -1,
1139 -1, -1, -1, -1, -1, 92, 93, -1, 95, -1,
1140 -1, -1, -1, -1, -1, 295, -1, -1, -1, 299,
1141 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1142 13, 14, 15, -1, 17, 18, 19, 20, -1, -1,
1143 -1, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1144 33, 34, 35, 36, 37, -1, 39, 40, 41, -1,
1145 -1, 44, 45, 46, 47, 48, 49, 50, -1, -1,
1146 -1, 54, 55, 56, 57, 58, 59, -1, -1, 62,
1147 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1148 -1, -1, -1, -1, -1, -1, -1, -1, 81, -1,
1149 -1, -1, 85, 86, -1, -1, -1, -1, 91, 92,
1150 93, -1, 95, 3, 4, 5, 6, 7, 8, 9,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001151 10, 11, 12, 13, 14, 15, -1, 17, 18, 19,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001152 20, -1, -1, -1, 24, 25, 26, 27, 28, 29,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001153 30, 31, 32, 33, 34, 35, 36, 37, -1, 39,
1154 40, 41, -1, -1, 44, 45, 46, 47, 48, 49,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001155 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1156 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001157 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001158 -1, 81, -1, -1, -1, 85, 86, -1, -1, -1,
1159 -1, 91, 92, 93, -1, 95, 3, 4, 5, 6,
1160 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
1161 17, 18, 19, 20, -1, -1, -1, 24, 25, 26,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001162 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1163 37, -1, 39, 40, 41, -1, -1, 44, 45, 46,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001164 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1165 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
zmo@google.com09c323a2011-08-12 18:22:25 +00001166 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001167 -1, -1, -1, -1, 81, -1, -1, -1, 85, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001168 -1, -1, -1, -1, 91, 92, 93, -1, 95, 3,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001169 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001170 14, 15, -1, 17, 18, 19, 20, -1, -1, -1,
1171 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001172 34, 35, 36, 37, -1, 39, 40, 41, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001173 44, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1174 54, 55, 56, 57, 58, 59, -1, -1, 62, 63,
1175 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1176 -1, -1, -1, -1, -1, -1, -1, 81, -1, -1,
1177 -1, 85, -1, -1, -1, -1, -1, 91, 92, 93,
1178 -1, 95, 3, 4, 5, 6, 7, 8, 9, 10,
1179 11, 12, 13, 14, 15, -1, 17, 18, 19, 20,
1180 -1, -1, -1, 24, 25, 26, 27, 28, 29, 30,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001181 31, 32, 33, 34, 35, 36, 37, -1, 39, 40,
1182 41, -1, -1, 44, 45, 46, 47, 48, 49, 50,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001183 -1, -1, -1, 54, 55, 56, 57, 58, 59, -1,
1184 -1, 62, 63, -1, -1, -1, -1, -1, -1, -1,
1185 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001186 81, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001187 91, 92, 93, -1, 95, 3, 4, 5, 6, 7,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001188 8, 9, 10, 11, 12, -1, -1, -1, -1, -1,
1189 -1, -1, -1, -1, -1, -1, 24, 25, 26, 27,
1190 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1191 -1, 39, 40, 41, -1, -1, 44, 45, -1, 47,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001192 48, 49, 50, -1, -1, -1, 54, 55, 56, 57,
1193 58, 59, -1, -1, 62, 63, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001194 -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
1195 4, 5, 6, 81, 8, 9, 10, 11, 12, -1,
1196 -1, -1, -1, 91, 92, 93, -1, 95, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001197 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001198 34, 35, 36, 37, -1, 39, 40, 41, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001199 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1200 54, 55, 56, 57, 58, 59, -1, -1, 62, 63,
1201 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1202 -1, -1, -1, -1, -1, -1, -1, 81, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001203 12, -1, -1, -1, -1, -1, -1, -1, 92, 93,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001204 -1, 95, 24, 25, 26, 27, 28, 29, 30, 31,
1205 32, 33, 34, 35, -1, -1, -1, -1, -1, -1,
1206 -1, -1, 44, 45, -1, 47, 48, 49, 50, -1,
1207 -1, -1, 54, 55, 56, 57, 58, 59, -1, -1,
1208 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
1209 -1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001210 10, 11, 12, -1, -1, -1, -1, -1, -1, 91,
1211 92, 93, -1, 95, 24, 25, 26, 27, 28, 29,
1212 30, 31, 32, 33, 34, 35, -1, -1, -1, -1,
1213 -1, -1, -1, -1, 44, 45, -1, 47, 48, 49,
1214 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1215 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001216 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001217 -1, 81, -1, -1, 84, 10, 11, 12, -1, -1,
1218 -1, -1, 92, 93, -1, 95, -1, -1, -1, 24,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001219 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1220 35, -1, -1, -1, -1, -1, -1, -1, -1, 44,
1221 45, -1, 47, 48, 49, 50, -1, -1, -1, 54,
1222 55, 56, 57, 58, 59, -1, -1, 62, 63, -1,
1223 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001224 -1, -1, -1, -1, -1, -1, 81, 10, 11, 12,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001225 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
1226 95, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1227 33, 34, 35, -1, -1, -1, -1, -1, -1, -1,
1228 -1, 44, 45, -1, 47, 48, 49, 50, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001229 -1, 54, 55, 56, 57, 58, 59, -1, -1, 62,
1230 63, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1231 -1, -1, -1, 4, 5, 6, -1, -1, 81, 10,
1232 11, 12, -1, -1, -1, -1, -1, -1, -1, 92,
1233 93, -1, 95, 24, 25, 26, 27, 28, 29, 30,
1234 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,
1235 -1, -1, -1, 44, 45, -1, 47, 48, 49, 50,
1236 4, 5, 6, -1, 55, -1, 10, 11, 12, -1,
1237 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1238 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1239 34, 35, -1, -1, -1, 86, -1, -1, -1, -1,
1240 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1241 -1, 55, -1, -1, -1, -1, -1, -1, -1, 0,
1242 -1, -1, 3, 4, 5, 6, 7, 8, 9, 10,
1243 11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
1244 -1, -1, 86, 24, 25, 26, 27, 28, 29, 30,
1245 31, 32, 33, 34, 35, 36, 37, -1, 39, 40,
1246 41, -1, -1, 44, 45, -1, 47, 48, 49, 50,
1247 -1, -1, -1, -1, 55, 3, 4, 5, 6, 7,
1248 8, 9, 10, 11, 12, -1, -1, -1, -1, -1,
1249 -1, -1, -1, -1, -1, -1, 24, 25, 26, 27,
1250 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1251 -1, 39, 40, 41, -1, -1, 44, 45, -1, 47,
1252 48, 49, 50, 4, 5, 6, -1, 55, -1, 10,
1253 11, 12, -1, -1, -1, -1, -1, -1, -1, -1,
1254 -1, -1, -1, 24, 25, 26, 27, 28, 29, 30,
1255 31, 32, 33, 34, 35, -1, -1, -1, -1, -1,
1256 -1, -1, -1, 44, 45, -1, 47, 48, 49, 50,
1257 10, 11, 12, -1, 55, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001258 -1, -1, -1, -1, 24, 25, 26, 27, 28, 29,
1259 30, 31, 32, 33, 34, 35, -1, -1, -1, -1,
1260 -1, -1, -1, -1, 44, 45, -1, 47, 48, 49,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001261 50, 10, 11, 12, 54, 55, -1, -1, -1, 59,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001262 -1, -1, -1, -1, -1, 24, 25, 26, 27, 28,
1263 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
1264 -1, -1, -1, -1, -1, 44, 45, -1, 47, 48,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001265 49, 50, -1, -1, -1, -1, 55
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001266};
1267
1268/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1269 symbol of state STATE-NUM. */
1270static const yytype_uint8 yystos[] =
1271{
1272 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001273 12, 24, 25, 26, 27, 28, 29, 30, 31, 32,
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00001274 33, 34, 35, 36, 37, 39, 40, 41, 44, 45,
1275 47, 48, 49, 50, 55, 135, 136, 137, 138, 139,
1276 144, 145, 146, 148, 149, 150, 151, 152, 153, 154,
1277 186, 187, 188, 40, 54, 151, 36, 37, 54, 85,
1278 91, 189, 82, 88, 9, 36, 37, 38, 141, 142,
1279 147, 88, 91, 54, 150, 152, 83, 0, 187, 152,
1280 85, 156, 85, 172, 141, 140, 143, 150, 142, 54,
1281 81, 83, 90, 54, 56, 57, 58, 59, 62, 63,
1282 81, 92, 93, 95, 106, 107, 108, 110, 111, 112,
1283 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
1284 123, 124, 125, 126, 127, 128, 129, 130, 134, 153,
1285 91, 155, 150, 157, 158, 13, 14, 15, 17, 18,
1286 19, 20, 46, 85, 86, 91, 117, 130, 131, 133,
1287 135, 136, 153, 162, 163, 164, 165, 173, 174, 175,
1288 178, 185, 54, 140, 143, 83, 90, 84, 134, 131,
1289 161, 117, 117, 133, 62, 63, 83, 87, 82, 82,
1290 88, 45, 131, 81, 117, 96, 97, 93, 95, 64,
1291 65, 99, 100, 66, 67, 68, 70, 69, 104, 84,
1292 157, 54, 159, 160, 86, 158, 91, 91, 180, 81,
1293 81, 91, 91, 133, 81, 86, 166, 71, 72, 73,
1294 80, 90, 132, 88, 91, 86, 163, 83, 84, 134,
1295 161, 84, 82, 109, 133, 54, 59, 112, 131, 117,
1296 117, 119, 119, 121, 121, 121, 121, 122, 122, 126,
1297 127, 128, 133, 86, 83, 88, 91, 169, 170, 171,
1298 181, 133, 91, 179, 173, 131, 131, 134, 84, 84,
1299 89, 134, 160, 46, 172, 164, 162, 174, 182, 82,
1300 3, 133, 146, 177, 167, 84, 131, 84, 81, 177,
1301 183, 184, 169, 176, 54, 82, 86, 133, 91, 82,
1302 16, 90, 164, 168, 172, 82, 133, 168, 169, 161,
1303 91
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001304};
1305
1306#define yyerrok (yyerrstatus = 0)
1307#define yyclearin (yychar = YYEMPTY)
1308#define YYEMPTY (-2)
1309#define YYEOF 0
1310
1311#define YYACCEPT goto yyacceptlab
1312#define YYABORT goto yyabortlab
1313#define YYERROR goto yyerrorlab
1314
1315
1316/* Like YYERROR except do call yyerror. This remains here temporarily
1317 to ease the transition to the new meaning of YYERROR, for GCC.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001318 Once GCC version 2 has supplanted version 1, this can go. However,
1319 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1320 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1321 discussed. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001322
1323#define YYFAIL goto yyerrlab
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001324#if defined YYFAIL
1325 /* This is here to suppress warnings from the GCC cpp's
1326 -Wunused-macros. Normally we don't worry about that warning, but
1327 some users do, and we want to make it easy for users to remove
1328 YYFAIL uses, which will produce warnings from Bison 2.5. */
1329#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001330
1331#define YYRECOVERING() (!!yyerrstatus)
1332
1333#define YYBACKUP(Token, Value) \
1334do \
1335 if (yychar == YYEMPTY && yylen == 1) \
1336 { \
1337 yychar = (Token); \
1338 yylval = (Value); \
1339 yytoken = YYTRANSLATE (yychar); \
1340 YYPOPSTACK (1); \
1341 goto yybackup; \
1342 } \
1343 else \
1344 { \
1345 yyerror (context, YY_("syntax error: cannot back up")); \
1346 YYERROR; \
1347 } \
1348while (YYID (0))
1349
1350
1351#define YYTERROR 1
1352#define YYERRCODE 256
1353
1354
1355/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1356 If N is 0, then set CURRENT to the empty location which ends
1357 the previous symbol: RHS[0] (always defined). */
1358
1359#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1360#ifndef YYLLOC_DEFAULT
1361# define YYLLOC_DEFAULT(Current, Rhs, N) \
1362 do \
1363 if (YYID (N)) \
1364 { \
1365 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1366 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1367 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1368 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1369 } \
1370 else \
1371 { \
1372 (Current).first_line = (Current).last_line = \
1373 YYRHSLOC (Rhs, 0).last_line; \
1374 (Current).first_column = (Current).last_column = \
1375 YYRHSLOC (Rhs, 0).last_column; \
1376 } \
1377 while (YYID (0))
1378#endif
1379
1380
1381/* YY_LOCATION_PRINT -- Print the location on the stream.
1382 This macro was not mandated originally: define only if we know
1383 we won't break user code: when these are the locations we know. */
1384
1385#ifndef YY_LOCATION_PRINT
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001386# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001387# define YY_LOCATION_PRINT(File, Loc) \
1388 fprintf (File, "%d.%d-%d.%d", \
1389 (Loc).first_line, (Loc).first_column, \
1390 (Loc).last_line, (Loc).last_column)
1391# else
1392# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1393# endif
1394#endif
1395
1396
1397/* YYLEX -- calling `yylex' with the right arguments. */
1398
1399#ifdef YYLEX_PARAM
1400# define YYLEX yylex (&yylval, YYLEX_PARAM)
1401#else
1402# define YYLEX yylex (&yylval)
1403#endif
1404
1405/* Enable debugging if requested. */
1406#if YYDEBUG
1407
1408# ifndef YYFPRINTF
1409# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1410# define YYFPRINTF fprintf
1411# endif
1412
1413# define YYDPRINTF(Args) \
1414do { \
1415 if (yydebug) \
1416 YYFPRINTF Args; \
1417} while (YYID (0))
1418
1419# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1420do { \
1421 if (yydebug) \
1422 { \
1423 YYFPRINTF (stderr, "%s ", Title); \
1424 yy_symbol_print (stderr, \
1425 Type, Value, context); \
1426 YYFPRINTF (stderr, "\n"); \
1427 } \
1428} while (YYID (0))
1429
1430
1431/*--------------------------------.
1432| Print this symbol on YYOUTPUT. |
1433`--------------------------------*/
1434
1435/*ARGSUSED*/
1436#if (defined __STDC__ || defined __C99__FUNC__ \
1437 || defined __cplusplus || defined _MSC_VER)
1438static void
1439yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1440#else
1441static void
1442yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1443 FILE *yyoutput;
1444 int yytype;
1445 YYSTYPE const * const yyvaluep;
1446 TParseContext* context;
1447#endif
1448{
1449 if (!yyvaluep)
1450 return;
1451 YYUSE (context);
1452# ifdef YYPRINT
1453 if (yytype < YYNTOKENS)
1454 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1455# else
1456 YYUSE (yyoutput);
1457# endif
1458 switch (yytype)
1459 {
1460 default:
1461 break;
1462 }
1463}
1464
1465
1466/*--------------------------------.
1467| Print this symbol on YYOUTPUT. |
1468`--------------------------------*/
1469
1470#if (defined __STDC__ || defined __C99__FUNC__ \
1471 || defined __cplusplus || defined _MSC_VER)
1472static void
1473yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1474#else
1475static void
1476yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1477 FILE *yyoutput;
1478 int yytype;
1479 YYSTYPE const * const yyvaluep;
1480 TParseContext* context;
1481#endif
1482{
1483 if (yytype < YYNTOKENS)
1484 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1485 else
1486 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1487
1488 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1489 YYFPRINTF (yyoutput, ")");
1490}
1491
1492/*------------------------------------------------------------------.
1493| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1494| TOP (included). |
1495`------------------------------------------------------------------*/
1496
1497#if (defined __STDC__ || defined __C99__FUNC__ \
1498 || defined __cplusplus || defined _MSC_VER)
1499static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001500yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001501#else
1502static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001503yy_stack_print (yybottom, yytop)
1504 yytype_int16 *yybottom;
1505 yytype_int16 *yytop;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001506#endif
1507{
1508 YYFPRINTF (stderr, "Stack now");
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001509 for (; yybottom <= yytop; yybottom++)
1510 {
1511 int yybot = *yybottom;
1512 YYFPRINTF (stderr, " %d", yybot);
1513 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001514 YYFPRINTF (stderr, "\n");
1515}
1516
1517# define YY_STACK_PRINT(Bottom, Top) \
1518do { \
1519 if (yydebug) \
1520 yy_stack_print ((Bottom), (Top)); \
1521} while (YYID (0))
1522
1523
1524/*------------------------------------------------.
1525| Report that the YYRULE is going to be reduced. |
1526`------------------------------------------------*/
1527
1528#if (defined __STDC__ || defined __C99__FUNC__ \
1529 || defined __cplusplus || defined _MSC_VER)
1530static void
1531yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1532#else
1533static void
1534yy_reduce_print (yyvsp, yyrule, context)
1535 YYSTYPE *yyvsp;
1536 int yyrule;
1537 TParseContext* context;
1538#endif
1539{
1540 int yynrhs = yyr2[yyrule];
1541 int yyi;
1542 unsigned long int yylno = yyrline[yyrule];
1543 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1544 yyrule - 1, yylno);
1545 /* The symbols being reduced. */
1546 for (yyi = 0; yyi < yynrhs; yyi++)
1547 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001548 YYFPRINTF (stderr, " $%d = ", yyi + 1);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001549 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1550 &(yyvsp[(yyi + 1) - (yynrhs)])
1551 , context);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001552 YYFPRINTF (stderr, "\n");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001553 }
1554}
1555
1556# define YY_REDUCE_PRINT(Rule) \
1557do { \
1558 if (yydebug) \
1559 yy_reduce_print (yyvsp, Rule, context); \
1560} while (YYID (0))
1561
1562/* Nonzero means print parse trace. It is left uninitialized so that
1563 multiple parsers can coexist. */
1564int yydebug;
1565#else /* !YYDEBUG */
1566# define YYDPRINTF(Args)
1567# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1568# define YY_STACK_PRINT(Bottom, Top)
1569# define YY_REDUCE_PRINT(Rule)
1570#endif /* !YYDEBUG */
1571
1572
1573/* YYINITDEPTH -- initial size of the parser's stacks. */
1574#ifndef YYINITDEPTH
1575# define YYINITDEPTH 200
1576#endif
1577
1578/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1579 if the built-in stack extension method is used).
1580
1581 Do not make this value too large; the results are undefined if
1582 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1583 evaluated with infinite-precision integer arithmetic. */
1584
1585#ifndef YYMAXDEPTH
1586# define YYMAXDEPTH 10000
1587#endif
1588
1589
1590
1591#if YYERROR_VERBOSE
1592
1593# ifndef yystrlen
1594# if defined __GLIBC__ && defined _STRING_H
1595# define yystrlen strlen
1596# else
1597/* Return the length of YYSTR. */
1598#if (defined __STDC__ || defined __C99__FUNC__ \
1599 || defined __cplusplus || defined _MSC_VER)
1600static YYSIZE_T
1601yystrlen (const char *yystr)
1602#else
1603static YYSIZE_T
1604yystrlen (yystr)
1605 const char *yystr;
1606#endif
1607{
1608 YYSIZE_T yylen;
1609 for (yylen = 0; yystr[yylen]; yylen++)
1610 continue;
1611 return yylen;
1612}
1613# endif
1614# endif
1615
1616# ifndef yystpcpy
1617# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1618# define yystpcpy stpcpy
1619# else
1620/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1621 YYDEST. */
1622#if (defined __STDC__ || defined __C99__FUNC__ \
1623 || defined __cplusplus || defined _MSC_VER)
1624static char *
1625yystpcpy (char *yydest, const char *yysrc)
1626#else
1627static char *
1628yystpcpy (yydest, yysrc)
1629 char *yydest;
1630 const char *yysrc;
1631#endif
1632{
1633 char *yyd = yydest;
1634 const char *yys = yysrc;
1635
1636 while ((*yyd++ = *yys++) != '\0')
1637 continue;
1638
1639 return yyd - 1;
1640}
1641# endif
1642# endif
1643
1644# ifndef yytnamerr
1645/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1646 quotes and backslashes, so that it's suitable for yyerror. The
1647 heuristic is that double-quoting is unnecessary unless the string
1648 contains an apostrophe, a comma, or backslash (other than
1649 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1650 null, do not copy; instead, return the length of what the result
1651 would have been. */
1652static YYSIZE_T
1653yytnamerr (char *yyres, const char *yystr)
1654{
1655 if (*yystr == '"')
1656 {
1657 YYSIZE_T yyn = 0;
1658 char const *yyp = yystr;
1659
1660 for (;;)
1661 switch (*++yyp)
1662 {
1663 case '\'':
1664 case ',':
1665 goto do_not_strip_quotes;
1666
1667 case '\\':
1668 if (*++yyp != '\\')
1669 goto do_not_strip_quotes;
1670 /* Fall through. */
1671 default:
1672 if (yyres)
1673 yyres[yyn] = *yyp;
1674 yyn++;
1675 break;
1676
1677 case '"':
1678 if (yyres)
1679 yyres[yyn] = '\0';
1680 return yyn;
1681 }
1682 do_not_strip_quotes: ;
1683 }
1684
1685 if (! yyres)
1686 return yystrlen (yystr);
1687
1688 return yystpcpy (yyres, yystr) - yyres;
1689}
1690# endif
1691
1692/* Copy into YYRESULT an error message about the unexpected token
1693 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1694 including the terminating null byte. If YYRESULT is null, do not
1695 copy anything; just return the number of bytes that would be
1696 copied. As a special case, return 0 if an ordinary "syntax error"
1697 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1698 size calculation. */
1699static YYSIZE_T
1700yysyntax_error (char *yyresult, int yystate, int yychar)
1701{
1702 int yyn = yypact[yystate];
1703
1704 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1705 return 0;
1706 else
1707 {
1708 int yytype = YYTRANSLATE (yychar);
1709 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1710 YYSIZE_T yysize = yysize0;
1711 YYSIZE_T yysize1;
1712 int yysize_overflow = 0;
1713 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1714 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1715 int yyx;
1716
1717# if 0
1718 /* This is so xgettext sees the translatable formats that are
1719 constructed on the fly. */
1720 YY_("syntax error, unexpected %s");
1721 YY_("syntax error, unexpected %s, expecting %s");
1722 YY_("syntax error, unexpected %s, expecting %s or %s");
1723 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1724 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1725# endif
1726 char *yyfmt;
1727 char const *yyf;
1728 static char const yyunexpected[] = "syntax error, unexpected %s";
1729 static char const yyexpecting[] = ", expecting %s";
1730 static char const yyor[] = " or %s";
1731 char yyformat[sizeof yyunexpected
1732 + sizeof yyexpecting - 1
1733 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1734 * (sizeof yyor - 1))];
1735 char const *yyprefix = yyexpecting;
1736
1737 /* Start YYX at -YYN if negative to avoid negative indexes in
1738 YYCHECK. */
1739 int yyxbegin = yyn < 0 ? -yyn : 0;
1740
1741 /* Stay within bounds of both yycheck and yytname. */
1742 int yychecklim = YYLAST - yyn + 1;
1743 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1744 int yycount = 1;
1745
1746 yyarg[0] = yytname[yytype];
1747 yyfmt = yystpcpy (yyformat, yyunexpected);
1748
1749 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1750 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1751 {
1752 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1753 {
1754 yycount = 1;
1755 yysize = yysize0;
1756 yyformat[sizeof yyunexpected - 1] = '\0';
1757 break;
1758 }
1759 yyarg[yycount++] = yytname[yyx];
1760 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1761 yysize_overflow |= (yysize1 < yysize);
1762 yysize = yysize1;
1763 yyfmt = yystpcpy (yyfmt, yyprefix);
1764 yyprefix = yyor;
1765 }
1766
1767 yyf = YY_(yyformat);
1768 yysize1 = yysize + yystrlen (yyf);
1769 yysize_overflow |= (yysize1 < yysize);
1770 yysize = yysize1;
1771
1772 if (yysize_overflow)
1773 return YYSIZE_MAXIMUM;
1774
1775 if (yyresult)
1776 {
1777 /* Avoid sprintf, as that infringes on the user's name space.
1778 Don't have undefined behavior even if the translation
1779 produced a string with the wrong number of "%s"s. */
1780 char *yyp = yyresult;
1781 int yyi = 0;
1782 while ((*yyp = *yyf) != '\0')
1783 {
1784 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1785 {
1786 yyp += yytnamerr (yyp, yyarg[yyi++]);
1787 yyf += 2;
1788 }
1789 else
1790 {
1791 yyp++;
1792 yyf++;
1793 }
1794 }
1795 }
1796 return yysize;
1797 }
1798}
1799#endif /* YYERROR_VERBOSE */
1800
1801
1802/*-----------------------------------------------.
1803| Release the memory associated to this symbol. |
1804`-----------------------------------------------*/
1805
1806/*ARGSUSED*/
1807#if (defined __STDC__ || defined __C99__FUNC__ \
1808 || defined __cplusplus || defined _MSC_VER)
1809static void
1810yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1811#else
1812static void
1813yydestruct (yymsg, yytype, yyvaluep, context)
1814 const char *yymsg;
1815 int yytype;
1816 YYSTYPE *yyvaluep;
1817 TParseContext* context;
1818#endif
1819{
1820 YYUSE (yyvaluep);
1821 YYUSE (context);
1822
1823 if (!yymsg)
1824 yymsg = "Deleting";
1825 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1826
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001827 switch (yytype)
1828 {
1829
1830 default:
1831 break;
1832 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001833}
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001834
1835/* Prevent warnings from -Wmissing-prototypes. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001836#ifdef YYPARSE_PARAM
1837#if defined __STDC__ || defined __cplusplus
1838int yyparse (void *YYPARSE_PARAM);
1839#else
1840int yyparse ();
1841#endif
1842#else /* ! YYPARSE_PARAM */
1843#if defined __STDC__ || defined __cplusplus
1844int yyparse (TParseContext* context);
1845#else
1846int yyparse ();
1847#endif
1848#endif /* ! YYPARSE_PARAM */
1849
1850
1851
1852
1853
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001854/*-------------------------.
1855| yyparse or yypush_parse. |
1856`-------------------------*/
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001857
1858#ifdef YYPARSE_PARAM
1859#if (defined __STDC__ || defined __C99__FUNC__ \
1860 || defined __cplusplus || defined _MSC_VER)
1861int
1862yyparse (void *YYPARSE_PARAM)
1863#else
1864int
1865yyparse (YYPARSE_PARAM)
1866 void *YYPARSE_PARAM;
1867#endif
1868#else /* ! YYPARSE_PARAM */
1869#if (defined __STDC__ || defined __C99__FUNC__ \
1870 || defined __cplusplus || defined _MSC_VER)
1871int
1872yyparse (TParseContext* context)
1873#else
1874int
1875yyparse (context)
1876 TParseContext* context;
1877#endif
1878#endif
1879{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001880/* The lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001881int yychar;
1882
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001883/* The semantic value of the lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001884YYSTYPE yylval;
1885
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001886 /* Number of syntax errors so far. */
1887 int yynerrs;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001888
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001889 int yystate;
1890 /* Number of tokens to shift before error messages enabled. */
1891 int yyerrstatus;
1892
1893 /* The stacks and their tools:
1894 `yyss': related to states.
1895 `yyvs': related to semantic values.
1896
1897 Refer to the stacks thru separate pointers, to allow yyoverflow
1898 to reallocate them elsewhere. */
1899
1900 /* The state stack. */
1901 yytype_int16 yyssa[YYINITDEPTH];
1902 yytype_int16 *yyss;
1903 yytype_int16 *yyssp;
1904
1905 /* The semantic value stack. */
1906 YYSTYPE yyvsa[YYINITDEPTH];
1907 YYSTYPE *yyvs;
1908 YYSTYPE *yyvsp;
1909
1910 YYSIZE_T yystacksize;
1911
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001912 int yyn;
1913 int yyresult;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001914 /* Lookahead token as an internal (translated) token number. */
1915 int yytoken;
1916 /* The variables used to return semantic value and location from the
1917 action routines. */
1918 YYSTYPE yyval;
1919
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001920#if YYERROR_VERBOSE
1921 /* Buffer for error messages, and its allocated size. */
1922 char yymsgbuf[128];
1923 char *yymsg = yymsgbuf;
1924 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1925#endif
1926
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001927#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1928
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001929 /* The number of symbols on the RHS of the reduced rule.
1930 Keep to zero when no symbol should be popped. */
1931 int yylen = 0;
1932
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001933 yytoken = 0;
1934 yyss = yyssa;
1935 yyvs = yyvsa;
1936 yystacksize = YYINITDEPTH;
1937
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001938 YYDPRINTF ((stderr, "Starting parse\n"));
1939
1940 yystate = 0;
1941 yyerrstatus = 0;
1942 yynerrs = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001943 yychar = YYEMPTY; /* Cause a token to be read. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001944
1945 /* Initialize stack pointers.
1946 Waste one element of value and location stack
1947 so that they stay on the same level as the state stack.
1948 The wasted elements are never initialized. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001949 yyssp = yyss;
1950 yyvsp = yyvs;
1951
1952 goto yysetstate;
1953
1954/*------------------------------------------------------------.
1955| yynewstate -- Push a new state, which is found in yystate. |
1956`------------------------------------------------------------*/
1957 yynewstate:
1958 /* In all cases, when you get here, the value and location stacks
1959 have just been pushed. So pushing a state here evens the stacks. */
1960 yyssp++;
1961
1962 yysetstate:
1963 *yyssp = yystate;
1964
1965 if (yyss + yystacksize - 1 <= yyssp)
1966 {
1967 /* Get the current used size of the three stacks, in elements. */
1968 YYSIZE_T yysize = yyssp - yyss + 1;
1969
1970#ifdef yyoverflow
1971 {
1972 /* Give user a chance to reallocate the stack. Use copies of
1973 these so that the &'s don't force the real ones into
1974 memory. */
1975 YYSTYPE *yyvs1 = yyvs;
1976 yytype_int16 *yyss1 = yyss;
1977
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001978 /* Each stack pointer address is followed by the size of the
1979 data in use in that stack, in bytes. This used to be a
1980 conditional around just the two extra args, but that might
1981 be undefined if yyoverflow is a macro. */
1982 yyoverflow (YY_("memory exhausted"),
1983 &yyss1, yysize * sizeof (*yyssp),
1984 &yyvs1, yysize * sizeof (*yyvsp),
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001985 &yystacksize);
1986
1987 yyss = yyss1;
1988 yyvs = yyvs1;
1989 }
1990#else /* no yyoverflow */
1991# ifndef YYSTACK_RELOCATE
1992 goto yyexhaustedlab;
1993# else
1994 /* Extend the stack our own way. */
1995 if (YYMAXDEPTH <= yystacksize)
1996 goto yyexhaustedlab;
1997 yystacksize *= 2;
1998 if (YYMAXDEPTH < yystacksize)
1999 yystacksize = YYMAXDEPTH;
2000
2001 {
2002 yytype_int16 *yyss1 = yyss;
2003 union yyalloc *yyptr =
2004 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2005 if (! yyptr)
2006 goto yyexhaustedlab;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002007 YYSTACK_RELOCATE (yyss_alloc, yyss);
2008 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002009# undef YYSTACK_RELOCATE
2010 if (yyss1 != yyssa)
2011 YYSTACK_FREE (yyss1);
2012 }
2013# endif
2014#endif /* no yyoverflow */
2015
2016 yyssp = yyss + yysize - 1;
2017 yyvsp = yyvs + yysize - 1;
2018
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002019 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2020 (unsigned long int) yystacksize));
2021
2022 if (yyss + yystacksize - 1 <= yyssp)
2023 YYABORT;
2024 }
2025
2026 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2027
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002028 if (yystate == YYFINAL)
2029 YYACCEPT;
2030
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002031 goto yybackup;
2032
2033/*-----------.
2034| yybackup. |
2035`-----------*/
2036yybackup:
2037
2038 /* Do appropriate processing given the current state. Read a
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002039 lookahead token if we need one and don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002040
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002041 /* First try to decide what to do without reference to lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002042 yyn = yypact[yystate];
2043 if (yyn == YYPACT_NINF)
2044 goto yydefault;
2045
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002046 /* Not known => get a lookahead token if don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002047
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002048 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002049 if (yychar == YYEMPTY)
2050 {
2051 YYDPRINTF ((stderr, "Reading a token: "));
2052 yychar = YYLEX;
2053 }
2054
2055 if (yychar <= YYEOF)
2056 {
2057 yychar = yytoken = YYEOF;
2058 YYDPRINTF ((stderr, "Now at end of input.\n"));
2059 }
2060 else
2061 {
2062 yytoken = YYTRANSLATE (yychar);
2063 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2064 }
2065
2066 /* If the proper action on seeing token YYTOKEN is to reduce or to
2067 detect an error, take that action. */
2068 yyn += yytoken;
2069 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2070 goto yydefault;
2071 yyn = yytable[yyn];
2072 if (yyn <= 0)
2073 {
2074 if (yyn == 0 || yyn == YYTABLE_NINF)
2075 goto yyerrlab;
2076 yyn = -yyn;
2077 goto yyreduce;
2078 }
2079
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002080 /* Count tokens shifted since error; after three, turn off error
2081 status. */
2082 if (yyerrstatus)
2083 yyerrstatus--;
2084
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002085 /* Shift the lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002086 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2087
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002088 /* Discard the shifted token. */
2089 yychar = YYEMPTY;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002090
2091 yystate = yyn;
2092 *++yyvsp = yylval;
2093
2094 goto yynewstate;
2095
2096
2097/*-----------------------------------------------------------.
2098| yydefault -- do the default action for the current state. |
2099`-----------------------------------------------------------*/
2100yydefault:
2101 yyn = yydefact[yystate];
2102 if (yyn == 0)
2103 goto yyerrlab;
2104 goto yyreduce;
2105
2106
2107/*-----------------------------.
2108| yyreduce -- Do a reduction. |
2109`-----------------------------*/
2110yyreduce:
2111 /* yyn is the number of a rule to reduce with. */
2112 yylen = yyr2[yyn];
2113
2114 /* If YYLEN is nonzero, implement the default value of the action:
2115 `$$ = $1'.
2116
2117 Otherwise, the following line sets YYVAL to garbage.
2118 This behavior is undocumented and Bison
2119 users should not rely upon it. Assigning to YYVAL
2120 unconditionally makes the parser a bit smaller, and it avoids a
2121 GCC warning that YYVAL may be used uninitialized. */
2122 yyval = yyvsp[1-yylen];
2123
2124
2125 YY_REDUCE_PRINT (yyn);
2126 switch (yyn)
2127 {
2128 case 2:
2129
2130 {
2131 // The symbol table search was done in the lexical phase
2132 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2133 const TVariable* variable;
2134 if (symbol == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002135 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002136 context->recover();
2137 TType type(EbtFloat, EbpUndefined);
2138 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
2139 context->symbolTable.insert(*fakeVariable);
2140 variable = fakeVariable;
2141 } else {
2142 // This identifier can only be a variable type symbol
2143 if (! symbol->isVariable()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002144 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002145 context->recover();
2146 }
2147 variable = static_cast<const TVariable*>(symbol);
2148 }
2149
2150 // don't delete $1.string, it's used by error recovery, and the pool
2151 // pop will reclaim the memory
2152
2153 if (variable->getType().getQualifier() == EvqConst ) {
2154 ConstantUnion* constArray = variable->getConstPointer();
2155 TType t(variable->getType());
2156 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2157 } else
2158 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2159 variable->getName(),
2160 variable->getType(), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002161 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002162 break;
2163
2164 case 3:
2165
2166 {
2167 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002168 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002169 break;
2170
2171 case 4:
2172
2173 {
2174 //
2175 // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
2176 // check for overflow for constants
2177 //
2178 if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002179 context->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002180 context->recover();
2181 }
2182 ConstantUnion *unionArray = new ConstantUnion[1];
2183 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2184 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002185 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002186 break;
2187
2188 case 5:
2189
2190 {
2191 ConstantUnion *unionArray = new ConstantUnion[1];
2192 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2193 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002194 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002195 break;
2196
2197 case 6:
2198
2199 {
2200 ConstantUnion *unionArray = new ConstantUnion[1];
2201 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2202 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002203 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002204 break;
2205
2206 case 7:
2207
2208 {
2209 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002210 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002211 break;
2212
2213 case 8:
2214
2215 {
2216 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002217 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002218 break;
2219
2220 case 9:
2221
2222 {
2223 if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) {
2224 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode())
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002225 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 +00002226 else
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002227 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 +00002228 context->recover();
2229 }
2230 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
2231 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002232 (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 +00002233 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors
2234 TVectorFields fields;
2235 fields.num = 1;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002236 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 +00002237 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2238 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002239 (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 +00002240 }
2241 } else {
2242 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002243 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 +00002244 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002245 extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002246 std::string extraInfo = extraInfoStream.str();
2247 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002248 context->recover();
2249 } else {
2250 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2251 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002252 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0)) {
2253 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 +00002254 context->recover();
2255 } else {
2256 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line))
2257 context->recover();
2258 }
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002259 } 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 +00002260 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002261 extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002262 std::string extraInfo = extraInfoStream.str();
2263 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002264 context->recover();
2265 }
2266 }
2267 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2268 }
2269 } else {
2270 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
2271 context->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable");
2272 context->recover();
2273 }
2274
2275 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2276 }
2277 }
2278 if ((yyval.interm.intermTypedNode) == 0) {
2279 ConstantUnion *unionArray = new ConstantUnion[1];
2280 unionArray->setFConst(0.0f);
2281 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), (yyvsp[(2) - (4)].lex).line);
2282 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2283 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct())
2284 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName()));
2285 else
2286 (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()));
2287
2288 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2289 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2290 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2291 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
2292 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())
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()));
2294 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2295 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst));
2296 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector())
2297 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary));
2298 else
2299 (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002300 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002301 break;
2302
2303 case 10:
2304
2305 {
2306 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002307 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002308 break;
2309
2310 case 11:
2311
2312 {
2313 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002314 context->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002315 context->recover();
2316 }
2317
2318 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) {
2319 TVectorFields fields;
2320 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2321 fields.num = 1;
2322 fields.offsets[0] = 0;
2323 context->recover();
2324 }
2325
2326 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { // constant folding for vector fields
2327 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line);
2328 if ((yyval.interm.intermTypedNode) == 0) {
2329 context->recover();
2330 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2331 }
2332 else
2333 (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()));
2334 } else {
alokp@chromium.orgab8c0262012-08-13 17:36:25 +00002335 TString vectorString = *(yyvsp[(3) - (3)].lex).string;
2336 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line);
2337 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2338 (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 +00002339 }
2340 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) {
2341 TMatrixFields fields;
2342 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2343 fields.wholeRow = false;
2344 fields.wholeCol = false;
2345 fields.row = 0;
2346 fields.col = 0;
2347 context->recover();
2348 }
2349
2350 if (fields.wholeRow || fields.wholeCol) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002351 context->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002352 context->recover();
2353 ConstantUnion *unionArray = new ConstantUnion[1];
2354 unionArray->setIConst(0);
2355 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2356 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2357 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize()));
2358 } else {
2359 ConstantUnion *unionArray = new ConstantUnion[1];
2360 unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row);
2361 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2362 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2363 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision()));
2364 }
2365 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) {
2366 bool fieldFound = false;
2367 const TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct();
2368 if (fields == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002369 context->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002370 context->recover();
2371 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2372 } else {
2373 unsigned int i;
2374 for (i = 0; i < fields->size(); ++i) {
2375 if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
2376 fieldFound = true;
2377 break;
2378 }
2379 }
2380 if (fieldFound) {
2381 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) {
2382 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2383 if ((yyval.interm.intermTypedNode) == 0) {
2384 context->recover();
2385 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2386 }
2387 else {
2388 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2389 // change the qualifier of the return type, not of the structure field
2390 // as the structure definition is shared between various structures.
2391 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2392 }
2393 } else {
2394 ConstantUnion *unionArray = new ConstantUnion[1];
2395 unionArray->setIConst(i);
2396 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line);
2397 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2398 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2399 }
2400 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002401 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 +00002402 context->recover();
2403 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2404 }
2405 }
2406 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002407 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 +00002408 context->recover();
2409 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2410 }
2411 // don't delete $3.string, it's from the pool
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002412 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002413 break;
2414
2415 case 12:
2416
2417 {
2418 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2419 context->recover();
2420 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2421 if ((yyval.interm.intermTypedNode) == 0) {
2422 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2423 context->recover();
2424 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2425 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002426 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002427 break;
2428
2429 case 13:
2430
2431 {
2432 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2433 context->recover();
2434 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2435 if ((yyval.interm.intermTypedNode) == 0) {
2436 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2437 context->recover();
2438 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2439 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002440 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002441 break;
2442
2443 case 14:
2444
2445 {
2446 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2447 context->recover();
2448 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002449 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002450 break;
2451
2452 case 15:
2453
2454 {
2455 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2456 TOperator op = fnCall->getBuiltInOp();
2457
2458 if (op != EOpNull)
2459 {
2460 //
2461 // Then this should be a constructor.
2462 // Don't go through the symbol table for constructors.
2463 // Their parameters will be verified algorithmically.
2464 //
2465 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2466 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2467 (yyval.interm.intermTypedNode) = 0;
2468 } else {
2469 //
2470 // It's a constructor, of type 'type'.
2471 //
2472 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2473 }
2474
2475 if ((yyval.interm.intermTypedNode) == 0) {
2476 context->recover();
2477 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2478 }
2479 (yyval.interm.intermTypedNode)->setType(type);
2480 } else {
2481 //
2482 // Not a constructor. Find it in the symbol table.
2483 //
2484 const TFunction* fnCandidate;
2485 bool builtIn;
2486 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn);
2487 if (fnCandidate) {
2488 //
2489 // A declared function.
2490 //
2491 if (builtIn && !fnCandidate->getExtension().empty() &&
2492 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2493 context->recover();
2494 }
2495 op = fnCandidate->getBuiltInOp();
2496 if (builtIn && op != EOpNull) {
2497 //
2498 // A function call mapped to a built-in operation.
2499 //
2500 if (fnCandidate->getParamCount() == 1) {
2501 //
2502 // Treat it like a built-in unary operator.
2503 //
2504 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2505 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002506 std::stringstream extraInfoStream;
2507 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2508 std::string extraInfo = extraInfoStream.str();
2509 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002510 YYERROR;
2511 }
2512 } else {
2513 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2514 }
2515 } else {
2516 // This is a real function call
2517
2518 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2519 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2520
2521 // this is how we know whether the given function is a builtIn function or a user defined function
2522 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2523 // if builtIn == true, it's definitely a builtIn function with EOpNull
2524 if (!builtIn)
2525 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2526 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2527
2528 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002529 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002530 qual = fnCandidate->getParam(i).type->getQualifier();
2531 if (qual == EvqOut || qual == EvqInOut) {
2532 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002533 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 +00002534 context->recover();
2535 }
2536 }
2537 }
2538 }
2539 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2540 } else {
2541 // error message was put out by PaFindFunction()
2542 // Put on a dummy node for error recovery
2543 ConstantUnion *unionArray = new ConstantUnion[1];
2544 unionArray->setFConst(0.0f);
2545 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2546 context->recover();
2547 }
2548 }
2549 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002550 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002551 break;
2552
2553 case 16:
2554
2555 {
2556 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002557 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002558 break;
2559
2560 case 17:
2561
2562 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002563 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002564 context->recover();
2565 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002566 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002567 break;
2568
2569 case 18:
2570
2571 {
2572 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2573 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002574 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002575 break;
2576
2577 case 19:
2578
2579 {
2580 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2581 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002582 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002583 break;
2584
2585 case 20:
2586
2587 {
2588 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2589 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002590 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002591 break;
2592
2593 case 21:
2594
2595 {
2596 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2597 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002598 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002599 break;
2600
2601 case 22:
2602
2603 {
2604 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2605 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2606 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2607 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002608 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002609 break;
2610
2611 case 23:
2612
2613 {
2614 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2615 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2616 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2617 (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 +00002618 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002619 break;
2620
2621 case 24:
2622
2623 {
2624 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002625 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002626 break;
2627
2628 case 25:
2629
2630 {
2631 //
2632 // Constructor
2633 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002634 TOperator op = EOpNull;
2635 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2636 op = EOpConstructStruct;
2637 } else {
2638 switch ((yyvsp[(1) - (1)].interm.type).type) {
2639 case EbtFloat:
2640 if ((yyvsp[(1) - (1)].interm.type).matrix) {
2641 switch((yyvsp[(1) - (1)].interm.type).size) {
2642 case 2: op = EOpConstructMat2; break;
2643 case 3: op = EOpConstructMat3; break;
2644 case 4: op = EOpConstructMat4; break;
2645 }
2646 } else {
2647 switch((yyvsp[(1) - (1)].interm.type).size) {
2648 case 1: op = EOpConstructFloat; break;
2649 case 2: op = EOpConstructVec2; break;
2650 case 3: op = EOpConstructVec3; break;
2651 case 4: op = EOpConstructVec4; break;
2652 }
2653 }
2654 break;
2655 case EbtInt:
2656 switch((yyvsp[(1) - (1)].interm.type).size) {
2657 case 1: op = EOpConstructInt; break;
2658 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2659 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2660 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2661 }
2662 break;
2663 case EbtBool:
2664 switch((yyvsp[(1) - (1)].interm.type).size) {
2665 case 1: op = EOpConstructBool; break;
2666 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2667 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2668 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2669 }
2670 break;
2671 default: break;
2672 }
2673 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002674 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 +00002675 context->recover();
2676 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2677 op = EOpConstructFloat;
2678 }
2679 }
2680 TString tempString;
2681 TType type((yyvsp[(1) - (1)].interm.type));
2682 TFunction *function = new TFunction(&tempString, type, op);
2683 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002684 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002685 break;
2686
2687 case 26:
2688
2689 {
2690 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2691 context->recover();
2692 TType type(EbtVoid, EbpUndefined);
2693 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2694 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002695 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002696 break;
2697
2698 case 27:
2699
2700 {
2701 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2702 context->recover();
2703 TType type(EbtVoid, EbpUndefined);
2704 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2705 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002706 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002707 break;
2708
2709 case 28:
2710
2711 {
2712 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002713 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002714 break;
2715
2716 case 29:
2717
2718 {
2719 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2720 context->recover();
2721 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2722 if ((yyval.interm.intermTypedNode) == 0) {
2723 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2724 context->recover();
2725 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2726 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002727 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002728 break;
2729
2730 case 30:
2731
2732 {
2733 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2734 context->recover();
2735 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2736 if ((yyval.interm.intermTypedNode) == 0) {
2737 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2738 context->recover();
2739 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2740 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002741 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002742 break;
2743
2744 case 31:
2745
2746 {
2747 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2748 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2749 if ((yyval.interm.intermTypedNode) == 0) {
2750 const char* errorOp = "";
2751 switch((yyvsp[(1) - (2)].interm).op) {
2752 case EOpNegative: errorOp = "-"; break;
2753 case EOpLogicalNot: errorOp = "!"; break;
2754 default: break;
2755 }
2756 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2757 context->recover();
2758 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2759 }
2760 } else
2761 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002762 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002763 break;
2764
2765 case 32:
2766
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002767 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002768 break;
2769
2770 case 33:
2771
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002772 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002773 break;
2774
2775 case 34:
2776
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002777 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002778 break;
2779
2780 case 35:
2781
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002782 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002783 break;
2784
2785 case 36:
2786
2787 {
2788 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2789 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2790 if ((yyval.interm.intermTypedNode) == 0) {
2791 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2792 context->recover();
2793 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2794 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002795 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002796 break;
2797
2798 case 37:
2799
2800 {
2801 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2802 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2803 if ((yyval.interm.intermTypedNode) == 0) {
2804 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2805 context->recover();
2806 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2807 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002808 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002809 break;
2810
2811 case 38:
2812
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002813 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002814 break;
2815
2816 case 39:
2817
2818 {
2819 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2820 if ((yyval.interm.intermTypedNode) == 0) {
2821 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2822 context->recover();
2823 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2824 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002825 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002826 break;
2827
2828 case 40:
2829
2830 {
2831 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2832 if ((yyval.interm.intermTypedNode) == 0) {
2833 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2834 context->recover();
2835 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2836 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002837 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002838 break;
2839
2840 case 41:
2841
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002842 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002843 break;
2844
2845 case 42:
2846
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002847 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002848 break;
2849
2850 case 43:
2851
2852 {
2853 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2854 if ((yyval.interm.intermTypedNode) == 0) {
2855 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2856 context->recover();
2857 ConstantUnion *unionArray = new ConstantUnion[1];
2858 unionArray->setBConst(false);
2859 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2860 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002861 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002862 break;
2863
2864 case 44:
2865
2866 {
2867 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2868 if ((yyval.interm.intermTypedNode) == 0) {
2869 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2870 context->recover();
2871 ConstantUnion *unionArray = new ConstantUnion[1];
2872 unionArray->setBConst(false);
2873 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2874 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002875 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002876 break;
2877
2878 case 45:
2879
2880 {
2881 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2882 if ((yyval.interm.intermTypedNode) == 0) {
2883 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2884 context->recover();
2885 ConstantUnion *unionArray = new ConstantUnion[1];
2886 unionArray->setBConst(false);
2887 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2888 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002889 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002890 break;
2891
2892 case 46:
2893
2894 {
2895 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2896 if ((yyval.interm.intermTypedNode) == 0) {
2897 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2898 context->recover();
2899 ConstantUnion *unionArray = new ConstantUnion[1];
2900 unionArray->setBConst(false);
2901 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2902 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002903 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002904 break;
2905
2906 case 47:
2907
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002908 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002909 break;
2910
2911 case 48:
2912
2913 {
2914 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2915 if ((yyval.interm.intermTypedNode) == 0) {
2916 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2917 context->recover();
2918 ConstantUnion *unionArray = new ConstantUnion[1];
2919 unionArray->setBConst(false);
2920 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2921 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002922 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002923 break;
2924
2925 case 49:
2926
2927 {
2928 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2929 if ((yyval.interm.intermTypedNode) == 0) {
2930 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2931 context->recover();
2932 ConstantUnion *unionArray = new ConstantUnion[1];
2933 unionArray->setBConst(false);
2934 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2935 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002936 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002937 break;
2938
2939 case 50:
2940
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002941 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002942 break;
2943
2944 case 51:
2945
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002946 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002947 break;
2948
2949 case 52:
2950
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002951 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002952 break;
2953
2954 case 53:
2955
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002956 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002957 break;
2958
2959 case 54:
2960
2961 {
2962 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2963 if ((yyval.interm.intermTypedNode) == 0) {
2964 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2965 context->recover();
2966 ConstantUnion *unionArray = new ConstantUnion[1];
2967 unionArray->setBConst(false);
2968 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2969 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002970 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002971 break;
2972
2973 case 55:
2974
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002975 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002976 break;
2977
2978 case 56:
2979
2980 {
2981 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2982 if ((yyval.interm.intermTypedNode) == 0) {
2983 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2984 context->recover();
2985 ConstantUnion *unionArray = new ConstantUnion[1];
2986 unionArray->setBConst(false);
2987 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2988 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002989 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002990 break;
2991
2992 case 57:
2993
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002994 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002995 break;
2996
2997 case 58:
2998
2999 {
3000 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
3001 if ((yyval.interm.intermTypedNode) == 0) {
3002 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3003 context->recover();
3004 ConstantUnion *unionArray = new ConstantUnion[1];
3005 unionArray->setBConst(false);
3006 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
3007 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003008 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003009 break;
3010
3011 case 59:
3012
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003013 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003014 break;
3015
3016 case 60:
3017
3018 {
3019 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3020 context->recover();
3021
3022 (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);
3023 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3024 (yyval.interm.intermTypedNode) = 0;
3025
3026 if ((yyval.interm.intermTypedNode) == 0) {
3027 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3028 context->recover();
3029 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3030 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003031 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003032 break;
3033
3034 case 61:
3035
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003036 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003037 break;
3038
3039 case 62:
3040
3041 {
3042 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3043 context->recover();
3044 (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);
3045 if ((yyval.interm.intermTypedNode) == 0) {
3046 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3047 context->recover();
3048 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3049 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003050 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003051 break;
3052
3053 case 63:
3054
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003055 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003056 break;
3057
3058 case 64:
3059
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003060 { 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 +00003061 break;
3062
3063 case 65:
3064
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003065 { 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 +00003066 break;
3067
3068 case 66:
3069
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003070 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003071 break;
3072
3073 case 67:
3074
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003075 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003076 break;
3077
3078 case 68:
3079
3080 {
3081 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003082 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003083 break;
3084
3085 case 69:
3086
3087 {
3088 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3089 if ((yyval.interm.intermTypedNode) == 0) {
3090 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3091 context->recover();
3092 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3093 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003094 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003095 break;
3096
3097 case 70:
3098
3099 {
3100 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3101 context->recover();
3102 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003103 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003104 break;
3105
3106 case 71:
3107
3108 {
3109 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3110
3111 TIntermAggregate *prototype = new TIntermAggregate;
3112 prototype->setType(function.getReturnType());
3113 prototype->setName(function.getName());
3114
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003115 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003116 {
3117 const TParameter &param = function.getParam(i);
3118 if (param.name != 0)
3119 {
3120 TVariable *variable = new TVariable(param.name, *param.type);
3121
3122 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3123 }
3124 else
3125 {
3126 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3127 }
3128 }
3129
3130 prototype->setOp(EOpPrototype);
3131 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003132
3133 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003134 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003135 break;
3136
3137 case 72:
3138
3139 {
3140 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3141 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3142 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003143 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003144 break;
3145
3146 case 73:
3147
3148 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003149 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3150 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3151 context->recover();
3152 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003153 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3154 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3155 context->recover();
3156 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003157 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003158 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003159 break;
3160
3161 case 74:
3162
3163 {
3164 //
3165 // Multiple declarations of the same function are allowed.
3166 //
3167 // If this is a definition, the definition production code will check for redefinitions
3168 // (we don't know at this point if it's a definition or not).
3169 //
3170 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3171 //
3172 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName()));
3173 if (prevDec) {
3174 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003175 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 +00003176 context->recover();
3177 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003178 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003179 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003180 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 +00003181 context->recover();
3182 }
3183 }
3184 }
3185
3186 //
3187 // If this is a redeclaration, it could also be a definition,
3188 // in which case, we want to use the variable names from this one, and not the one that's
3189 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3190 //
3191 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3192 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3193
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003194 // We're at the inner scope level of the function's arguments and body statement.
3195 // Add the function prototype to the surrounding scope instead.
3196 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003197 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003198 break;
3199
3200 case 75:
3201
3202 {
3203 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003204 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003205 break;
3206
3207 case 76:
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 77:
3215
3216 {
3217 // Add the parameter
3218 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3219 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3220 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3221 else
3222 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003223 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003224 break;
3225
3226 case 78:
3227
3228 {
3229 //
3230 // Only first parameter of one-parameter functions can be void
3231 // The check for named parameters not being void is done in parameter_declarator
3232 //
3233 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3234 //
3235 // This parameter > first is void
3236 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003237 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003238 context->recover();
3239 delete (yyvsp[(3) - (3)].interm).param.type;
3240 } else {
3241 // Add the parameter
3242 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3243 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3244 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003245 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003246 break;
3247
3248 case 79:
3249
3250 {
3251 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003252 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 +00003253 context->recover();
3254 }
3255 // make sure a sampler is not involved as well...
3256 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3257 context->recover();
3258
3259 // Add the function as a prototype after parsing it (we do not support recursion)
3260 TFunction *function;
3261 TType type((yyvsp[(1) - (3)].interm.type));
3262 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3263 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003264
3265 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003266 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003267 break;
3268
3269 case 80:
3270
3271 {
3272 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003273 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 +00003274 context->recover();
3275 }
3276 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3277 context->recover();
3278 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3279 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3280 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003281 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003282 break;
3283
3284 case 81:
3285
3286 {
3287 // Check that we can make an array out of this type
3288 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3289 context->recover();
3290
3291 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3292 context->recover();
3293
3294 int size;
3295 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3296 context->recover();
3297 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3298
3299 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3300 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3301 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3302 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003303 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003304 break;
3305
3306 case 82:
3307
3308 {
3309 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003310 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 +00003311 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003312 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003313 break;
3314
3315 case 83:
3316
3317 {
3318 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3319 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3320 context->recover();
3321 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3322 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003323 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003324 break;
3325
3326 case 84:
3327
3328 {
3329 (yyval.interm) = (yyvsp[(3) - (3)].interm);
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003330 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 +00003331 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003332 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003333 break;
3334
3335 case 85:
3336
3337 {
3338 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3339 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3340 context->recover();
3341 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3342 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003343 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003344 break;
3345
3346 case 86:
3347
3348 {
3349 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003350 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003351 break;
3352
3353 case 87:
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 88:
3361
3362 {
3363 (yyval.interm.qualifier) = EvqOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003364 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003365 break;
3366
3367 case 89:
3368
3369 {
3370 (yyval.interm.qualifier) = EvqInOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003371 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003372 break;
3373
3374 case 90:
3375
3376 {
3377 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3378 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003379 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003380 break;
3381
3382 case 91:
3383
3384 {
3385 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003386 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003387 break;
3388
3389 case 92:
3390
3391 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003392 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3393 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003394 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 +00003395 context->recover();
3396 }
3397
zmo@google.comfd747b82011-04-23 01:30:07 +00003398 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3399 (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 +00003400
3401 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3402 context->recover();
3403
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003404 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 +00003405 context->recover();
3406
zmo@google.comfd747b82011-04-23 01:30:07 +00003407 TVariable* variable = 0;
3408 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 +00003409 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003410 if (symbol && variable)
3411 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003412 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003413 break;
3414
3415 case 93:
3416
3417 {
3418 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3419 context->recover();
3420
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003421 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 +00003422 context->recover();
3423
3424 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3425
3426 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))
3427 context->recover();
3428 else {
3429 (yyvsp[(1) - (5)].interm).type.setArray(true);
3430 TVariable* variable;
3431 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3432 context->recover();
3433 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003434 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003435 break;
3436
3437 case 94:
3438
3439 {
3440 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3441 context->recover();
3442
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003443 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 +00003444 context->recover();
3445
3446 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3447
3448 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))
3449 context->recover();
3450 else {
3451 int size;
3452 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3453 context->recover();
3454 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003455 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003456 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3457 context->recover();
3458 TType type = TType((yyvsp[(1) - (6)].interm).type);
3459 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003460 (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 +00003461 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003462 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003463 break;
3464
3465 case 95:
3466
3467 {
3468 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3469 context->recover();
3470
3471 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3472
3473 TIntermNode* intermNode;
3474 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3475 //
3476 // build the intermediate representation
3477 //
3478 if (intermNode)
3479 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3480 else
3481 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3482 } else {
3483 context->recover();
3484 (yyval.interm).intermAggregate = 0;
3485 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003486 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003487 break;
3488
3489 case 96:
3490
3491 {
3492 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3493 (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 +00003494 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003495 break;
3496
3497 case 97:
3498
3499 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003500 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3501 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003502
3503 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3504 context->recover();
3505
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003506 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 +00003507 context->recover();
3508
3509 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3510
zmo@google.comfd747b82011-04-23 01:30:07 +00003511 TVariable* variable = 0;
3512 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 +00003513 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003514 if (variable && symbol)
3515 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003516 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003517 break;
3518
3519 case 98:
3520
3521 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003522 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 +00003523 context->recover();
3524
zmo@google.comfd747b82011-04-23 01:30:07 +00003525 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3526 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003527 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003528 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003529 break;
3530
3531 case 99:
3532
3533 {
3534 TType type = TType((yyvsp[(1) - (5)].interm.type));
3535 int size;
3536 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3537 context->recover();
3538 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003539 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3540 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003541
3542 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3543 context->recover();
3544
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003545 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 +00003546 context->recover();
3547
3548 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3549
3550 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)))
3551 context->recover();
3552 else {
3553 int size;
3554 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3555 context->recover();
3556
3557 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003558 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003559 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3560 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003561 if (variable && symbol)
3562 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003563 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003564 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003565 break;
3566
3567 case 100:
3568
3569 {
3570 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3571 context->recover();
3572
3573 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3574
3575 TIntermNode* intermNode;
3576 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3577 //
3578 // Build intermediate representation
3579 //
3580 if(intermNode)
3581 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3582 else
3583 (yyval.interm).intermAggregate = 0;
3584 } else {
3585 context->recover();
3586 (yyval.interm).intermAggregate = 0;
3587 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003588 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003589 break;
3590
3591 case 101:
3592
3593 {
3594 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003595 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3596 context->recover();
3597 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3598 if (!(yyvsp[(2) - (2)].lex).symbol)
3599 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003600 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 +00003601 context->recover();
3602
3603 (yyval.interm).intermAggregate = 0;
3604 }
3605 else
3606 {
3607 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3608 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3609 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003610 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003611 break;
3612
3613 case 102:
3614
3615 {
3616 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3617
3618 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003619 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003620 context->recover();
3621 (yyvsp[(1) - (1)].interm.type).setArray(false);
3622 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003623 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003624 break;
3625
3626 case 103:
3627
3628 {
3629 if ((yyvsp[(2) - (2)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003630 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003631 context->recover();
3632 (yyvsp[(2) - (2)].interm.type).setArray(false);
3633 }
3634
3635 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3636 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003637 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 +00003638 context->recover();
3639 }
3640 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3641 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003642 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 +00003643 context->recover();
3644 }
3645 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3646 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003647 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003648 break;
3649
3650 case 104:
3651
3652 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003653 (yyval.interm.qualifier) = EvqConst;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003654 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003655 break;
3656
3657 case 105:
3658
3659 {
3660 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00003661 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003662 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3663 context->recover();
3664 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003665 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003666 break;
3667
3668 case 106:
3669
3670 {
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00003671 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003672 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3673 context->recover();
3674 if (context->shaderType == SH_VERTEX_SHADER)
3675 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3676 else
3677 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003678 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003679 break;
3680
3681 case 107:
3682
3683 {
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00003684 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003685 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3686 context->recover();
3687 if (context->shaderType == SH_VERTEX_SHADER)
3688 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3689 else
3690 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003691 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003692 break;
3693
3694 case 108:
3695
3696 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003697 (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 +00003698 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003699 break;
3700
3701 case 109:
3702
3703 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003704 (yyval.interm.type).qualifier = EvqConst;
3705 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3706 }
3707 break;
3708
3709 case 110:
3710
3711 {
3712 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
3713 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqVaryingIn : EvqAttribute;
3714 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3715 }
3716 break;
3717
3718 case 111:
3719
3720 {
3721 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
3722 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqVaryingOut;
3723 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3724 }
3725 break;
3726
3727 case 112:
3728
3729 {
3730 ES3_ONLY("in", (yyvsp[(1) - (2)].lex).line);
3731 // FIXME: Handle centroid qualifier
3732 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqVaryingIn : EvqAttribute;
3733 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
3734 }
3735 break;
3736
3737 case 113:
3738
3739 {
3740 ES3_ONLY("out", (yyvsp[(1) - (2)].lex).line);
3741 // FIXME: Handle centroid qualifier
3742 (yyval.interm.type).qualifier = (context->shaderType == SH_FRAGMENT_SHADER) ? EvqFragColor : EvqVaryingOut;
3743 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
3744 }
3745 break;
3746
3747 case 114:
3748
3749 {
3750 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3751 context->recover();
3752 (yyval.interm.type).qualifier = EvqUniform;
3753 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3754 }
3755 break;
3756
3757 case 115:
3758
3759 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003760 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003761
3762 if ((yyval.interm.type).precision == EbpUndefined) {
3763 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3764 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3765 context->recover();
3766 }
3767 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003768 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003769 break;
3770
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003771 case 116:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003772
3773 {
3774 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3775 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003776 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003777 break;
3778
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003779 case 117:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003780
3781 {
3782 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003783 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003784 break;
3785
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003786 case 118:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003787
3788 {
3789 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003790 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003791 break;
3792
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003793 case 119:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003794
3795 {
3796 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003797 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003798 break;
3799
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003800 case 120:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003801
3802 {
3803 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003804 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003805 break;
3806
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003807 case 121:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003808
3809 {
3810 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3811
3812 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3813 context->recover();
3814 else {
3815 int size;
3816 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3817 context->recover();
3818 (yyval.interm.type).setArray(true, size);
3819 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003820 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003821 break;
3822
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003823 case 122:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003824
3825 {
3826 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3827 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003828 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003829 break;
3830
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003831 case 123:
3832
3833 {
3834 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003835 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003836 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003837 break;
3838
3839 case 124:
3840
3841 {
3842 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003843 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003844 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003845 break;
3846
3847 case 125:
3848
3849 {
3850 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3851 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003852 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003853 break;
3854
3855 case 126:
3856
3857 {
3858 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003859 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003860 (yyval.interm.type).setAggregate(2);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003861 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003862 break;
3863
3864 case 127:
3865
3866 {
3867 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003868 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003869 (yyval.interm.type).setAggregate(3);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003870 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003871 break;
3872
3873 case 128:
3874
3875 {
3876 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003877 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003878 (yyval.interm.type).setAggregate(4);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003879 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003880 break;
3881
3882 case 129:
3883
3884 {
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003885 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3886 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3887 (yyval.interm.type).setAggregate(2);
3888 }
3889 break;
3890
3891 case 130:
3892
3893 {
3894 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3895 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3896 (yyval.interm.type).setAggregate(3);
3897 }
3898 break;
3899
3900 case 131:
3901
3902 {
3903 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3904 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3905 (yyval.interm.type).setAggregate(4);
3906 }
3907 break;
3908
3909 case 132:
3910
3911 {
3912 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3913 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3914 (yyval.interm.type).setAggregate(2);
3915 }
3916 break;
3917
3918 case 133:
3919
3920 {
3921 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3922 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3923 (yyval.interm.type).setAggregate(3);
3924 }
3925 break;
3926
3927 case 134:
3928
3929 {
3930 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3931 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3932 (yyval.interm.type).setAggregate(4);
3933 }
3934 break;
3935
3936 case 135:
3937
3938 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003939 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
3940 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3941 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3942 (yyval.interm.type).setAggregate(2, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003943 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003944 break;
3945
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003946 case 136:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003947
3948 {
3949 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
3950 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3951 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3952 (yyval.interm.type).setAggregate(3, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003953 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003954 break;
3955
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003956 case 137:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003957
3958 {
3959 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
3960 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3961 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3962 (yyval.interm.type).setAggregate(4, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003963 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003964 break;
3965
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003966 case 138:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003967
3968 {
3969 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
3970 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3971 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003972 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003973 break;
3974
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003975 case 139:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003976
3977 {
3978 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
3979 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3980 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003981 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003982 break;
3983
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003984 case 140:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003985
3986 {
zmo@google.com09c323a2011-08-12 18:22:25 +00003987 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003988 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00003989 context->recover();
3990 }
3991 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
3992 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3993 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003994 }
zmo@google.com09c323a2011-08-12 18:22:25 +00003995 break;
3996
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00003997 case 141:
zmo@google.com09c323a2011-08-12 18:22:25 +00003998
3999 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004000 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004001 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00004002 context->recover();
4003 }
4004 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
4005 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4006 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004007 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004008 break;
4009
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004010 case 142:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004011
4012 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004013 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4014 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4015 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004016 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004017 break;
4018
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004019 case 143:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004020
4021 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004022 //
4023 // This is for user defined type names. The lexical phase looked up the
4024 // type.
4025 //
4026 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4027 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4028 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4029 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004030 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004031 break;
4032
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004033 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004034
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004035 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004036 break;
4037
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004038 case 145:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004039
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004040 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004041 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
4042 context->recover();
4043
4044 TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
4045 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
4046 if (! context->symbolTable.insert(*userTypeDef)) {
4047 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
4048 context->recover();
4049 }
4050 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004051 (yyval.interm.type).userDef = structure;
kbr@chromium.org476541f2011-10-27 21:14:51 +00004052 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004053 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004054 break;
4055
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004056 case 146:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004057
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004058 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004059 break;
4060
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004061 case 147:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004062
kbr@chromium.org476541f2011-10-27 21:14:51 +00004063 {
4064 TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
4065 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
4066 (yyval.interm.type).userDef = structure;
4067 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004068 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004069 break;
4070
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004071 case 148:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004072
4073 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004074 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004075 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004076 break;
4077
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004078 case 149:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004079
4080 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004081 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4082 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4083 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4084 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4085 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());
4086 context->recover();
4087 }
4088 }
4089 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4090 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004091 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004092 break;
4093
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004094 case 150:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004095
4096 {
4097 (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
4098
4099 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
4100 context->recover();
4101 }
4102 for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) {
4103 //
4104 // Careful not to replace already known aspects of type, like array-ness
4105 //
4106 TType* type = (*(yyval.interm.typeList))[i].type;
4107 type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
4108 type->setNominalSize((yyvsp[(1) - (3)].interm.type).size);
4109 type->setMatrix((yyvsp[(1) - (3)].interm.type).matrix);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00004110 type->setPrecision((yyvsp[(1) - (3)].interm.type).precision);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004111
4112 // don't allow arrays of arrays
4113 if (type->isArray()) {
4114 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type)))
4115 context->recover();
4116 }
4117 if ((yyvsp[(1) - (3)].interm.type).array)
4118 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize);
4119 if ((yyvsp[(1) - (3)].interm.type).userDef) {
4120 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
4121 type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName());
4122 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004123
4124 if (context->structNestingErrorCheck((yyvsp[(1) - (3)].interm.type).line, *type)) {
4125 context->recover();
4126 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004127 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004128 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004129 break;
4130
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004131 case 151:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004132
4133 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004134 (yyval.interm.typeList) = NewPoolTTypeList();
4135 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004136 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004137 break;
4138
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004139 case 152:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004140
4141 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004142 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004143 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004144 break;
4145
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004146 case 153:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004147
4148 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004149 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4150 context->recover();
4151
4152 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4153 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4154 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004155 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004156 break;
4157
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004158 case 154:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004159
4160 {
4161 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4162 context->recover();
4163
4164 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4165 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4166 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4167
4168 int size;
4169 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4170 context->recover();
4171 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004172 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004173 break;
4174
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004175 case 155:
4176
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004177 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004178 break;
4179
4180 case 156:
4181
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004182 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004183 break;
4184
4185 case 157:
4186
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004187 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
zmo@google.com09c323a2011-08-12 18:22:25 +00004188 break;
4189
4190 case 158:
4191
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004192 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004193 break;
4194
4195 case 159:
4196
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004197 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004198 break;
4199
4200 case 160:
4201
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004202 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004203 break;
4204
4205 case 161:
4206
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004207 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004208 break;
4209
4210 case 162:
4211
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004212 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004213 break;
4214
4215 case 163:
4216
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004217 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004218 break;
4219
kbr@chromium.org476541f2011-10-27 21:14:51 +00004220 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004221
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004222 { (yyval.interm.intermAggregate) = 0; }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004223 break;
4224
4225 case 165:
4226
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004227 { context->symbolTable.push(); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004228 break;
4229
4230 case 166:
4231
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004232 { context->symbolTable.pop(); }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004233 break;
4234
4235 case 167:
4236
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004237 {
4238 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4239 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4240 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4241 }
4242 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4243 }
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004244 break;
4245
4246 case 168:
4247
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004248 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4249 break;
4250
4251 case 169:
4252
4253 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4254 break;
4255
4256 case 170:
4257
4258 { context->symbolTable.push(); }
4259 break;
4260
4261 case 171:
4262
4263 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4264 break;
4265
4266 case 172:
4267
4268 { context->symbolTable.push(); }
4269 break;
4270
4271 case 173:
4272
4273 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4274 break;
4275
4276 case 174:
4277
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004278 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004279 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004280 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004281 break;
4282
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004283 case 175:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004284
4285 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004286 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004287 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004288 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4289 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004290 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004291 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004292 break;
4293
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004294 case 176:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004295
4296 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004297 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004298 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004299 break;
4300
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004301 case 177:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004302
kbr@chromium.org205fef32011-11-22 20:50:02 +00004303 {
4304 (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 +00004305 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004306 break;
4307
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004308 case 178:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004309
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004310 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004311 break;
4312
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004313 case 179:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004314
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004315 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004316 break;
4317
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004318 case 180:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004319
4320 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004321 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4322 context->recover();
4323 (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 +00004324 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004325 break;
4326
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004327 case 181:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004328
4329 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004330 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4331 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004332 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004333 break;
4334
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004335 case 182:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004336
4337 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004338 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4339 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004340 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004341 break;
4342
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004343 case 183:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004344
4345 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004346 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4347 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4348 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004349 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004350 break;
4351
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004352 case 184:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004353
4354 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004355 TIntermNode* intermNode;
4356 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4357 context->recover();
4358 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4359 context->recover();
4360
4361 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4362 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4363 else {
4364 context->recover();
4365 (yyval.interm.intermTypedNode) = 0;
4366 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004367 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004368 break;
4369
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004370 case 185:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004371
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004372 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004373 break;
4374
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004375 case 186:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004376
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004377 {
4378 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004379 (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 +00004380 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004381 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004382 break;
4383
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004384 case 187:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004385
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004386 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004387 break;
4388
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004389 case 188:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004390
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004391 {
4392 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4393 context->recover();
4394
alokp@chromium.org52813552010-11-16 18:36:09 +00004395 (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 +00004396 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004397 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004398 break;
4399
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004400 case 189:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004401
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004402 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004403 break;
4404
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004405 case 190:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004406
4407 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004408 context->symbolTable.pop();
4409 (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);
4410 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004411 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004412 break;
4413
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004414 case 191:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004415
4416 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004417 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004418 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004419 break;
4420
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004421 case 192:
zmo@google.com09c323a2011-08-12 18:22:25 +00004422
4423 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004424 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004425 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004426 break;
4427
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004428 case 193:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004429
4430 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004431 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004432 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004433 break;
4434
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004435 case 194:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004436
4437 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004438 (yyval.interm.intermTypedNode) = 0;
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.com2226e042013-04-13 03:38:26 +00004442 case 195:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004443
4444 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004445 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4446 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004447 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004448 break;
4449
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004450 case 196:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004451
4452 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004453 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4454 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004455 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004456 break;
4457
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004458 case 197:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004459
4460 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004461 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004462 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004463 context->recover();
4464 }
4465 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004466 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004467 break;
4468
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004469 case 198:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004470
4471 {
4472 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004473 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004474 context->recover();
4475 }
4476 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004477 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004478 break;
4479
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004480 case 199:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004481
4482 {
4483 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4484 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004485 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004486 context->recover();
4487 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004488 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004489 break;
4490
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004491 case 200:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004492
4493 {
4494 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4495 context->functionReturnsValue = true;
4496 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004497 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004498 context->recover();
4499 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004500 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004501 context->recover();
4502 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004503 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004504 break;
4505
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004506 case 201:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004507
4508 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004509 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4510 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004511 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004512 break;
4513
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004514 case 202:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004515
4516 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004517 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004518 context->treeRoot = (yyval.interm.intermNode);
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.com2226e042013-04-13 03:38:26 +00004522 case 203:
zmo@google.com09c323a2011-08-12 18:22:25 +00004523
4524 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004525 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4526 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004527 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004528 break;
4529
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004530 case 204:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004531
4532 {
4533 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004534 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004535 break;
4536
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004537 case 205:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004538
4539 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004540 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004541 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004542 break;
4543
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004544 case 206:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004545
4546 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004547 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004548
4549 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName());
4550
4551 if (builtIn)
4552 {
4553 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4554 context->recover();
4555 }
4556
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004557 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName()));
4558 //
4559 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4560 // as it would have just been put in the symbol table. Otherwise, we're looking up
4561 // an earlier occurance.
4562 //
4563 if (prevDec->isDefined()) {
4564 //
4565 // Then this function already has a body.
4566 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004567 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004568 context->recover();
4569 }
4570 prevDec->setDefined();
4571
4572 //
4573 // Raise error message if main function takes any parameters or return anything other than void
4574 //
4575 if (function->getName() == "main") {
4576 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004577 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 +00004578 context->recover();
4579 }
4580 if (function->getReturnType().getBasicType() != EbtVoid) {
4581 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4582 context->recover();
4583 }
4584 }
4585
4586 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004587 // Remember the return type for later checking for RETURN statements.
4588 //
4589 context->currentFunctionType = &(prevDec->getReturnType());
4590 context->functionReturnsValue = false;
4591
4592 //
4593 // Insert parameters into the symbol table.
4594 // If the parameter has no name, it's not an error, just don't insert it
4595 // (could be used for unused args).
4596 //
4597 // Also, accumulate the list of parameters into the HIL, so lower level code
4598 // knows where to find parameters.
4599 //
4600 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004601 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004602 const TParameter& param = function->getParam(i);
4603 if (param.name != 0) {
4604 TVariable *variable = new TVariable(param.name, *param.type);
4605 //
4606 // Insert the parameters with name in the symbol table.
4607 //
4608 if (! context->symbolTable.insert(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004609 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004610 context->recover();
4611 delete variable;
4612 }
4613
4614 //
4615 // Add the parameter to the HIL
4616 //
4617 paramNodes = context->intermediate.growAggregate(
4618 paramNodes,
4619 context->intermediate.addSymbol(variable->getUniqueId(),
4620 variable->getName(),
4621 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4622 (yyvsp[(1) - (1)].interm).line);
4623 } else {
4624 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4625 }
4626 }
4627 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4628 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4629 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004630 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004631 break;
4632
shannon.woods%transgaming.com@gtempaccount.com2226e042013-04-13 03:38:26 +00004633 case 207:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004634
4635 {
4636 //?? Check that all paths return a value if return type != void ?
4637 // May be best done as post process phase on intermediate code
4638 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4639 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4640 context->recover();
4641 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004642
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004643 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4644 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4645 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4646 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4647
4648 // store the pragma information for debug and optimize and other vendor specific
4649 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004650 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4651 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004652
4653 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4654 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004655
4656 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004657 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004658 break;
4659
4660
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004661
4662 default: break;
4663 }
4664 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4665
4666 YYPOPSTACK (yylen);
4667 yylen = 0;
4668 YY_STACK_PRINT (yyss, yyssp);
4669
4670 *++yyvsp = yyval;
4671
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004672 /* Now `shift' the result of the reduction. Determine what state
4673 that goes to, based on the state we popped back to and the rule
4674 number reduced by. */
4675
4676 yyn = yyr1[yyn];
4677
4678 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4679 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4680 yystate = yytable[yystate];
4681 else
4682 yystate = yydefgoto[yyn - YYNTOKENS];
4683
4684 goto yynewstate;
4685
4686
4687/*------------------------------------.
4688| yyerrlab -- here on detecting error |
4689`------------------------------------*/
4690yyerrlab:
4691 /* If not already recovering from an error, report this error. */
4692 if (!yyerrstatus)
4693 {
4694 ++yynerrs;
4695#if ! YYERROR_VERBOSE
4696 yyerror (context, YY_("syntax error"));
4697#else
4698 {
4699 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4700 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4701 {
4702 YYSIZE_T yyalloc = 2 * yysize;
4703 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4704 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4705 if (yymsg != yymsgbuf)
4706 YYSTACK_FREE (yymsg);
4707 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4708 if (yymsg)
4709 yymsg_alloc = yyalloc;
4710 else
4711 {
4712 yymsg = yymsgbuf;
4713 yymsg_alloc = sizeof yymsgbuf;
4714 }
4715 }
4716
4717 if (0 < yysize && yysize <= yymsg_alloc)
4718 {
4719 (void) yysyntax_error (yymsg, yystate, yychar);
4720 yyerror (context, yymsg);
4721 }
4722 else
4723 {
4724 yyerror (context, YY_("syntax error"));
4725 if (yysize != 0)
4726 goto yyexhaustedlab;
4727 }
4728 }
4729#endif
4730 }
4731
4732
4733
4734 if (yyerrstatus == 3)
4735 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004736 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004737 error, discard it. */
4738
4739 if (yychar <= YYEOF)
4740 {
4741 /* Return failure if at end of input. */
4742 if (yychar == YYEOF)
4743 YYABORT;
4744 }
4745 else
4746 {
4747 yydestruct ("Error: discarding",
4748 yytoken, &yylval, context);
4749 yychar = YYEMPTY;
4750 }
4751 }
4752
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004753 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004754 token. */
4755 goto yyerrlab1;
4756
4757
4758/*---------------------------------------------------.
4759| yyerrorlab -- error raised explicitly by YYERROR. |
4760`---------------------------------------------------*/
4761yyerrorlab:
4762
4763 /* Pacify compilers like GCC when the user code never invokes
4764 YYERROR and the label yyerrorlab therefore never appears in user
4765 code. */
4766 if (/*CONSTCOND*/ 0)
4767 goto yyerrorlab;
4768
4769 /* Do not reclaim the symbols of the rule which action triggered
4770 this YYERROR. */
4771 YYPOPSTACK (yylen);
4772 yylen = 0;
4773 YY_STACK_PRINT (yyss, yyssp);
4774 yystate = *yyssp;
4775 goto yyerrlab1;
4776
4777
4778/*-------------------------------------------------------------.
4779| yyerrlab1 -- common code for both syntax error and YYERROR. |
4780`-------------------------------------------------------------*/
4781yyerrlab1:
4782 yyerrstatus = 3; /* Each real token shifted decrements this. */
4783
4784 for (;;)
4785 {
4786 yyn = yypact[yystate];
4787 if (yyn != YYPACT_NINF)
4788 {
4789 yyn += YYTERROR;
4790 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4791 {
4792 yyn = yytable[yyn];
4793 if (0 < yyn)
4794 break;
4795 }
4796 }
4797
4798 /* Pop the current state because it cannot handle the error token. */
4799 if (yyssp == yyss)
4800 YYABORT;
4801
4802
4803 yydestruct ("Error: popping",
4804 yystos[yystate], yyvsp, context);
4805 YYPOPSTACK (1);
4806 yystate = *yyssp;
4807 YY_STACK_PRINT (yyss, yyssp);
4808 }
4809
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004810 *++yyvsp = yylval;
4811
4812
4813 /* Shift the error token. */
4814 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4815
4816 yystate = yyn;
4817 goto yynewstate;
4818
4819
4820/*-------------------------------------.
4821| yyacceptlab -- YYACCEPT comes here. |
4822`-------------------------------------*/
4823yyacceptlab:
4824 yyresult = 0;
4825 goto yyreturn;
4826
4827/*-----------------------------------.
4828| yyabortlab -- YYABORT comes here. |
4829`-----------------------------------*/
4830yyabortlab:
4831 yyresult = 1;
4832 goto yyreturn;
4833
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004834#if !defined(yyoverflow) || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004835/*-------------------------------------------------.
4836| yyexhaustedlab -- memory exhaustion comes here. |
4837`-------------------------------------------------*/
4838yyexhaustedlab:
4839 yyerror (context, YY_("memory exhausted"));
4840 yyresult = 2;
4841 /* Fall through. */
4842#endif
4843
4844yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004845 if (yychar != YYEMPTY)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004846 yydestruct ("Cleanup: discarding lookahead",
4847 yytoken, &yylval, context);
4848 /* Do not reclaim the symbols of the rule which action triggered
4849 this YYABORT or YYACCEPT. */
4850 YYPOPSTACK (yylen);
4851 YY_STACK_PRINT (yyss, yyssp);
4852 while (yyssp != yyss)
4853 {
4854 yydestruct ("Cleanup: popping",
4855 yystos[*yyssp], yyvsp, context);
4856 YYPOPSTACK (1);
4857 }
4858#ifndef yyoverflow
4859 if (yyss != yyssa)
4860 YYSTACK_FREE (yyss);
4861#endif
4862#if YYERROR_VERBOSE
4863 if (yymsg != yymsgbuf)
4864 YYSTACK_FREE (yymsg);
4865#endif
4866 /* Make sure YYID is used. */
4867 return YYID (yyresult);
4868}
4869
4870
4871
4872
4873
4874int glslang_parse(TParseContext* context) {
4875 return yyparse(context);
4876}
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00004877