blob: 6409edc8c8a1b34d8ccb68be7614a4a3afb54fd3 [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. */
kbr@chromium.org205fef32011-11-22 20:50:02 +0000532#define YYFINAL 71
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000533/* YYLAST -- Last index in YYTABLE. */
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000534#define YYLAST 1567
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. */
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000539#define YYNNTS 83
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000540/* YYNRULES -- Number of rules. */
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000541#define YYNRULES 201
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000542/* YYNRULES -- Number of states. */
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000543#define YYNSTATES 304
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,
609 324, 327, 329, 331, 333, 335, 340, 342, 344, 346,
610 348, 350, 352, 354, 356, 358, 360, 362, 364, 366,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000611 368, 370, 372, 374, 376, 378, 380, 382, 384, 385,
612 392, 393, 399, 401, 404, 408, 410, 414, 416, 421,
613 423, 425, 427, 429, 431, 433, 435, 437, 439, 442,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000614 443, 444, 450, 452, 454, 455, 458, 459, 462, 465,
615 469, 471, 474, 476, 479, 485, 489, 491, 493, 498,
616 499, 506, 507, 516, 517, 525, 527, 529, 531, 532,
617 535, 539, 542, 545, 548, 552, 555, 557, 560, 562,
618 564, 565
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.com5524db02013-04-13 03:38:16 +0000624 184, 0, -1, 54, -1, 106, -1, 57, -1, 56,
625 -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,
630 114, 88, 131, -1, 116, 81, -1, 151, -1, 54,
631 -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,
644 91, -1, 7, 149, 150, 91, -1, 137, 82, -1,
645 139, -1, 138, -1, 139, 141, -1, 138, 88, 141,
646 -1, 146, 54, 81, -1, 148, 54, -1, 148, 54,
647 83, 134, 84, -1, 147, 142, 140, -1, 142, 140,
648 -1, 147, 142, 143, -1, 142, 143, -1, -1, 36,
649 -1, 37, -1, 38, -1, 148, -1, 145, -1, 144,
650 88, 54, -1, 144, 88, 54, 83, 84, -1, 144,
651 88, 54, 83, 134, 84, -1, 144, 88, 54, 90,
652 159, -1, 146, -1, 146, 54, -1, 146, 54, 83,
653 84, -1, 146, 54, 83, 134, 84, -1, 146, 54,
654 90, 159, -1, 3, 54, -1, 148, -1, 147, 148,
655 -1, 9, -1, 8, -1, 40, -1, 3, 40, -1,
656 39, -1, 150, -1, 149, 150, -1, 4, -1, 5,
657 -1, 6, -1, 151, -1, 151, 83, 134, 84, -1,
658 45, -1, 11, -1, 12, -1, 10, -1, 30, -1,
659 31, -1, 32, -1, 24, -1, 25, -1, 26, -1,
660 27, -1, 28, -1, 29, -1, 33, -1, 34, -1,
661 35, -1, 47, -1, 48, -1, 49, -1, 50, -1,
662 152, -1, 55, -1, -1, 44, 54, 85, 153, 155,
663 86, -1, -1, 44, 85, 154, 155, 86, -1, 156,
664 -1, 155, 156, -1, 148, 157, 91, -1, 158, -1,
665 157, 88, 158, -1, 54, -1, 54, 83, 134, 84,
666 -1, 131, -1, 135, -1, 163, -1, 162, -1, 160,
667 -1, 172, -1, 173, -1, 176, -1, 183, -1, 85,
668 86, -1, -1, -1, 85, 164, 171, 165, 86, -1,
669 170, -1, 162, -1, -1, 168, 170, -1, -1, 169,
670 162, -1, 85, 86, -1, 85, 171, 86, -1, 161,
671 -1, 171, 161, -1, 91, -1, 133, 91, -1, 18,
672 81, 133, 82, 174, -1, 167, 16, 167, -1, 167,
673 -1, 133, -1, 146, 54, 90, 159, -1, -1, 46,
674 81, 177, 175, 82, 166, -1, -1, 15, 178, 167,
675 46, 81, 133, 82, 91, -1, -1, 17, 81, 179,
676 180, 182, 82, 166, -1, 172, -1, 160, -1, 175,
677 -1, -1, 181, 91, -1, 181, 91, 133, -1, 14,
678 91, -1, 13, 91, -1, 20, 91, -1, 20, 133,
679 91, -1, 19, 91, -1, 185, -1, 184, 185, -1,
680 186, -1, 135, -1, -1, 136, 187, 170, -1
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000681};
682
683/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
684static const yytype_uint16 yyrline[] =
685{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000686 0, 184, 184, 219, 222, 235, 240, 245, 251, 254,
687 333, 336, 437, 447, 460, 468, 568, 571, 579, 583,
688 590, 594, 601, 607, 616, 624, 679, 686, 696, 699,
689 709, 719, 740, 741, 742, 747, 748, 757, 769, 770,
690 778, 789, 793, 794, 804, 814, 824, 837, 838, 848,
691 861, 865, 869, 873, 874, 887, 888, 901, 902, 915,
692 916, 933, 934, 947, 948, 949, 950, 951, 955, 958,
693 969, 977, 1004, 1009, 1023, 1061, 1064, 1071, 1079, 1100,
694 1121, 1132, 1161, 1166, 1176, 1181, 1191, 1194, 1197, 1200,
695 1206, 1213, 1216, 1238, 1256, 1280, 1303, 1307, 1325, 1333,
696 1365, 1385, 1474, 1483, 1506, 1509, 1516, 1525, 1534, 1542,
697 1552, 1559, 1562, 1565, 1571, 1574, 1589, 1593, 1597, 1601,
698 1610, 1615, 1620, 1625, 1630, 1635, 1640, 1645, 1650, 1655,
699 1661, 1667, 1673, 1678, 1683, 1692, 1701, 1706, 1719, 1719,
700 1733, 1733, 1742, 1745, 1760, 1796, 1800, 1806, 1814, 1830,
701 1834, 1838, 1839, 1845, 1846, 1847, 1848, 1849, 1853, 1854,
702 1854, 1854, 1864, 1865, 1869, 1869, 1870, 1870, 1875, 1878,
703 1888, 1891, 1897, 1898, 1902, 1910, 1914, 1924, 1929, 1946,
704 1946, 1951, 1951, 1958, 1958, 1966, 1969, 1975, 1978, 1984,
705 1988, 1995, 2002, 2009, 2016, 2027, 2036, 2040, 2047, 2050,
706 2056, 2056
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000707};
708#endif
709
710#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
711/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
712 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
713static const char *const yytname[] =
714{
715 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
716 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
717 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE",
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000718 "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "SWITCH", "CASE",
719 "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2",
720 "VEC3", "VEC4", "MATRIX2", "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL",
721 "INOUT_QUAL", "UNIFORM", "VARYING", "CENTROID", "FLAT", "SMOOTH",
722 "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE",
723 "SAMPLER_EXTERNAL_OES", "SAMPLER2DRECT", "SAMPLER3D", "SAMPLER3DRECT",
724 "SAMPLER2DSHADOW", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
725 "INTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
726 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
727 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
728 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
729 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
730 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
731 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
732 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
733 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000734 "primary_expression", "postfix_expression", "integer_expression",
735 "function_call", "function_call_or_method", "function_call_generic",
736 "function_call_header_no_parameters",
737 "function_call_header_with_parameters", "function_call_header",
738 "function_identifier", "unary_expression", "unary_operator",
739 "multiplicative_expression", "additive_expression", "shift_expression",
740 "relational_expression", "equality_expression", "and_expression",
741 "exclusive_or_expression", "inclusive_or_expression",
742 "logical_and_expression", "logical_xor_expression",
743 "logical_or_expression", "conditional_expression",
744 "assignment_expression", "assignment_operator", "expression",
745 "constant_expression", "declaration", "function_prototype",
746 "function_declarator", "function_header_with_parameters",
747 "function_header", "parameter_declarator", "parameter_declaration",
748 "parameter_qualifier", "parameter_type_specifier",
749 "init_declarator_list", "single_declaration", "fully_specified_type",
750 "type_qualifier", "type_specifier", "precision_qualifier",
751 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000752 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000753 "struct_declarator_list", "struct_declarator", "initializer",
754 "declaration_statement", "statement", "simple_statement",
daniel@transgaming.com05bc2042012-03-09 21:56:58 +0000755 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000756 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
757 "statement_list", "expression_statement", "selection_statement",
758 "selection_rest_statement", "condition", "iteration_statement", "$@7",
759 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000760 "jump_statement", "translation_unit", "external_declaration",
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000761 "function_definition", "$@10", 0
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000762};
763#endif
764
765# ifdef YYPRINT
766/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
767 token YYLEX-NUM. */
768static const yytype_uint16 yytoknum[] =
769{
770 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
771 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
772 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
773 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
774 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
775 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
776 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
777 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
778 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000779 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
780 355, 356, 357, 358, 359
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000781};
782# endif
783
784/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
785static const yytype_uint8 yyr1[] =
786{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000787 0, 105, 106, 107, 107, 107, 107, 107, 108, 108,
788 108, 108, 108, 108, 109, 110, 111, 111, 112, 112,
789 113, 113, 114, 114, 115, 116, 116, 116, 117, 117,
790 117, 117, 118, 118, 118, 119, 119, 119, 120, 120,
791 120, 121, 122, 122, 122, 122, 122, 123, 123, 123,
792 124, 125, 126, 127, 127, 128, 128, 129, 129, 130,
793 130, 131, 131, 132, 132, 132, 132, 132, 133, 133,
794 134, 135, 135, 135, 136, 137, 137, 138, 138, 139,
795 140, 140, 141, 141, 141, 141, 142, 142, 142, 142,
796 143, 144, 144, 144, 144, 144, 145, 145, 145, 145,
797 145, 145, 146, 146, 147, 147, 147, 147, 147, 148,
798 148, 149, 149, 149, 150, 150, 151, 151, 151, 151,
799 151, 151, 151, 151, 151, 151, 151, 151, 151, 151,
800 151, 151, 151, 151, 151, 151, 151, 151, 153, 152,
801 154, 152, 155, 155, 156, 157, 157, 158, 158, 159,
802 160, 161, 161, 162, 162, 162, 162, 162, 163, 164,
803 165, 163, 166, 166, 168, 167, 169, 167, 170, 170,
804 171, 171, 172, 172, 173, 174, 174, 175, 175, 177,
805 176, 178, 176, 179, 176, 180, 180, 181, 181, 182,
806 182, 183, 183, 183, 183, 183, 184, 184, 185, 185,
807 187, 186
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000808};
809
810/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
811static const yytype_uint8 yyr2[] =
812{
813 0, 2, 1, 1, 1, 1, 1, 3, 1, 4,
814 1, 3, 2, 2, 1, 1, 1, 3, 2, 2,
815 2, 1, 2, 3, 2, 1, 1, 1, 1, 2,
816 2, 2, 1, 1, 1, 1, 3, 3, 1, 3,
817 3, 1, 1, 3, 3, 3, 3, 1, 3, 3,
818 1, 1, 1, 1, 3, 1, 3, 1, 3, 1,
819 5, 1, 3, 1, 1, 1, 1, 1, 1, 3,
820 1, 2, 2, 4, 2, 1, 1, 2, 3, 3,
821 2, 5, 3, 2, 3, 2, 0, 1, 1, 1,
822 1, 1, 3, 5, 6, 5, 1, 2, 4, 5,
823 4, 2, 1, 2, 1, 1, 1, 2, 1, 1,
824 2, 1, 1, 1, 1, 4, 1, 1, 1, 1,
825 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000826 1, 1, 1, 1, 1, 1, 1, 1, 0, 6,
827 0, 5, 1, 2, 3, 1, 3, 1, 4, 1,
828 1, 1, 1, 1, 1, 1, 1, 1, 2, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000829 0, 5, 1, 1, 0, 2, 0, 2, 2, 3,
830 1, 2, 1, 2, 5, 3, 1, 1, 4, 0,
831 6, 0, 8, 0, 7, 1, 1, 1, 0, 2,
832 3, 2, 2, 2, 3, 2, 1, 2, 1, 1,
833 0, 3
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000834};
835
836/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
837 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
838 means the default is an error. */
839static const yytype_uint8 yydefact[] =
840{
841 0, 0, 111, 112, 113, 0, 105, 104, 119, 117,
842 118, 123, 124, 125, 126, 127, 128, 120, 121, 122,
zmo@google.com09c323a2011-08-12 18:22:25 +0000843 129, 130, 131, 108, 106, 0, 116, 132, 133, 134,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000844 135, 137, 199, 200, 0, 76, 86, 0, 91, 96,
845 0, 102, 0, 109, 114, 136, 0, 196, 198, 107,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000846 101, 0, 0, 140, 71, 0, 74, 86, 0, 87,
847 88, 89, 77, 0, 86, 0, 72, 97, 103, 110,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000848 0, 1, 197, 0, 138, 0, 0, 201, 78, 83,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000849 85, 90, 0, 92, 79, 0, 0, 2, 5, 4,
850 6, 27, 0, 0, 0, 34, 33, 32, 3, 8,
851 28, 10, 15, 16, 0, 0, 21, 0, 35, 0,
852 38, 41, 42, 47, 50, 51, 52, 53, 55, 57,
853 59, 70, 0, 25, 73, 0, 0, 0, 142, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000854 0, 181, 0, 0, 0, 0, 0, 159, 168, 172,
855 35, 61, 68, 0, 150, 0, 114, 153, 170, 152,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000856 151, 0, 154, 155, 156, 157, 80, 82, 84, 0,
857 0, 98, 0, 149, 100, 29, 30, 0, 12, 13,
858 0, 0, 19, 18, 0, 20, 22, 24, 31, 0,
kbr@chromium.org476541f2011-10-27 21:14:51 +0000859 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000860 0, 0, 0, 115, 0, 147, 0, 145, 141, 143,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000861 192, 191, 166, 183, 0, 195, 193, 0, 179, 158,
862 0, 64, 65, 66, 67, 63, 0, 0, 173, 169,
863 171, 0, 93, 0, 95, 99, 7, 0, 14, 26,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000864 11, 17, 23, 36, 37, 40, 39, 45, 46, 43,
865 44, 48, 49, 54, 56, 58, 0, 139, 0, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000866 144, 0, 0, 0, 0, 0, 194, 0, 160, 62,
867 69, 0, 94, 9, 0, 0, 146, 0, 165, 167,
868 186, 185, 188, 166, 177, 0, 0, 0, 81, 60,
869 148, 0, 187, 0, 0, 176, 174, 0, 0, 161,
870 0, 189, 0, 166, 0, 163, 180, 162, 0, 190,
871 184, 175, 178, 182
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000872};
873
874/* YYDEFGOTO[NTERM-NUM]. */
875static const yytype_int16 yydefgoto[] =
876{
kbr@chromium.org205fef32011-11-22 20:50:02 +0000877 -1, 98, 99, 100, 227, 101, 102, 103, 104, 105,
878 106, 107, 140, 109, 110, 111, 112, 113, 114, 115,
879 116, 117, 118, 119, 120, 141, 142, 216, 143, 122,
880 144, 145, 34, 35, 36, 79, 62, 63, 80, 37,
881 38, 39, 40, 41, 42, 43, 123, 45, 125, 75,
882 127, 128, 196, 197, 164, 147, 148, 149, 150, 210,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000883 277, 296, 251, 252, 253, 297, 151, 152, 153, 286,
884 276, 154, 257, 202, 254, 272, 283, 284, 155, 46,
885 47, 48, 55
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000886};
887
888/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
889 STATE-NUM. */
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000890#define YYPACT_NINF -258
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000891static const yytype_int16 yypact[] =
892{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000893 1383, -29, -258, -258, -258, 126, -258, -258, -258, -258,
894 -258, -258, -258, -258, -258, -258, -258, -258, -258, -258,
895 -258, -258, -258, -258, -258, -48, -258, -258, -258, -258,
896 -258, -258, -258, -74, -32, 25, 19, 15, -258, 68,
897 1430, -258, 1512, -258, 45, -258, 1330, -258, -258, -258,
898 -258, 1512, 65, -258, -258, 74, -258, 71, 117, -258,
899 -258, -258, -258, 1430, 116, 112, -258, 6, -258, -258,
900 1123, -258, -258, 78, -258, 1430, 290, -258, -258, -258,
901 -258, 118, 1430, -2, -258, 901, 1123, 89, -258, -258,
902 -258, -258, 1123, 1123, 1123, -258, -258, -258, -258, -258,
903 7, -258, -258, -258, 91, -64, 1195, 90, -258, 1123,
904 -58, -22, -258, -33, -5, -258, -258, -258, 106, 108,
905 -60, -258, 92, -258, -258, 1430, 125, 191, -258, 93,
906 94, -258, 102, 105, 96, 976, 107, 104, -258, -258,
907 12, -258, -258, 32, -258, -74, 75, -258, -258, -258,
908 -258, 383, -258, -258, -258, -258, 109, -258, -258, 1048,
909 1123, -258, 121, -258, -258, -258, -258, -35, -258, -258,
910 1123, 1471, -258, -258, 1123, 110, -258, -258, -258, 1123,
911 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123, 1123,
912 1123, 1123, 1123, -258, 1267, 123, 33, -258, -258, -258,
913 -258, -258, 115, -258, 1123, -258, -258, 38, -258, -258,
914 476, -258, -258, -258, -258, -258, 1123, 1123, -258, -258,
915 -258, 1123, -258, 124, -258, -258, -258, 128, 119, -258,
916 132, -258, -258, -258, -258, -58, -58, -258, -258, -258,
917 -258, -33, -33, -258, 106, 108, 72, -258, 1123, 125,
918 -258, 147, 74, 662, 755, 16, -258, 829, 476, -258,
919 -258, 130, -258, -258, 1123, 143, -258, 148, -258, -258,
920 -258, -258, 829, 115, 119, 155, 146, 144, -258, -258,
921 -258, 1123, -258, 140, 150, 217, -258, 152, 569, -258,
922 17, 1123, 569, 115, 1123, -258, -258, -258, 153, 119,
923 -258, -258, -258, -258
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000924};
925
926/* YYPGOTO[NTERM-NUM]. */
927static const yytype_int16 yypgoto[] =
928{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000929 -258, -258, -258, -258, -258, -258, -258, 63, -258, -258,
930 -258, -258, -44, -258, -19, -258, -67, -20, -258, -258,
931 -258, 48, 53, 54, -258, -66, -83, -258, -92, -73,
932 8, 14, -258, -258, -258, 165, 192, 184, 168, -258,
933 -258, -237, -23, -30, 246, -21, 0, -258, -258, -258,
934 127, -122, -258, 10, -145, 1, -144, -224, -258, -258,
935 -258, -36, -257, -258, -258, -54, 50, 9, -258, -258,
936 -11, -258, -258, -258, -258, -258, -258, -258, -258, -258,
937 216, -258, -258
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000938};
939
940/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
941 positive, shift that token. If negative, reduce the rule which
942 number is the opposite. If zero, do what YYDEFACT says.
943 If YYTABLE_NINF, syntax error. */
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000944#define YYTABLE_NINF -165
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000945static const yytype_int16 yytable[] =
946{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000947 44, 77, 167, 163, 121, 199, 52, 220, 32, 191,
948 68, 49, 162, 64, 33, 224, 285, 54, 173, 121,
949 275, 69, 58, 176, 174, 50, 108, 6, 7, 269,
950 73, 183, 184, 81, 64, 275, 301, 53, 179, 180,
951 44, 108, 44, 207, 192, 126, 44, 226, 165, 166,
952 56, 44, 81, 217, 32, 59, 60, 61, 23, 24,
953 33, 187, 188, 44, 295, 178, 185, 186, 295, 168,
954 169, 181, 199, 182, 58, 44, 146, 163, 228, 6,
955 7, 159, 44, 211, 212, 213, 223, 84, 160, 85,
956 170, 232, 214, 121, 171, 126, 86, 126, 273, 298,
957 246, -75, 215, 65, 217, 217, 66, 59, 60, 61,
958 23, 24, 255, 57, 220, 108, 237, 238, 239, 240,
959 217, 249, 67, 218, 250, 44, 217, 44, 70, 256,
960 2, 3, 4, 259, 260, 233, 234, 108, 108, 108,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000961 108, 108, 108, 108, 108, 108, 108, 108, 261, 302,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000962 74, 146, 59, 60, 61, 121, -25, 49, 70, 76,
963 217, 264, 235, 236, 126, 274, 83, 241, 242, 124,
964 -26, 177, 156, 172, 189, 265, 193, 108, 190, 195,
965 274, 279, 121, 203, 200, 201, 204, 205, 208, 290,
966 209, -116, 221, 267, 44, 2, 3, 4, 268, 299,
967 -164, 8, 9, 10, 108, 225, 248, 217, 262, 287,
968 146, 163, 263, -27, 278, 11, 12, 13, 14, 15,
969 16, 17, 18, 19, 20, 21, 22, 280, 288, 281,
970 289, 291, 292, 293, 231, 25, 26, 243, 27, 28,
971 29, 30, 294, 244, 303, 245, 31, 157, 82, 78,
972 158, 51, 194, 146, 146, 270, 300, 146, 146, 266,
973 258, 282, 72, 271, 0, 0, 0, 0, 0, 0,
974 0, 0, 146, 0, 0, 0, 0, 198, 0, 0,
975 0, 0, 0, 0, 0, 0, 0, 0, 146, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000976 0, 0, 146, 1, 2, 3, 4, 5, 6, 7,
977 8, 9, 10, 129, 130, 131, 0, 132, 133, 134,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000978 135, 0, 0, 0, 11, 12, 13, 14, 15, 16,
979 17, 18, 19, 20, 21, 22, 0, 0, 0, 23,
980 24, 0, 0, 0, 25, 26, 136, 27, 28, 29,
981 30, 0, 0, 0, 87, 31, 88, 89, 90, 91,
982 0, 0, 92, 93, 0, 0, 0, 0, 0, 0,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +0000983 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000984 0, 94, 0, 0, 0, 137, 138, 0, 0, 0,
985 0, 139, 95, 96, 0, 97, 1, 2, 3, 4,
986 5, 6, 7, 8, 9, 10, 129, 130, 131, 0,
987 132, 133, 134, 135, 0, 0, 0, 11, 12, 13,
988 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
989 0, 0, 23, 24, 0, 0, 0, 25, 26, 136,
990 27, 28, 29, 30, 0, 0, 0, 87, 31, 88,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000991 89, 90, 91, 0, 0, 92, 93, 0, 0, 0,
kbr@chromium.org205fef32011-11-22 20:50:02 +0000992 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000993 0, 0, 0, 0, 94, 0, 0, 0, 137, 219,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +0000994 0, 0, 0, 0, 139, 95, 96, 0, 97, 1,
995 2, 3, 4, 5, 6, 7, 8, 9, 10, 129,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +0000996 130, 131, 0, 132, 133, 134, 135, 0, 0, 0,
997 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
998 21, 22, 0, 0, 0, 23, 24, 0, 0, 0,
999 25, 26, 136, 27, 28, 29, 30, 0, 0, 0,
1000 87, 31, 88, 89, 90, 91, 0, 0, 92, 93,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001001 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001002 0, 0, 0, 0, 0, 0, 0, 94, 0, 0,
1003 0, 137, 0, 0, 0, 0, 0, 139, 95, 96,
1004 0, 97, 1, 2, 3, 4, 5, 6, 7, 8,
1005 9, 10, 129, 130, 131, 0, 132, 133, 134, 135,
1006 0, 0, 0, 11, 12, 13, 14, 15, 16, 17,
1007 18, 19, 20, 21, 22, 0, 0, 0, 23, 24,
1008 0, 0, 0, 25, 26, 136, 27, 28, 29, 30,
1009 0, 0, 0, 87, 31, 88, 89, 90, 91, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001010 0, 92, 93, 0, 0, 0, 0, 0, 0, 0,
1011 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001012 94, 0, 0, 0, 76, 0, 0, 0, 0, 0,
1013 139, 95, 96, 0, 97, 1, 2, 3, 4, 5,
1014 6, 7, 8, 9, 10, 129, 130, 131, 0, 132,
1015 133, 134, 135, 0, 0, 0, 11, 12, 13, 14,
1016 15, 16, 17, 18, 19, 20, 21, 22, 0, 0,
1017 0, 23, 24, 0, 0, 0, 25, 26, 136, 27,
1018 28, 29, 30, 0, 0, 0, 87, 31, 88, 89,
1019 90, 91, 0, 0, 92, 93, 0, 0, 0, 0,
1020 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1021 0, 0, 0, 94, 0, 0, 0, 0, 0, 0,
1022 0, 0, 0, 139, 95, 96, 0, 97, 1, 2,
1023 3, 4, 5, 6, 7, 8, 9, 10, 0, 0,
1024 0, 0, 0, 0, 0, 0, 0, 0, 0, 11,
1025 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1026 22, 0, 0, 0, 23, 24, 0, 0, 0, 25,
1027 26, 0, 27, 28, 29, 30, 0, 0, 0, 87,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001028 31, 88, 89, 90, 91, 0, 0, 92, 93, 0,
1029 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001030 0, 0, 58, 2, 3, 4, 94, 6, 7, 8,
1031 9, 10, 0, 0, 0, 0, 139, 95, 96, 0,
1032 97, 0, 0, 11, 12, 13, 14, 15, 16, 17,
1033 18, 19, 20, 21, 22, 0, 0, 0, 23, 24,
1034 0, 0, 0, 25, 26, 0, 27, 28, 29, 30,
1035 0, 0, 0, 87, 31, 88, 89, 90, 91, 0,
1036 0, 92, 93, 0, 0, 0, 0, 0, 0, 0,
1037 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1038 94, 8, 9, 10, 0, 0, 0, 0, 0, 0,
1039 0, 95, 96, 0, 97, 11, 12, 13, 14, 15,
1040 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
1041 0, 0, 0, 0, 0, 25, 26, 0, 27, 28,
1042 29, 30, 0, 0, 0, 87, 31, 88, 89, 90,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001043 91, 0, 0, 92, 93, 0, 0, 0, 0, 0,
1044 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001045 0, 0, 94, 0, 0, 161, 8, 9, 10, 0,
1046 0, 0, 0, 95, 96, 0, 97, 0, 0, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001047 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001048 21, 22, 0, 0, 0, 0, 0, 0, 0, 0,
1049 25, 26, 0, 27, 28, 29, 30, 0, 0, 0,
1050 87, 31, 88, 89, 90, 91, 0, 0, 92, 93,
1051 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1052 0, 0, 0, 0, 0, 0, 0, 94, 8, 9,
1053 10, 0, 0, 0, 0, 0, 0, 206, 95, 96,
1054 0, 97, 11, 12, 13, 14, 15, 16, 17, 18,
1055 19, 20, 21, 22, 0, 0, 0, 0, 0, 0,
1056 0, 0, 25, 26, 0, 27, 28, 29, 30, 0,
1057 0, 0, 87, 31, 88, 89, 90, 91, 0, 0,
1058 92, 93, 0, 0, 0, 0, 0, 0, 0, 0,
1059 0, 0, 0, 0, 0, 0, 0, 0, 0, 94,
1060 0, 0, 222, 8, 9, 10, 0, 0, 0, 0,
1061 95, 96, 0, 97, 0, 0, 0, 11, 12, 13,
1062 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
1063 0, 0, 0, 0, 0, 0, 0, 25, 26, 0,
1064 27, 28, 29, 30, 0, 0, 0, 87, 31, 88,
1065 89, 90, 91, 0, 0, 92, 93, 0, 0, 0,
1066 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1067 0, 0, 0, 0, 94, 8, 9, 10, 0, 0,
1068 0, 0, 0, 0, 0, 95, 96, 0, 97, 11,
1069 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1070 22, 0, 0, 0, 0, 0, 0, 0, 0, 25,
1071 175, 0, 27, 28, 29, 30, 0, 0, 0, 87,
1072 31, 88, 89, 90, 91, 0, 0, 92, 93, 0,
1073 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1074 0, 2, 3, 4, 0, 0, 94, 8, 9, 10,
1075 0, 0, 0, 0, 0, 0, 0, 95, 96, 0,
1076 97, 11, 12, 13, 14, 15, 16, 17, 18, 19,
1077 20, 21, 22, 0, 0, 0, 0, 0, 0, 0,
1078 0, 25, 26, 0, 27, 28, 29, 30, 0, 0,
1079 0, 0, 31, 0, 0, 0, 0, 0, 0, 0,
1080 71, 0, 0, 1, 2, 3, 4, 5, 6, 7,
1081 8, 9, 10, 0, 0, 0, 0, 0, 0, 0,
1082 0, 0, 0, 247, 11, 12, 13, 14, 15, 16,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001083 17, 18, 19, 20, 21, 22, 0, 0, 0, 23,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001084 24, 0, 0, 0, 25, 26, 0, 27, 28, 29,
1085 30, 0, 0, 0, 0, 31, 1, 2, 3, 4,
1086 5, 6, 7, 8, 9, 10, 0, 0, 0, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001087 0, 0, 0, 0, 0, 0, 0, 11, 12, 13,
1088 14, 15, 16, 17, 18, 19, 20, 21, 22, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001089 0, 0, 23, 24, 0, 0, 0, 25, 26, 0,
1090 27, 28, 29, 30, 2, 3, 4, 0, 31, 0,
1091 8, 9, 10, 0, 0, 0, 0, 0, 0, 0,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001092 0, 0, 0, 0, 11, 12, 13, 14, 15, 16,
1093 17, 18, 19, 20, 21, 22, 0, 0, 0, 0,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001094 0, 0, 0, 0, 25, 26, 0, 27, 28, 29,
1095 30, 8, 9, 10, 0, 31, 0, 0, 0, 0,
1096 0, 0, 0, 0, 0, 11, 12, 13, 14, 15,
1097 16, 17, 18, 19, 20, 21, 22, 0, 0, 0,
1098 0, 0, 0, 0, 0, 25, 26, 0, 27, 28,
1099 29, 30, 8, 9, 10, 229, 31, 0, 0, 0,
1100 230, 0, 0, 0, 0, 0, 11, 12, 13, 14,
1101 15, 16, 17, 18, 19, 20, 21, 22, 0, 0,
1102 0, 0, 0, 0, 0, 0, 25, 26, 0, 27,
1103 28, 29, 30, 0, 0, 0, 0, 31
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001104};
1105
1106static const yytype_int16 yycheck[] =
1107{
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001108 0, 55, 94, 86, 70, 127, 54, 151, 0, 69,
1109 40, 40, 85, 36, 0, 160, 273, 91, 82, 85,
1110 257, 42, 3, 106, 88, 54, 70, 8, 9, 253,
1111 51, 64, 65, 63, 57, 272, 293, 85, 96, 97,
1112 40, 85, 42, 135, 104, 75, 46, 82, 92, 93,
1113 82, 51, 82, 88, 46, 36, 37, 38, 39, 40,
1114 46, 66, 67, 63, 288, 109, 99, 100, 292, 62,
1115 63, 93, 194, 95, 3, 75, 76, 160, 170, 8,
1116 9, 83, 82, 71, 72, 73, 159, 81, 90, 83,
1117 83, 174, 80, 159, 87, 125, 90, 127, 82, 82,
1118 192, 82, 90, 88, 88, 88, 91, 36, 37, 38,
1119 39, 40, 204, 88, 258, 159, 183, 184, 185, 186,
1120 88, 88, 54, 91, 91, 125, 88, 127, 83, 91,
1121 4, 5, 6, 216, 217, 179, 180, 181, 182, 183,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001122 184, 185, 186, 187, 188, 189, 190, 191, 221, 294,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001123 85, 151, 36, 37, 38, 221, 81, 40, 83, 85,
1124 88, 89, 181, 182, 194, 257, 54, 187, 188, 91,
1125 81, 81, 54, 82, 68, 248, 84, 221, 70, 54,
1126 272, 264, 248, 81, 91, 91, 81, 91, 81, 281,
1127 86, 81, 83, 46, 194, 4, 5, 6, 252, 291,
1128 85, 10, 11, 12, 248, 84, 83, 88, 84, 54,
1129 210, 294, 84, 81, 84, 24, 25, 26, 27, 28,
1130 29, 30, 31, 32, 33, 34, 35, 84, 82, 81,
1131 86, 91, 82, 16, 171, 44, 45, 189, 47, 48,
1132 49, 50, 90, 190, 91, 191, 55, 82, 64, 57,
1133 82, 5, 125, 253, 254, 254, 292, 257, 258, 249,
1134 210, 272, 46, 254, -1, -1, -1, -1, -1, -1,
1135 -1, -1, 272, -1, -1, -1, -1, 86, -1, -1,
1136 -1, -1, -1, -1, -1, -1, -1, -1, 288, -1,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001137 -1, -1, 292, 3, 4, 5, 6, 7, 8, 9,
1138 10, 11, 12, 13, 14, 15, -1, 17, 18, 19,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001139 20, -1, -1, -1, 24, 25, 26, 27, 28, 29,
1140 30, 31, 32, 33, 34, 35, -1, -1, -1, 39,
1141 40, -1, -1, -1, 44, 45, 46, 47, 48, 49,
1142 50, -1, -1, -1, 54, 55, 56, 57, 58, 59,
1143 -1, -1, 62, 63, -1, -1, -1, -1, -1, -1,
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001144 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001145 -1, 81, -1, -1, -1, 85, 86, -1, -1, -1,
1146 -1, 91, 92, 93, -1, 95, 3, 4, 5, 6,
1147 7, 8, 9, 10, 11, 12, 13, 14, 15, -1,
1148 17, 18, 19, 20, -1, -1, -1, 24, 25, 26,
1149 27, 28, 29, 30, 31, 32, 33, 34, 35, -1,
1150 -1, -1, 39, 40, -1, -1, -1, 44, 45, 46,
1151 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1152 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
zmo@google.com09c323a2011-08-12 18:22:25 +00001153 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001154 -1, -1, -1, -1, 81, -1, -1, -1, 85, 86,
1155 -1, -1, -1, -1, 91, 92, 93, -1, 95, 3,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001156 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001157 14, 15, -1, 17, 18, 19, 20, -1, -1, -1,
1158 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1159 34, 35, -1, -1, -1, 39, 40, -1, -1, -1,
1160 44, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1161 54, 55, 56, 57, 58, 59, -1, -1, 62, 63,
1162 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1163 -1, -1, -1, -1, -1, -1, -1, 81, -1, -1,
1164 -1, 85, -1, -1, -1, -1, -1, 91, 92, 93,
1165 -1, 95, 3, 4, 5, 6, 7, 8, 9, 10,
1166 11, 12, 13, 14, 15, -1, 17, 18, 19, 20,
1167 -1, -1, -1, 24, 25, 26, 27, 28, 29, 30,
1168 31, 32, 33, 34, 35, -1, -1, -1, 39, 40,
1169 -1, -1, -1, 44, 45, 46, 47, 48, 49, 50,
1170 -1, -1, -1, 54, 55, 56, 57, 58, 59, -1,
1171 -1, 62, 63, -1, -1, -1, -1, -1, -1, -1,
1172 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1173 81, -1, -1, -1, 85, -1, -1, -1, -1, -1,
1174 91, 92, 93, -1, 95, 3, 4, 5, 6, 7,
1175 8, 9, 10, 11, 12, 13, 14, 15, -1, 17,
1176 18, 19, 20, -1, -1, -1, 24, 25, 26, 27,
1177 28, 29, 30, 31, 32, 33, 34, 35, -1, -1,
1178 -1, 39, 40, -1, -1, -1, 44, 45, 46, 47,
1179 48, 49, 50, -1, -1, -1, 54, 55, 56, 57,
1180 58, 59, -1, -1, 62, 63, -1, -1, -1, -1,
1181 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1182 -1, -1, -1, 81, -1, -1, -1, -1, -1, -1,
1183 -1, -1, -1, 91, 92, 93, -1, 95, 3, 4,
1184 5, 6, 7, 8, 9, 10, 11, 12, -1, -1,
1185 -1, -1, -1, -1, -1, -1, -1, -1, -1, 24,
1186 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1187 35, -1, -1, -1, 39, 40, -1, -1, -1, 44,
1188 45, -1, 47, 48, 49, 50, -1, -1, -1, 54,
1189 55, 56, 57, 58, 59, -1, -1, 62, 63, -1,
1190 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1191 -1, -1, 3, 4, 5, 6, 81, 8, 9, 10,
1192 11, 12, -1, -1, -1, -1, 91, 92, 93, -1,
1193 95, -1, -1, 24, 25, 26, 27, 28, 29, 30,
1194 31, 32, 33, 34, 35, -1, -1, -1, 39, 40,
1195 -1, -1, -1, 44, 45, -1, 47, 48, 49, 50,
1196 -1, -1, -1, 54, 55, 56, 57, 58, 59, -1,
1197 -1, 62, 63, -1, -1, -1, -1, -1, -1, -1,
1198 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1199 81, 10, 11, 12, -1, -1, -1, -1, -1, -1,
1200 -1, 92, 93, -1, 95, 24, 25, 26, 27, 28,
1201 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
1202 -1, -1, -1, -1, -1, 44, 45, -1, 47, 48,
1203 49, 50, -1, -1, -1, 54, 55, 56, 57, 58,
1204 59, -1, -1, 62, 63, -1, -1, -1, -1, -1,
1205 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1206 -1, -1, 81, -1, -1, 84, 10, 11, 12, -1,
1207 -1, -1, -1, 92, 93, -1, 95, -1, -1, -1,
1208 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1209 34, 35, -1, -1, -1, -1, -1, -1, -1, -1,
1210 44, 45, -1, 47, 48, 49, 50, -1, -1, -1,
1211 54, 55, 56, 57, 58, 59, -1, -1, 62, 63,
1212 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1213 -1, -1, -1, -1, -1, -1, -1, 81, 10, 11,
1214 12, -1, -1, -1, -1, -1, -1, 91, 92, 93,
1215 -1, 95, 24, 25, 26, 27, 28, 29, 30, 31,
1216 32, 33, 34, 35, -1, -1, -1, -1, -1, -1,
1217 -1, -1, 44, 45, -1, 47, 48, 49, 50, -1,
1218 -1, -1, 54, 55, 56, 57, 58, 59, -1, -1,
1219 62, 63, -1, -1, -1, -1, -1, -1, -1, -1,
1220 -1, -1, -1, -1, -1, -1, -1, -1, -1, 81,
1221 -1, -1, 84, 10, 11, 12, -1, -1, -1, -1,
1222 92, 93, -1, 95, -1, -1, -1, 24, 25, 26,
1223 27, 28, 29, 30, 31, 32, 33, 34, 35, -1,
1224 -1, -1, -1, -1, -1, -1, -1, 44, 45, -1,
1225 47, 48, 49, 50, -1, -1, -1, 54, 55, 56,
1226 57, 58, 59, -1, -1, 62, 63, -1, -1, -1,
1227 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1228 -1, -1, -1, -1, 81, 10, 11, 12, -1, -1,
1229 -1, -1, -1, -1, -1, 92, 93, -1, 95, 24,
1230 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1231 35, -1, -1, -1, -1, -1, -1, -1, -1, 44,
1232 45, -1, 47, 48, 49, 50, -1, -1, -1, 54,
1233 55, 56, 57, 58, 59, -1, -1, 62, 63, -1,
1234 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1235 -1, 4, 5, 6, -1, -1, 81, 10, 11, 12,
1236 -1, -1, -1, -1, -1, -1, -1, 92, 93, -1,
1237 95, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1238 33, 34, 35, -1, -1, -1, -1, -1, -1, -1,
1239 -1, 44, 45, -1, 47, 48, 49, 50, -1, -1,
1240 -1, -1, 55, -1, -1, -1, -1, -1, -1, -1,
1241 0, -1, -1, 3, 4, 5, 6, 7, 8, 9,
kbr@chromium.org205fef32011-11-22 20:50:02 +00001242 10, 11, 12, -1, -1, -1, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001243 -1, -1, -1, 86, 24, 25, 26, 27, 28, 29,
1244 30, 31, 32, 33, 34, 35, -1, -1, -1, 39,
1245 40, -1, -1, -1, 44, 45, -1, 47, 48, 49,
1246 50, -1, -1, -1, -1, 55, 3, 4, 5, 6,
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00001247 7, 8, 9, 10, 11, 12, -1, -1, -1, -1,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001248 -1, -1, -1, -1, -1, -1, -1, 24, 25, 26,
1249 27, 28, 29, 30, 31, 32, 33, 34, 35, -1,
1250 -1, -1, 39, 40, -1, -1, -1, 44, 45, -1,
1251 47, 48, 49, 50, 4, 5, 6, -1, 55, -1,
1252 10, 11, 12, -1, -1, -1, -1, -1, -1, -1,
1253 -1, -1, -1, -1, 24, 25, 26, 27, 28, 29,
1254 30, 31, 32, 33, 34, 35, -1, -1, -1, -1,
1255 -1, -1, -1, -1, 44, 45, -1, 47, 48, 49,
1256 50, 10, 11, 12, -1, 55, -1, -1, -1, -1,
1257 -1, -1, -1, -1, -1, 24, 25, 26, 27, 28,
1258 29, 30, 31, 32, 33, 34, 35, -1, -1, -1,
1259 -1, -1, -1, -1, -1, 44, 45, -1, 47, 48,
1260 49, 50, 10, 11, 12, 54, 55, -1, -1, -1,
1261 59, -1, -1, -1, -1, -1, 24, 25, 26, 27,
1262 28, 29, 30, 31, 32, 33, 34, 35, -1, -1,
1263 -1, -1, -1, -1, -1, -1, 44, 45, -1, 47,
1264 48, 49, 50, -1, -1, -1, -1, 55
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001265};
1266
1267/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1268 symbol of state STATE-NUM. */
1269static const yytype_uint8 yystos[] =
1270{
1271 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00001272 12, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1273 33, 34, 35, 39, 40, 44, 45, 47, 48, 49,
1274 50, 55, 135, 136, 137, 138, 139, 144, 145, 146,
1275 147, 148, 149, 150, 151, 152, 184, 185, 186, 40,
1276 54, 149, 54, 85, 91, 187, 82, 88, 3, 36,
1277 37, 38, 141, 142, 147, 88, 91, 54, 148, 150,
1278 83, 0, 185, 150, 85, 154, 85, 170, 141, 140,
1279 143, 148, 142, 54, 81, 83, 90, 54, 56, 57,
1280 58, 59, 62, 63, 81, 92, 93, 95, 106, 107,
1281 108, 110, 111, 112, 113, 114, 115, 116, 117, 118,
1282 119, 120, 121, 122, 123, 124, 125, 126, 127, 128,
1283 129, 130, 134, 151, 91, 153, 148, 155, 156, 13,
1284 14, 15, 17, 18, 19, 20, 46, 85, 86, 91,
1285 117, 130, 131, 133, 135, 136, 151, 160, 161, 162,
1286 163, 171, 172, 173, 176, 183, 54, 140, 143, 83,
1287 90, 84, 134, 131, 159, 117, 117, 133, 62, 63,
1288 83, 87, 82, 82, 88, 45, 131, 81, 117, 96,
1289 97, 93, 95, 64, 65, 99, 100, 66, 67, 68,
1290 70, 69, 104, 84, 155, 54, 157, 158, 86, 156,
1291 91, 91, 178, 81, 81, 91, 91, 133, 81, 86,
1292 164, 71, 72, 73, 80, 90, 132, 88, 91, 86,
1293 161, 83, 84, 134, 159, 84, 82, 109, 133, 54,
1294 59, 112, 131, 117, 117, 119, 119, 121, 121, 121,
1295 121, 122, 122, 126, 127, 128, 133, 86, 83, 88,
1296 91, 167, 168, 169, 179, 133, 91, 177, 171, 131,
1297 131, 134, 84, 84, 89, 134, 158, 46, 170, 162,
1298 160, 172, 180, 82, 133, 146, 175, 165, 84, 131,
1299 84, 81, 175, 181, 182, 167, 174, 54, 82, 86,
1300 133, 91, 82, 16, 90, 162, 166, 170, 82, 133,
1301 166, 167, 159, 91
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001302};
1303
1304#define yyerrok (yyerrstatus = 0)
1305#define yyclearin (yychar = YYEMPTY)
1306#define YYEMPTY (-2)
1307#define YYEOF 0
1308
1309#define YYACCEPT goto yyacceptlab
1310#define YYABORT goto yyabortlab
1311#define YYERROR goto yyerrorlab
1312
1313
1314/* Like YYERROR except do call yyerror. This remains here temporarily
1315 to ease the transition to the new meaning of YYERROR, for GCC.
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001316 Once GCC version 2 has supplanted version 1, this can go. However,
1317 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1318 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1319 discussed. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001320
1321#define YYFAIL goto yyerrlab
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001322#if defined YYFAIL
1323 /* This is here to suppress warnings from the GCC cpp's
1324 -Wunused-macros. Normally we don't worry about that warning, but
1325 some users do, and we want to make it easy for users to remove
1326 YYFAIL uses, which will produce warnings from Bison 2.5. */
1327#endif
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001328
1329#define YYRECOVERING() (!!yyerrstatus)
1330
1331#define YYBACKUP(Token, Value) \
1332do \
1333 if (yychar == YYEMPTY && yylen == 1) \
1334 { \
1335 yychar = (Token); \
1336 yylval = (Value); \
1337 yytoken = YYTRANSLATE (yychar); \
1338 YYPOPSTACK (1); \
1339 goto yybackup; \
1340 } \
1341 else \
1342 { \
1343 yyerror (context, YY_("syntax error: cannot back up")); \
1344 YYERROR; \
1345 } \
1346while (YYID (0))
1347
1348
1349#define YYTERROR 1
1350#define YYERRCODE 256
1351
1352
1353/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1354 If N is 0, then set CURRENT to the empty location which ends
1355 the previous symbol: RHS[0] (always defined). */
1356
1357#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1358#ifndef YYLLOC_DEFAULT
1359# define YYLLOC_DEFAULT(Current, Rhs, N) \
1360 do \
1361 if (YYID (N)) \
1362 { \
1363 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1364 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1365 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1366 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1367 } \
1368 else \
1369 { \
1370 (Current).first_line = (Current).last_line = \
1371 YYRHSLOC (Rhs, 0).last_line; \
1372 (Current).first_column = (Current).last_column = \
1373 YYRHSLOC (Rhs, 0).last_column; \
1374 } \
1375 while (YYID (0))
1376#endif
1377
1378
1379/* YY_LOCATION_PRINT -- Print the location on the stream.
1380 This macro was not mandated originally: define only if we know
1381 we won't break user code: when these are the locations we know. */
1382
1383#ifndef YY_LOCATION_PRINT
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001384# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001385# define YY_LOCATION_PRINT(File, Loc) \
1386 fprintf (File, "%d.%d-%d.%d", \
1387 (Loc).first_line, (Loc).first_column, \
1388 (Loc).last_line, (Loc).last_column)
1389# else
1390# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1391# endif
1392#endif
1393
1394
1395/* YYLEX -- calling `yylex' with the right arguments. */
1396
1397#ifdef YYLEX_PARAM
1398# define YYLEX yylex (&yylval, YYLEX_PARAM)
1399#else
1400# define YYLEX yylex (&yylval)
1401#endif
1402
1403/* Enable debugging if requested. */
1404#if YYDEBUG
1405
1406# ifndef YYFPRINTF
1407# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1408# define YYFPRINTF fprintf
1409# endif
1410
1411# define YYDPRINTF(Args) \
1412do { \
1413 if (yydebug) \
1414 YYFPRINTF Args; \
1415} while (YYID (0))
1416
1417# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1418do { \
1419 if (yydebug) \
1420 { \
1421 YYFPRINTF (stderr, "%s ", Title); \
1422 yy_symbol_print (stderr, \
1423 Type, Value, context); \
1424 YYFPRINTF (stderr, "\n"); \
1425 } \
1426} while (YYID (0))
1427
1428
1429/*--------------------------------.
1430| Print this symbol on YYOUTPUT. |
1431`--------------------------------*/
1432
1433/*ARGSUSED*/
1434#if (defined __STDC__ || defined __C99__FUNC__ \
1435 || defined __cplusplus || defined _MSC_VER)
1436static void
1437yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1438#else
1439static void
1440yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1441 FILE *yyoutput;
1442 int yytype;
1443 YYSTYPE const * const yyvaluep;
1444 TParseContext* context;
1445#endif
1446{
1447 if (!yyvaluep)
1448 return;
1449 YYUSE (context);
1450# ifdef YYPRINT
1451 if (yytype < YYNTOKENS)
1452 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1453# else
1454 YYUSE (yyoutput);
1455# endif
1456 switch (yytype)
1457 {
1458 default:
1459 break;
1460 }
1461}
1462
1463
1464/*--------------------------------.
1465| Print this symbol on YYOUTPUT. |
1466`--------------------------------*/
1467
1468#if (defined __STDC__ || defined __C99__FUNC__ \
1469 || defined __cplusplus || defined _MSC_VER)
1470static void
1471yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1472#else
1473static void
1474yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1475 FILE *yyoutput;
1476 int yytype;
1477 YYSTYPE const * const yyvaluep;
1478 TParseContext* context;
1479#endif
1480{
1481 if (yytype < YYNTOKENS)
1482 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1483 else
1484 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1485
1486 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1487 YYFPRINTF (yyoutput, ")");
1488}
1489
1490/*------------------------------------------------------------------.
1491| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1492| TOP (included). |
1493`------------------------------------------------------------------*/
1494
1495#if (defined __STDC__ || defined __C99__FUNC__ \
1496 || defined __cplusplus || defined _MSC_VER)
1497static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001498yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001499#else
1500static void
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001501yy_stack_print (yybottom, yytop)
1502 yytype_int16 *yybottom;
1503 yytype_int16 *yytop;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001504#endif
1505{
1506 YYFPRINTF (stderr, "Stack now");
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001507 for (; yybottom <= yytop; yybottom++)
1508 {
1509 int yybot = *yybottom;
1510 YYFPRINTF (stderr, " %d", yybot);
1511 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001512 YYFPRINTF (stderr, "\n");
1513}
1514
1515# define YY_STACK_PRINT(Bottom, Top) \
1516do { \
1517 if (yydebug) \
1518 yy_stack_print ((Bottom), (Top)); \
1519} while (YYID (0))
1520
1521
1522/*------------------------------------------------.
1523| Report that the YYRULE is going to be reduced. |
1524`------------------------------------------------*/
1525
1526#if (defined __STDC__ || defined __C99__FUNC__ \
1527 || defined __cplusplus || defined _MSC_VER)
1528static void
1529yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1530#else
1531static void
1532yy_reduce_print (yyvsp, yyrule, context)
1533 YYSTYPE *yyvsp;
1534 int yyrule;
1535 TParseContext* context;
1536#endif
1537{
1538 int yynrhs = yyr2[yyrule];
1539 int yyi;
1540 unsigned long int yylno = yyrline[yyrule];
1541 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1542 yyrule - 1, yylno);
1543 /* The symbols being reduced. */
1544 for (yyi = 0; yyi < yynrhs; yyi++)
1545 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001546 YYFPRINTF (stderr, " $%d = ", yyi + 1);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001547 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1548 &(yyvsp[(yyi + 1) - (yynrhs)])
1549 , context);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001550 YYFPRINTF (stderr, "\n");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001551 }
1552}
1553
1554# define YY_REDUCE_PRINT(Rule) \
1555do { \
1556 if (yydebug) \
1557 yy_reduce_print (yyvsp, Rule, context); \
1558} while (YYID (0))
1559
1560/* Nonzero means print parse trace. It is left uninitialized so that
1561 multiple parsers can coexist. */
1562int yydebug;
1563#else /* !YYDEBUG */
1564# define YYDPRINTF(Args)
1565# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1566# define YY_STACK_PRINT(Bottom, Top)
1567# define YY_REDUCE_PRINT(Rule)
1568#endif /* !YYDEBUG */
1569
1570
1571/* YYINITDEPTH -- initial size of the parser's stacks. */
1572#ifndef YYINITDEPTH
1573# define YYINITDEPTH 200
1574#endif
1575
1576/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1577 if the built-in stack extension method is used).
1578
1579 Do not make this value too large; the results are undefined if
1580 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1581 evaluated with infinite-precision integer arithmetic. */
1582
1583#ifndef YYMAXDEPTH
1584# define YYMAXDEPTH 10000
1585#endif
1586
1587
1588
1589#if YYERROR_VERBOSE
1590
1591# ifndef yystrlen
1592# if defined __GLIBC__ && defined _STRING_H
1593# define yystrlen strlen
1594# else
1595/* Return the length of YYSTR. */
1596#if (defined __STDC__ || defined __C99__FUNC__ \
1597 || defined __cplusplus || defined _MSC_VER)
1598static YYSIZE_T
1599yystrlen (const char *yystr)
1600#else
1601static YYSIZE_T
1602yystrlen (yystr)
1603 const char *yystr;
1604#endif
1605{
1606 YYSIZE_T yylen;
1607 for (yylen = 0; yystr[yylen]; yylen++)
1608 continue;
1609 return yylen;
1610}
1611# endif
1612# endif
1613
1614# ifndef yystpcpy
1615# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1616# define yystpcpy stpcpy
1617# else
1618/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1619 YYDEST. */
1620#if (defined __STDC__ || defined __C99__FUNC__ \
1621 || defined __cplusplus || defined _MSC_VER)
1622static char *
1623yystpcpy (char *yydest, const char *yysrc)
1624#else
1625static char *
1626yystpcpy (yydest, yysrc)
1627 char *yydest;
1628 const char *yysrc;
1629#endif
1630{
1631 char *yyd = yydest;
1632 const char *yys = yysrc;
1633
1634 while ((*yyd++ = *yys++) != '\0')
1635 continue;
1636
1637 return yyd - 1;
1638}
1639# endif
1640# endif
1641
1642# ifndef yytnamerr
1643/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1644 quotes and backslashes, so that it's suitable for yyerror. The
1645 heuristic is that double-quoting is unnecessary unless the string
1646 contains an apostrophe, a comma, or backslash (other than
1647 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1648 null, do not copy; instead, return the length of what the result
1649 would have been. */
1650static YYSIZE_T
1651yytnamerr (char *yyres, const char *yystr)
1652{
1653 if (*yystr == '"')
1654 {
1655 YYSIZE_T yyn = 0;
1656 char const *yyp = yystr;
1657
1658 for (;;)
1659 switch (*++yyp)
1660 {
1661 case '\'':
1662 case ',':
1663 goto do_not_strip_quotes;
1664
1665 case '\\':
1666 if (*++yyp != '\\')
1667 goto do_not_strip_quotes;
1668 /* Fall through. */
1669 default:
1670 if (yyres)
1671 yyres[yyn] = *yyp;
1672 yyn++;
1673 break;
1674
1675 case '"':
1676 if (yyres)
1677 yyres[yyn] = '\0';
1678 return yyn;
1679 }
1680 do_not_strip_quotes: ;
1681 }
1682
1683 if (! yyres)
1684 return yystrlen (yystr);
1685
1686 return yystpcpy (yyres, yystr) - yyres;
1687}
1688# endif
1689
1690/* Copy into YYRESULT an error message about the unexpected token
1691 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1692 including the terminating null byte. If YYRESULT is null, do not
1693 copy anything; just return the number of bytes that would be
1694 copied. As a special case, return 0 if an ordinary "syntax error"
1695 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1696 size calculation. */
1697static YYSIZE_T
1698yysyntax_error (char *yyresult, int yystate, int yychar)
1699{
1700 int yyn = yypact[yystate];
1701
1702 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1703 return 0;
1704 else
1705 {
1706 int yytype = YYTRANSLATE (yychar);
1707 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1708 YYSIZE_T yysize = yysize0;
1709 YYSIZE_T yysize1;
1710 int yysize_overflow = 0;
1711 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1712 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1713 int yyx;
1714
1715# if 0
1716 /* This is so xgettext sees the translatable formats that are
1717 constructed on the fly. */
1718 YY_("syntax error, unexpected %s");
1719 YY_("syntax error, unexpected %s, expecting %s");
1720 YY_("syntax error, unexpected %s, expecting %s or %s");
1721 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1722 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1723# endif
1724 char *yyfmt;
1725 char const *yyf;
1726 static char const yyunexpected[] = "syntax error, unexpected %s";
1727 static char const yyexpecting[] = ", expecting %s";
1728 static char const yyor[] = " or %s";
1729 char yyformat[sizeof yyunexpected
1730 + sizeof yyexpecting - 1
1731 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1732 * (sizeof yyor - 1))];
1733 char const *yyprefix = yyexpecting;
1734
1735 /* Start YYX at -YYN if negative to avoid negative indexes in
1736 YYCHECK. */
1737 int yyxbegin = yyn < 0 ? -yyn : 0;
1738
1739 /* Stay within bounds of both yycheck and yytname. */
1740 int yychecklim = YYLAST - yyn + 1;
1741 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1742 int yycount = 1;
1743
1744 yyarg[0] = yytname[yytype];
1745 yyfmt = yystpcpy (yyformat, yyunexpected);
1746
1747 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1748 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1749 {
1750 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1751 {
1752 yycount = 1;
1753 yysize = yysize0;
1754 yyformat[sizeof yyunexpected - 1] = '\0';
1755 break;
1756 }
1757 yyarg[yycount++] = yytname[yyx];
1758 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1759 yysize_overflow |= (yysize1 < yysize);
1760 yysize = yysize1;
1761 yyfmt = yystpcpy (yyfmt, yyprefix);
1762 yyprefix = yyor;
1763 }
1764
1765 yyf = YY_(yyformat);
1766 yysize1 = yysize + yystrlen (yyf);
1767 yysize_overflow |= (yysize1 < yysize);
1768 yysize = yysize1;
1769
1770 if (yysize_overflow)
1771 return YYSIZE_MAXIMUM;
1772
1773 if (yyresult)
1774 {
1775 /* Avoid sprintf, as that infringes on the user's name space.
1776 Don't have undefined behavior even if the translation
1777 produced a string with the wrong number of "%s"s. */
1778 char *yyp = yyresult;
1779 int yyi = 0;
1780 while ((*yyp = *yyf) != '\0')
1781 {
1782 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1783 {
1784 yyp += yytnamerr (yyp, yyarg[yyi++]);
1785 yyf += 2;
1786 }
1787 else
1788 {
1789 yyp++;
1790 yyf++;
1791 }
1792 }
1793 }
1794 return yysize;
1795 }
1796}
1797#endif /* YYERROR_VERBOSE */
1798
1799
1800/*-----------------------------------------------.
1801| Release the memory associated to this symbol. |
1802`-----------------------------------------------*/
1803
1804/*ARGSUSED*/
1805#if (defined __STDC__ || defined __C99__FUNC__ \
1806 || defined __cplusplus || defined _MSC_VER)
1807static void
1808yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1809#else
1810static void
1811yydestruct (yymsg, yytype, yyvaluep, context)
1812 const char *yymsg;
1813 int yytype;
1814 YYSTYPE *yyvaluep;
1815 TParseContext* context;
1816#endif
1817{
1818 YYUSE (yyvaluep);
1819 YYUSE (context);
1820
1821 if (!yymsg)
1822 yymsg = "Deleting";
1823 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
1824
apatrick@chromium.org536888b2012-01-25 02:10:25 +00001825 switch (yytype)
1826 {
1827
1828 default:
1829 break;
1830 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001831}
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001832
1833/* Prevent warnings from -Wmissing-prototypes. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001834#ifdef YYPARSE_PARAM
1835#if defined __STDC__ || defined __cplusplus
1836int yyparse (void *YYPARSE_PARAM);
1837#else
1838int yyparse ();
1839#endif
1840#else /* ! YYPARSE_PARAM */
1841#if defined __STDC__ || defined __cplusplus
1842int yyparse (TParseContext* context);
1843#else
1844int yyparse ();
1845#endif
1846#endif /* ! YYPARSE_PARAM */
1847
1848
1849
1850
1851
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001852/*-------------------------.
1853| yyparse or yypush_parse. |
1854`-------------------------*/
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001855
1856#ifdef YYPARSE_PARAM
1857#if (defined __STDC__ || defined __C99__FUNC__ \
1858 || defined __cplusplus || defined _MSC_VER)
1859int
1860yyparse (void *YYPARSE_PARAM)
1861#else
1862int
1863yyparse (YYPARSE_PARAM)
1864 void *YYPARSE_PARAM;
1865#endif
1866#else /* ! YYPARSE_PARAM */
1867#if (defined __STDC__ || defined __C99__FUNC__ \
1868 || defined __cplusplus || defined _MSC_VER)
1869int
1870yyparse (TParseContext* context)
1871#else
1872int
1873yyparse (context)
1874 TParseContext* context;
1875#endif
1876#endif
1877{
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001878/* The lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001879int yychar;
1880
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001881/* The semantic value of the lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001882YYSTYPE yylval;
1883
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001884 /* Number of syntax errors so far. */
1885 int yynerrs;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001886
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001887 int yystate;
1888 /* Number of tokens to shift before error messages enabled. */
1889 int yyerrstatus;
1890
1891 /* The stacks and their tools:
1892 `yyss': related to states.
1893 `yyvs': related to semantic values.
1894
1895 Refer to the stacks thru separate pointers, to allow yyoverflow
1896 to reallocate them elsewhere. */
1897
1898 /* The state stack. */
1899 yytype_int16 yyssa[YYINITDEPTH];
1900 yytype_int16 *yyss;
1901 yytype_int16 *yyssp;
1902
1903 /* The semantic value stack. */
1904 YYSTYPE yyvsa[YYINITDEPTH];
1905 YYSTYPE *yyvs;
1906 YYSTYPE *yyvsp;
1907
1908 YYSIZE_T yystacksize;
1909
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001910 int yyn;
1911 int yyresult;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001912 /* Lookahead token as an internal (translated) token number. */
1913 int yytoken;
1914 /* The variables used to return semantic value and location from the
1915 action routines. */
1916 YYSTYPE yyval;
1917
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001918#if YYERROR_VERBOSE
1919 /* Buffer for error messages, and its allocated size. */
1920 char yymsgbuf[128];
1921 char *yymsg = yymsgbuf;
1922 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
1923#endif
1924
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001925#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1926
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001927 /* The number of symbols on the RHS of the reduced rule.
1928 Keep to zero when no symbol should be popped. */
1929 int yylen = 0;
1930
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001931 yytoken = 0;
1932 yyss = yyssa;
1933 yyvs = yyvsa;
1934 yystacksize = YYINITDEPTH;
1935
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001936 YYDPRINTF ((stderr, "Starting parse\n"));
1937
1938 yystate = 0;
1939 yyerrstatus = 0;
1940 yynerrs = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00001941 yychar = YYEMPTY; /* Cause a token to be read. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001942
1943 /* Initialize stack pointers.
1944 Waste one element of value and location stack
1945 so that they stay on the same level as the state stack.
1946 The wasted elements are never initialized. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001947 yyssp = yyss;
1948 yyvsp = yyvs;
1949
1950 goto yysetstate;
1951
1952/*------------------------------------------------------------.
1953| yynewstate -- Push a new state, which is found in yystate. |
1954`------------------------------------------------------------*/
1955 yynewstate:
1956 /* In all cases, when you get here, the value and location stacks
1957 have just been pushed. So pushing a state here evens the stacks. */
1958 yyssp++;
1959
1960 yysetstate:
1961 *yyssp = yystate;
1962
1963 if (yyss + yystacksize - 1 <= yyssp)
1964 {
1965 /* Get the current used size of the three stacks, in elements. */
1966 YYSIZE_T yysize = yyssp - yyss + 1;
1967
1968#ifdef yyoverflow
1969 {
1970 /* Give user a chance to reallocate the stack. Use copies of
1971 these so that the &'s don't force the real ones into
1972 memory. */
1973 YYSTYPE *yyvs1 = yyvs;
1974 yytype_int16 *yyss1 = yyss;
1975
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001976 /* Each stack pointer address is followed by the size of the
1977 data in use in that stack, in bytes. This used to be a
1978 conditional around just the two extra args, but that might
1979 be undefined if yyoverflow is a macro. */
1980 yyoverflow (YY_("memory exhausted"),
1981 &yyss1, yysize * sizeof (*yyssp),
1982 &yyvs1, yysize * sizeof (*yyvsp),
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00001983 &yystacksize);
1984
1985 yyss = yyss1;
1986 yyvs = yyvs1;
1987 }
1988#else /* no yyoverflow */
1989# ifndef YYSTACK_RELOCATE
1990 goto yyexhaustedlab;
1991# else
1992 /* Extend the stack our own way. */
1993 if (YYMAXDEPTH <= yystacksize)
1994 goto yyexhaustedlab;
1995 yystacksize *= 2;
1996 if (YYMAXDEPTH < yystacksize)
1997 yystacksize = YYMAXDEPTH;
1998
1999 {
2000 yytype_int16 *yyss1 = yyss;
2001 union yyalloc *yyptr =
2002 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2003 if (! yyptr)
2004 goto yyexhaustedlab;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002005 YYSTACK_RELOCATE (yyss_alloc, yyss);
2006 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002007# undef YYSTACK_RELOCATE
2008 if (yyss1 != yyssa)
2009 YYSTACK_FREE (yyss1);
2010 }
2011# endif
2012#endif /* no yyoverflow */
2013
2014 yyssp = yyss + yysize - 1;
2015 yyvsp = yyvs + yysize - 1;
2016
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002017 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2018 (unsigned long int) yystacksize));
2019
2020 if (yyss + yystacksize - 1 <= yyssp)
2021 YYABORT;
2022 }
2023
2024 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2025
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002026 if (yystate == YYFINAL)
2027 YYACCEPT;
2028
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002029 goto yybackup;
2030
2031/*-----------.
2032| yybackup. |
2033`-----------*/
2034yybackup:
2035
2036 /* Do appropriate processing given the current state. Read a
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002037 lookahead token if we need one and don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002038
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002039 /* First try to decide what to do without reference to lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002040 yyn = yypact[yystate];
2041 if (yyn == YYPACT_NINF)
2042 goto yydefault;
2043
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002044 /* Not known => get a lookahead token if don't already have one. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002045
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002046 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002047 if (yychar == YYEMPTY)
2048 {
2049 YYDPRINTF ((stderr, "Reading a token: "));
2050 yychar = YYLEX;
2051 }
2052
2053 if (yychar <= YYEOF)
2054 {
2055 yychar = yytoken = YYEOF;
2056 YYDPRINTF ((stderr, "Now at end of input.\n"));
2057 }
2058 else
2059 {
2060 yytoken = YYTRANSLATE (yychar);
2061 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2062 }
2063
2064 /* If the proper action on seeing token YYTOKEN is to reduce or to
2065 detect an error, take that action. */
2066 yyn += yytoken;
2067 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2068 goto yydefault;
2069 yyn = yytable[yyn];
2070 if (yyn <= 0)
2071 {
2072 if (yyn == 0 || yyn == YYTABLE_NINF)
2073 goto yyerrlab;
2074 yyn = -yyn;
2075 goto yyreduce;
2076 }
2077
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002078 /* Count tokens shifted since error; after three, turn off error
2079 status. */
2080 if (yyerrstatus)
2081 yyerrstatus--;
2082
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002083 /* Shift the lookahead token. */
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002084 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2085
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002086 /* Discard the shifted token. */
2087 yychar = YYEMPTY;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002088
2089 yystate = yyn;
2090 *++yyvsp = yylval;
2091
2092 goto yynewstate;
2093
2094
2095/*-----------------------------------------------------------.
2096| yydefault -- do the default action for the current state. |
2097`-----------------------------------------------------------*/
2098yydefault:
2099 yyn = yydefact[yystate];
2100 if (yyn == 0)
2101 goto yyerrlab;
2102 goto yyreduce;
2103
2104
2105/*-----------------------------.
2106| yyreduce -- Do a reduction. |
2107`-----------------------------*/
2108yyreduce:
2109 /* yyn is the number of a rule to reduce with. */
2110 yylen = yyr2[yyn];
2111
2112 /* If YYLEN is nonzero, implement the default value of the action:
2113 `$$ = $1'.
2114
2115 Otherwise, the following line sets YYVAL to garbage.
2116 This behavior is undocumented and Bison
2117 users should not rely upon it. Assigning to YYVAL
2118 unconditionally makes the parser a bit smaller, and it avoids a
2119 GCC warning that YYVAL may be used uninitialized. */
2120 yyval = yyvsp[1-yylen];
2121
2122
2123 YY_REDUCE_PRINT (yyn);
2124 switch (yyn)
2125 {
2126 case 2:
2127
2128 {
2129 // The symbol table search was done in the lexical phase
2130 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2131 const TVariable* variable;
2132 if (symbol == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002133 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002134 context->recover();
2135 TType type(EbtFloat, EbpUndefined);
2136 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
2137 context->symbolTable.insert(*fakeVariable);
2138 variable = fakeVariable;
2139 } else {
2140 // This identifier can only be a variable type symbol
2141 if (! symbol->isVariable()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002142 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002143 context->recover();
2144 }
2145 variable = static_cast<const TVariable*>(symbol);
2146 }
2147
2148 // don't delete $1.string, it's used by error recovery, and the pool
2149 // pop will reclaim the memory
2150
2151 if (variable->getType().getQualifier() == EvqConst ) {
2152 ConstantUnion* constArray = variable->getConstPointer();
2153 TType t(variable->getType());
2154 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2155 } else
2156 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2157 variable->getName(),
2158 variable->getType(), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002159 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002160 break;
2161
2162 case 3:
2163
2164 {
2165 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002166 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002167 break;
2168
2169 case 4:
2170
2171 {
2172 //
2173 // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders,
2174 // check for overflow for constants
2175 //
2176 if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002177 context->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002178 context->recover();
2179 }
2180 ConstantUnion *unionArray = new ConstantUnion[1];
2181 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2182 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002183 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002184 break;
2185
2186 case 5:
2187
2188 {
2189 ConstantUnion *unionArray = new ConstantUnion[1];
2190 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2191 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002192 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002193 break;
2194
2195 case 6:
2196
2197 {
2198 ConstantUnion *unionArray = new ConstantUnion[1];
2199 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2200 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002201 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002202 break;
2203
2204 case 7:
2205
2206 {
2207 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002208 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002209 break;
2210
2211 case 8:
2212
2213 {
2214 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002215 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002216 break;
2217
2218 case 9:
2219
2220 {
2221 if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) {
2222 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode())
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002223 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 +00002224 else
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 ", "expression");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002226 context->recover();
2227 }
2228 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
2229 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002230 (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 +00002231 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors
2232 TVectorFields fields;
2233 fields.num = 1;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002234 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 +00002235 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2236 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002237 (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 +00002238 }
2239 } else {
2240 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002241 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 +00002242 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002243 extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002244 std::string extraInfo = extraInfoStream.str();
2245 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002246 context->recover();
2247 } else {
2248 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2249 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002250 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0)) {
2251 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 +00002252 context->recover();
2253 } else {
2254 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line))
2255 context->recover();
2256 }
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002257 } 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 +00002258 std::stringstream extraInfoStream;
shannon.woods%transgaming.com@gtempaccount.comc0d0c222013-04-13 03:29:36 +00002259 extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002260 std::string extraInfo = extraInfoStream.str();
2261 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002262 context->recover();
2263 }
2264 }
2265 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2266 }
2267 } else {
2268 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
2269 context->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable");
2270 context->recover();
2271 }
2272
2273 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2274 }
2275 }
2276 if ((yyval.interm.intermTypedNode) == 0) {
2277 ConstantUnion *unionArray = new ConstantUnion[1];
2278 unionArray->setFConst(0.0f);
2279 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), (yyvsp[(2) - (4)].lex).line);
2280 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2281 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct())
2282 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName()));
2283 else
2284 (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()));
2285
2286 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2287 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2288 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2289 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
2290 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())
2291 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
2292 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst)
2293 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst));
2294 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector())
2295 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary));
2296 else
2297 (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002298 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002299 break;
2300
2301 case 10:
2302
2303 {
2304 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002305 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002306 break;
2307
2308 case 11:
2309
2310 {
2311 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002312 context->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002313 context->recover();
2314 }
2315
2316 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) {
2317 TVectorFields fields;
2318 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2319 fields.num = 1;
2320 fields.offsets[0] = 0;
2321 context->recover();
2322 }
2323
2324 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { // constant folding for vector fields
2325 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line);
2326 if ((yyval.interm.intermTypedNode) == 0) {
2327 context->recover();
2328 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2329 }
2330 else
2331 (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()));
2332 } else {
alokp@chromium.orgab8c0262012-08-13 17:36:25 +00002333 TString vectorString = *(yyvsp[(3) - (3)].lex).string;
2334 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line);
2335 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2336 (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 +00002337 }
2338 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) {
2339 TMatrixFields fields;
2340 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2341 fields.wholeRow = false;
2342 fields.wholeCol = false;
2343 fields.row = 0;
2344 fields.col = 0;
2345 context->recover();
2346 }
2347
2348 if (fields.wholeRow || fields.wholeCol) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002349 context->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", ".");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002350 context->recover();
2351 ConstantUnion *unionArray = new ConstantUnion[1];
2352 unionArray->setIConst(0);
2353 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2354 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2355 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize()));
2356 } else {
2357 ConstantUnion *unionArray = new ConstantUnion[1];
2358 unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row);
2359 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line);
2360 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2361 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision()));
2362 }
2363 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) {
2364 bool fieldFound = false;
2365 const TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct();
2366 if (fields == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002367 context->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002368 context->recover();
2369 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2370 } else {
2371 unsigned int i;
2372 for (i = 0; i < fields->size(); ++i) {
2373 if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
2374 fieldFound = true;
2375 break;
2376 }
2377 }
2378 if (fieldFound) {
2379 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) {
2380 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2381 if ((yyval.interm.intermTypedNode) == 0) {
2382 context->recover();
2383 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2384 }
2385 else {
2386 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2387 // change the qualifier of the return type, not of the structure field
2388 // as the structure definition is shared between various structures.
2389 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConst);
2390 }
2391 } else {
2392 ConstantUnion *unionArray = new ConstantUnion[1];
2393 unionArray->setIConst(i);
2394 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line);
2395 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2396 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2397 }
2398 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002399 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 +00002400 context->recover();
2401 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2402 }
2403 }
2404 } else {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002405 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 +00002406 context->recover();
2407 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2408 }
2409 // don't delete $3.string, it's from the pool
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002410 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002411 break;
2412
2413 case 12:
2414
2415 {
2416 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2417 context->recover();
2418 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2419 if ((yyval.interm.intermTypedNode) == 0) {
2420 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2421 context->recover();
2422 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2423 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002424 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002425 break;
2426
2427 case 13:
2428
2429 {
2430 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2431 context->recover();
2432 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, context->symbolTable);
2433 if ((yyval.interm.intermTypedNode) == 0) {
2434 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2435 context->recover();
2436 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2437 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002438 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002439 break;
2440
2441 case 14:
2442
2443 {
2444 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2445 context->recover();
2446 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002447 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002448 break;
2449
2450 case 15:
2451
2452 {
2453 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2454 TOperator op = fnCall->getBuiltInOp();
2455
2456 if (op != EOpNull)
2457 {
2458 //
2459 // Then this should be a constructor.
2460 // Don't go through the symbol table for constructors.
2461 // Their parameters will be verified algorithmically.
2462 //
2463 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2464 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2465 (yyval.interm.intermTypedNode) = 0;
2466 } else {
2467 //
2468 // It's a constructor, of type 'type'.
2469 //
2470 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2471 }
2472
2473 if ((yyval.interm.intermTypedNode) == 0) {
2474 context->recover();
2475 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2476 }
2477 (yyval.interm.intermTypedNode)->setType(type);
2478 } else {
2479 //
2480 // Not a constructor. Find it in the symbol table.
2481 //
2482 const TFunction* fnCandidate;
2483 bool builtIn;
2484 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn);
2485 if (fnCandidate) {
2486 //
2487 // A declared function.
2488 //
2489 if (builtIn && !fnCandidate->getExtension().empty() &&
2490 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2491 context->recover();
2492 }
2493 op = fnCandidate->getBuiltInOp();
2494 if (builtIn && op != EOpNull) {
2495 //
2496 // A function call mapped to a built-in operation.
2497 //
2498 if (fnCandidate->getParamCount() == 1) {
2499 //
2500 // Treat it like a built-in unary operator.
2501 //
2502 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, context->symbolTable);
2503 if ((yyval.interm.intermTypedNode) == 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002504 std::stringstream extraInfoStream;
2505 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2506 std::string extraInfo = extraInfoStream.str();
2507 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002508 YYERROR;
2509 }
2510 } else {
2511 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2512 }
2513 } else {
2514 // This is a real function call
2515
2516 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2517 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2518
2519 // this is how we know whether the given function is a builtIn function or a user defined function
2520 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2521 // if builtIn == true, it's definitely a builtIn function with EOpNull
2522 if (!builtIn)
2523 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2524 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2525
2526 TQualifier qual;
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00002527 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002528 qual = fnCandidate->getParam(i).type->getQualifier();
2529 if (qual == EvqOut || qual == EvqInOut) {
2530 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002531 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 +00002532 context->recover();
2533 }
2534 }
2535 }
2536 }
2537 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2538 } else {
2539 // error message was put out by PaFindFunction()
2540 // Put on a dummy node for error recovery
2541 ConstantUnion *unionArray = new ConstantUnion[1];
2542 unionArray->setFConst(0.0f);
2543 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line);
2544 context->recover();
2545 }
2546 }
2547 delete fnCall;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002548 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002549 break;
2550
2551 case 16:
2552
2553 {
2554 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002555 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002556 break;
2557
2558 case 17:
2559
2560 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002561 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002562 context->recover();
2563 (yyval.interm) = (yyvsp[(3) - (3)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002564 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002565 break;
2566
2567 case 18:
2568
2569 {
2570 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2571 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002572 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002573 break;
2574
2575 case 19:
2576
2577 {
2578 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2579 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002580 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002581 break;
2582
2583 case 20:
2584
2585 {
2586 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2587 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002588 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002589 break;
2590
2591 case 21:
2592
2593 {
2594 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2595 (yyval.interm).intermNode = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002596 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002597 break;
2598
2599 case 22:
2600
2601 {
2602 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2603 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2604 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2605 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002606 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002607 break;
2608
2609 case 23:
2610
2611 {
2612 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2613 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2614 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2615 (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 +00002616 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002617 break;
2618
2619 case 24:
2620
2621 {
2622 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002623 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002624 break;
2625
2626 case 25:
2627
2628 {
2629 //
2630 // Constructor
2631 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002632 TOperator op = EOpNull;
2633 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2634 op = EOpConstructStruct;
2635 } else {
2636 switch ((yyvsp[(1) - (1)].interm.type).type) {
2637 case EbtFloat:
2638 if ((yyvsp[(1) - (1)].interm.type).matrix) {
2639 switch((yyvsp[(1) - (1)].interm.type).size) {
2640 case 2: op = EOpConstructMat2; break;
2641 case 3: op = EOpConstructMat3; break;
2642 case 4: op = EOpConstructMat4; break;
2643 }
2644 } else {
2645 switch((yyvsp[(1) - (1)].interm.type).size) {
2646 case 1: op = EOpConstructFloat; break;
2647 case 2: op = EOpConstructVec2; break;
2648 case 3: op = EOpConstructVec3; break;
2649 case 4: op = EOpConstructVec4; break;
2650 }
2651 }
2652 break;
2653 case EbtInt:
2654 switch((yyvsp[(1) - (1)].interm.type).size) {
2655 case 1: op = EOpConstructInt; break;
2656 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2657 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2658 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2659 }
2660 break;
2661 case EbtBool:
2662 switch((yyvsp[(1) - (1)].interm.type).size) {
2663 case 1: op = EOpConstructBool; break;
2664 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2665 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2666 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2667 }
2668 break;
2669 default: break;
2670 }
2671 if (op == EOpNull) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00002672 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 +00002673 context->recover();
2674 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2675 op = EOpConstructFloat;
2676 }
2677 }
2678 TString tempString;
2679 TType type((yyvsp[(1) - (1)].interm.type));
2680 TFunction *function = new TFunction(&tempString, type, op);
2681 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002682 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002683 break;
2684
2685 case 26:
2686
2687 {
2688 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2689 context->recover();
2690 TType type(EbtVoid, EbpUndefined);
2691 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2692 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002693 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002694 break;
2695
2696 case 27:
2697
2698 {
2699 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2700 context->recover();
2701 TType type(EbtVoid, EbpUndefined);
2702 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2703 (yyval.interm.function) = function;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002704 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002705 break;
2706
2707 case 28:
2708
2709 {
2710 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002711 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002712 break;
2713
2714 case 29:
2715
2716 {
2717 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2718 context->recover();
2719 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2720 if ((yyval.interm.intermTypedNode) == 0) {
2721 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2722 context->recover();
2723 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2724 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002725 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002726 break;
2727
2728 case 30:
2729
2730 {
2731 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2732 context->recover();
2733 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, context->symbolTable);
2734 if ((yyval.interm.intermTypedNode) == 0) {
2735 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2736 context->recover();
2737 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2738 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002739 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002740 break;
2741
2742 case 31:
2743
2744 {
2745 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2746 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, context->symbolTable);
2747 if ((yyval.interm.intermTypedNode) == 0) {
2748 const char* errorOp = "";
2749 switch((yyvsp[(1) - (2)].interm).op) {
2750 case EOpNegative: errorOp = "-"; break;
2751 case EOpLogicalNot: errorOp = "!"; break;
2752 default: break;
2753 }
2754 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2755 context->recover();
2756 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2757 }
2758 } else
2759 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002760 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002761 break;
2762
2763 case 32:
2764
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002765 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002766 break;
2767
2768 case 33:
2769
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002770 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002771 break;
2772
2773 case 34:
2774
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002775 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002776 break;
2777
2778 case 35:
2779
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002780 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002781 break;
2782
2783 case 36:
2784
2785 {
2786 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
2787 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2788 if ((yyval.interm.intermTypedNode) == 0) {
2789 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2790 context->recover();
2791 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2792 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002793 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002794 break;
2795
2796 case 37:
2797
2798 {
2799 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
2800 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2801 if ((yyval.interm.intermTypedNode) == 0) {
2802 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2803 context->recover();
2804 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2805 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002806 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002807 break;
2808
2809 case 38:
2810
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002811 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002812 break;
2813
2814 case 39:
2815
2816 {
2817 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2818 if ((yyval.interm.intermTypedNode) == 0) {
2819 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2820 context->recover();
2821 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2822 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002823 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002824 break;
2825
2826 case 40:
2827
2828 {
2829 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2830 if ((yyval.interm.intermTypedNode) == 0) {
2831 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2832 context->recover();
2833 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2834 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002835 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002836 break;
2837
2838 case 41:
2839
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002840 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002841 break;
2842
2843 case 42:
2844
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002845 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002846 break;
2847
2848 case 43:
2849
2850 {
2851 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2852 if ((yyval.interm.intermTypedNode) == 0) {
2853 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2854 context->recover();
2855 ConstantUnion *unionArray = new ConstantUnion[1];
2856 unionArray->setBConst(false);
2857 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2858 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002859 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002860 break;
2861
2862 case 44:
2863
2864 {
2865 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2866 if ((yyval.interm.intermTypedNode) == 0) {
2867 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2868 context->recover();
2869 ConstantUnion *unionArray = new ConstantUnion[1];
2870 unionArray->setBConst(false);
2871 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2872 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002873 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002874 break;
2875
2876 case 45:
2877
2878 {
2879 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2880 if ((yyval.interm.intermTypedNode) == 0) {
2881 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2882 context->recover();
2883 ConstantUnion *unionArray = new ConstantUnion[1];
2884 unionArray->setBConst(false);
2885 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2886 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002887 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002888 break;
2889
2890 case 46:
2891
2892 {
2893 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2894 if ((yyval.interm.intermTypedNode) == 0) {
2895 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2896 context->recover();
2897 ConstantUnion *unionArray = new ConstantUnion[1];
2898 unionArray->setBConst(false);
2899 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2900 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002901 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002902 break;
2903
2904 case 47:
2905
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002906 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002907 break;
2908
2909 case 48:
2910
2911 {
2912 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2913 if ((yyval.interm.intermTypedNode) == 0) {
2914 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2915 context->recover();
2916 ConstantUnion *unionArray = new ConstantUnion[1];
2917 unionArray->setBConst(false);
2918 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2919 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002920 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002921 break;
2922
2923 case 49:
2924
2925 {
2926 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2927 if ((yyval.interm.intermTypedNode) == 0) {
2928 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2929 context->recover();
2930 ConstantUnion *unionArray = new ConstantUnion[1];
2931 unionArray->setBConst(false);
2932 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2933 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002934 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002935 break;
2936
2937 case 50:
2938
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002939 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002940 break;
2941
2942 case 51:
2943
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002944 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002945 break;
2946
2947 case 52:
2948
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002949 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002950 break;
2951
2952 case 53:
2953
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002954 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002955 break;
2956
2957 case 54:
2958
2959 {
2960 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2961 if ((yyval.interm.intermTypedNode) == 0) {
2962 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2963 context->recover();
2964 ConstantUnion *unionArray = new ConstantUnion[1];
2965 unionArray->setBConst(false);
2966 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2967 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002968 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002969 break;
2970
2971 case 55:
2972
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002973 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002974 break;
2975
2976 case 56:
2977
2978 {
2979 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2980 if ((yyval.interm.intermTypedNode) == 0) {
2981 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2982 context->recover();
2983 ConstantUnion *unionArray = new ConstantUnion[1];
2984 unionArray->setBConst(false);
2985 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
2986 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002987 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002988 break;
2989
2990 case 57:
2991
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00002992 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00002993 break;
2994
2995 case 58:
2996
2997 {
2998 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, context->symbolTable);
2999 if ((yyval.interm.intermTypedNode) == 0) {
3000 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3001 context->recover();
3002 ConstantUnion *unionArray = new ConstantUnion[1];
3003 unionArray->setBConst(false);
3004 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line);
3005 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003006 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003007 break;
3008
3009 case 59:
3010
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003011 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003012 break;
3013
3014 case 60:
3015
3016 {
3017 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3018 context->recover();
3019
3020 (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);
3021 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3022 (yyval.interm.intermTypedNode) = 0;
3023
3024 if ((yyval.interm.intermTypedNode) == 0) {
3025 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3026 context->recover();
3027 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3028 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003029 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003030 break;
3031
3032 case 61:
3033
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003034 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003035 break;
3036
3037 case 62:
3038
3039 {
3040 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3041 context->recover();
3042 (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);
3043 if ((yyval.interm.intermTypedNode) == 0) {
3044 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3045 context->recover();
3046 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3047 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003048 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003049 break;
3050
3051 case 63:
3052
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003053 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003054 break;
3055
3056 case 64:
3057
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003058 { 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 +00003059 break;
3060
3061 case 65:
3062
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003063 { 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 +00003064 break;
3065
3066 case 66:
3067
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003068 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003069 break;
3070
3071 case 67:
3072
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003073 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003074 break;
3075
3076 case 68:
3077
3078 {
3079 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003080 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003081 break;
3082
3083 case 69:
3084
3085 {
3086 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3087 if ((yyval.interm.intermTypedNode) == 0) {
3088 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3089 context->recover();
3090 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3091 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003092 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003093 break;
3094
3095 case 70:
3096
3097 {
3098 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3099 context->recover();
3100 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003101 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003102 break;
3103
3104 case 71:
3105
3106 {
3107 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3108
3109 TIntermAggregate *prototype = new TIntermAggregate;
3110 prototype->setType(function.getReturnType());
3111 prototype->setName(function.getName());
3112
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003113 for (size_t i = 0; i < function.getParamCount(); i++)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003114 {
3115 const TParameter &param = function.getParam(i);
3116 if (param.name != 0)
3117 {
3118 TVariable *variable = new TVariable(param.name, *param.type);
3119
3120 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3121 }
3122 else
3123 {
3124 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3125 }
3126 }
3127
3128 prototype->setOp(EOpPrototype);
3129 (yyval.interm.intermNode) = prototype;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003130
3131 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003132 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003133 break;
3134
3135 case 72:
3136
3137 {
3138 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3139 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3140 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003141 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003142 break;
3143
3144 case 73:
3145
3146 {
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00003147 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3148 context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
3149 context->recover();
3150 }
shannon.woods@transgaming.comd25a6b32013-02-28 23:19:13 +00003151 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3152 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3153 context->recover();
3154 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003155 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003156 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003157 break;
3158
3159 case 74:
3160
3161 {
3162 //
3163 // Multiple declarations of the same function are allowed.
3164 //
3165 // If this is a definition, the definition production code will check for redefinitions
3166 // (we don't know at this point if it's a definition or not).
3167 //
3168 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3169 //
3170 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName()));
3171 if (prevDec) {
3172 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003173 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 +00003174 context->recover();
3175 }
shannon.woods@transgaming.comd64b3da2013-02-28 23:19:26 +00003176 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003177 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003178 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 +00003179 context->recover();
3180 }
3181 }
3182 }
3183
3184 //
3185 // If this is a redeclaration, it could also be a definition,
3186 // in which case, we want to use the variable names from this one, and not the one that's
3187 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3188 //
3189 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3190 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3191
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003192 // We're at the inner scope level of the function's arguments and body statement.
3193 // Add the function prototype to the surrounding scope instead.
3194 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003195 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003196 break;
3197
3198 case 75:
3199
3200 {
3201 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003202 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003203 break;
3204
3205 case 76:
3206
3207 {
3208 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003209 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003210 break;
3211
3212 case 77:
3213
3214 {
3215 // Add the parameter
3216 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3217 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3218 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3219 else
3220 delete (yyvsp[(2) - (2)].interm).param.type;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003221 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003222 break;
3223
3224 case 78:
3225
3226 {
3227 //
3228 // Only first parameter of one-parameter functions can be void
3229 // The check for named parameters not being void is done in parameter_declarator
3230 //
3231 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3232 //
3233 // This parameter > first is void
3234 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003235 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003236 context->recover();
3237 delete (yyvsp[(3) - (3)].interm).param.type;
3238 } else {
3239 // Add the parameter
3240 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3241 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3242 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003243 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003244 break;
3245
3246 case 79:
3247
3248 {
3249 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003250 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 +00003251 context->recover();
3252 }
3253 // make sure a sampler is not involved as well...
3254 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3255 context->recover();
3256
3257 // Add the function as a prototype after parsing it (we do not support recursion)
3258 TFunction *function;
3259 TType type((yyvsp[(1) - (3)].interm.type));
3260 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3261 (yyval.interm.function) = function;
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00003262
3263 context->symbolTable.push();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003264 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003265 break;
3266
3267 case 80:
3268
3269 {
3270 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003271 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 +00003272 context->recover();
3273 }
3274 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3275 context->recover();
3276 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3277 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3278 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003279 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003280 break;
3281
3282 case 81:
3283
3284 {
3285 // Check that we can make an array out of this type
3286 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3287 context->recover();
3288
3289 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3290 context->recover();
3291
3292 int size;
3293 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3294 context->recover();
3295 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3296
3297 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3298 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3299 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3300 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003301 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003302 break;
3303
3304 case 82:
3305
3306 {
3307 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3308 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3309 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003310 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003311 break;
3312
3313 case 83:
3314
3315 {
3316 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3317 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3318 context->recover();
3319 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3320 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003321 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003322 break;
3323
3324 case 84:
3325
3326 {
3327 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3328 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3329 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003330 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003331 break;
3332
3333 case 85:
3334
3335 {
3336 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3337 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3338 context->recover();
3339 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3340 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003341 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003342 break;
3343
3344 case 86:
3345
3346 {
3347 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003348 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003349 break;
3350
3351 case 87:
3352
3353 {
3354 (yyval.interm.qualifier) = EvqIn;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003355 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003356 break;
3357
3358 case 88:
3359
3360 {
3361 (yyval.interm.qualifier) = EvqOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003362 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003363 break;
3364
3365 case 89:
3366
3367 {
3368 (yyval.interm.qualifier) = EvqInOut;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003369 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003370 break;
3371
3372 case 90:
3373
3374 {
3375 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3376 (yyval.interm).param = param;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003377 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003378 break;
3379
3380 case 91:
3381
3382 {
3383 (yyval.interm) = (yyvsp[(1) - (1)].interm);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003384 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003385 break;
3386
3387 case 92:
3388
3389 {
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003390 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3391 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003392 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 +00003393 context->recover();
3394 }
3395
zmo@google.comfd747b82011-04-23 01:30:07 +00003396 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3397 (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 +00003398
3399 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3400 context->recover();
3401
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003402 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 +00003403 context->recover();
3404
zmo@google.comfd747b82011-04-23 01:30:07 +00003405 TVariable* variable = 0;
3406 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 +00003407 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003408 if (symbol && variable)
3409 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003410 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003411 break;
3412
3413 case 93:
3414
3415 {
3416 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3417 context->recover();
3418
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003419 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 +00003420 context->recover();
3421
3422 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3423
3424 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))
3425 context->recover();
3426 else {
3427 (yyvsp[(1) - (5)].interm).type.setArray(true);
3428 TVariable* variable;
3429 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3430 context->recover();
3431 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003432 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003433 break;
3434
3435 case 94:
3436
3437 {
3438 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3439 context->recover();
3440
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003441 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 +00003442 context->recover();
3443
3444 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3445
3446 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))
3447 context->recover();
3448 else {
3449 int size;
3450 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3451 context->recover();
3452 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003453 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003454 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3455 context->recover();
3456 TType type = TType((yyvsp[(1) - (6)].interm).type);
3457 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003458 (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 +00003459 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003460 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003461 break;
3462
3463 case 95:
3464
3465 {
3466 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3467 context->recover();
3468
3469 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3470
3471 TIntermNode* intermNode;
3472 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3473 //
3474 // build the intermediate representation
3475 //
3476 if (intermNode)
3477 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3478 else
3479 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3480 } else {
3481 context->recover();
3482 (yyval.interm).intermAggregate = 0;
3483 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003484 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003485 break;
3486
3487 case 96:
3488
3489 {
3490 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3491 (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 +00003492 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003493 break;
3494
3495 case 97:
3496
3497 {
zmo@google.comfd747b82011-04-23 01:30:07 +00003498 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3499 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003500
3501 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3502 context->recover();
3503
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003504 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 +00003505 context->recover();
3506
3507 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3508
zmo@google.comfd747b82011-04-23 01:30:07 +00003509 TVariable* variable = 0;
3510 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 +00003511 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003512 if (variable && symbol)
3513 symbol->setId(variable->getUniqueId());
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003514 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003515 break;
3516
3517 case 98:
3518
3519 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003520 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 +00003521 context->recover();
3522
zmo@google.comfd747b82011-04-23 01:30:07 +00003523 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3524 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003525 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003526 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003527 break;
3528
3529 case 99:
3530
3531 {
3532 TType type = TType((yyvsp[(1) - (5)].interm.type));
3533 int size;
3534 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3535 context->recover();
3536 type.setArraySize(size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003537 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3538 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003539
3540 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3541 context->recover();
3542
daniel@transgaming.com8abd0b72012-09-27 17:46:07 +00003543 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 +00003544 context->recover();
3545
3546 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3547
3548 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)))
3549 context->recover();
3550 else {
3551 int size;
3552 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3553 context->recover();
3554
3555 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
zmo@google.comfd747b82011-04-23 01:30:07 +00003556 TVariable* variable = 0;
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003557 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3558 context->recover();
zmo@google.comfd747b82011-04-23 01:30:07 +00003559 if (variable && symbol)
3560 symbol->setId(variable->getUniqueId());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003561 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003562 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003563 break;
3564
3565 case 100:
3566
3567 {
3568 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3569 context->recover();
3570
3571 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3572
3573 TIntermNode* intermNode;
3574 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3575 //
3576 // Build intermediate representation
3577 //
3578 if(intermNode)
3579 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3580 else
3581 (yyval.interm).intermAggregate = 0;
3582 } else {
3583 context->recover();
3584 (yyval.interm).intermAggregate = 0;
3585 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003586 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003587 break;
3588
3589 case 101:
3590
3591 {
3592 VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.comeec8efc2012-03-09 21:57:49 +00003593 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3594 context->recover();
3595 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3596 if (!(yyvsp[(2) - (2)].lex).symbol)
3597 {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003598 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 +00003599 context->recover();
3600
3601 (yyval.interm).intermAggregate = 0;
3602 }
3603 else
3604 {
3605 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3606 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3607 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003608 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003609 break;
3610
3611 case 102:
3612
3613 {
3614 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3615
3616 if ((yyvsp[(1) - (1)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003617 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003618 context->recover();
3619 (yyvsp[(1) - (1)].interm.type).setArray(false);
3620 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003621 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003622 break;
3623
3624 case 103:
3625
3626 {
3627 if ((yyvsp[(2) - (2)].interm.type).array) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003628 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003629 context->recover();
3630 (yyvsp[(2) - (2)].interm.type).setArray(false);
3631 }
3632
3633 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3634 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003635 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 +00003636 context->recover();
3637 }
3638 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3639 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003640 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 +00003641 context->recover();
3642 }
3643 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3644 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003645 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003646 break;
3647
3648 case 104:
3649
3650 {
3651 (yyval.interm.type).setBasic(EbtVoid, EvqConst, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003652 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003653 break;
3654
3655 case 105:
3656
3657 {
3658 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00003659 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003660 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3661 context->recover();
3662 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003663 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003664 break;
3665
3666 case 106:
3667
3668 {
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00003669 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003670 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3671 context->recover();
3672 if (context->shaderType == SH_VERTEX_SHADER)
3673 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3674 else
3675 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003676 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003677 break;
3678
3679 case 107:
3680
3681 {
shannon.woods%transgaming.com@gtempaccount.com5524db02013-04-13 03:38:16 +00003682 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003683 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3684 context->recover();
3685 if (context->shaderType == SH_VERTEX_SHADER)
3686 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3687 else
3688 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003689 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003690 break;
3691
3692 case 108:
3693
3694 {
3695 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3696 context->recover();
3697 (yyval.interm.type).setBasic(EbtVoid, EvqUniform, (yyvsp[(1) - (1)].lex).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 {
3704 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00003705
3706 if ((yyval.interm.type).precision == EbpUndefined) {
3707 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3708 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3709 context->recover();
3710 }
3711 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003712 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003713 break;
3714
3715 case 110:
3716
3717 {
3718 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3719 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003720 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003721 break;
3722
3723 case 111:
3724
3725 {
3726 (yyval.interm.precision) = EbpHigh;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003727 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003728 break;
3729
3730 case 112:
3731
3732 {
3733 (yyval.interm.precision) = EbpMedium;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003734 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003735 break;
3736
3737 case 113:
3738
3739 {
3740 (yyval.interm.precision) = EbpLow;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003741 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003742 break;
3743
3744 case 114:
3745
3746 {
3747 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003748 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003749 break;
3750
3751 case 115:
3752
3753 {
3754 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3755
3756 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3757 context->recover();
3758 else {
3759 int size;
3760 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3761 context->recover();
3762 (yyval.interm.type).setArray(true, size);
3763 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003764 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003765 break;
3766
3767 case 116:
3768
3769 {
3770 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3771 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003772 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003773 break;
3774
3775 case 117:
3776
3777 {
3778 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3779 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003780 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003781 break;
3782
3783 case 118:
3784
3785 {
3786 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3787 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003788 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003789 break;
3790
3791 case 119:
3792
3793 {
3794 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3795 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003796 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003797 break;
3798
3799 case 120:
3800
3801 {
3802 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3803 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3804 (yyval.interm.type).setAggregate(2);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003805 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003806 break;
3807
3808 case 121:
3809
3810 {
3811 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3812 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3813 (yyval.interm.type).setAggregate(3);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003814 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003815 break;
3816
3817 case 122:
3818
3819 {
3820 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3821 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3822 (yyval.interm.type).setAggregate(4);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003823 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003824 break;
3825
3826 case 123:
3827
3828 {
3829 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3830 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3831 (yyval.interm.type).setAggregate(2);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003832 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003833 break;
3834
3835 case 124:
3836
3837 {
3838 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3839 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3840 (yyval.interm.type).setAggregate(3);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003841 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003842 break;
3843
3844 case 125:
3845
3846 {
3847 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3848 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
3849 (yyval.interm.type).setAggregate(4);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003850 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003851 break;
3852
3853 case 126:
3854
3855 {
3856 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3857 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3858 (yyval.interm.type).setAggregate(2);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003859 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003860 break;
3861
3862 case 127:
3863
3864 {
3865 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3866 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3867 (yyval.interm.type).setAggregate(3);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003868 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003869 break;
3870
3871 case 128:
3872
3873 {
3874 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3875 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
3876 (yyval.interm.type).setAggregate(4);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003877 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003878 break;
3879
3880 case 129:
3881
3882 {
3883 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
3884 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3885 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3886 (yyval.interm.type).setAggregate(2, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003887 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003888 break;
3889
3890 case 130:
3891
3892 {
3893 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
3894 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3895 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3896 (yyval.interm.type).setAggregate(3, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003897 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003898 break;
3899
3900 case 131:
3901
3902 {
3903 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
3904 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3905 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
3906 (yyval.interm.type).setAggregate(4, true);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003907 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003908 break;
3909
3910 case 132:
3911
3912 {
3913 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
3914 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3915 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003916 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003917 break;
3918
3919 case 133:
3920
3921 {
3922 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
3923 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3924 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003925 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003926 break;
3927
3928 case 134:
3929
3930 {
zmo@google.com09c323a2011-08-12 18:22:25 +00003931 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003932 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES");
zmo@google.com09c323a2011-08-12 18:22:25 +00003933 context->recover();
3934 }
3935 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
3936 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3937 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003938 }
zmo@google.com09c323a2011-08-12 18:22:25 +00003939 break;
3940
3941 case 135:
3942
3943 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00003944 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00003945 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "sampler2DRect");
kbr@chromium.org205fef32011-11-22 20:50:02 +00003946 context->recover();
3947 }
3948 FRAG_VERT_ONLY("sampler2DRect", (yyvsp[(1) - (1)].lex).line);
3949 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3950 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yyvsp[(1) - (1)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003951 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003952 break;
3953
zmo@google.com09c323a2011-08-12 18:22:25 +00003954 case 136:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003955
3956 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00003957 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
3958 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3959 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003960 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00003961 break;
3962
3963 case 137:
3964
3965 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003966 //
3967 // This is for user defined type names. The lexical phase looked up the
3968 // type.
3969 //
3970 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
3971 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3972 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
3973 (yyval.interm.type).userDef = &structure;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003974 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003975 break;
3976
zmo@google.com09c323a2011-08-12 18:22:25 +00003977 case 138:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003978
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003979 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00003980 break;
3981
3982 case 139:
3983
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003984 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00003985 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
3986 context->recover();
3987
3988 TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
3989 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
3990 if (! context->symbolTable.insert(*userTypeDef)) {
3991 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
3992 context->recover();
3993 }
3994 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00003995 (yyval.interm.type).userDef = structure;
kbr@chromium.org476541f2011-10-27 21:14:51 +00003996 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00003997 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00003998 break;
3999
4000 case 140:
4001
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004002 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004003 break;
4004
4005 case 141:
4006
kbr@chromium.org476541f2011-10-27 21:14:51 +00004007 {
4008 TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
4009 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
4010 (yyval.interm.type).userDef = structure;
4011 context->exitStructDeclaration();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004012 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004013 break;
4014
kbr@chromium.org476541f2011-10-27 21:14:51 +00004015 case 142:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004016
4017 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004018 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004019 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004020 break;
4021
4022 case 143:
4023
4024 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004025 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4026 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4027 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4028 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4029 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());
4030 context->recover();
4031 }
4032 }
4033 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4034 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004035 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004036 break;
4037
kbr@chromium.org205fef32011-11-22 20:50:02 +00004038 case 144:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004039
4040 {
4041 (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
4042
4043 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
4044 context->recover();
4045 }
4046 for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) {
4047 //
4048 // Careful not to replace already known aspects of type, like array-ness
4049 //
4050 TType* type = (*(yyval.interm.typeList))[i].type;
4051 type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
4052 type->setNominalSize((yyvsp[(1) - (3)].interm.type).size);
4053 type->setMatrix((yyvsp[(1) - (3)].interm.type).matrix);
zmo@google.comdc4b4f82011-06-17 00:42:53 +00004054 type->setPrecision((yyvsp[(1) - (3)].interm.type).precision);
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004055
4056 // don't allow arrays of arrays
4057 if (type->isArray()) {
4058 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type)))
4059 context->recover();
4060 }
4061 if ((yyvsp[(1) - (3)].interm.type).array)
4062 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize);
4063 if ((yyvsp[(1) - (3)].interm.type).userDef) {
4064 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
4065 type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName());
4066 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004067
4068 if (context->structNestingErrorCheck((yyvsp[(1) - (3)].interm.type).line, *type)) {
4069 context->recover();
4070 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004071 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004072 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004073 break;
4074
kbr@chromium.org476541f2011-10-27 21:14:51 +00004075 case 145:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004076
4077 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004078 (yyval.interm.typeList) = NewPoolTTypeList();
4079 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004080 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004081 break;
4082
kbr@chromium.org476541f2011-10-27 21:14:51 +00004083 case 146:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004084
4085 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004086 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004087 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004088 break;
4089
4090 case 147:
4091
4092 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004093 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4094 context->recover();
4095
4096 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4097 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4098 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004099 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004100 break;
4101
kbr@chromium.org205fef32011-11-22 20:50:02 +00004102 case 148:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004103
4104 {
4105 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4106 context->recover();
4107
4108 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4109 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4110 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4111
4112 int size;
4113 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4114 context->recover();
4115 (yyval.interm.typeLine).type->setArraySize(size);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004116 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004117 break;
4118
4119 case 149:
4120
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004121 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004122 break;
4123
4124 case 150:
4125
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004126 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004127 break;
4128
4129 case 151:
4130
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004131 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004132 break;
4133
4134 case 152:
4135
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004136 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004137 break;
4138
4139 case 153:
4140
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004141 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004142 break;
4143
4144 case 154:
4145
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004146 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004147 break;
4148
4149 case 155:
4150
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004151 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004152 break;
4153
4154 case 156:
4155
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004156 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004157 break;
4158
4159 case 157:
4160
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004161 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
zmo@google.com09c323a2011-08-12 18:22:25 +00004162 break;
4163
4164 case 158:
4165
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004166 { (yyval.interm.intermAggregate) = 0; }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004167 break;
4168
4169 case 159:
4170
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004171 { context->symbolTable.push(); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004172 break;
4173
4174 case 160:
4175
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004176 { context->symbolTable.pop(); }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004177 break;
4178
4179 case 161:
4180
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004181 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004182 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004183 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004184 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4185 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004186 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004187 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004188 break;
4189
4190 case 162:
4191
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004192 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004193 break;
4194
4195 case 163:
4196
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004197 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004198 break;
4199
kbr@chromium.org476541f2011-10-27 21:14:51 +00004200 case 164:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004201
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004202 { context->symbolTable.push(); }
4203 break;
4204
4205 case 165:
4206
4207 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4208 break;
4209
4210 case 166:
4211
4212 { context->symbolTable.push(); }
4213 break;
4214
4215 case 167:
4216
4217 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4218 break;
4219
4220 case 168:
4221
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004222 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004223 (yyval.interm.intermNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004224 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004225 break;
4226
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004227 case 169:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004228
4229 {
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004230 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004231 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004232 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4233 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004234 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004235 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004236 break;
4237
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004238 case 170:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004239
4240 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004241 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004242 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004243 break;
4244
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004245 case 171:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004246
kbr@chromium.org205fef32011-11-22 20:50:02 +00004247 {
4248 (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 +00004249 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004250 break;
4251
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004252 case 172:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004253
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004254 { (yyval.interm.intermNode) = 0; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004255 break;
4256
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004257 case 173:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004258
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004259 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004260 break;
4261
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004262 case 174:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004263
4264 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004265 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4266 context->recover();
4267 (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 +00004268 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004269 break;
4270
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004271 case 175:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004272
4273 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004274 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4275 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004276 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004277 break;
4278
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004279 case 176:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004280
4281 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004282 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4283 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004284 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004285 break;
4286
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004287 case 177:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004288
4289 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004290 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4291 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4292 context->recover();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004293 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004294 break;
4295
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004296 case 178:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004297
4298 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004299 TIntermNode* intermNode;
4300 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4301 context->recover();
4302 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4303 context->recover();
4304
4305 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4306 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4307 else {
4308 context->recover();
4309 (yyval.interm.intermTypedNode) = 0;
4310 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004311 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004312 break;
4313
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004314 case 179:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004315
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004316 { context->symbolTable.push(); ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004317 break;
4318
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004319 case 180:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004320
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004321 {
4322 context->symbolTable.pop();
alokp@chromium.org52813552010-11-16 18:36:09 +00004323 (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 +00004324 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004325 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004326 break;
4327
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004328 case 181:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004329
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004330 { ++context->loopNestingLevel; }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004331 break;
4332
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004333 case 182:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004334
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004335 {
4336 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4337 context->recover();
4338
alokp@chromium.org52813552010-11-16 18:36:09 +00004339 (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 +00004340 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004341 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004342 break;
4343
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004344 case 183:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004345
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004346 { context->symbolTable.push(); ++context->loopNestingLevel; }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004347 break;
4348
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004349 case 184:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004350
4351 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004352 context->symbolTable.pop();
4353 (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);
4354 --context->loopNestingLevel;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004355 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004356 break;
4357
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004358 case 185:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004359
4360 {
kbr@chromium.org476541f2011-10-27 21:14:51 +00004361 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004362 }
zmo@google.com09c323a2011-08-12 18:22:25 +00004363 break;
4364
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004365 case 186:
zmo@google.com09c323a2011-08-12 18:22:25 +00004366
4367 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004368 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004369 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004370 break;
4371
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004372 case 187:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004373
4374 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004375 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004376 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004377 break;
4378
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004379 case 188:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004380
4381 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004382 (yyval.interm.intermTypedNode) = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004383 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004384 break;
4385
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004386 case 189:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004387
4388 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004389 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4390 (yyval.interm.nodePair).node2 = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004391 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004392 break;
4393
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004394 case 190:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004395
4396 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004397 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4398 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004399 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004400 break;
4401
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004402 case 191:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004403
4404 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004405 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004406 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004407 context->recover();
4408 }
4409 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004410 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004411 break;
4412
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004413 case 192:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004414
4415 {
4416 if (context->loopNestingLevel <= 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004417 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004418 context->recover();
4419 }
4420 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004421 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004422 break;
4423
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004424 case 193:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004425
4426 {
4427 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
4428 if (context->currentFunctionType->getBasicType() != EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004429 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004430 context->recover();
4431 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004432 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004433 break;
4434
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004435 case 194:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004436
4437 {
4438 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4439 context->functionReturnsValue = true;
4440 if (context->currentFunctionType->getBasicType() == EbtVoid) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004441 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004442 context->recover();
4443 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004444 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004445 context->recover();
4446 }
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004447 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004448 break;
4449
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004450 case 195:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004451
4452 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004453 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
4454 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004455 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004456 break;
4457
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004458 case 196:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004459
4460 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004461 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
zmo@google.com09c323a2011-08-12 18:22:25 +00004462 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004463 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004464 break;
4465
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004466 case 197:
zmo@google.com09c323a2011-08-12 18:22:25 +00004467
4468 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004469 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4470 context->treeRoot = (yyval.interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004471 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004472 break;
4473
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004474 case 198:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004475
4476 {
4477 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004478 }
kbr@chromium.org476541f2011-10-27 21:14:51 +00004479 break;
4480
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004481 case 199:
kbr@chromium.org476541f2011-10-27 21:14:51 +00004482
4483 {
kbr@chromium.org205fef32011-11-22 20:50:02 +00004484 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004485 }
kbr@chromium.org205fef32011-11-22 20:50:02 +00004486 break;
4487
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004488 case 200:
kbr@chromium.org205fef32011-11-22 20:50:02 +00004489
4490 {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004491 TFunction* function = (yyvsp[(1) - (1)].interm).function;
daniel@transgaming.coma8833e92012-07-11 20:37:16 +00004492
4493 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName());
4494
4495 if (builtIn)
4496 {
4497 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4498 context->recover();
4499 }
4500
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004501 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName()));
4502 //
4503 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4504 // as it would have just been put in the symbol table. Otherwise, we're looking up
4505 // an earlier occurance.
4506 //
4507 if (prevDec->isDefined()) {
4508 //
4509 // Then this function already has a body.
4510 //
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004511 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004512 context->recover();
4513 }
4514 prevDec->setDefined();
4515
4516 //
4517 // Raise error message if main function takes any parameters or return anything other than void
4518 //
4519 if (function->getName() == "main") {
4520 if (function->getParamCount() > 0) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004521 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 +00004522 context->recover();
4523 }
4524 if (function->getReturnType().getBasicType() != EbtVoid) {
4525 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
4526 context->recover();
4527 }
4528 }
4529
4530 //
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004531 // Remember the return type for later checking for RETURN statements.
4532 //
4533 context->currentFunctionType = &(prevDec->getReturnType());
4534 context->functionReturnsValue = false;
4535
4536 //
4537 // Insert parameters into the symbol table.
4538 // If the parameter has no name, it's not an error, just don't insert it
4539 // (could be used for unused args).
4540 //
4541 // Also, accumulate the list of parameters into the HIL, so lower level code
4542 // knows where to find parameters.
4543 //
4544 TIntermAggregate* paramNodes = new TIntermAggregate;
shannon.woods@transgaming.com6b04e1b2013-02-28 23:19:41 +00004545 for (size_t i = 0; i < function->getParamCount(); i++) {
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004546 const TParameter& param = function->getParam(i);
4547 if (param.name != 0) {
4548 TVariable *variable = new TVariable(param.name, *param.type);
4549 //
4550 // Insert the parameters with name in the symbol table.
4551 //
4552 if (! context->symbolTable.insert(*variable)) {
maxvujovic@gmail.comc6b3b3c2012-06-27 22:49:39 +00004553 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004554 context->recover();
4555 delete variable;
4556 }
4557
4558 //
4559 // Add the parameter to the HIL
4560 //
4561 paramNodes = context->intermediate.growAggregate(
4562 paramNodes,
4563 context->intermediate.addSymbol(variable->getUniqueId(),
4564 variable->getName(),
4565 variable->getType(), (yyvsp[(1) - (1)].interm).line),
4566 (yyvsp[(1) - (1)].interm).line);
4567 } else {
4568 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
4569 }
4570 }
4571 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
4572 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4573 context->loopNestingLevel = 0;
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004574 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004575 break;
4576
daniel@transgaming.com83dc5a72012-03-09 21:57:07 +00004577 case 201:
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004578
4579 {
4580 //?? Check that all paths return a value if return type != void ?
4581 // May be best done as post process phase on intermediate code
4582 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4583 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4584 context->recover();
4585 }
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004586
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004587 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
4588 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
4589 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4590 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4591
4592 // store the pragma information for debug and optimize and other vendor specific
4593 // information. This information can be queried from the parse tree
alokp@chromium.org8b851c62012-06-15 16:25:11 +00004594 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4595 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
apatrick@chromium.org0f4cefe2011-01-26 19:30:57 +00004596
4597 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4598 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
daniel@transgaming.com5dd6d092012-03-20 20:10:28 +00004599
4600 context->symbolTable.pop();
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004601 }
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004602 break;
4603
4604
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004605
4606 default: break;
4607 }
4608 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4609
4610 YYPOPSTACK (yylen);
4611 yylen = 0;
4612 YY_STACK_PRINT (yyss, yyssp);
4613
4614 *++yyvsp = yyval;
4615
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004616 /* Now `shift' the result of the reduction. Determine what state
4617 that goes to, based on the state we popped back to and the rule
4618 number reduced by. */
4619
4620 yyn = yyr1[yyn];
4621
4622 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4623 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4624 yystate = yytable[yystate];
4625 else
4626 yystate = yydefgoto[yyn - YYNTOKENS];
4627
4628 goto yynewstate;
4629
4630
4631/*------------------------------------.
4632| yyerrlab -- here on detecting error |
4633`------------------------------------*/
4634yyerrlab:
4635 /* If not already recovering from an error, report this error. */
4636 if (!yyerrstatus)
4637 {
4638 ++yynerrs;
4639#if ! YYERROR_VERBOSE
4640 yyerror (context, YY_("syntax error"));
4641#else
4642 {
4643 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4644 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4645 {
4646 YYSIZE_T yyalloc = 2 * yysize;
4647 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4648 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4649 if (yymsg != yymsgbuf)
4650 YYSTACK_FREE (yymsg);
4651 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4652 if (yymsg)
4653 yymsg_alloc = yyalloc;
4654 else
4655 {
4656 yymsg = yymsgbuf;
4657 yymsg_alloc = sizeof yymsgbuf;
4658 }
4659 }
4660
4661 if (0 < yysize && yysize <= yymsg_alloc)
4662 {
4663 (void) yysyntax_error (yymsg, yystate, yychar);
4664 yyerror (context, yymsg);
4665 }
4666 else
4667 {
4668 yyerror (context, YY_("syntax error"));
4669 if (yysize != 0)
4670 goto yyexhaustedlab;
4671 }
4672 }
4673#endif
4674 }
4675
4676
4677
4678 if (yyerrstatus == 3)
4679 {
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004680 /* If just tried and failed to reuse lookahead token after an
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004681 error, discard it. */
4682
4683 if (yychar <= YYEOF)
4684 {
4685 /* Return failure if at end of input. */
4686 if (yychar == YYEOF)
4687 YYABORT;
4688 }
4689 else
4690 {
4691 yydestruct ("Error: discarding",
4692 yytoken, &yylval, context);
4693 yychar = YYEMPTY;
4694 }
4695 }
4696
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004697 /* Else will try to reuse lookahead token after shifting the error
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004698 token. */
4699 goto yyerrlab1;
4700
4701
4702/*---------------------------------------------------.
4703| yyerrorlab -- error raised explicitly by YYERROR. |
4704`---------------------------------------------------*/
4705yyerrorlab:
4706
4707 /* Pacify compilers like GCC when the user code never invokes
4708 YYERROR and the label yyerrorlab therefore never appears in user
4709 code. */
4710 if (/*CONSTCOND*/ 0)
4711 goto yyerrorlab;
4712
4713 /* Do not reclaim the symbols of the rule which action triggered
4714 this YYERROR. */
4715 YYPOPSTACK (yylen);
4716 yylen = 0;
4717 YY_STACK_PRINT (yyss, yyssp);
4718 yystate = *yyssp;
4719 goto yyerrlab1;
4720
4721
4722/*-------------------------------------------------------------.
4723| yyerrlab1 -- common code for both syntax error and YYERROR. |
4724`-------------------------------------------------------------*/
4725yyerrlab1:
4726 yyerrstatus = 3; /* Each real token shifted decrements this. */
4727
4728 for (;;)
4729 {
4730 yyn = yypact[yystate];
4731 if (yyn != YYPACT_NINF)
4732 {
4733 yyn += YYTERROR;
4734 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
4735 {
4736 yyn = yytable[yyn];
4737 if (0 < yyn)
4738 break;
4739 }
4740 }
4741
4742 /* Pop the current state because it cannot handle the error token. */
4743 if (yyssp == yyss)
4744 YYABORT;
4745
4746
4747 yydestruct ("Error: popping",
4748 yystos[yystate], yyvsp, context);
4749 YYPOPSTACK (1);
4750 yystate = *yyssp;
4751 YY_STACK_PRINT (yyss, yyssp);
4752 }
4753
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004754 *++yyvsp = yylval;
4755
4756
4757 /* Shift the error token. */
4758 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
4759
4760 yystate = yyn;
4761 goto yynewstate;
4762
4763
4764/*-------------------------------------.
4765| yyacceptlab -- YYACCEPT comes here. |
4766`-------------------------------------*/
4767yyacceptlab:
4768 yyresult = 0;
4769 goto yyreturn;
4770
4771/*-----------------------------------.
4772| yyabortlab -- YYABORT comes here. |
4773`-----------------------------------*/
4774yyabortlab:
4775 yyresult = 1;
4776 goto yyreturn;
4777
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004778#if !defined(yyoverflow) || YYERROR_VERBOSE
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004779/*-------------------------------------------------.
4780| yyexhaustedlab -- memory exhaustion comes here. |
4781`-------------------------------------------------*/
4782yyexhaustedlab:
4783 yyerror (context, YY_("memory exhausted"));
4784 yyresult = 2;
4785 /* Fall through. */
4786#endif
4787
4788yyreturn:
daniel@transgaming.com05bc2042012-03-09 21:56:58 +00004789 if (yychar != YYEMPTY)
alokp@chromium.org044a5cf2010-11-12 15:42:16 +00004790 yydestruct ("Cleanup: discarding lookahead",
4791 yytoken, &yylval, context);
4792 /* Do not reclaim the symbols of the rule which action triggered
4793 this YYABORT or YYACCEPT. */
4794 YYPOPSTACK (yylen);
4795 YY_STACK_PRINT (yyss, yyssp);
4796 while (yyssp != yyss)
4797 {
4798 yydestruct ("Cleanup: popping",
4799 yystos[*yyssp], yyvsp, context);
4800 YYPOPSTACK (1);
4801 }
4802#ifndef yyoverflow
4803 if (yyss != yyssa)
4804 YYSTACK_FREE (yyss);
4805#endif
4806#if YYERROR_VERBOSE
4807 if (yymsg != yymsgbuf)
4808 YYSTACK_FREE (yymsg);
4809#endif
4810 /* Make sure YYID is used. */
4811 return YYID (yyresult);
4812}
4813
4814
4815
4816
4817
4818int glslang_parse(TParseContext* context) {
4819 return yyparse(context);
4820}
shannon.woods%transgaming.com@gtempaccount.comcbb6b6a2013-04-13 03:27:47 +00004821