blob: e3777f0d328658a515ea959185ad67b015561a06 [file] [log] [blame]
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001
2/* A Bison parser, made by GNU Bison 2.4.1. */
John Bauman66b8ab22014-05-06 15:57:45 -04003
4/* Skeleton implementation for Bison's Yacc-like parsers in C
5
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
John Bauman66b8ab22014-05-06 15:57:45 -04008
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22/* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35/* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
37
38/* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
44
45/* Identify Bison output. */
46#define YYBISON 1
47
48/* Bison version. */
Nicolas Capense9c5e4f2014-05-28 22:46:43 -040049#define YYBISON_VERSION "2.4.1"
John Bauman66b8ab22014-05-06 15:57:45 -040050
51/* Skeleton name. */
52#define YYSKELETON_NAME "yacc.c"
53
54/* Pure parsers. */
55#define YYPURE 1
56
57/* Push parsers. */
58#define YYPUSH 0
59
60/* Pull parsers. */
61#define YYPULL 1
62
63/* Using locations. */
64#define YYLSP_NEEDED 0
65
66
67
68/* Copy the first part of user declarations. */
69
70
71//
Alexis Hetub14178b2015-04-13 13:23:20 -040072// Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved.
John Bauman66b8ab22014-05-06 15:57:45 -040073// Use of this source code is governed by a BSD-style license that can be
74// found in the LICENSE file.
75//
76
77// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
78
79// Ignore errors in auto-generated code.
80#if defined(__GNUC__)
81#pragma GCC diagnostic ignored "-Wunused-function"
82#pragma GCC diagnostic ignored "-Wunused-variable"
83#pragma GCC diagnostic ignored "-Wswitch-enum"
84#elif defined(_MSC_VER)
85#pragma warning(disable: 4065)
86#pragma warning(disable: 4189)
87#pragma warning(disable: 4505)
88#pragma warning(disable: 4701)
89#endif
90
Nicolas Capenscc863da2015-01-21 15:50:55 -050091#include "SymbolTable.h"
92#include "ParseHelper.h"
John Bauman66b8ab22014-05-06 15:57:45 -040093
John Baumand4ae8632014-05-06 16:18:33 -040094#define YYENABLE_NLS 0
95#define YYLTYPE_IS_TRIVIAL 1
96
John Bauman66b8ab22014-05-06 15:57:45 -040097#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
120/* 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,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500136 UINT_TYPE = 268,
137 BREAK = 269,
138 CONTINUE = 270,
139 DO = 271,
140 ELSE = 272,
141 FOR = 273,
142 IF = 274,
143 DISCARD = 275,
144 RETURN = 276,
145 SWITCH = 277,
146 CASE = 278,
147 DEFAULT = 279,
148 BVEC2 = 280,
149 BVEC3 = 281,
150 BVEC4 = 282,
151 IVEC2 = 283,
152 IVEC3 = 284,
153 IVEC4 = 285,
154 VEC2 = 286,
155 VEC3 = 287,
156 VEC4 = 288,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500157 UVEC2 = 289,
158 UVEC3 = 290,
159 UVEC4 = 291,
160 MATRIX2 = 292,
161 MATRIX3 = 293,
162 MATRIX4 = 294,
163 IN_QUAL = 295,
164 OUT_QUAL = 296,
165 INOUT_QUAL = 297,
166 UNIFORM = 298,
167 VARYING = 299,
Alexis Hetub14178b2015-04-13 13:23:20 -0400168 MATRIX2x3 = 300,
169 MATRIX3x2 = 301,
170 MATRIX2x4 = 302,
171 MATRIX4x2 = 303,
172 MATRIX3x4 = 304,
173 MATRIX4x3 = 305,
174 CENTROID = 306,
175 FLAT = 307,
176 SMOOTH = 308,
177 STRUCT = 309,
178 VOID_TYPE = 310,
179 WHILE = 311,
180 SAMPLER2D = 312,
181 SAMPLERCUBE = 313,
182 SAMPLER_EXTERNAL_OES = 314,
183 SAMPLER2DRECT = 315,
184 SAMPLER2DARRAY = 316,
185 ISAMPLER2D = 317,
186 ISAMPLER3D = 318,
187 ISAMPLERCUBE = 319,
188 ISAMPLER2DARRAY = 320,
189 USAMPLER2D = 321,
190 USAMPLER3D = 322,
191 USAMPLERCUBE = 323,
192 USAMPLER2DARRAY = 324,
193 SAMPLER3D = 325,
194 SAMPLER3DRECT = 326,
195 SAMPLER2DSHADOW = 327,
196 SAMPLERCUBESHADOW = 328,
197 SAMPLER2DARRAYSHADOW = 329,
198 LAYOUT = 330,
199 IDENTIFIER = 331,
200 TYPE_NAME = 332,
201 FLOATCONSTANT = 333,
202 INTCONSTANT = 334,
203 UINTCONSTANT = 335,
204 BOOLCONSTANT = 336,
205 FIELD_SELECTION = 337,
206 LEFT_OP = 338,
207 RIGHT_OP = 339,
208 INC_OP = 340,
209 DEC_OP = 341,
210 LE_OP = 342,
211 GE_OP = 343,
212 EQ_OP = 344,
213 NE_OP = 345,
214 AND_OP = 346,
215 OR_OP = 347,
216 XOR_OP = 348,
217 MUL_ASSIGN = 349,
218 DIV_ASSIGN = 350,
219 ADD_ASSIGN = 351,
220 MOD_ASSIGN = 352,
221 LEFT_ASSIGN = 353,
222 RIGHT_ASSIGN = 354,
223 AND_ASSIGN = 355,
224 XOR_ASSIGN = 356,
225 OR_ASSIGN = 357,
226 SUB_ASSIGN = 358,
227 LEFT_PAREN = 359,
228 RIGHT_PAREN = 360,
229 LEFT_BRACKET = 361,
230 RIGHT_BRACKET = 362,
231 LEFT_BRACE = 363,
232 RIGHT_BRACE = 364,
233 DOT = 365,
234 COMMA = 366,
235 COLON = 367,
236 EQUAL = 368,
237 SEMICOLON = 369,
238 BANG = 370,
239 DASH = 371,
240 TILDE = 372,
241 PLUS = 373,
242 STAR = 374,
243 SLASH = 375,
244 PERCENT = 376,
245 LEFT_ANGLE = 377,
246 RIGHT_ANGLE = 378,
247 VERTICAL_BAR = 379,
248 CARET = 380,
249 AMPERSAND = 381,
250 QUESTION = 382
John Bauman66b8ab22014-05-06 15:57:45 -0400251 };
252#endif
253
254
255
256#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
257typedef union YYSTYPE
258{
259
260
261 struct {
262 TSourceLoc line;
263 union {
264 TString *string;
265 float f;
266 int i;
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500267 unsigned int u;
John Bauman66b8ab22014-05-06 15:57:45 -0400268 bool b;
269 };
270 TSymbol* symbol;
271 } lex;
272 struct {
273 TSourceLoc line;
274 TOperator op;
275 union {
276 TIntermNode* intermNode;
277 TIntermNodePair nodePair;
278 TIntermTyped* intermTypedNode;
279 TIntermAggregate* intermAggregate;
280 };
281 union {
282 TPublicType type;
283 TPrecision precision;
Nicolas Capens7d626792015-02-17 17:58:31 -0500284 TLayoutQualifier layoutQualifier;
John Bauman66b8ab22014-05-06 15:57:45 -0400285 TQualifier qualifier;
286 TFunction* function;
287 TParameter param;
288 TTypeLine typeLine;
289 TTypeList* typeList;
290 };
291 } interm;
292
293
294
295} YYSTYPE;
296# define YYSTYPE_IS_TRIVIAL 1
297# define yystype YYSTYPE /* obsolescent; will be withdrawn */
298# define YYSTYPE_IS_DECLARED 1
299#endif
300
301
302/* Copy the second part of user declarations. */
303
304
305extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
306extern void yyerror(TParseContext* context, const char* reason);
307
308#define FRAG_VERT_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500309 if (context->shaderType != GL_FRAGMENT_SHADER && \
310 context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400311 context->error(L, " supported in vertex/fragment shaders only ", S); \
312 context->recover(); \
313 } \
314}
315
316#define VERTEX_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500317 if (context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400318 context->error(L, " supported in vertex shaders only ", S); \
319 context->recover(); \
320 } \
321}
322
323#define FRAG_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500324 if (context->shaderType != GL_FRAGMENT_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400325 context->error(L, " supported in fragment shaders only ", S); \
326 context->recover(); \
327 } \
328}
329
Nicolas Capensc6841852015-02-15 14:25:37 -0500330#define ES2_ONLY(S, L) { \
331 if (context->shaderVersion != 100) { \
332 context->error(L, " supported in GLSL ES 1.00 only ", S); \
333 context->recover(); \
334 } \
335}
336
337#define ES3_ONLY(S, L) { \
338 if (context->shaderVersion != 300) { \
339 context->error(L, " supported in GLSL ES 3.00 only ", S); \
340 context->recover(); \
341 } \
342}
343
John Bauman66b8ab22014-05-06 15:57:45 -0400344
345
346#ifdef short
347# undef short
348#endif
349
350#ifdef YYTYPE_UINT8
351typedef YYTYPE_UINT8 yytype_uint8;
352#else
353typedef unsigned char yytype_uint8;
354#endif
355
356#ifdef YYTYPE_INT8
357typedef YYTYPE_INT8 yytype_int8;
358#elif (defined __STDC__ || defined __C99__FUNC__ \
359 || defined __cplusplus || defined _MSC_VER)
360typedef signed char yytype_int8;
361#else
362typedef short int yytype_int8;
363#endif
364
365#ifdef YYTYPE_UINT16
366typedef YYTYPE_UINT16 yytype_uint16;
367#else
368typedef unsigned short int yytype_uint16;
369#endif
370
371#ifdef YYTYPE_INT16
372typedef YYTYPE_INT16 yytype_int16;
373#else
374typedef short int yytype_int16;
375#endif
376
377#ifndef YYSIZE_T
378# ifdef __SIZE_TYPE__
379# define YYSIZE_T __SIZE_TYPE__
380# elif defined size_t
381# define YYSIZE_T size_t
382# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
385# define YYSIZE_T size_t
386# else
387# define YYSIZE_T unsigned int
388# endif
389#endif
390
391#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
392
393#ifndef YY_
Nicolas Capense9c5e4f2014-05-28 22:46:43 -0400394# if YYENABLE_NLS
John Bauman66b8ab22014-05-06 15:57:45 -0400395# if ENABLE_NLS
396# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
397# define YY_(msgid) dgettext ("bison-runtime", msgid)
398# endif
399# endif
400# ifndef YY_
401# define YY_(msgid) msgid
402# endif
403#endif
404
405/* Suppress unused-variable warnings by "using" E. */
406#if ! defined lint || defined __GNUC__
407# define YYUSE(e) ((void) (e))
408#else
409# define YYUSE(e) /* empty */
410#endif
411
412/* Identity function, used to suppress warnings about constant conditions. */
413#ifndef lint
414# define YYID(n) (n)
415#else
416#if (defined __STDC__ || defined __C99__FUNC__ \
417 || defined __cplusplus || defined _MSC_VER)
418static int
419YYID (int yyi)
420#else
421static int
422YYID (yyi)
423 int yyi;
424#endif
425{
426 return yyi;
427}
428#endif
429
430#if ! defined yyoverflow || YYERROR_VERBOSE
431
432/* The parser invokes alloca or malloc; define the necessary symbols. */
433
434# ifdef YYSTACK_USE_ALLOCA
435# if YYSTACK_USE_ALLOCA
436# ifdef __GNUC__
437# define YYSTACK_ALLOC __builtin_alloca
438# elif defined __BUILTIN_VA_ARG_INCR
439# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
440# elif defined _AIX
441# define YYSTACK_ALLOC __alloca
442# elif defined _MSC_VER
443# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
444# define alloca _alloca
445# else
446# define YYSTACK_ALLOC alloca
447# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
448 || defined __cplusplus || defined _MSC_VER)
449# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
450# ifndef _STDLIB_H
451# define _STDLIB_H 1
452# endif
453# endif
454# endif
455# endif
456# endif
457
458# ifdef YYSTACK_ALLOC
459 /* Pacify GCC's `empty if-body' warning. */
460# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
461# ifndef YYSTACK_ALLOC_MAXIMUM
462 /* The OS might guarantee only one guard page at the bottom of the stack,
463 and a page size can be as small as 4096 bytes. So we cannot safely
464 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
465 to allow for a few compiler-allocated temporary stack slots. */
466# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
467# endif
468# else
469# define YYSTACK_ALLOC YYMALLOC
470# define YYSTACK_FREE YYFREE
471# ifndef YYSTACK_ALLOC_MAXIMUM
472# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
473# endif
474# if (defined __cplusplus && ! defined _STDLIB_H \
475 && ! ((defined YYMALLOC || defined malloc) \
476 && (defined YYFREE || defined free)))
477# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
478# ifndef _STDLIB_H
479# define _STDLIB_H 1
480# endif
481# endif
482# ifndef YYMALLOC
483# define YYMALLOC malloc
484# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
485 || defined __cplusplus || defined _MSC_VER)
486void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
487# endif
488# endif
489# ifndef YYFREE
490# define YYFREE free
491# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
492 || defined __cplusplus || defined _MSC_VER)
493void free (void *); /* INFRINGES ON USER NAME SPACE */
494# endif
495# endif
496# endif
497#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
498
499
500#if (! defined yyoverflow \
501 && (! defined __cplusplus \
502 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
503
504/* A type that is properly aligned for any stack member. */
505union yyalloc
506{
507 yytype_int16 yyss_alloc;
508 YYSTYPE yyvs_alloc;
509};
510
511/* The size of the maximum gap between one aligned stack and the next. */
512# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
513
514/* The size of an array large to enough to hold all stacks, each with
515 N elements. */
516# define YYSTACK_BYTES(N) \
517 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
518 + YYSTACK_GAP_MAXIMUM)
519
520/* Copy COUNT objects from FROM to TO. The source and destination do
521 not overlap. */
522# ifndef YYCOPY
523# if defined __GNUC__ && 1 < __GNUC__
524# define YYCOPY(To, From, Count) \
525 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
526# else
527# define YYCOPY(To, From, Count) \
528 do \
529 { \
530 YYSIZE_T yyi; \
531 for (yyi = 0; yyi < (Count); yyi++) \
532 (To)[yyi] = (From)[yyi]; \
533 } \
534 while (YYID (0))
535# endif
536# endif
537
538/* Relocate STACK from its old location to the new one. The
539 local variables YYSIZE and YYSTACKSIZE give the old and new number of
540 elements in the stack, and YYPTR gives the new location of the
541 stack. Advance YYPTR to a properly aligned location for the next
542 stack. */
543# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
544 do \
545 { \
546 YYSIZE_T yynewbytes; \
547 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
548 Stack = &yyptr->Stack_alloc; \
549 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
550 yyptr += yynewbytes / sizeof (*yyptr); \
551 } \
552 while (YYID (0))
553
554#endif
555
556/* YYFINAL -- State number of the termination state. */
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400557#define YYFINAL 107
John Bauman66b8ab22014-05-06 15:57:45 -0400558/* YYLAST -- Last index in YYTABLE. */
Alexis Hetu17809052015-05-13 11:28:22 -0400559#define YYLAST 2056
John Bauman66b8ab22014-05-06 15:57:45 -0400560
561/* YYNTOKENS -- Number of terminals. */
Alexis Hetub14178b2015-04-13 13:23:20 -0400562#define YYNTOKENS 128
John Bauman66b8ab22014-05-06 15:57:45 -0400563/* YYNNTS -- Number of nonterminals. */
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400564#define YYNNTS 89
John Bauman66b8ab22014-05-06 15:57:45 -0400565/* YYNRULES -- Number of rules. */
Alexis Hetu17809052015-05-13 11:28:22 -0400566#define YYNRULES 255
John Bauman66b8ab22014-05-06 15:57:45 -0400567/* YYNRULES -- Number of states. */
Alexis Hetu17809052015-05-13 11:28:22 -0400568#define YYNSTATES 370
John Bauman66b8ab22014-05-06 15:57:45 -0400569
570/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
571#define YYUNDEFTOK 2
Alexis Hetub14178b2015-04-13 13:23:20 -0400572#define YYMAXUTOK 382
John Bauman66b8ab22014-05-06 15:57:45 -0400573
574#define YYTRANSLATE(YYX) \
575 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
576
577/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
578static const yytype_uint8 yytranslate[] =
579{
580 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
606 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
607 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
608 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
609 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
610 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
611 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
612 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
613 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
Alexis Hetub027aa92015-01-19 15:56:12 -0500614 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500615 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Alexis Hetub14178b2015-04-13 13:23:20 -0400616 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
617 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
618 125, 126, 127
John Bauman66b8ab22014-05-06 15:57:45 -0400619};
620
621#if YYDEBUG
622/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
623 YYRHS. */
624static const yytype_uint16 yyprhs[] =
625{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500626 0, 0, 3, 5, 7, 9, 11, 13, 15, 19,
627 21, 26, 28, 32, 35, 38, 40, 42, 44, 48,
628 51, 54, 57, 59, 62, 66, 69, 71, 73, 75,
Alexis Hetu17809052015-05-13 11:28:22 -0400629 77, 80, 83, 86, 88, 90, 92, 94, 96, 100,
630 104, 108, 110, 114, 118, 120, 124, 128, 130, 134,
631 138, 142, 146, 148, 152, 156, 158, 162, 164, 168,
632 170, 174, 176, 180, 182, 186, 188, 192, 194, 200,
633 202, 206, 208, 210, 212, 214, 216, 218, 220, 222,
634 224, 226, 228, 230, 234, 236, 239, 242, 247, 250,
635 252, 254, 257, 261, 265, 268, 274, 278, 281, 285,
636 288, 289, 291, 293, 295, 297, 299, 303, 309, 316,
637 322, 324, 327, 332, 338, 343, 346, 348, 351, 353,
638 355, 357, 359, 361, 364, 366, 369, 371, 373, 376,
639 378, 380, 382, 385, 388, 390, 392, 395, 397, 399,
640 401, 406, 408, 412, 414, 418, 422, 424, 429, 431,
641 433, 435, 437, 439, 441, 443, 445, 447, 449, 451,
642 453, 455, 457, 459, 461, 463, 465, 467, 469, 471,
643 473, 475, 477, 479, 481, 483, 485, 487, 489, 491,
644 493, 495, 497, 499, 501, 503, 505, 507, 509, 511,
645 513, 515, 517, 518, 525, 526, 532, 534, 537, 541,
646 543, 547, 549, 554, 556, 558, 560, 562, 564, 566,
647 568, 570, 572, 575, 576, 577, 583, 585, 587, 588,
648 591, 592, 595, 598, 602, 604, 607, 609, 612, 618,
649 622, 624, 626, 631, 632, 639, 640, 649, 650, 658,
650 660, 662, 664, 665, 668, 672, 675, 678, 681, 685,
651 688, 690, 693, 695, 697, 698
John Bauman66b8ab22014-05-06 15:57:45 -0400652};
653
654/* YYRHS -- A `-1'-separated list of the rules' RHS. */
655static const yytype_int16 yyrhs[] =
656{
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400657 213, 0, -1, 76, -1, 129, -1, 79, -1, 80,
Alexis Hetub14178b2015-04-13 13:23:20 -0400658 -1, 78, -1, 81, -1, 104, 156, 105, -1, 130,
659 -1, 131, 106, 132, 107, -1, 133, -1, 131, 110,
660 82, -1, 131, 85, -1, 131, 86, -1, 156, -1,
661 134, -1, 135, -1, 131, 110, 135, -1, 137, 105,
662 -1, 136, 105, -1, 138, 55, -1, 138, -1, 138,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400663 154, -1, 137, 111, 154, -1, 139, 104, -1, 180,
Alexis Hetub14178b2015-04-13 13:23:20 -0400664 -1, 76, -1, 82, -1, 131, -1, 85, 140, -1,
665 86, 140, -1, 141, 140, -1, 118, -1, 116, -1,
Alexis Hetu17809052015-05-13 11:28:22 -0400666 115, -1, 117, -1, 140, -1, 142, 119, 140, -1,
667 142, 120, 140, -1, 142, 121, 140, -1, 142, -1,
668 143, 118, 142, -1, 143, 116, 142, -1, 143, -1,
669 144, 83, 143, -1, 144, 84, 143, -1, 144, -1,
670 145, 122, 144, -1, 145, 123, 144, -1, 145, 87,
671 144, -1, 145, 88, 144, -1, 145, -1, 146, 89,
672 145, -1, 146, 90, 145, -1, 146, -1, 147, 126,
673 146, -1, 147, -1, 148, 125, 147, -1, 148, -1,
674 149, 124, 148, -1, 149, -1, 150, 91, 149, -1,
675 150, -1, 151, 93, 150, -1, 151, -1, 152, 92,
676 151, -1, 152, -1, 152, 127, 156, 112, 154, -1,
677 153, -1, 140, 155, 154, -1, 113, -1, 94, -1,
678 95, -1, 97, -1, 96, -1, 103, -1, 98, -1,
679 99, -1, 100, -1, 101, -1, 102, -1, 154, -1,
680 156, 111, 154, -1, 153, -1, 159, 114, -1, 167,
681 114, -1, 7, 175, 179, 114, -1, 160, 105, -1,
682 162, -1, 161, -1, 162, 164, -1, 161, 111, 164,
683 -1, 169, 76, 104, -1, 174, 76, -1, 174, 76,
684 106, 157, 107, -1, 171, 165, 163, -1, 165, 163,
685 -1, 171, 165, 166, -1, 165, 166, -1, -1, 40,
686 -1, 41, -1, 42, -1, 174, -1, 168, -1, 167,
687 111, 76, -1, 167, 111, 76, 106, 107, -1, 167,
688 111, 76, 106, 157, 107, -1, 167, 111, 76, 113,
689 188, -1, 169, -1, 169, 76, -1, 169, 76, 106,
690 107, -1, 169, 76, 106, 157, 107, -1, 169, 76,
691 113, 188, -1, 3, 76, -1, 174, -1, 172, 174,
692 -1, 53, -1, 52, -1, 9, -1, 8, -1, 44,
693 -1, 3, 44, -1, 173, -1, 170, 173, -1, 170,
694 -1, 176, -1, 176, 173, -1, 9, -1, 40, -1,
695 41, -1, 51, 40, -1, 51, 41, -1, 43, -1,
696 179, -1, 175, 179, -1, 4, -1, 5, -1, 6,
697 -1, 75, 104, 177, 105, -1, 178, -1, 177, 111,
698 178, -1, 76, -1, 76, 113, 79, -1, 76, 113,
699 80, -1, 180, -1, 180, 106, 157, 107, -1, 55,
700 -1, 11, -1, 12, -1, 13, -1, 10, -1, 31,
701 -1, 32, -1, 33, -1, 25, -1, 26, -1, 27,
702 -1, 28, -1, 29, -1, 30, -1, 34, -1, 35,
703 -1, 36, -1, 37, -1, 38, -1, 39, -1, 45,
704 -1, 46, -1, 47, -1, 48, -1, 49, -1, 50,
705 -1, 57, -1, 58, -1, 59, -1, 70, -1, 61,
706 -1, 62, -1, 63, -1, 64, -1, 65, -1, 66,
707 -1, 67, -1, 68, -1, 69, -1, 72, -1, 73,
708 -1, 74, -1, 181, -1, 77, -1, -1, 54, 76,
709 108, 182, 184, 109, -1, -1, 54, 108, 183, 184,
710 109, -1, 185, -1, 184, 185, -1, 174, 186, 114,
711 -1, 187, -1, 186, 111, 187, -1, 76, -1, 76,
712 106, 157, 107, -1, 154, -1, 158, -1, 192, -1,
713 191, -1, 189, -1, 201, -1, 202, -1, 205, -1,
714 212, -1, 108, 109, -1, -1, -1, 108, 193, 200,
715 194, 109, -1, 199, -1, 191, -1, -1, 197, 199,
716 -1, -1, 198, 191, -1, 108, 109, -1, 108, 200,
717 109, -1, 190, -1, 200, 190, -1, 114, -1, 156,
718 114, -1, 19, 104, 156, 105, 203, -1, 196, 17,
719 196, -1, 196, -1, 156, -1, 169, 76, 113, 188,
720 -1, -1, 56, 104, 206, 204, 105, 195, -1, -1,
721 16, 207, 196, 56, 104, 156, 105, 114, -1, -1,
722 18, 104, 208, 209, 211, 105, 195, -1, 201, -1,
723 189, -1, 204, -1, -1, 210, 114, -1, 210, 114,
724 156, -1, 15, 114, -1, 14, 114, -1, 21, 114,
725 -1, 21, 156, 114, -1, 20, 114, -1, 214, -1,
726 213, 214, -1, 215, -1, 158, -1, -1, 159, 216,
727 199, -1
John Bauman66b8ab22014-05-06 15:57:45 -0400728};
729
730/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
731static const yytype_uint16 yyrline[] =
732{
Alexis Hetub14178b2015-04-13 13:23:20 -0400733 0, 190, 190, 225, 228, 233, 238, 243, 248, 254,
734 257, 336, 339, 440, 450, 463, 471, 571, 574, 582,
Alexis Hetub7c46af2015-05-12 15:58:09 -0400735 586, 593, 597, 604, 610, 619, 627, 704, 711, 721,
Alexis Hetud061e422015-05-13 16:37:50 -0400736 724, 734, 744, 766, 767, 768, 769, 777, 778, 787,
737 796, 809, 810, 818, 829, 830, 839, 851, 852, 862,
738 872, 882, 895, 896, 906, 919, 920, 934, 935, 949,
739 950, 964, 965, 978, 979, 992, 993, 1006, 1007, 1024,
740 1025, 1038, 1039, 1040, 1041, 1043, 1044, 1045, 1047, 1049,
741 1051, 1053, 1058, 1061, 1072, 1080, 1107, 1112, 1122, 1160,
742 1163, 1170, 1178, 1199, 1220, 1231, 1260, 1265, 1275, 1280,
743 1290, 1293, 1296, 1299, 1305, 1312, 1315, 1337, 1355, 1379,
Alexis Hetu42ff6b12015-06-03 16:03:48 -0400744 1402, 1406, 1424, 1432, 1464, 1484, 1572, 1582, 1588, 1591,
745 1597, 1603, 1610, 1619, 1628, 1631, 1634, 1641, 1645, 1652,
746 1656, 1661, 1666, 1676, 1686, 1695, 1705, 1712, 1715, 1718,
747 1724, 1731, 1734, 1740, 1743, 1746, 1752, 1755, 1770, 1774,
748 1778, 1782, 1786, 1790, 1795, 1800, 1805, 1810, 1815, 1820,
749 1825, 1830, 1835, 1840, 1845, 1850, 1856, 1862, 1868, 1874,
750 1880, 1886, 1892, 1898, 1904, 1909, 1914, 1923, 1928, 1933,
751 1938, 1943, 1948, 1953, 1958, 1963, 1968, 1973, 1978, 1983,
752 1988, 1993, 2006, 2006, 2020, 2020, 2029, 2032, 2047, 2079,
753 2083, 2089, 2097, 2113, 2117, 2121, 2122, 2128, 2129, 2130,
754 2131, 2132, 2136, 2137, 2137, 2137, 2147, 2148, 2152, 2152,
755 2153, 2153, 2158, 2161, 2171, 2174, 2180, 2181, 2185, 2193,
756 2197, 2207, 2212, 2229, 2229, 2234, 2234, 2241, 2241, 2249,
757 2252, 2258, 2261, 2267, 2271, 2278, 2285, 2292, 2299, 2310,
758 2319, 2323, 2330, 2333, 2339, 2339
John Bauman66b8ab22014-05-06 15:57:45 -0400759};
760#endif
761
762#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
763/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
764 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
765static const char *const yytname[] =
766{
767 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
768 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
Nicolas Capens3c20f802015-02-17 17:17:20 -0500769 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE",
770 "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN",
771 "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500772 "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2",
773 "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
Alexis Hetub14178b2015-04-13 13:23:20 -0400774 "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2",
775 "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT",
776 "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES",
777 "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D",
778 "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
779 "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT",
780 "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT",
781 "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
782 "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
783 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
784 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
785 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
786 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500787 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
788 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
789 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
790 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
791 "primary_expression", "postfix_expression", "integer_expression",
792 "function_call", "function_call_or_method", "function_call_generic",
John Bauman66b8ab22014-05-06 15:57:45 -0400793 "function_call_header_no_parameters",
794 "function_call_header_with_parameters", "function_call_header",
795 "function_identifier", "unary_expression", "unary_operator",
796 "multiplicative_expression", "additive_expression", "shift_expression",
797 "relational_expression", "equality_expression", "and_expression",
798 "exclusive_or_expression", "inclusive_or_expression",
799 "logical_and_expression", "logical_xor_expression",
800 "logical_or_expression", "conditional_expression",
801 "assignment_expression", "assignment_operator", "expression",
802 "constant_expression", "declaration", "function_prototype",
803 "function_declarator", "function_header_with_parameters",
804 "function_header", "parameter_declarator", "parameter_declaration",
805 "parameter_qualifier", "parameter_type_specifier",
806 "init_declarator_list", "single_declaration", "fully_specified_type",
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400807 "interpolation_qualifier", "parameter_type_qualifier", "type_qualifier",
808 "storage_qualifier", "type_specifier", "precision_qualifier",
809 "layout_qualifier", "layout_qualifier_id_list", "layout_qualifier_id",
Nicolas Capens7d626792015-02-17 17:58:31 -0500810 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
811 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
John Bauman66b8ab22014-05-06 15:57:45 -0400812 "struct_declarator_list", "struct_declarator", "initializer",
813 "declaration_statement", "statement", "simple_statement",
814 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
815 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
816 "statement_list", "expression_statement", "selection_statement",
817 "selection_rest_statement", "condition", "iteration_statement", "$@7",
818 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
819 "jump_statement", "translation_unit", "external_declaration",
820 "function_definition", "$@10", 0
821};
822#endif
823
824# ifdef YYPRINT
825/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
826 token YYLEX-NUM. */
827static const yytype_uint16 yytoknum[] =
828{
829 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
830 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
831 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
832 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
833 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
834 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
835 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
836 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
837 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
Nicolas Capensc6841852015-02-15 14:25:37 -0500838 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Nicolas Capens7d626792015-02-17 17:58:31 -0500839 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Alexis Hetub14178b2015-04-13 13:23:20 -0400840 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
841 375, 376, 377, 378, 379, 380, 381, 382
John Bauman66b8ab22014-05-06 15:57:45 -0400842};
843# endif
844
845/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
846static const yytype_uint8 yyr1[] =
847{
Alexis Hetub14178b2015-04-13 13:23:20 -0400848 0, 128, 129, 130, 130, 130, 130, 130, 130, 131,
849 131, 131, 131, 131, 131, 132, 133, 134, 134, 135,
850 135, 136, 136, 137, 137, 138, 139, 139, 139, 140,
Alexis Hetu17809052015-05-13 11:28:22 -0400851 140, 140, 140, 141, 141, 141, 141, 142, 142, 142,
852 142, 143, 143, 143, 144, 144, 144, 145, 145, 145,
853 145, 145, 146, 146, 146, 147, 147, 148, 148, 149,
854 149, 150, 150, 151, 151, 152, 152, 153, 153, 154,
855 154, 155, 155, 155, 155, 155, 155, 155, 155, 155,
856 155, 155, 156, 156, 157, 158, 158, 158, 159, 160,
857 160, 161, 161, 162, 163, 163, 164, 164, 164, 164,
858 165, 165, 165, 165, 166, 167, 167, 167, 167, 167,
859 168, 168, 168, 168, 168, 168, 169, 169, 170, 170,
860 171, 172, 172, 172, 172, 172, 172, 172, 172, 173,
861 173, 173, 173, 173, 173, 174, 174, 175, 175, 175,
862 176, 177, 177, 178, 178, 178, 179, 179, 180, 180,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400863 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
864 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
865 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
Alexis Hetu17809052015-05-13 11:28:22 -0400866 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
867 180, 180, 182, 181, 183, 181, 184, 184, 185, 186,
868 186, 187, 187, 188, 189, 190, 190, 191, 191, 191,
869 191, 191, 192, 193, 194, 192, 195, 195, 197, 196,
870 198, 196, 199, 199, 200, 200, 201, 201, 202, 203,
871 203, 204, 204, 206, 205, 207, 205, 208, 205, 209,
872 209, 210, 210, 211, 211, 212, 212, 212, 212, 212,
873 213, 213, 214, 214, 216, 215
John Bauman66b8ab22014-05-06 15:57:45 -0400874};
875
876/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
877static const yytype_uint8 yyr2[] =
878{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500879 0, 2, 1, 1, 1, 1, 1, 1, 3, 1,
880 4, 1, 3, 2, 2, 1, 1, 1, 3, 2,
881 2, 2, 1, 2, 3, 2, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400882 2, 2, 2, 1, 1, 1, 1, 1, 3, 3,
883 3, 1, 3, 3, 1, 3, 3, 1, 3, 3,
884 3, 3, 1, 3, 3, 1, 3, 1, 3, 1,
885 3, 1, 3, 1, 3, 1, 3, 1, 5, 1,
886 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
887 1, 1, 1, 3, 1, 2, 2, 4, 2, 1,
888 1, 2, 3, 3, 2, 5, 3, 2, 3, 2,
889 0, 1, 1, 1, 1, 1, 3, 5, 6, 5,
890 1, 2, 4, 5, 4, 2, 1, 2, 1, 1,
891 1, 1, 1, 2, 1, 2, 1, 1, 2, 1,
892 1, 1, 2, 2, 1, 1, 2, 1, 1, 1,
893 4, 1, 3, 1, 3, 3, 1, 4, 1, 1,
John Bauman66b8ab22014-05-06 15:57:45 -0400894 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetub14178b2015-04-13 13:23:20 -0400895 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
896 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400897 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
898 1, 1, 0, 6, 0, 5, 1, 2, 3, 1,
899 3, 1, 4, 1, 1, 1, 1, 1, 1, 1,
900 1, 1, 2, 0, 0, 5, 1, 1, 0, 2,
901 0, 2, 2, 3, 1, 2, 1, 2, 5, 3,
902 1, 1, 4, 0, 6, 0, 8, 0, 7, 1,
903 1, 1, 0, 2, 3, 2, 2, 2, 3, 2,
904 1, 2, 1, 1, 0, 3
John Bauman66b8ab22014-05-06 15:57:45 -0400905};
906
907/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
908 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
909 means the default is an error. */
910static const yytype_uint8 yydefact[] =
911{
Alexis Hetu17809052015-05-13 11:28:22 -0400912 0, 0, 137, 138, 139, 0, 121, 129, 152, 149,
913 150, 151, 156, 157, 158, 159, 160, 161, 153, 154,
914 155, 162, 163, 164, 165, 166, 167, 130, 131, 134,
915 122, 168, 169, 170, 171, 172, 173, 0, 119, 118,
916 0, 148, 174, 175, 176, 178, 179, 180, 181, 182,
917 183, 184, 185, 186, 177, 187, 188, 189, 0, 191,
918 253, 254, 0, 90, 100, 0, 105, 110, 126, 0,
919 124, 116, 0, 127, 135, 146, 190, 0, 250, 252,
920 123, 115, 0, 132, 133, 0, 194, 0, 85, 0,
921 88, 100, 120, 101, 102, 103, 91, 0, 100, 0,
922 86, 111, 125, 117, 136, 128, 0, 1, 251, 0,
923 192, 0, 143, 0, 141, 0, 255, 92, 97, 99,
924 104, 0, 106, 93, 0, 0, 2, 6, 4, 5,
925 7, 28, 0, 0, 0, 35, 34, 36, 33, 3,
926 9, 29, 11, 16, 17, 0, 0, 22, 0, 37,
927 0, 41, 44, 47, 52, 55, 57, 59, 61, 63,
928 65, 67, 84, 0, 26, 87, 0, 0, 0, 196,
929 0, 140, 0, 0, 0, 235, 0, 0, 0, 0,
930 0, 213, 222, 226, 37, 69, 82, 0, 204, 0,
931 146, 207, 224, 206, 205, 0, 208, 209, 210, 211,
932 94, 96, 98, 0, 0, 112, 0, 203, 114, 30,
933 31, 0, 13, 14, 0, 0, 20, 19, 0, 21,
934 23, 25, 32, 0, 0, 0, 0, 0, 0, 0,
935 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
936 0, 0, 0, 147, 0, 201, 0, 199, 195, 197,
937 144, 145, 142, 246, 245, 220, 237, 0, 249, 247,
938 0, 233, 212, 0, 72, 73, 75, 74, 77, 78,
939 79, 80, 81, 76, 71, 0, 0, 227, 223, 225,
940 0, 107, 0, 109, 113, 8, 0, 15, 27, 12,
941 18, 24, 38, 39, 40, 43, 42, 45, 46, 50,
942 51, 48, 49, 53, 54, 56, 58, 60, 62, 64,
943 66, 0, 193, 0, 0, 198, 0, 0, 0, 0,
944 0, 248, 0, 214, 70, 83, 0, 108, 10, 0,
945 0, 200, 0, 219, 221, 240, 239, 242, 220, 0,
946 231, 0, 0, 0, 95, 68, 202, 0, 241, 0,
947 0, 230, 228, 0, 0, 215, 0, 243, 0, 220,
948 0, 217, 234, 216, 0, 244, 238, 229, 232, 236
John Bauman66b8ab22014-05-06 15:57:45 -0400949};
950
951/* YYDEFGOTO[NTERM-NUM]. */
952static const yytype_int16 yydefgoto[] =
953{
Alexis Hetu17809052015-05-13 11:28:22 -0400954 -1, 139, 140, 141, 286, 142, 143, 144, 145, 146,
955 147, 148, 184, 150, 151, 152, 153, 154, 155, 156,
956 157, 158, 159, 160, 161, 185, 186, 275, 187, 163,
957 188, 189, 62, 63, 64, 118, 96, 97, 119, 65,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400958 66, 67, 68, 98, 69, 70, 71, 72, 73, 113,
Alexis Hetu17809052015-05-13 11:28:22 -0400959 114, 74, 164, 76, 166, 111, 168, 169, 246, 247,
960 208, 191, 192, 193, 194, 263, 343, 362, 316, 317,
961 318, 363, 195, 196, 197, 352, 342, 198, 322, 255,
962 319, 337, 349, 350, 199, 77, 78, 79, 89
John Bauman66b8ab22014-05-06 15:57:45 -0400963};
964
965/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
966 STATE-NUM. */
Alexis Hetu17809052015-05-13 11:28:22 -0400967#define YYPACT_NINF -324
John Bauman66b8ab22014-05-06 15:57:45 -0400968static const yytype_int16 yypact[] =
969{
Alexis Hetu17809052015-05-13 11:28:22 -0400970 1769, -31, -324, -324, -324, 144, -324, -324, -324, -324,
971 -324, -324, -324, -324, -324, -324, -324, -324, -324, -324,
972 -324, -324, -324, -324, -324, -324, -324, -324, -324, -324,
973 -324, -324, -324, -324, -324, -324, -324, 69, -324, -324,
974 -60, -324, -324, -324, -324, -324, -324, -324, -324, -324,
975 -324, -324, -324, -324, -324, -324, -324, -324, -82, -324,
976 -324, -88, -52, -48, 1, -23, -324, 2, 11, 1843,
977 -324, -324, 1979, 11, -324, -7, -324, 1694, -324, -324,
978 -324, -324, 1979, -324, -324, 18, -324, 31, -324, 59,
979 -324, 78, -324, -324, -324, -324, -324, 1843, 113, 85,
980 -324, -79, -324, -324, -324, -324, 1419, -324, -324, 55,
981 -324, 1843, 61, -55, -324, 356, -324, -324, -324, -324,
982 102, 1843, -67, -324, 1128, 1419, 75, -324, -324, -324,
983 -324, -324, 1419, 1419, 1419, -324, -324, -324, -324, -324,
984 -324, -27, -324, -324, -324, 76, -44, 1514, 79, -324,
985 1419, 37, -45, 30, -57, 27, 56, 62, 60, 95,
986 96, -83, -324, 81, -324, -324, 1843, 114, 243, -324,
987 80, -324, 31, 77, 83, -324, 89, 90, 84, 1226,
988 97, 91, -324, -324, 230, -324, -324, -19, -324, -88,
989 -1, -324, -324, -324, -324, 472, -324, -324, -324, -324,
990 93, -324, -324, 1321, 1419, -324, 99, -324, -324, -324,
991 -324, -37, -324, -324, 1419, 1911, -324, -324, 1419, 98,
992 -324, -324, -324, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
993 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
994 1419, 1419, 1419, -324, 1609, 103, -18, -324, -324, -324,
995 -324, -324, -324, -324, -324, 100, -324, 1419, -324, -324,
996 -13, -324, -324, 588, -324, -324, -324, -324, -324, -324,
997 -324, -324, -324, -324, -324, 1419, 1419, -324, -324, -324,
998 1419, -324, 104, -324, -324, -324, 105, 92, -324, 109,
999 -324, -324, -324, -324, -324, 37, 37, -45, -45, 30,
1000 30, 30, 30, -57, -57, 27, 56, 62, 60, 95,
1001 96, 53, -324, 1419, 114, -324, 148, 59, 820, 936,
1002 -35, -324, 1033, 588, -324, -324, 107, -324, -324, 1419,
1003 108, -324, 112, -324, -324, -324, -324, 1033, 100, 175,
1004 92, 145, 115, 116, -324, -324, -324, 1419, -324, 110,
1005 117, 206, -324, 118, 704, -324, -30, 1419, 704, 100,
1006 1419, -324, -324, -324, 119, 92, -324, -324, -324, -324
John Bauman66b8ab22014-05-06 15:57:45 -04001007};
1008
1009/* YYPGOTO[NTERM-NUM]. */
1010static const yytype_int16 yypgoto[] =
1011{
Alexis Hetu17809052015-05-13 11:28:22 -04001012 -324, -324, -324, -324, -324, -324, -324, 13, -324, -324,
1013 -324, -324, -95, -324, -56, -53, -108, -62, -10, -8,
1014 -6, -5, -3, -2, -324, -103, -124, -324, -130, -117,
1015 8, 12, -324, -324, -324, 120, 147, 137, 121, -324,
1016 -324, -305, -324, -324, -324, -33, -64, 235, -324, -324,
1017 71, -54, 0, -324, -324, -324, 86, -154, -324, -69,
1018 -198, -73, -176, -294, -324, -324, -324, -107, -323, -324,
1019 -324, -87, -4, -61, -324, -324, -80, -324, -324, -324,
1020 -324, -324, -324, -324, -324, -324, 173, -324, -324
John Bauman66b8ab22014-05-06 15:57:45 -04001021};
1022
1023/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1024 positive, shift that token. If negative, reduce the rule which
1025 number is the opposite. If zero, do what YYDEFACT says.
1026 If YYTABLE_NINF, syntax error. */
Alexis Hetu17809052015-05-13 11:28:22 -04001027#define YYTABLE_NINF -219
John Bauman66b8ab22014-05-06 15:57:45 -04001028static const yytype_int16 yytable[] =
1029{
Alexis Hetu17809052015-05-13 11:28:22 -04001030 75, 207, 116, 162, 211, 103, 283, 206, 60, 241,
1031 92, 149, 61, 80, 249, 351, 85, 341, 104, 279,
1032 7, 162, 87, 220, 334, 123, 88, 124, 109, 149,
1033 230, 231, 341, 120, 125, 102, 367, 209, 210, 203,
1034 105, 93, 94, 95, 242, 81, 204, 167, 86, 260,
1035 171, 27, 28, 90, 29, 222, 172, 120, 212, 213,
1036 361, 217, 37, 91, 361, 232, 233, 218, 285, 75,
1037 338, 226, 75, 227, 276, 364, 276, 75, 101, 214,
1038 207, 276, 75, 215, 287, 60, 282, 92, 99, 61,
1039 249, 100, 276, 314, 291, 277, 315, 75, 276, 106,
1040 162, 321, 167, -26, 167, 106, -89, 112, 149, 83,
1041 84, 75, 311, 228, 229, 190, 234, 235, 93, 94,
1042 95, 75, 299, 300, 301, 302, 110, 320, 292, 293,
1043 294, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1044 149, 149, 149, 149, 149, 149, 149, 279, 2, 3,
1045 4, 324, 325, 93, 94, 95, 223, 224, 225, 250,
1046 251, 122, 368, 326, 276, 329, 75, 115, 75, 165,
1047 295, 296, 303, 304, 170, 297, 298, 162, 200, -27,
1048 167, 216, 236, 221, 238, 149, 239, 237, 243, 240,
1049 245, 253, 340, 256, 257, 190, 330, 254, 258, 280,
1050 262, 261, -148, 276, 332, 345, 284, 340, -218, 313,
1051 162, 327, 328, -28, 344, 346, 347, 356, 149, 80,
1052 354, 353, 358, 359, 357, 355, 305, 365, 290, 306,
1053 333, 360, 307, 369, 308, 121, 207, 309, 117, 310,
1054 82, 201, 202, 252, 75, 331, 335, 2, 3, 4,
1055 108, 366, 244, 8, 9, 10, 11, 348, 336, 323,
1056 0, 0, 0, 190, 0, 0, 0, 0, 12, 13,
1057 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1058 24, 25, 26, 0, 0, 0, 0, 0, 31, 32,
1059 33, 34, 35, 36, 0, 0, 0, 40, 41, 0,
1060 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1061 51, 52, 53, 54, 0, 55, 56, 57, 190, 190,
1062 59, 0, 190, 190, 264, 265, 266, 267, 268, 269,
1063 270, 271, 272, 273, 0, 0, 0, 190, 0, 0,
1064 0, 0, 0, 274, 0, 0, 0, 0, 0, 0,
1065 0, 0, 248, 0, 190, 0, 0, 0, 190, 1,
1066 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1067 173, 174, 175, 0, 176, 177, 178, 179, 0, 0,
1068 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1069 21, 22, 23, 24, 25, 26, 27, 28, 0, 29,
1070 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1071 40, 41, 180, 42, 43, 44, 0, 45, 46, 47,
1072 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1073 57, 58, 126, 59, 127, 128, 129, 130, 131, 0,
1074 0, 132, 133, 0, 0, 0, 0, 0, 0, 0,
1075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1076 134, 0, 0, 0, 181, 182, 0, 0, 0, 0,
1077 183, 135, 136, 137, 138, 1, 2, 3, 4, 5,
1078 6, 7, 8, 9, 10, 11, 173, 174, 175, 0,
1079 176, 177, 178, 179, 0, 0, 0, 12, 13, 14,
1080 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1081 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1082 34, 35, 36, 37, 38, 39, 40, 41, 180, 42,
1083 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1084 52, 53, 54, 0, 55, 56, 57, 58, 126, 59,
1085 127, 128, 129, 130, 131, 0, 0, 132, 133, 0,
1086 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1087 0, 0, 0, 0, 0, 0, 134, 0, 0, 0,
1088 181, 278, 0, 0, 0, 0, 183, 135, 136, 137,
1089 138, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1090 10, 11, 173, 174, 175, 0, 176, 177, 178, 179,
1091 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1092 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1093 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1094 38, 39, 40, 41, 180, 42, 43, 44, 0, 45,
1095 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1096 55, 56, 57, 58, 126, 59, 127, 128, 129, 130,
1097 131, 0, 0, 132, 133, 0, 0, 0, 0, 0,
1098 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1099 0, 0, 134, 0, 0, 0, 181, 0, 0, 0,
1100 0, 0, 183, 135, 136, 137, 138, 1, 2, 3,
1101 4, 5, 6, 7, 8, 9, 10, 11, 173, 174,
1102 175, 0, 176, 177, 178, 179, 0, 0, 0, 12,
1103 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1104 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1105 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1106 180, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1107 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1108 126, 59, 127, 128, 129, 130, 131, 0, 0, 132,
1109 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1110 0, 0, 0, 0, 0, 0, 0, 0, 134, 0,
1111 0, 0, 115, 0, 0, 0, 0, 0, 183, 135,
1112 136, 137, 138, 1, 2, 3, 4, 5, 6, 7,
1113 8, 9, 10, 11, 173, 174, 175, 0, 176, 177,
1114 178, 179, 0, 0, 0, 12, 13, 14, 15, 16,
1115 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1116 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1117 36, 37, 38, 39, 40, 41, 180, 42, 43, 44,
1118 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1119 54, 0, 55, 56, 57, 58, 126, 59, 127, 128,
1120 129, 130, 131, 0, 0, 132, 133, 0, 0, 0,
1121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1122 0, 0, 0, 0, 134, 0, 0, 0, 0, 0,
1123 0, 0, 0, 0, 183, 135, 136, 137, 138, 1,
1124 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1126 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1127 21, 22, 23, 24, 25, 26, 27, 28, 0, 29,
1128 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001129 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1130 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
Alexis Hetu17809052015-05-13 11:28:22 -04001131 57, 58, 126, 59, 127, 128, 129, 130, 131, 0,
1132 0, 132, 133, 0, 0, 0, 0, 0, 0, 0,
1133 0, 0, 0, 0, 0, 0, 339, 2, 3, 4,
1134 134, 6, 7, 8, 9, 10, 11, 0, 0, 0,
1135 183, 135, 136, 137, 138, 0, 0, 0, 12, 13,
Alexis Hetub14178b2015-04-13 13:23:20 -04001136 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1137 24, 25, 26, 27, 28, 0, 29, 30, 31, 32,
Alexis Hetu17809052015-05-13 11:28:22 -04001138 33, 34, 35, 36, 37, 38, 39, 40, 41, 0,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001139 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1140 51, 52, 53, 54, 0, 55, 56, 57, 58, 126,
1141 59, 127, 128, 129, 130, 131, 0, 0, 132, 133,
Alexis Hetub14178b2015-04-13 13:23:20 -04001142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001143 0, 0, 0, 0, 0, 0, 0, 134, 8, 9,
1144 10, 11, 0, 0, 0, 0, 0, 0, 135, 136,
1145 137, 138, 0, 12, 13, 14, 15, 16, 17, 18,
1146 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
1147 0, 0, 0, 31, 32, 33, 34, 35, 36, 0,
1148 0, 0, 40, 41, 0, 42, 43, 44, 0, 45,
1149 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1150 55, 56, 57, 0, 126, 59, 127, 128, 129, 130,
1151 131, 0, 0, 132, 133, 0, 0, 0, 0, 0,
Alexis Hetub14178b2015-04-13 13:23:20 -04001152 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001153 0, 0, 134, 0, 0, 205, 8, 9, 10, 11,
1154 0, 0, 0, 135, 136, 137, 138, 0, 0, 0,
1155 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1156 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1157 0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1158 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1159 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1160 57, 0, 126, 59, 127, 128, 129, 130, 131, 0,
1161 0, 132, 133, 0, 0, 0, 0, 0, 0, 0,
1162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1163 134, 8, 9, 10, 11, 0, 0, 0, 0, 0,
1164 259, 135, 136, 137, 138, 0, 12, 13, 14, 15,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001165 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
Alexis Hetu17809052015-05-13 11:28:22 -04001166 26, 0, 0, 0, 0, 0, 31, 32, 33, 34,
1167 35, 36, 0, 0, 0, 40, 41, 0, 42, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001168 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
Alexis Hetu17809052015-05-13 11:28:22 -04001169 53, 54, 0, 55, 56, 57, 0, 126, 59, 127,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001170 128, 129, 130, 131, 0, 0, 132, 133, 0, 0,
Nicolas Capens7d626792015-02-17 17:58:31 -05001171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001172 0, 0, 0, 0, 0, 134, 0, 0, 281, 8,
1173 9, 10, 11, 0, 0, 0, 135, 136, 137, 138,
1174 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001175 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1176 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1177 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1178 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1179 0, 55, 56, 57, 0, 126, 59, 127, 128, 129,
1180 130, 131, 0, 0, 132, 133, 0, 0, 0, 0,
1181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1182 0, 0, 0, 134, 8, 9, 10, 11, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001183 0, 0, 0, 0, 135, 136, 137, 138, 0, 12,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001184 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1185 23, 24, 25, 26, 0, 0, 0, 0, 0, 31,
Alexis Hetu17809052015-05-13 11:28:22 -04001186 32, 33, 34, 35, 36, 0, 0, 0, 40, 219,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001187 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1188 50, 51, 52, 53, 54, 0, 55, 56, 57, 0,
1189 126, 59, 127, 128, 129, 130, 131, 0, 0, 132,
1190 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001191 0, 0, 0, 2, 3, 4, 0, 0, 134, 8,
1192 9, 10, 11, 0, 0, 0, 0, 0, 0, 135,
1193 136, 137, 138, 0, 12, 13, 14, 15, 16, 17,
1194 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1195 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1196 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1197 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1198 0, 55, 56, 57, 0, 0, 59, 0, 0, 0,
1199 0, 0, 0, 0, 107, 0, 0, 1, 2, 3,
1200 4, 5, 6, 7, 8, 9, 10, 11, 0, 0,
1201 0, 0, 0, 0, 0, 0, 0, 0, 312, 12,
1202 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1203 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1204 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1205 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1206 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1207 0, 59, 1, 2, 3, 4, 5, 6, 7, 8,
1208 9, 10, 11, 0, 0, 0, 0, 0, 0, 0,
1209 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
1210 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1211 28, 0, 29, 30, 31, 32, 33, 34, 35, 36,
1212 37, 38, 39, 40, 41, 0, 42, 43, 44, 0,
1213 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1214 0, 55, 56, 57, 58, 0, 59, 2, 3, 4,
1215 0, 0, 0, 8, 9, 10, 11, 0, 0, 0,
1216 0, 0, 0, 0, 0, 0, 0, 0, 12, 13,
1217 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1218 24, 25, 26, 0, 0, 0, 0, 0, 31, 32,
1219 33, 34, 35, 36, 0, 0, 0, 40, 41, 0,
1220 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1221 51, 52, 53, 54, 0, 55, 56, 57, 0, 0,
1222 59, 8, 9, 10, 11, 0, 0, 0, 0, 0,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001223 0, 0, 0, 0, 0, 0, 12, 13, 14, 15,
1224 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1225 26, 0, 0, 0, 0, 0, 31, 32, 33, 34,
1226 35, 36, 0, 0, 0, 40, 41, 0, 42, 43,
1227 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
Alexis Hetu17809052015-05-13 11:28:22 -04001228 53, 54, 0, 55, 56, 57, 0, 288, 59, 8,
1229 9, 10, 11, 289, 0, 0, 0, 0, 0, 0,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001230 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
1231 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1232 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1233 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1234 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
Alexis Hetu17809052015-05-13 11:28:22 -04001235 0, 55, 56, 57, 0, 0, 59
John Bauman66b8ab22014-05-06 15:57:45 -04001236};
1237
1238static const yytype_int16 yycheck[] =
1239{
Alexis Hetu17809052015-05-13 11:28:22 -04001240 0, 125, 89, 106, 134, 69, 204, 124, 0, 92,
1241 9, 106, 0, 44, 168, 338, 76, 322, 72, 195,
1242 9, 124, 104, 147, 318, 104, 114, 106, 82, 124,
1243 87, 88, 337, 97, 113, 68, 359, 132, 133, 106,
1244 73, 40, 41, 42, 127, 76, 113, 111, 108, 179,
1245 105, 40, 41, 105, 43, 150, 111, 121, 85, 86,
1246 354, 105, 51, 111, 358, 122, 123, 111, 105, 69,
1247 105, 116, 72, 118, 111, 105, 111, 77, 76, 106,
1248 204, 111, 82, 110, 214, 77, 203, 9, 111, 77,
1249 244, 114, 111, 111, 218, 114, 114, 97, 111, 106,
1250 203, 114, 166, 104, 168, 106, 105, 76, 203, 40,
1251 41, 111, 242, 83, 84, 115, 89, 90, 40, 41,
1252 42, 121, 230, 231, 232, 233, 108, 257, 223, 224,
1253 225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
1254 235, 236, 237, 238, 239, 240, 241, 323, 4, 5,
1255 6, 275, 276, 40, 41, 42, 119, 120, 121, 79,
1256 80, 76, 360, 280, 111, 112, 166, 108, 168, 114,
1257 226, 227, 234, 235, 113, 228, 229, 280, 76, 104,
1258 244, 105, 126, 104, 124, 280, 91, 125, 107, 93,
1259 76, 114, 322, 104, 104, 195, 313, 114, 114, 106,
1260 109, 104, 104, 111, 56, 329, 107, 337, 108, 106,
1261 313, 107, 107, 104, 107, 107, 104, 347, 313, 44,
1262 105, 76, 105, 17, 114, 109, 236, 357, 215, 237,
1263 317, 113, 238, 114, 239, 98, 360, 240, 91, 241,
1264 5, 121, 121, 172, 244, 314, 319, 4, 5, 6,
1265 77, 358, 166, 10, 11, 12, 13, 337, 319, 263,
1266 -1, -1, -1, 263, -1, -1, -1, -1, 25, 26,
1267 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1268 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
1269 47, 48, 49, 50, -1, -1, -1, 54, 55, -1,
1270 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1271 67, 68, 69, 70, -1, 72, 73, 74, 318, 319,
1272 77, -1, 322, 323, 94, 95, 96, 97, 98, 99,
1273 100, 101, 102, 103, -1, -1, -1, 337, -1, -1,
1274 -1, -1, -1, 113, -1, -1, -1, -1, -1, -1,
1275 -1, -1, 109, -1, 354, -1, -1, -1, 358, 3,
1276 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1277 14, 15, 16, -1, 18, 19, 20, 21, -1, -1,
1278 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1279 34, 35, 36, 37, 38, 39, 40, 41, -1, 43,
1280 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1281 54, 55, 56, 57, 58, 59, -1, 61, 62, 63,
1282 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1283 74, 75, 76, 77, 78, 79, 80, 81, 82, -1,
1284 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1285 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1286 104, -1, -1, -1, 108, 109, -1, -1, -1, -1,
1287 114, 115, 116, 117, 118, 3, 4, 5, 6, 7,
1288 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1289 18, 19, 20, 21, -1, -1, -1, 25, 26, 27,
1290 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1291 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1292 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
1293 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1294 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
1295 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1296 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1297 -1, -1, -1, -1, -1, -1, 104, -1, -1, -1,
1298 108, 109, -1, -1, -1, -1, 114, 115, 116, 117,
1299 118, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1300 12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
1301 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1302 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1303 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1304 52, 53, 54, 55, 56, 57, 58, 59, -1, 61,
1305 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1306 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1307 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1309 -1, -1, 104, -1, -1, -1, 108, -1, -1, -1,
1310 -1, -1, 114, 115, 116, 117, 118, 3, 4, 5,
1311 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1312 16, -1, 18, 19, 20, 21, -1, -1, -1, 25,
1313 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1314 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1315 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1316 56, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1317 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1318 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1319 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1320 -1, -1, -1, -1, -1, -1, -1, -1, 104, -1,
1321 -1, -1, 108, -1, -1, -1, -1, -1, 114, 115,
1322 116, 117, 118, 3, 4, 5, 6, 7, 8, 9,
1323 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
1324 20, 21, -1, -1, -1, 25, 26, 27, 28, 29,
1325 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1326 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1327 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1328 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1329 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
1330 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
1331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1332 -1, -1, -1, -1, 104, -1, -1, -1, -1, -1,
1333 -1, -1, -1, -1, 114, 115, 116, 117, 118, 3,
1334 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1335 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1336 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1337 34, 35, 36, 37, 38, 39, 40, 41, -1, 43,
1338 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001339 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1340 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
Alexis Hetu17809052015-05-13 11:28:22 -04001341 74, 75, 76, 77, 78, 79, 80, 81, 82, -1,
1342 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1343 -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
1344 104, 8, 9, 10, 11, 12, 13, -1, -1, -1,
1345 114, 115, 116, 117, 118, -1, -1, -1, 25, 26,
Alexis Hetub14178b2015-04-13 13:23:20 -04001346 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1347 37, 38, 39, 40, 41, -1, 43, 44, 45, 46,
Alexis Hetu17809052015-05-13 11:28:22 -04001348 47, 48, 49, 50, 51, 52, 53, 54, 55, -1,
Alexis Hetub14178b2015-04-13 13:23:20 -04001349 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1350 67, 68, 69, 70, -1, 72, 73, 74, 75, 76,
1351 77, 78, 79, 80, 81, 82, -1, -1, 85, 86,
1352 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001353 -1, -1, -1, -1, -1, -1, -1, 104, 10, 11,
1354 12, 13, -1, -1, -1, -1, -1, -1, 115, 116,
1355 117, 118, -1, 25, 26, 27, 28, 29, 30, 31,
1356 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
1357 -1, -1, -1, 45, 46, 47, 48, 49, 50, -1,
1358 -1, -1, 54, 55, -1, 57, 58, 59, -1, 61,
1359 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1360 72, 73, 74, -1, 76, 77, 78, 79, 80, 81,
1361 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
Alexis Hetub14178b2015-04-13 13:23:20 -04001362 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001363 -1, -1, 104, -1, -1, 107, 10, 11, 12, 13,
1364 -1, -1, -1, 115, 116, 117, 118, -1, -1, -1,
1365 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1366 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1367 -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1368 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1369 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1370 74, -1, 76, 77, 78, 79, 80, 81, 82, -1,
1371 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1372 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1373 104, 10, 11, 12, 13, -1, -1, -1, -1, -1,
1374 114, 115, 116, 117, 118, -1, 25, 26, 27, 28,
Nicolas Capens7d626792015-02-17 17:58:31 -05001375 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
Alexis Hetu17809052015-05-13 11:28:22 -04001376 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
1377 49, 50, -1, -1, -1, 54, 55, -1, 57, 58,
Alexis Hetub14178b2015-04-13 13:23:20 -04001378 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
Alexis Hetu17809052015-05-13 11:28:22 -04001379 69, 70, -1, 72, 73, 74, -1, 76, 77, 78,
Alexis Hetub14178b2015-04-13 13:23:20 -04001380 79, 80, 81, 82, -1, -1, 85, 86, -1, -1,
Nicolas Capens7d626792015-02-17 17:58:31 -05001381 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001382 -1, -1, -1, -1, -1, 104, -1, -1, 107, 10,
1383 11, 12, 13, -1, -1, -1, 115, 116, 117, 118,
1384 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001385 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1386 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1387 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1388 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1389 -1, 72, 73, 74, -1, 76, 77, 78, 79, 80,
1390 81, 82, -1, -1, 85, 86, -1, -1, -1, -1,
Nicolas Capens7d626792015-02-17 17:58:31 -05001391 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001392 -1, -1, -1, 104, 10, 11, 12, 13, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001393 -1, -1, -1, -1, 115, 116, 117, 118, -1, 25,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001394 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1395 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
1396 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1397 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1398 66, 67, 68, 69, 70, -1, 72, 73, 74, -1,
1399 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1400 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001401 -1, -1, -1, 4, 5, 6, -1, -1, 104, 10,
1402 11, 12, 13, -1, -1, -1, -1, -1, -1, 115,
1403 116, 117, 118, -1, 25, 26, 27, 28, 29, 30,
1404 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1405 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1406 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1407 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1408 -1, 72, 73, 74, -1, -1, 77, -1, -1, -1,
1409 -1, -1, -1, -1, 0, -1, -1, 3, 4, 5,
1410 6, 7, 8, 9, 10, 11, 12, 13, -1, -1,
1411 -1, -1, -1, -1, -1, -1, -1, -1, 109, 25,
1412 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1413 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1414 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1415 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1416 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1417 -1, 77, 3, 4, 5, 6, 7, 8, 9, 10,
1418 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
1419 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
1420 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1421 41, -1, 43, 44, 45, 46, 47, 48, 49, 50,
1422 51, 52, 53, 54, 55, -1, 57, 58, 59, -1,
1423 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1424 -1, 72, 73, 74, 75, -1, 77, 4, 5, 6,
1425 -1, -1, -1, 10, 11, 12, 13, -1, -1, -1,
1426 -1, -1, -1, -1, -1, -1, -1, -1, 25, 26,
1427 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1428 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
1429 47, 48, 49, 50, -1, -1, -1, 54, 55, -1,
1430 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1431 67, 68, 69, 70, -1, 72, 73, 74, -1, -1,
1432 77, 10, 11, 12, 13, -1, -1, -1, -1, -1,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001433 -1, -1, -1, -1, -1, -1, 25, 26, 27, 28,
1434 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1435 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
1436 49, 50, -1, -1, -1, 54, 55, -1, 57, 58,
1437 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
Alexis Hetu17809052015-05-13 11:28:22 -04001438 69, 70, -1, 72, 73, 74, -1, 76, 77, 10,
1439 11, 12, 13, 82, -1, -1, -1, -1, -1, -1,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001440 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
1441 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1442 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1443 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1444 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
Alexis Hetu17809052015-05-13 11:28:22 -04001445 -1, 72, 73, 74, -1, -1, 77
John Bauman66b8ab22014-05-06 15:57:45 -04001446};
1447
1448/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1449 symbol of state STATE-NUM. */
1450static const yytype_uint8 yystos[] =
1451{
1452 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Nicolas Capens3c20f802015-02-17 17:17:20 -05001453 12, 13, 25, 26, 27, 28, 29, 30, 31, 32,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05001454 33, 34, 35, 36, 37, 38, 39, 40, 41, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001455 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1456 54, 55, 57, 58, 59, 61, 62, 63, 64, 65,
1457 66, 67, 68, 69, 70, 72, 73, 74, 75, 77,
1458 158, 159, 160, 161, 162, 167, 168, 169, 170, 172,
1459 173, 174, 175, 176, 179, 180, 181, 213, 214, 215,
1460 44, 76, 175, 40, 41, 76, 108, 104, 114, 216,
1461 105, 111, 9, 40, 41, 42, 164, 165, 171, 111,
1462 114, 76, 173, 174, 179, 173, 106, 0, 214, 179,
1463 108, 183, 76, 177, 178, 108, 199, 164, 163, 166,
1464 174, 165, 76, 104, 106, 113, 76, 78, 79, 80,
Alexis Hetu17809052015-05-13 11:28:22 -04001465 81, 82, 85, 86, 104, 115, 116, 117, 118, 129,
1466 130, 131, 133, 134, 135, 136, 137, 138, 139, 140,
1467 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
1468 151, 152, 153, 157, 180, 114, 182, 174, 184, 185,
1469 113, 105, 111, 14, 15, 16, 18, 19, 20, 21,
1470 56, 108, 109, 114, 140, 153, 154, 156, 158, 159,
1471 180, 189, 190, 191, 192, 200, 201, 202, 205, 212,
1472 76, 163, 166, 106, 113, 107, 157, 154, 188, 140,
1473 140, 156, 85, 86, 106, 110, 105, 105, 111, 55,
1474 154, 104, 140, 119, 120, 121, 116, 118, 83, 84,
1475 87, 88, 122, 123, 89, 90, 126, 125, 124, 91,
1476 93, 92, 127, 107, 184, 76, 186, 187, 109, 185,
1477 79, 80, 178, 114, 114, 207, 104, 104, 114, 114,
1478 156, 104, 109, 193, 94, 95, 96, 97, 98, 99,
1479 100, 101, 102, 103, 113, 155, 111, 114, 109, 190,
1480 106, 107, 157, 188, 107, 105, 132, 156, 76, 82,
1481 135, 154, 140, 140, 140, 142, 142, 143, 143, 144,
1482 144, 144, 144, 145, 145, 146, 147, 148, 149, 150,
1483 151, 156, 109, 106, 111, 114, 196, 197, 198, 208,
1484 156, 114, 206, 200, 154, 154, 157, 107, 107, 112,
1485 157, 187, 56, 199, 191, 189, 201, 209, 105, 3,
1486 156, 169, 204, 194, 107, 154, 107, 104, 204, 210,
1487 211, 196, 203, 76, 105, 109, 156, 114, 105, 17,
1488 113, 191, 195, 199, 105, 156, 195, 196, 188, 114
John Bauman66b8ab22014-05-06 15:57:45 -04001489};
1490
1491#define yyerrok (yyerrstatus = 0)
1492#define yyclearin (yychar = YYEMPTY)
1493#define YYEMPTY (-2)
1494#define YYEOF 0
1495
1496#define YYACCEPT goto yyacceptlab
1497#define YYABORT goto yyabortlab
1498#define YYERROR goto yyerrorlab
1499
1500
1501/* Like YYERROR except do call yyerror. This remains here temporarily
1502 to ease the transition to the new meaning of YYERROR, for GCC.
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001503 Once GCC version 2 has supplanted version 1, this can go. */
John Bauman66b8ab22014-05-06 15:57:45 -04001504
1505#define YYFAIL goto yyerrlab
John Bauman66b8ab22014-05-06 15:57:45 -04001506
1507#define YYRECOVERING() (!!yyerrstatus)
1508
1509#define YYBACKUP(Token, Value) \
1510do \
1511 if (yychar == YYEMPTY && yylen == 1) \
1512 { \
1513 yychar = (Token); \
1514 yylval = (Value); \
1515 yytoken = YYTRANSLATE (yychar); \
1516 YYPOPSTACK (1); \
1517 goto yybackup; \
1518 } \
1519 else \
1520 { \
1521 yyerror (context, YY_("syntax error: cannot back up")); \
1522 YYERROR; \
1523 } \
1524while (YYID (0))
1525
1526
1527#define YYTERROR 1
1528#define YYERRCODE 256
1529
1530
1531/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1532 If N is 0, then set CURRENT to the empty location which ends
1533 the previous symbol: RHS[0] (always defined). */
1534
1535#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1536#ifndef YYLLOC_DEFAULT
1537# define YYLLOC_DEFAULT(Current, Rhs, N) \
1538 do \
1539 if (YYID (N)) \
1540 { \
1541 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1542 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1543 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1544 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1545 } \
1546 else \
1547 { \
1548 (Current).first_line = (Current).last_line = \
1549 YYRHSLOC (Rhs, 0).last_line; \
1550 (Current).first_column = (Current).last_column = \
1551 YYRHSLOC (Rhs, 0).last_column; \
1552 } \
1553 while (YYID (0))
1554#endif
1555
1556
1557/* YY_LOCATION_PRINT -- Print the location on the stream.
1558 This macro was not mandated originally: define only if we know
1559 we won't break user code: when these are the locations we know. */
1560
1561#ifndef YY_LOCATION_PRINT
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001562# if YYLTYPE_IS_TRIVIAL
John Bauman66b8ab22014-05-06 15:57:45 -04001563# define YY_LOCATION_PRINT(File, Loc) \
1564 fprintf (File, "%d.%d-%d.%d", \
1565 (Loc).first_line, (Loc).first_column, \
1566 (Loc).last_line, (Loc).last_column)
1567# else
1568# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1569# endif
1570#endif
1571
1572
1573/* YYLEX -- calling `yylex' with the right arguments. */
1574
1575#ifdef YYLEX_PARAM
1576# define YYLEX yylex (&yylval, YYLEX_PARAM)
1577#else
1578# define YYLEX yylex (&yylval)
1579#endif
1580
1581/* Enable debugging if requested. */
1582#if YYDEBUG
1583
1584# ifndef YYFPRINTF
1585# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1586# define YYFPRINTF fprintf
1587# endif
1588
1589# define YYDPRINTF(Args) \
1590do { \
1591 if (yydebug) \
1592 YYFPRINTF Args; \
1593} while (YYID (0))
1594
1595# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1596do { \
1597 if (yydebug) \
1598 { \
1599 YYFPRINTF (stderr, "%s ", Title); \
1600 yy_symbol_print (stderr, \
1601 Type, Value, context); \
1602 YYFPRINTF (stderr, "\n"); \
1603 } \
1604} while (YYID (0))
1605
1606
1607/*--------------------------------.
1608| Print this symbol on YYOUTPUT. |
1609`--------------------------------*/
1610
1611/*ARGSUSED*/
1612#if (defined __STDC__ || defined __C99__FUNC__ \
1613 || defined __cplusplus || defined _MSC_VER)
1614static void
1615yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1616#else
1617static void
1618yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1619 FILE *yyoutput;
1620 int yytype;
1621 YYSTYPE const * const yyvaluep;
1622 TParseContext* context;
1623#endif
1624{
1625 if (!yyvaluep)
1626 return;
1627 YYUSE (context);
1628# ifdef YYPRINT
1629 if (yytype < YYNTOKENS)
1630 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1631# else
1632 YYUSE (yyoutput);
1633# endif
1634 switch (yytype)
1635 {
1636 default:
1637 break;
1638 }
1639}
1640
1641
1642/*--------------------------------.
1643| Print this symbol on YYOUTPUT. |
1644`--------------------------------*/
1645
1646#if (defined __STDC__ || defined __C99__FUNC__ \
1647 || defined __cplusplus || defined _MSC_VER)
1648static void
1649yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1650#else
1651static void
1652yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1653 FILE *yyoutput;
1654 int yytype;
1655 YYSTYPE const * const yyvaluep;
1656 TParseContext* context;
1657#endif
1658{
1659 if (yytype < YYNTOKENS)
1660 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1661 else
1662 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1663
1664 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1665 YYFPRINTF (yyoutput, ")");
1666}
1667
1668/*------------------------------------------------------------------.
1669| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1670| TOP (included). |
1671`------------------------------------------------------------------*/
1672
1673#if (defined __STDC__ || defined __C99__FUNC__ \
1674 || defined __cplusplus || defined _MSC_VER)
1675static void
1676yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1677#else
1678static void
1679yy_stack_print (yybottom, yytop)
1680 yytype_int16 *yybottom;
1681 yytype_int16 *yytop;
1682#endif
1683{
1684 YYFPRINTF (stderr, "Stack now");
1685 for (; yybottom <= yytop; yybottom++)
1686 {
1687 int yybot = *yybottom;
1688 YYFPRINTF (stderr, " %d", yybot);
1689 }
1690 YYFPRINTF (stderr, "\n");
1691}
1692
1693# define YY_STACK_PRINT(Bottom, Top) \
1694do { \
1695 if (yydebug) \
1696 yy_stack_print ((Bottom), (Top)); \
1697} while (YYID (0))
1698
1699
1700/*------------------------------------------------.
1701| Report that the YYRULE is going to be reduced. |
1702`------------------------------------------------*/
1703
1704#if (defined __STDC__ || defined __C99__FUNC__ \
1705 || defined __cplusplus || defined _MSC_VER)
1706static void
1707yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1708#else
1709static void
1710yy_reduce_print (yyvsp, yyrule, context)
1711 YYSTYPE *yyvsp;
1712 int yyrule;
1713 TParseContext* context;
1714#endif
1715{
1716 int yynrhs = yyr2[yyrule];
1717 int yyi;
1718 unsigned long int yylno = yyrline[yyrule];
1719 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1720 yyrule - 1, yylno);
1721 /* The symbols being reduced. */
1722 for (yyi = 0; yyi < yynrhs; yyi++)
1723 {
1724 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1725 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1726 &(yyvsp[(yyi + 1) - (yynrhs)])
1727 , context);
1728 YYFPRINTF (stderr, "\n");
1729 }
1730}
1731
1732# define YY_REDUCE_PRINT(Rule) \
1733do { \
1734 if (yydebug) \
1735 yy_reduce_print (yyvsp, Rule, context); \
1736} while (YYID (0))
1737
1738/* Nonzero means print parse trace. It is left uninitialized so that
1739 multiple parsers can coexist. */
1740int yydebug;
1741#else /* !YYDEBUG */
1742# define YYDPRINTF(Args)
1743# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1744# define YY_STACK_PRINT(Bottom, Top)
1745# define YY_REDUCE_PRINT(Rule)
1746#endif /* !YYDEBUG */
1747
1748
1749/* YYINITDEPTH -- initial size of the parser's stacks. */
1750#ifndef YYINITDEPTH
1751# define YYINITDEPTH 200
1752#endif
1753
1754/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1755 if the built-in stack extension method is used).
1756
1757 Do not make this value too large; the results are undefined if
1758 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1759 evaluated with infinite-precision integer arithmetic. */
1760
1761#ifndef YYMAXDEPTH
1762# define YYMAXDEPTH 10000
1763#endif
1764
1765
1766
1767#if YYERROR_VERBOSE
1768
1769# ifndef yystrlen
1770# if defined __GLIBC__ && defined _STRING_H
1771# define yystrlen strlen
1772# else
1773/* Return the length of YYSTR. */
1774#if (defined __STDC__ || defined __C99__FUNC__ \
1775 || defined __cplusplus || defined _MSC_VER)
1776static YYSIZE_T
1777yystrlen (const char *yystr)
1778#else
1779static YYSIZE_T
1780yystrlen (yystr)
1781 const char *yystr;
1782#endif
1783{
1784 YYSIZE_T yylen;
1785 for (yylen = 0; yystr[yylen]; yylen++)
1786 continue;
1787 return yylen;
1788}
1789# endif
1790# endif
1791
1792# ifndef yystpcpy
1793# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1794# define yystpcpy stpcpy
1795# else
1796/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1797 YYDEST. */
1798#if (defined __STDC__ || defined __C99__FUNC__ \
1799 || defined __cplusplus || defined _MSC_VER)
1800static char *
1801yystpcpy (char *yydest, const char *yysrc)
1802#else
1803static char *
1804yystpcpy (yydest, yysrc)
1805 char *yydest;
1806 const char *yysrc;
1807#endif
1808{
1809 char *yyd = yydest;
1810 const char *yys = yysrc;
1811
1812 while ((*yyd++ = *yys++) != '\0')
1813 continue;
1814
1815 return yyd - 1;
1816}
1817# endif
1818# endif
1819
1820# ifndef yytnamerr
1821/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1822 quotes and backslashes, so that it's suitable for yyerror. The
1823 heuristic is that double-quoting is unnecessary unless the string
1824 contains an apostrophe, a comma, or backslash (other than
1825 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1826 null, do not copy; instead, return the length of what the result
1827 would have been. */
1828static YYSIZE_T
1829yytnamerr (char *yyres, const char *yystr)
1830{
1831 if (*yystr == '"')
1832 {
1833 YYSIZE_T yyn = 0;
1834 char const *yyp = yystr;
1835
1836 for (;;)
1837 switch (*++yyp)
1838 {
1839 case '\'':
1840 case ',':
1841 goto do_not_strip_quotes;
1842
1843 case '\\':
1844 if (*++yyp != '\\')
1845 goto do_not_strip_quotes;
1846 /* Fall through. */
1847 default:
1848 if (yyres)
1849 yyres[yyn] = *yyp;
1850 yyn++;
1851 break;
1852
1853 case '"':
1854 if (yyres)
1855 yyres[yyn] = '\0';
1856 return yyn;
1857 }
1858 do_not_strip_quotes: ;
1859 }
1860
1861 if (! yyres)
1862 return yystrlen (yystr);
1863
1864 return yystpcpy (yyres, yystr) - yyres;
1865}
1866# endif
1867
1868/* Copy into YYRESULT an error message about the unexpected token
1869 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1870 including the terminating null byte. If YYRESULT is null, do not
1871 copy anything; just return the number of bytes that would be
1872 copied. As a special case, return 0 if an ordinary "syntax error"
1873 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1874 size calculation. */
1875static YYSIZE_T
1876yysyntax_error (char *yyresult, int yystate, int yychar)
1877{
1878 int yyn = yypact[yystate];
1879
1880 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1881 return 0;
1882 else
1883 {
1884 int yytype = YYTRANSLATE (yychar);
1885 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1886 YYSIZE_T yysize = yysize0;
1887 YYSIZE_T yysize1;
1888 int yysize_overflow = 0;
1889 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1890 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1891 int yyx;
1892
1893# if 0
1894 /* This is so xgettext sees the translatable formats that are
1895 constructed on the fly. */
1896 YY_("syntax error, unexpected %s");
1897 YY_("syntax error, unexpected %s, expecting %s");
1898 YY_("syntax error, unexpected %s, expecting %s or %s");
1899 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1900 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1901# endif
1902 char *yyfmt;
1903 char const *yyf;
1904 static char const yyunexpected[] = "syntax error, unexpected %s";
1905 static char const yyexpecting[] = ", expecting %s";
1906 static char const yyor[] = " or %s";
1907 char yyformat[sizeof yyunexpected
1908 + sizeof yyexpecting - 1
1909 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1910 * (sizeof yyor - 1))];
1911 char const *yyprefix = yyexpecting;
1912
1913 /* Start YYX at -YYN if negative to avoid negative indexes in
1914 YYCHECK. */
1915 int yyxbegin = yyn < 0 ? -yyn : 0;
1916
1917 /* Stay within bounds of both yycheck and yytname. */
1918 int yychecklim = YYLAST - yyn + 1;
1919 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1920 int yycount = 1;
1921
1922 yyarg[0] = yytname[yytype];
1923 yyfmt = yystpcpy (yyformat, yyunexpected);
1924
1925 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1926 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1927 {
1928 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1929 {
1930 yycount = 1;
1931 yysize = yysize0;
1932 yyformat[sizeof yyunexpected - 1] = '\0';
1933 break;
1934 }
1935 yyarg[yycount++] = yytname[yyx];
1936 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1937 yysize_overflow |= (yysize1 < yysize);
1938 yysize = yysize1;
1939 yyfmt = yystpcpy (yyfmt, yyprefix);
1940 yyprefix = yyor;
1941 }
1942
1943 yyf = YY_(yyformat);
1944 yysize1 = yysize + yystrlen (yyf);
1945 yysize_overflow |= (yysize1 < yysize);
1946 yysize = yysize1;
1947
1948 if (yysize_overflow)
1949 return YYSIZE_MAXIMUM;
1950
1951 if (yyresult)
1952 {
1953 /* Avoid sprintf, as that infringes on the user's name space.
1954 Don't have undefined behavior even if the translation
1955 produced a string with the wrong number of "%s"s. */
1956 char *yyp = yyresult;
1957 int yyi = 0;
1958 while ((*yyp = *yyf) != '\0')
1959 {
1960 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1961 {
1962 yyp += yytnamerr (yyp, yyarg[yyi++]);
1963 yyf += 2;
1964 }
1965 else
1966 {
1967 yyp++;
1968 yyf++;
1969 }
1970 }
1971 }
1972 return yysize;
1973 }
1974}
1975#endif /* YYERROR_VERBOSE */
1976
1977
1978/*-----------------------------------------------.
1979| Release the memory associated to this symbol. |
1980`-----------------------------------------------*/
1981
1982/*ARGSUSED*/
1983#if (defined __STDC__ || defined __C99__FUNC__ \
1984 || defined __cplusplus || defined _MSC_VER)
1985static void
1986yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1987#else
1988static void
1989yydestruct (yymsg, yytype, yyvaluep, context)
1990 const char *yymsg;
1991 int yytype;
1992 YYSTYPE *yyvaluep;
1993 TParseContext* context;
1994#endif
1995{
1996 YYUSE (yyvaluep);
1997 YYUSE (context);
1998
1999 if (!yymsg)
2000 yymsg = "Deleting";
2001 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2002
2003 switch (yytype)
2004 {
2005
2006 default:
2007 break;
2008 }
2009}
2010
2011/* Prevent warnings from -Wmissing-prototypes. */
2012#ifdef YYPARSE_PARAM
2013#if defined __STDC__ || defined __cplusplus
2014int yyparse (void *YYPARSE_PARAM);
2015#else
2016int yyparse ();
2017#endif
2018#else /* ! YYPARSE_PARAM */
2019#if defined __STDC__ || defined __cplusplus
2020int yyparse (TParseContext* context);
2021#else
2022int yyparse ();
2023#endif
2024#endif /* ! YYPARSE_PARAM */
2025
2026
2027
2028
2029
2030/*-------------------------.
2031| yyparse or yypush_parse. |
2032`-------------------------*/
2033
2034#ifdef YYPARSE_PARAM
2035#if (defined __STDC__ || defined __C99__FUNC__ \
2036 || defined __cplusplus || defined _MSC_VER)
2037int
2038yyparse (void *YYPARSE_PARAM)
2039#else
2040int
2041yyparse (YYPARSE_PARAM)
2042 void *YYPARSE_PARAM;
2043#endif
2044#else /* ! YYPARSE_PARAM */
2045#if (defined __STDC__ || defined __C99__FUNC__ \
2046 || defined __cplusplus || defined _MSC_VER)
2047int
2048yyparse (TParseContext* context)
2049#else
2050int
2051yyparse (context)
2052 TParseContext* context;
2053#endif
2054#endif
2055{
2056/* The lookahead symbol. */
2057int yychar;
2058
2059/* The semantic value of the lookahead symbol. */
2060YYSTYPE yylval;
2061
2062 /* Number of syntax errors so far. */
2063 int yynerrs;
2064
2065 int yystate;
2066 /* Number of tokens to shift before error messages enabled. */
2067 int yyerrstatus;
2068
2069 /* The stacks and their tools:
2070 `yyss': related to states.
2071 `yyvs': related to semantic values.
2072
2073 Refer to the stacks thru separate pointers, to allow yyoverflow
2074 to reallocate them elsewhere. */
2075
2076 /* The state stack. */
2077 yytype_int16 yyssa[YYINITDEPTH];
2078 yytype_int16 *yyss;
2079 yytype_int16 *yyssp;
2080
2081 /* The semantic value stack. */
2082 YYSTYPE yyvsa[YYINITDEPTH];
2083 YYSTYPE *yyvs;
2084 YYSTYPE *yyvsp;
2085
2086 YYSIZE_T yystacksize;
2087
2088 int yyn;
2089 int yyresult;
2090 /* Lookahead token as an internal (translated) token number. */
2091 int yytoken;
2092 /* The variables used to return semantic value and location from the
2093 action routines. */
2094 YYSTYPE yyval;
2095
2096#if YYERROR_VERBOSE
2097 /* Buffer for error messages, and its allocated size. */
2098 char yymsgbuf[128];
2099 char *yymsg = yymsgbuf;
2100 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2101#endif
2102
2103#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2104
2105 /* The number of symbols on the RHS of the reduced rule.
2106 Keep to zero when no symbol should be popped. */
2107 int yylen = 0;
2108
2109 yytoken = 0;
2110 yyss = yyssa;
2111 yyvs = yyvsa;
2112 yystacksize = YYINITDEPTH;
2113
2114 YYDPRINTF ((stderr, "Starting parse\n"));
2115
2116 yystate = 0;
2117 yyerrstatus = 0;
2118 yynerrs = 0;
2119 yychar = YYEMPTY; /* Cause a token to be read. */
2120
2121 /* Initialize stack pointers.
2122 Waste one element of value and location stack
2123 so that they stay on the same level as the state stack.
2124 The wasted elements are never initialized. */
2125 yyssp = yyss;
2126 yyvsp = yyvs;
2127
2128 goto yysetstate;
2129
2130/*------------------------------------------------------------.
2131| yynewstate -- Push a new state, which is found in yystate. |
2132`------------------------------------------------------------*/
2133 yynewstate:
2134 /* In all cases, when you get here, the value and location stacks
2135 have just been pushed. So pushing a state here evens the stacks. */
2136 yyssp++;
2137
2138 yysetstate:
2139 *yyssp = yystate;
2140
2141 if (yyss + yystacksize - 1 <= yyssp)
2142 {
2143 /* Get the current used size of the three stacks, in elements. */
2144 YYSIZE_T yysize = yyssp - yyss + 1;
2145
2146#ifdef yyoverflow
2147 {
2148 /* Give user a chance to reallocate the stack. Use copies of
2149 these so that the &'s don't force the real ones into
2150 memory. */
2151 YYSTYPE *yyvs1 = yyvs;
2152 yytype_int16 *yyss1 = yyss;
2153
2154 /* Each stack pointer address is followed by the size of the
2155 data in use in that stack, in bytes. This used to be a
2156 conditional around just the two extra args, but that might
2157 be undefined if yyoverflow is a macro. */
2158 yyoverflow (YY_("memory exhausted"),
2159 &yyss1, yysize * sizeof (*yyssp),
2160 &yyvs1, yysize * sizeof (*yyvsp),
2161 &yystacksize);
2162
2163 yyss = yyss1;
2164 yyvs = yyvs1;
2165 }
2166#else /* no yyoverflow */
2167# ifndef YYSTACK_RELOCATE
2168 goto yyexhaustedlab;
2169# else
2170 /* Extend the stack our own way. */
2171 if (YYMAXDEPTH <= yystacksize)
2172 goto yyexhaustedlab;
2173 yystacksize *= 2;
2174 if (YYMAXDEPTH < yystacksize)
2175 yystacksize = YYMAXDEPTH;
2176
2177 {
2178 yytype_int16 *yyss1 = yyss;
2179 union yyalloc *yyptr =
2180 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2181 if (! yyptr)
2182 goto yyexhaustedlab;
2183 YYSTACK_RELOCATE (yyss_alloc, yyss);
2184 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2185# undef YYSTACK_RELOCATE
2186 if (yyss1 != yyssa)
2187 YYSTACK_FREE (yyss1);
2188 }
2189# endif
2190#endif /* no yyoverflow */
2191
2192 yyssp = yyss + yysize - 1;
2193 yyvsp = yyvs + yysize - 1;
2194
2195 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2196 (unsigned long int) yystacksize));
2197
2198 if (yyss + yystacksize - 1 <= yyssp)
2199 YYABORT;
2200 }
2201
2202 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2203
2204 if (yystate == YYFINAL)
2205 YYACCEPT;
2206
2207 goto yybackup;
2208
2209/*-----------.
2210| yybackup. |
2211`-----------*/
2212yybackup:
2213
2214 /* Do appropriate processing given the current state. Read a
2215 lookahead token if we need one and don't already have one. */
2216
2217 /* First try to decide what to do without reference to lookahead token. */
2218 yyn = yypact[yystate];
2219 if (yyn == YYPACT_NINF)
2220 goto yydefault;
2221
2222 /* Not known => get a lookahead token if don't already have one. */
2223
2224 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2225 if (yychar == YYEMPTY)
2226 {
2227 YYDPRINTF ((stderr, "Reading a token: "));
2228 yychar = YYLEX;
2229 }
2230
2231 if (yychar <= YYEOF)
2232 {
2233 yychar = yytoken = YYEOF;
2234 YYDPRINTF ((stderr, "Now at end of input.\n"));
2235 }
2236 else
2237 {
2238 yytoken = YYTRANSLATE (yychar);
2239 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2240 }
2241
2242 /* If the proper action on seeing token YYTOKEN is to reduce or to
2243 detect an error, take that action. */
2244 yyn += yytoken;
2245 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2246 goto yydefault;
2247 yyn = yytable[yyn];
2248 if (yyn <= 0)
2249 {
2250 if (yyn == 0 || yyn == YYTABLE_NINF)
2251 goto yyerrlab;
2252 yyn = -yyn;
2253 goto yyreduce;
2254 }
2255
2256 /* Count tokens shifted since error; after three, turn off error
2257 status. */
2258 if (yyerrstatus)
2259 yyerrstatus--;
2260
2261 /* Shift the lookahead token. */
2262 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2263
2264 /* Discard the shifted token. */
2265 yychar = YYEMPTY;
2266
2267 yystate = yyn;
2268 *++yyvsp = yylval;
2269
2270 goto yynewstate;
2271
2272
2273/*-----------------------------------------------------------.
2274| yydefault -- do the default action for the current state. |
2275`-----------------------------------------------------------*/
2276yydefault:
2277 yyn = yydefact[yystate];
2278 if (yyn == 0)
2279 goto yyerrlab;
2280 goto yyreduce;
2281
2282
2283/*-----------------------------.
2284| yyreduce -- Do a reduction. |
2285`-----------------------------*/
2286yyreduce:
2287 /* yyn is the number of a rule to reduce with. */
2288 yylen = yyr2[yyn];
2289
2290 /* If YYLEN is nonzero, implement the default value of the action:
2291 `$$ = $1'.
2292
2293 Otherwise, the following line sets YYVAL to garbage.
2294 This behavior is undocumented and Bison
2295 users should not rely upon it. Assigning to YYVAL
2296 unconditionally makes the parser a bit smaller, and it avoids a
2297 GCC warning that YYVAL may be used uninitialized. */
2298 yyval = yyvsp[1-yylen];
2299
2300
2301 YY_REDUCE_PRINT (yyn);
2302 switch (yyn)
2303 {
2304 case 2:
2305
2306 {
2307 // The symbol table search was done in the lexical phase
2308 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2309 const TVariable* variable;
2310 if (symbol == 0) {
2311 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
2312 context->recover();
2313 TType type(EbtFloat, EbpUndefined);
2314 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05002315 context->symbolTable.declare(*fakeVariable);
John Bauman66b8ab22014-05-06 15:57:45 -04002316 variable = fakeVariable;
2317 } else {
2318 // This identifier can only be a variable type symbol
2319 if (! symbol->isVariable()) {
2320 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
2321 context->recover();
2322 }
2323 variable = static_cast<const TVariable*>(symbol);
2324 }
2325
2326 // don't delete $1.string, it's used by error recovery, and the pool
2327 // pop will reclaim the memory
2328
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002329 if (variable->getType().getQualifier() == EvqConstExpr ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002330 ConstantUnion* constArray = variable->getConstPointer();
2331 TType t(variable->getType());
2332 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2333 } else
2334 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2335 variable->getName(),
2336 variable->getType(), (yyvsp[(1) - (1)].lex).line);
2337 }
2338 break;
2339
2340 case 3:
2341
2342 {
2343 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2344 }
2345 break;
2346
2347 case 4:
2348
2349 {
John Bauman66b8ab22014-05-06 15:57:45 -04002350 ConstantUnion *unionArray = new ConstantUnion[1];
2351 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002352 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002353 }
2354 break;
2355
2356 case 5:
2357
2358 {
2359 ConstantUnion *unionArray = new ConstantUnion[1];
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002360 unionArray->setUConst((yyvsp[(1) - (1)].lex).u);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002361 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002362 }
2363 break;
2364
2365 case 6:
2366
2367 {
2368 ConstantUnion *unionArray = new ConstantUnion[1];
John Bauman66b8ab22014-05-06 15:57:45 -04002369 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002370 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002371 }
2372 break;
2373
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002374 case 7:
John Bauman66b8ab22014-05-06 15:57:45 -04002375
2376 {
2377 ConstantUnion *unionArray = new ConstantUnion[1];
2378 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002379 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002380 }
2381 break;
2382
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002383 case 8:
John Bauman66b8ab22014-05-06 15:57:45 -04002384
2385 {
2386 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
2387 }
2388 break;
2389
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002390 case 9:
John Bauman66b8ab22014-05-06 15:57:45 -04002391
2392 {
2393 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2394 }
2395 break;
2396
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002397 case 10:
John Bauman66b8ab22014-05-06 15:57:45 -04002398
2399 {
2400 if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) {
2401 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode())
2402 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());
2403 else
2404 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", "expression");
2405 context->recover();
2406 }
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002407 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConstExpr) {
John Bauman66b8ab22014-05-06 15:57:45 -04002408 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays
Nicolas Capens198529d2015-02-10 13:54:19 -05002409 (yyval.interm.intermTypedNode) = context->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002410 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors
2411 TVectorFields fields;
2412 fields.num = 1;
Nicolas Capens198529d2015-02-10 13:54:19 -05002413 fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0); // need to do it this way because v.xy sends fields integer array
John Bauman66b8ab22014-05-06 15:57:45 -04002414 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2415 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices
Nicolas Capens198529d2015-02-10 13:54:19 -05002416 (yyval.interm.intermTypedNode) = context->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002417 }
2418 } else {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002419 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConstExpr) {
Nicolas Capens198529d2015-02-10 13:54:19 -05002420 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() ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002421 std::stringstream extraInfoStream;
Nicolas Capens198529d2015-02-10 13:54:19 -05002422 extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
John Bauman66b8ab22014-05-06 15:57:45 -04002423 std::string extraInfo = extraInfoStream.str();
2424 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
2425 context->recover();
2426 } else {
2427 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2428 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
Nicolas Capens198529d2015-02-10 13:54:19 -05002429 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0)) {
2430 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))
John Bauman66b8ab22014-05-06 15:57:45 -04002431 context->recover();
2432 } else {
2433 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line))
2434 context->recover();
2435 }
Nicolas Capens198529d2015-02-10 13:54:19 -05002436 } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) {
John Bauman66b8ab22014-05-06 15:57:45 -04002437 std::stringstream extraInfoStream;
Nicolas Capens198529d2015-02-10 13:54:19 -05002438 extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
John Bauman66b8ab22014-05-06 15:57:45 -04002439 std::string extraInfo = extraInfoStream.str();
2440 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
2441 context->recover();
2442 }
2443 }
2444 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2445 }
2446 } else {
2447 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
2448 context->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable");
2449 context->recover();
2450 }
2451
2452 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2453 }
2454 }
2455 if ((yyval.interm.intermTypedNode) == 0) {
2456 ConstantUnion *unionArray = new ConstantUnion[1];
2457 unionArray->setFConst(0.0f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002458 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConstExpr), (yyvsp[(2) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002459 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2460 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct())
2461 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName()));
2462 else
Alexis Hetub14178b2015-04-13 13:23:20 -04002463 (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)->getSecondarySize()));
John Bauman66b8ab22014-05-06 15:57:45 -04002464
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002465 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr)
2466 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConstExpr);
2467 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr)
Alexis Hetu00106d42015-04-23 11:45:35 -04002468 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConstExpr, (yyvsp[(1) - (4)].interm.intermTypedNode)->getSecondarySize()));
John Bauman66b8ab22014-05-06 15:57:45 -04002469 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())
Alexis Hetu00106d42015-04-23 11:45:35 -04002470 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getSecondarySize()));
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002471 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr)
2472 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConstExpr));
John Bauman66b8ab22014-05-06 15:57:45 -04002473 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector())
2474 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary));
2475 else
2476 (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType());
2477 }
2478 break;
2479
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002480 case 11:
John Bauman66b8ab22014-05-06 15:57:45 -04002481
2482 {
2483 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2484 }
2485 break;
2486
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002487 case 12:
John Bauman66b8ab22014-05-06 15:57:45 -04002488
2489 {
2490 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) {
2491 context->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", ".");
2492 context->recover();
2493 }
2494
2495 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) {
2496 TVectorFields fields;
2497 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2498 fields.num = 1;
2499 fields.offsets[0] = 0;
2500 context->recover();
2501 }
2502
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002503 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr) { // constant folding for vector fields
John Bauman66b8ab22014-05-06 15:57:45 -04002504 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line);
2505 if ((yyval.interm.intermTypedNode) == 0) {
2506 context->recover();
2507 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2508 }
2509 else
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002510 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqConstExpr, (int) (*(yyvsp[(3) - (3)].lex).string).size()));
John Bauman66b8ab22014-05-06 15:57:45 -04002511 } else {
2512 TString vectorString = *(yyvsp[(3) - (3)].lex).string;
2513 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line);
2514 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2515 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (int) vectorString.size()));
2516 }
2517 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) {
2518 TMatrixFields fields;
Alexis Hetu00106d42015-04-23 11:45:35 -04002519 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getSecondarySize(), fields, (yyvsp[(3) - (3)].lex).line)) {
John Bauman66b8ab22014-05-06 15:57:45 -04002520 fields.wholeRow = false;
2521 fields.wholeCol = false;
2522 fields.row = 0;
2523 fields.col = 0;
2524 context->recover();
2525 }
2526
2527 if (fields.wholeRow || fields.wholeCol) {
2528 context->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", ".");
2529 context->recover();
2530 ConstantUnion *unionArray = new ConstantUnion[1];
2531 unionArray->setIConst(0);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002532 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(3) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002533 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2534 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize()));
2535 } else {
2536 ConstantUnion *unionArray = new ConstantUnion[1];
2537 unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002538 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(3) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002539 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2540 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision()));
2541 }
2542 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) {
2543 bool fieldFound = false;
2544 const TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct();
2545 if (fields == 0) {
2546 context->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error");
2547 context->recover();
2548 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2549 } else {
2550 unsigned int i;
2551 for (i = 0; i < fields->size(); ++i) {
2552 if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
2553 fieldFound = true;
2554 break;
2555 }
2556 }
2557 if (fieldFound) {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002558 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr) {
John Bauman66b8ab22014-05-06 15:57:45 -04002559 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2560 if ((yyval.interm.intermTypedNode) == 0) {
2561 context->recover();
2562 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2563 }
2564 else {
2565 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2566 // change the qualifier of the return type, not of the structure field
2567 // as the structure definition is shared between various structures.
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002568 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConstExpr);
John Bauman66b8ab22014-05-06 15:57:45 -04002569 }
2570 } else {
2571 ConstantUnion *unionArray = new ConstantUnion[1];
2572 unionArray->setIConst(i);
2573 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line);
2574 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2575 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2576 }
2577 } else {
2578 context->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str());
2579 context->recover();
2580 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2581 }
2582 }
2583 } else {
2584 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());
2585 context->recover();
2586 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2587 }
2588 // don't delete $3.string, it's from the pool
2589 }
2590 break;
2591
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002592 case 13:
John Bauman66b8ab22014-05-06 15:57:45 -04002593
2594 {
2595 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2596 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002597 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002598 if ((yyval.interm.intermTypedNode) == 0) {
2599 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2600 context->recover();
2601 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2602 }
2603 }
2604 break;
2605
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002606 case 14:
John Bauman66b8ab22014-05-06 15:57:45 -04002607
2608 {
2609 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2610 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002611 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002612 if ((yyval.interm.intermTypedNode) == 0) {
2613 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2614 context->recover();
2615 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2616 }
2617 }
2618 break;
2619
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002620 case 15:
John Bauman66b8ab22014-05-06 15:57:45 -04002621
2622 {
2623 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2624 context->recover();
2625 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2626 }
2627 break;
2628
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002629 case 16:
John Bauman66b8ab22014-05-06 15:57:45 -04002630
2631 {
2632 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2633 TOperator op = fnCall->getBuiltInOp();
2634
2635 if (op != EOpNull)
2636 {
2637 //
2638 // Then this should be a constructor.
2639 // Don't go through the symbol table for constructors.
2640 // Their parameters will be verified algorithmically.
2641 //
2642 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2643 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2644 (yyval.interm.intermTypedNode) = 0;
2645 } else {
2646 //
2647 // It's a constructor, of type 'type'.
2648 //
2649 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2650 }
2651
2652 if ((yyval.interm.intermTypedNode) == 0) {
2653 context->recover();
2654 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2655 }
2656 (yyval.interm.intermTypedNode)->setType(type);
2657 } else {
2658 //
2659 // Not a constructor. Find it in the symbol table.
2660 //
2661 const TFunction* fnCandidate;
2662 bool builtIn;
2663 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn);
2664 if (fnCandidate) {
2665 //
2666 // A declared function.
2667 //
2668 if (builtIn && !fnCandidate->getExtension().empty() &&
2669 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2670 context->recover();
2671 }
2672 op = fnCandidate->getBuiltInOp();
2673 if (builtIn && op != EOpNull) {
2674 //
2675 // A function call mapped to a built-in operation.
2676 //
2677 if (fnCandidate->getParamCount() == 1) {
2678 //
2679 // Treat it like a built-in unary operator.
2680 //
John Baumand4ae8632014-05-06 16:18:33 -04002681 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0);
John Bauman66b8ab22014-05-06 15:57:45 -04002682 if ((yyval.interm.intermTypedNode) == 0) {
2683 std::stringstream extraInfoStream;
2684 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2685 std::string extraInfo = extraInfoStream.str();
2686 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
2687 YYERROR;
2688 }
2689 } else {
2690 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2691 }
2692 } else {
2693 // This is a real function call
2694
2695 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2696 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2697
2698 // this is how we know whether the given function is a builtIn function or a user defined function
2699 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2700 // if builtIn == true, it's definitely a builtIn function with EOpNull
2701 if (!builtIn)
2702 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2703 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2704
2705 TQualifier qual;
2706 for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
2707 qual = fnCandidate->getParam(i).type->getQualifier();
2708 if (qual == EvqOut || qual == EvqInOut) {
2709 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
2710 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
2711 context->recover();
2712 }
2713 }
2714 }
2715 }
2716 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2717 } else {
2718 // error message was put out by PaFindFunction()
2719 // Put on a dummy node for error recovery
2720 ConstantUnion *unionArray = new ConstantUnion[1];
2721 unionArray->setFConst(0.0f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002722 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002723 context->recover();
2724 }
2725 }
2726 delete fnCall;
2727 }
2728 break;
2729
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002730 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002731
2732 {
2733 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2734 }
2735 break;
2736
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002737 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002738
2739 {
2740 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
2741 context->recover();
2742 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2743 }
2744 break;
2745
John Bauman66b8ab22014-05-06 15:57:45 -04002746 case 19:
2747
2748 {
2749 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2750 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2751 }
2752 break;
2753
2754 case 20:
2755
2756 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002757 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2758 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2759 }
2760 break;
2761
2762 case 21:
2763
2764 {
John Bauman66b8ab22014-05-06 15:57:45 -04002765 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2766 (yyval.interm).intermNode = 0;
2767 }
2768 break;
2769
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002770 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002771
2772 {
2773 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2774 (yyval.interm).intermNode = 0;
2775 }
2776 break;
2777
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002778 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002779
2780 {
2781 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2782 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2783 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2784 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2785 }
2786 break;
2787
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002788 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002789
2790 {
2791 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2792 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2793 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2794 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2795 }
2796 break;
2797
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002798 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002799
2800 {
2801 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2802 }
2803 break;
2804
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002805 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002806
2807 {
2808 //
2809 // Constructor
2810 //
2811 TOperator op = EOpNull;
2812 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2813 op = EOpConstructStruct;
2814 } else {
2815 switch ((yyvsp[(1) - (1)].interm.type).type) {
2816 case EbtFloat:
Alexis Hetub14178b2015-04-13 13:23:20 -04002817 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2818 case 1:
2819 op = EOpConstructFloat; break;
2820 case 2:
2821 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2822 case 1: op = EOpConstructVec2; break;
2823 case 2: op = EOpConstructMat2; break;
2824 case 3: op = EOpConstructMat2x3; break;
2825 case 4: op = EOpConstructMat2x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002826 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002827 break;
2828 case 3:
2829 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2830 case 1: op = EOpConstructVec3; break;
2831 case 2: op = EOpConstructMat3x2; break;
2832 case 3: op = EOpConstructMat3; break;
2833 case 4: op = EOpConstructMat3x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002834 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002835 break;
2836 case 4:
2837 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2838 case 1: op = EOpConstructVec4; break;
2839 case 2: op = EOpConstructMat4x2; break;
2840 case 3: op = EOpConstructMat4x3; break;
2841 case 4: op = EOpConstructMat4; break;
2842 }
2843 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002844 }
2845 break;
2846 case EbtInt:
Alexis Hetub14178b2015-04-13 13:23:20 -04002847 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002848 case 1: op = EOpConstructInt; break;
2849 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2850 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2851 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2852 }
2853 break;
Alexis Hetub7c46af2015-05-12 15:58:09 -04002854 case EbtUInt:
2855 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2856 case 1: op = EOpConstructUInt; break;
2857 case 2: FRAG_VERT_ONLY("uvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec2; break;
2858 case 3: FRAG_VERT_ONLY("uvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec3; break;
2859 case 4: FRAG_VERT_ONLY("uvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec4; break;
2860 }
2861 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002862 case EbtBool:
Alexis Hetub14178b2015-04-13 13:23:20 -04002863 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002864 case 1: op = EOpConstructBool; break;
2865 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2866 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2867 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2868 }
2869 break;
2870 default: break;
2871 }
2872 if (op == EOpNull) {
2873 context->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type));
2874 context->recover();
2875 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2876 op = EOpConstructFloat;
2877 }
2878 }
2879 TString tempString;
2880 TType type((yyvsp[(1) - (1)].interm.type));
2881 TFunction *function = new TFunction(&tempString, type, op);
2882 (yyval.interm.function) = function;
2883 }
2884 break;
2885
John Bauman66b8ab22014-05-06 15:57:45 -04002886 case 27:
2887
2888 {
2889 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2890 context->recover();
2891 TType type(EbtVoid, EbpUndefined);
2892 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2893 (yyval.interm.function) = function;
2894 }
2895 break;
2896
2897 case 28:
2898
2899 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002900 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2901 context->recover();
2902 TType type(EbtVoid, EbpUndefined);
2903 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2904 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002905 }
2906 break;
2907
2908 case 29:
2909
2910 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002911 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2912 }
2913 break;
2914
2915 case 30:
2916
2917 {
John Bauman66b8ab22014-05-06 15:57:45 -04002918 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2919 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002920 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002921 if ((yyval.interm.intermTypedNode) == 0) {
2922 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2923 context->recover();
2924 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2925 }
2926 }
2927 break;
2928
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002929 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002930
2931 {
2932 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2933 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002934 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002935 if ((yyval.interm.intermTypedNode) == 0) {
2936 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2937 context->recover();
2938 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2939 }
2940 }
2941 break;
2942
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002943 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002944
2945 {
2946 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
John Baumand4ae8632014-05-06 16:18:33 -04002947 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002948 if ((yyval.interm.intermTypedNode) == 0) {
2949 const char* errorOp = "";
2950 switch((yyvsp[(1) - (2)].interm).op) {
2951 case EOpNegative: errorOp = "-"; break;
2952 case EOpLogicalNot: errorOp = "!"; break;
Alexis Hetud061e422015-05-13 16:37:50 -04002953 case EOpBitwiseNot: errorOp = "~"; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002954 default: break;
2955 }
2956 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2957 context->recover();
2958 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2959 }
2960 } else
2961 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2962 }
2963 break;
2964
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002965 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002966
2967 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
2968 break;
2969
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002970 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002971
2972 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
2973 break;
2974
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002975 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002976
2977 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
2978 break;
2979
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002980 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002981
Alexis Hetu17809052015-05-13 11:28:22 -04002982 {
2983 ES3_ONLY("~", (yyvsp[(1) - (1)].lex).line);
2984 (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseNot;
2985 }
John Bauman66b8ab22014-05-06 15:57:45 -04002986 break;
2987
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002988 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002989
Alexis Hetu17809052015-05-13 11:28:22 -04002990 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2991 break;
2992
2993 case 38:
2994
John Bauman66b8ab22014-05-06 15:57:45 -04002995 {
2996 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04002997 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002998 if ((yyval.interm.intermTypedNode) == 0) {
2999 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3000 context->recover();
3001 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3002 }
3003 }
3004 break;
3005
Alexis Hetu17809052015-05-13 11:28:22 -04003006 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04003007
3008 {
3009 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04003010 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003011 if ((yyval.interm.intermTypedNode) == 0) {
3012 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3013 context->recover();
3014 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3015 }
3016 }
3017 break;
3018
Alexis Hetu17809052015-05-13 11:28:22 -04003019 case 40:
3020
3021 {
3022 FRAG_VERT_ONLY("%", (yyvsp[(2) - (3)].lex).line);
3023 ES3_ONLY("%", (yyvsp[(2) - (3)].lex).line);
3024 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpIMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3025 if ((yyval.interm.intermTypedNode) == 0) {
3026 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "%", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3027 context->recover();
3028 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3029 }
3030 }
3031 break;
3032
3033 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04003034
3035 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3036 break;
3037
Alexis Hetu17809052015-05-13 11:28:22 -04003038 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04003039
3040 {
John Baumand4ae8632014-05-06 16:18:33 -04003041 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003042 if ((yyval.interm.intermTypedNode) == 0) {
3043 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3044 context->recover();
3045 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3046 }
3047 }
3048 break;
3049
Alexis Hetu17809052015-05-13 11:28:22 -04003050 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04003051
3052 {
John Baumand4ae8632014-05-06 16:18:33 -04003053 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003054 if ((yyval.interm.intermTypedNode) == 0) {
3055 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3056 context->recover();
3057 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3058 }
3059 }
3060 break;
3061
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003062 case 44:
3063
Alexis Hetu17809052015-05-13 11:28:22 -04003064 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3065 break;
3066
3067 case 45:
3068
3069 {
3070 ES3_ONLY("<<", (yyvsp[(2) - (3)].lex).line);
3071 context->intermediate.addBinaryMath(EOpBitShiftLeft, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3072 if ((yyval.interm.intermTypedNode) == 0) {
3073 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3074 context->recover();
3075 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3076 }
3077 }
3078 break;
3079
3080 case 46:
3081
3082 {
3083 ES3_ONLY(">>", (yyvsp[(2) - (3)].lex).line);
3084 context->intermediate.addBinaryMath(EOpBitShiftRight, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3085 if ((yyval.interm.intermTypedNode) == 0) {
3086 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">>", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3087 context->recover();
3088 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3089 }
3090 }
3091 break;
3092
3093 case 47:
3094
3095 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3096 break;
3097
3098 case 48:
3099
John Bauman66b8ab22014-05-06 15:57:45 -04003100 {
John Baumand4ae8632014-05-06 16:18:33 -04003101 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003102 if ((yyval.interm.intermTypedNode) == 0) {
3103 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3104 context->recover();
3105 ConstantUnion *unionArray = new ConstantUnion[1];
3106 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003107 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003108 }
3109 }
3110 break;
3111
Alexis Hetu17809052015-05-13 11:28:22 -04003112 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04003113
3114 {
John Baumand4ae8632014-05-06 16:18:33 -04003115 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003116 if ((yyval.interm.intermTypedNode) == 0) {
3117 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3118 context->recover();
3119 ConstantUnion *unionArray = new ConstantUnion[1];
3120 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003121 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003122 }
3123 }
3124 break;
3125
Alexis Hetu17809052015-05-13 11:28:22 -04003126 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04003127
3128 {
John Baumand4ae8632014-05-06 16:18:33 -04003129 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003130 if ((yyval.interm.intermTypedNode) == 0) {
3131 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3132 context->recover();
3133 ConstantUnion *unionArray = new ConstantUnion[1];
3134 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003135 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003136 }
3137 }
3138 break;
3139
Alexis Hetu17809052015-05-13 11:28:22 -04003140 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04003141
3142 {
John Baumand4ae8632014-05-06 16:18:33 -04003143 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003144 if ((yyval.interm.intermTypedNode) == 0) {
3145 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3146 context->recover();
3147 ConstantUnion *unionArray = new ConstantUnion[1];
3148 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003149 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003150 }
3151 }
3152 break;
3153
Alexis Hetu17809052015-05-13 11:28:22 -04003154 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04003155
3156 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3157 break;
3158
Alexis Hetu17809052015-05-13 11:28:22 -04003159 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04003160
3161 {
John Baumand4ae8632014-05-06 16:18:33 -04003162 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003163 if ((yyval.interm.intermTypedNode) == 0) {
3164 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3165 context->recover();
3166 ConstantUnion *unionArray = new ConstantUnion[1];
3167 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003168 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003169 }
3170 }
3171 break;
3172
Alexis Hetu17809052015-05-13 11:28:22 -04003173 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04003174
3175 {
John Baumand4ae8632014-05-06 16:18:33 -04003176 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003177 if ((yyval.interm.intermTypedNode) == 0) {
3178 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3179 context->recover();
3180 ConstantUnion *unionArray = new ConstantUnion[1];
3181 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003182 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003183 }
3184 }
3185 break;
3186
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003187 case 55:
3188
Alexis Hetu17809052015-05-13 11:28:22 -04003189 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3190 break;
3191
3192 case 56:
3193
3194 {
3195 ES3_ONLY("&", (yyvsp[(2) - (3)].lex).line);
3196 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3197 if ((yyval.interm.intermTypedNode) == 0) {
3198 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3199 context->recover();
3200 ConstantUnion *unionArray = new ConstantUnion[1];
3201 unionArray->setBConst(false);
3202 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3203 }
3204 }
3205 break;
3206
3207 case 57:
3208
3209 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3210 break;
3211
3212 case 58:
3213
3214 {
3215 ES3_ONLY("^", (yyvsp[(2) - (3)].lex).line);
3216 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3217 if ((yyval.interm.intermTypedNode) == 0) {
3218 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3219 context->recover();
3220 ConstantUnion *unionArray = new ConstantUnion[1];
3221 unionArray->setBConst(false);
3222 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3223 }
3224 }
3225 break;
3226
3227 case 59:
3228
3229 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3230 break;
3231
3232 case 60:
3233
3234 {
3235 ES3_ONLY("|", (yyvsp[(2) - (3)].lex).line);
3236 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3237 if ((yyval.interm.intermTypedNode) == 0) {
3238 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "|", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3239 context->recover();
3240 ConstantUnion *unionArray = new ConstantUnion[1];
3241 unionArray->setBConst(false);
3242 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3243 }
3244 }
3245 break;
3246
3247 case 61:
3248
3249 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3250 break;
3251
3252 case 62:
3253
John Bauman66b8ab22014-05-06 15:57:45 -04003254 {
John Baumand4ae8632014-05-06 16:18:33 -04003255 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003256 if ((yyval.interm.intermTypedNode) == 0) {
3257 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3258 context->recover();
3259 ConstantUnion *unionArray = new ConstantUnion[1];
3260 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003261 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003262 }
3263 }
3264 break;
3265
Alexis Hetu17809052015-05-13 11:28:22 -04003266 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04003267
3268 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3269 break;
3270
Alexis Hetu17809052015-05-13 11:28:22 -04003271 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003272
3273 {
John Baumand4ae8632014-05-06 16:18:33 -04003274 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003275 if ((yyval.interm.intermTypedNode) == 0) {
3276 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3277 context->recover();
3278 ConstantUnion *unionArray = new ConstantUnion[1];
3279 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003280 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003281 }
3282 }
3283 break;
3284
Alexis Hetu17809052015-05-13 11:28:22 -04003285 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003286
3287 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3288 break;
3289
Alexis Hetu17809052015-05-13 11:28:22 -04003290 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003291
3292 {
John Baumand4ae8632014-05-06 16:18:33 -04003293 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003294 if ((yyval.interm.intermTypedNode) == 0) {
3295 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3296 context->recover();
3297 ConstantUnion *unionArray = new ConstantUnion[1];
3298 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003299 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003300 }
3301 }
3302 break;
3303
Alexis Hetu17809052015-05-13 11:28:22 -04003304 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003305
3306 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3307 break;
3308
Alexis Hetu17809052015-05-13 11:28:22 -04003309 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003310
3311 {
3312 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3313 context->recover();
3314
3315 (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);
3316 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3317 (yyval.interm.intermTypedNode) = 0;
3318
3319 if ((yyval.interm.intermTypedNode) == 0) {
3320 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3321 context->recover();
3322 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3323 }
3324 }
3325 break;
3326
Alexis Hetu17809052015-05-13 11:28:22 -04003327 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003328
3329 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3330 break;
3331
Alexis Hetu17809052015-05-13 11:28:22 -04003332 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003333
3334 {
3335 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3336 context->recover();
3337 (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);
3338 if ((yyval.interm.intermTypedNode) == 0) {
3339 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3340 context->recover();
3341 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3342 }
3343 }
3344 break;
3345
Alexis Hetu17809052015-05-13 11:28:22 -04003346 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003347
3348 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
3349 break;
3350
Alexis Hetu17809052015-05-13 11:28:22 -04003351 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003352
3353 { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; }
3354 break;
3355
Alexis Hetu17809052015-05-13 11:28:22 -04003356 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003357
3358 { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; }
3359 break;
3360
Alexis Hetu17809052015-05-13 11:28:22 -04003361 case 74:
3362
3363 { ES3_ONLY("%=", (yyvsp[(1) - (1)].lex).line);
3364 FRAG_VERT_ONLY("%=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpIModAssign; }
3365 break;
3366
3367 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003368
3369 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
3370 break;
3371
Alexis Hetu17809052015-05-13 11:28:22 -04003372 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003373
3374 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
3375 break;
3376
Alexis Hetu17809052015-05-13 11:28:22 -04003377 case 77:
3378
3379 { ES3_ONLY("<<=", (yyvsp[(1) - (1)].lex).line);
3380 FRAG_VERT_ONLY("<<=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftLeftAssign; }
3381 break;
3382
3383 case 78:
3384
3385 { ES3_ONLY(">>=", (yyvsp[(1) - (1)].lex).line);
3386 FRAG_VERT_ONLY(">>=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftRightAssign; }
3387 break;
3388
3389 case 79:
3390
3391 { ES3_ONLY("&=", (yyvsp[(1) - (1)].lex).line);
3392 FRAG_VERT_ONLY("&=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseAndAssign; }
3393 break;
3394
3395 case 80:
3396
3397 { ES3_ONLY("^=", (yyvsp[(1) - (1)].lex).line);
3398 FRAG_VERT_ONLY("^=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseXorAssign; }
3399 break;
3400
3401 case 81:
3402
3403 { ES3_ONLY("|=", (yyvsp[(1) - (1)].lex).line);
3404 FRAG_VERT_ONLY("|=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseOrAssign; }
3405 break;
3406
3407 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003408
3409 {
3410 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3411 }
3412 break;
3413
Alexis Hetu17809052015-05-13 11:28:22 -04003414 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003415
3416 {
3417 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3418 if ((yyval.interm.intermTypedNode) == 0) {
3419 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3420 context->recover();
3421 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3422 }
3423 }
3424 break;
3425
Alexis Hetu17809052015-05-13 11:28:22 -04003426 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003427
3428 {
3429 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3430 context->recover();
3431 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3432 }
3433 break;
3434
Alexis Hetu17809052015-05-13 11:28:22 -04003435 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003436
3437 {
3438 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3439
3440 TIntermAggregate *prototype = new TIntermAggregate;
3441 prototype->setType(function.getReturnType());
3442 prototype->setName(function.getName());
3443
3444 for (int i = 0; i < function.getParamCount(); i++)
3445 {
3446 const TParameter &param = function.getParam(i);
3447 if (param.name != 0)
3448 {
John Baumand4ae8632014-05-06 16:18:33 -04003449 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003450
John Baumand4ae8632014-05-06 16:18:33 -04003451 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003452 }
3453 else
3454 {
3455 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3456 }
3457 }
3458
3459 prototype->setOp(EOpPrototype);
3460 (yyval.interm.intermNode) = prototype;
3461
3462 context->symbolTable.pop();
3463 }
3464 break;
3465
Alexis Hetu17809052015-05-13 11:28:22 -04003466 case 86:
John Bauman66b8ab22014-05-06 15:57:45 -04003467
3468 {
3469 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3470 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3471 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
3472 }
3473 break;
3474
Alexis Hetu17809052015-05-13 11:28:22 -04003475 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003476
3477 {
John Baumand4ae8632014-05-06 16:18:33 -04003478 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3479 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3480 context->recover();
3481 }
John Bauman66b8ab22014-05-06 15:57:45 -04003482 (yyval.interm.intermNode) = 0;
3483 }
3484 break;
3485
Alexis Hetu17809052015-05-13 11:28:22 -04003486 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003487
3488 {
3489 //
3490 // Multiple declarations of the same function are allowed.
3491 //
3492 // If this is a definition, the definition production code will check for redefinitions
3493 // (we don't know at this point if it's a definition or not).
3494 //
3495 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3496 //
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05003497 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04003498 if (prevDec) {
3499 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
3500 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
3501 context->recover();
3502 }
3503 for (int i = 0; i < prevDec->getParamCount(); ++i) {
3504 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
3505 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
3506 context->recover();
3507 }
3508 }
3509 }
3510
3511 //
3512 // If this is a redeclaration, it could also be a definition,
3513 // in which case, we want to use the variable names from this one, and not the one that's
3514 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3515 //
3516 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3517 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3518
3519 // We're at the inner scope level of the function's arguments and body statement.
3520 // Add the function prototype to the surrounding scope instead.
3521 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3522 }
3523 break;
3524
Alexis Hetu17809052015-05-13 11:28:22 -04003525 case 89:
John Bauman66b8ab22014-05-06 15:57:45 -04003526
3527 {
3528 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3529 }
3530 break;
3531
Alexis Hetu17809052015-05-13 11:28:22 -04003532 case 90:
John Bauman66b8ab22014-05-06 15:57:45 -04003533
3534 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003535 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3536 }
3537 break;
3538
Alexis Hetu17809052015-05-13 11:28:22 -04003539 case 91:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003540
3541 {
John Bauman66b8ab22014-05-06 15:57:45 -04003542 // Add the parameter
3543 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3544 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3545 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3546 else
3547 delete (yyvsp[(2) - (2)].interm).param.type;
3548 }
3549 break;
3550
Alexis Hetu17809052015-05-13 11:28:22 -04003551 case 92:
John Bauman66b8ab22014-05-06 15:57:45 -04003552
3553 {
3554 //
3555 // Only first parameter of one-parameter functions can be void
3556 // The check for named parameters not being void is done in parameter_declarator
3557 //
3558 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3559 //
3560 // This parameter > first is void
3561 //
3562 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
3563 context->recover();
3564 delete (yyvsp[(3) - (3)].interm).param.type;
3565 } else {
3566 // Add the parameter
3567 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3568 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3569 }
3570 }
3571 break;
3572
Alexis Hetu17809052015-05-13 11:28:22 -04003573 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003574
3575 {
3576 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
3577 context->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));
3578 context->recover();
3579 }
3580 // make sure a sampler is not involved as well...
3581 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3582 context->recover();
3583
3584 // Add the function as a prototype after parsing it (we do not support recursion)
3585 TFunction *function;
3586 TType type((yyvsp[(1) - (3)].interm.type));
3587 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3588 (yyval.interm.function) = function;
3589
3590 context->symbolTable.push();
3591 }
3592 break;
3593
Alexis Hetu17809052015-05-13 11:28:22 -04003594 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003595
3596 {
3597 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
3598 context->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
3599 context->recover();
3600 }
3601 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3602 context->recover();
3603 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3604 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3605 (yyval.interm).param = param;
3606 }
3607 break;
3608
Alexis Hetu17809052015-05-13 11:28:22 -04003609 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003610
3611 {
3612 // Check that we can make an array out of this type
3613 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3614 context->recover();
3615
3616 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3617 context->recover();
3618
3619 int size;
3620 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3621 context->recover();
3622 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3623
3624 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3625 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3626 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3627 (yyval.interm).param = param;
3628 }
3629 break;
3630
Alexis Hetu17809052015-05-13 11:28:22 -04003631 case 96:
John Bauman66b8ab22014-05-06 15:57:45 -04003632
3633 {
3634 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003635 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
John Bauman66b8ab22014-05-06 15:57:45 -04003636 context->recover();
3637 }
3638 break;
3639
Alexis Hetu17809052015-05-13 11:28:22 -04003640 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003641
3642 {
John Bauman66b8ab22014-05-06 15:57:45 -04003643 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3644 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3645 context->recover();
3646 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3647 context->recover();
3648 }
3649 break;
3650
Alexis Hetu17809052015-05-13 11:28:22 -04003651 case 98:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003652
3653 {
3654 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3655 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3656 context->recover();
3657 }
3658 break;
3659
Alexis Hetu17809052015-05-13 11:28:22 -04003660 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003661
3662 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003663 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3664 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3665 context->recover();
3666 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3667 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003668 }
3669 break;
3670
Alexis Hetu17809052015-05-13 11:28:22 -04003671 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003672
3673 {
3674 (yyval.interm.qualifier) = EvqIn;
3675 }
3676 break;
3677
Alexis Hetu17809052015-05-13 11:28:22 -04003678 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003679
3680 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003681 (yyval.interm.qualifier) = EvqIn;
John Bauman66b8ab22014-05-06 15:57:45 -04003682 }
3683 break;
3684
Alexis Hetu17809052015-05-13 11:28:22 -04003685 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003686
3687 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003688 (yyval.interm.qualifier) = EvqOut;
John Bauman66b8ab22014-05-06 15:57:45 -04003689 }
3690 break;
3691
Alexis Hetu17809052015-05-13 11:28:22 -04003692 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003693
3694 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003695 (yyval.interm.qualifier) = EvqInOut;
3696 }
3697 break;
3698
Alexis Hetu17809052015-05-13 11:28:22 -04003699 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003700
3701 {
John Bauman66b8ab22014-05-06 15:57:45 -04003702 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3703 (yyval.interm).param = param;
3704 }
3705 break;
3706
Alexis Hetu17809052015-05-13 11:28:22 -04003707 case 105:
John Bauman66b8ab22014-05-06 15:57:45 -04003708
3709 {
3710 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3711 }
3712 break;
3713
Alexis Hetu17809052015-05-13 11:28:22 -04003714 case 106:
John Bauman66b8ab22014-05-06 15:57:45 -04003715
3716 {
3717 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3718 {
3719 context->error((yyvsp[(3) - (3)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(3) - (3)].lex).string->c_str());
3720 context->recover();
3721 }
3722
3723 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3724 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, symbol, (yyvsp[(3) - (3)].lex).line);
3725
3726 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3727 context->recover();
3728
3729 if (context->nonInitConstErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, false))
3730 context->recover();
3731
3732 TVariable* variable = 0;
3733 if (context->nonInitErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, variable))
3734 context->recover();
3735 if (symbol && variable)
3736 symbol->setId(variable->getUniqueId());
3737 }
3738 break;
3739
Alexis Hetu17809052015-05-13 11:28:22 -04003740 case 107:
John Bauman66b8ab22014-05-06 15:57:45 -04003741
3742 {
3743 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3744 context->recover();
3745
3746 if (context->nonInitConstErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, true))
3747 context->recover();
3748
3749 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3750
3751 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))
3752 context->recover();
3753 else {
3754 (yyvsp[(1) - (5)].interm).type.setArray(true);
3755 TVariable* variable;
3756 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3757 context->recover();
3758 }
3759 }
3760 break;
3761
Alexis Hetu17809052015-05-13 11:28:22 -04003762 case 108:
John Bauman66b8ab22014-05-06 15:57:45 -04003763
3764 {
3765 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3766 context->recover();
3767
3768 if (context->nonInitConstErrorCheck((yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, true))
3769 context->recover();
3770
3771 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3772
3773 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))
3774 context->recover();
3775 else {
3776 int size;
3777 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3778 context->recover();
3779 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
3780 TVariable* variable = 0;
3781 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3782 context->recover();
3783 TType type = TType((yyvsp[(1) - (6)].interm).type);
3784 type.setArraySize(size);
3785 (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);
3786 }
3787 }
3788 break;
3789
Alexis Hetu17809052015-05-13 11:28:22 -04003790 case 109:
John Bauman66b8ab22014-05-06 15:57:45 -04003791
3792 {
3793 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3794 context->recover();
3795
3796 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3797
3798 TIntermNode* intermNode;
3799 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3800 //
3801 // build the intermediate representation
3802 //
3803 if (intermNode)
3804 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3805 else
3806 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3807 } else {
3808 context->recover();
3809 (yyval.interm).intermAggregate = 0;
3810 }
3811 }
3812 break;
3813
Alexis Hetu17809052015-05-13 11:28:22 -04003814 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003815
3816 {
3817 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3818 (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);
3819 }
3820 break;
3821
Alexis Hetu17809052015-05-13 11:28:22 -04003822 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003823
3824 {
3825 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3826 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3827
3828 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3829 context->recover();
3830
3831 if (context->nonInitConstErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, false))
3832 context->recover();
3833
3834 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3835
3836 TVariable* variable = 0;
3837 if (context->nonInitErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, variable))
3838 context->recover();
3839 if (variable && symbol)
3840 symbol->setId(variable->getUniqueId());
3841 }
3842 break;
3843
Alexis Hetu17809052015-05-13 11:28:22 -04003844 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003845
3846 {
3847 context->error((yyvsp[(2) - (4)].lex).line, "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str());
3848 context->recover();
3849
3850 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3851 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
3852 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3853 }
3854 break;
3855
Alexis Hetu17809052015-05-13 11:28:22 -04003856 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003857
3858 {
3859 TType type = TType((yyvsp[(1) - (5)].interm.type));
3860 int size;
3861 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3862 context->recover();
3863 type.setArraySize(size);
3864 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3865 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
3866
3867 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3868 context->recover();
3869
3870 if (context->nonInitConstErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), true))
3871 context->recover();
3872
3873 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3874
3875 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)))
3876 context->recover();
3877 else {
3878 int size;
3879 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3880 context->recover();
3881
3882 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3883 TVariable* variable = 0;
3884 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3885 context->recover();
3886 if (variable && symbol)
3887 symbol->setId(variable->getUniqueId());
3888 }
3889 }
3890 break;
3891
Alexis Hetu17809052015-05-13 11:28:22 -04003892 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003893
3894 {
3895 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3896 context->recover();
3897
3898 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3899
3900 TIntermNode* intermNode;
3901 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3902 //
3903 // Build intermediate representation
3904 //
3905 if(intermNode)
3906 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3907 else
3908 (yyval.interm).intermAggregate = 0;
3909 } else {
3910 context->recover();
3911 (yyval.interm).intermAggregate = 0;
3912 }
3913 }
3914 break;
3915
Alexis Hetu17809052015-05-13 11:28:22 -04003916 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003917
3918 {
John Bauman66b8ab22014-05-06 15:57:45 -04003919 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3920 context->recover();
3921 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3922 if (!(yyvsp[(2) - (2)].lex).symbol)
3923 {
3924 context->error((yyvsp[(2) - (2)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(2) - (2)].lex).string->c_str());
3925 context->recover();
3926
3927 (yyval.interm).intermAggregate = 0;
3928 }
3929 else
3930 {
3931 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3932 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3933 }
3934 }
3935 break;
3936
Alexis Hetu17809052015-05-13 11:28:22 -04003937 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003938
3939 {
3940 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3941
3942 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003943 ES3_ONLY("[]", (yyvsp[(1) - (1)].interm.type).line);
3944 if (context->getShaderVersion() != 300) {
3945 (yyvsp[(1) - (1)].interm.type).clearArrayness();
3946 }
John Bauman66b8ab22014-05-06 15:57:45 -04003947 }
3948 }
3949 break;
3950
Alexis Hetu17809052015-05-13 11:28:22 -04003951 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003952
3953 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003954 (yyval.interm.type) = context->addFullySpecifiedType((yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(1) - (2)].interm.type).invariant, (yyvsp[(1) - (2)].interm.type).layoutQualifier, (yyvsp[(2) - (2)].interm.type));
John Bauman66b8ab22014-05-06 15:57:45 -04003955 }
3956 break;
3957
Alexis Hetu17809052015-05-13 11:28:22 -04003958 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003959
3960 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003961 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003962 }
3963 break;
3964
Alexis Hetu17809052015-05-13 11:28:22 -04003965 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003966
3967 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003968 (yyval.interm.type).qualifier = EvqFlat;
3969 }
3970 break;
3971
Alexis Hetu17809052015-05-13 11:28:22 -04003972 case 120:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003973
3974 {
3975 (yyval.interm.qualifier) = EvqConstReadOnly;
3976 }
3977 break;
3978
Alexis Hetu17809052015-05-13 11:28:22 -04003979 case 121:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003980
3981 {
John Bauman66b8ab22014-05-06 15:57:45 -04003982 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
Nicolas Capensc6841852015-02-15 14:25:37 -05003983 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003984 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3985 context->recover();
3986 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3987 }
3988 break;
3989
Alexis Hetu17809052015-05-13 11:28:22 -04003990 case 122:
John Bauman66b8ab22014-05-06 15:57:45 -04003991
3992 {
Nicolas Capensc6841852015-02-15 14:25:37 -05003993 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003994 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3995 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05003996 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04003997 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3998 else
3999 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
4000 }
4001 break;
4002
Alexis Hetu17809052015-05-13 11:28:22 -04004003 case 123:
John Bauman66b8ab22014-05-06 15:57:45 -04004004
4005 {
Nicolas Capensc6841852015-02-15 14:25:37 -05004006 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004007 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
4008 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05004009 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04004010 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
4011 else
4012 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
4013 }
4014 break;
4015
Alexis Hetu17809052015-05-13 11:28:22 -04004016 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04004017
4018 {
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004019 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yyvsp[(1) - (1)].interm.type).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004020 }
4021 break;
4022
Alexis Hetu17809052015-05-13 11:28:22 -04004023 case 125:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004024
4025 {
4026 (yyval.interm.type) = context->joinInterpolationQualifiers((yyvsp[(1) - (2)].interm.type).line, (yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line, (yyvsp[(2) - (2)].interm.type).qualifier);
4027 }
4028 break;
4029
Alexis Hetu17809052015-05-13 11:28:22 -04004030 case 126:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004031
4032 {
4033 context->error((yyvsp[(1) - (1)].interm.type).line, "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getQualifierString((yyvsp[(1) - (1)].interm.type).qualifier));
4034 context->recover();
4035
4036 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4037 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
4038 }
4039 break;
4040
Alexis Hetu17809052015-05-13 11:28:22 -04004041 case 127:
John Bauman66b8ab22014-05-06 15:57:45 -04004042
4043 {
Nicolas Capens7d626792015-02-17 17:58:31 -05004044 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4045 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
4046 }
4047 break;
4048
Alexis Hetu17809052015-05-13 11:28:22 -04004049 case 128:
Nicolas Capens7d626792015-02-17 17:58:31 -05004050
4051 {
4052 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
4053 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
4054 }
4055 break;
4056
Alexis Hetu17809052015-05-13 11:28:22 -04004057 case 129:
Nicolas Capens7d626792015-02-17 17:58:31 -05004058
4059 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05004060 (yyval.interm.type).qualifier = EvqConstExpr;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004061 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4062 }
4063 break;
4064
Alexis Hetu17809052015-05-13 11:28:22 -04004065 case 130:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004066
4067 {
4068 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004069 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004070 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4071 }
4072 break;
4073
Alexis Hetu17809052015-05-13 11:28:22 -04004074 case 131:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004075
4076 {
4077 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004078 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004079 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4080 }
4081 break;
4082
Alexis Hetu17809052015-05-13 11:28:22 -04004083 case 132:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004084
4085 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004086 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line);
4087 if (context->shaderType == GL_VERTEX_SHADER)
4088 {
4089 context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader");
4090 context->recover();
4091 }
4092 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004093 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
4094 }
4095 break;
4096
Alexis Hetu17809052015-05-13 11:28:22 -04004097 case 133:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004098
4099 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004100 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line);
4101 if (context->shaderType == GL_FRAGMENT_SHADER)
4102 {
4103 context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader");
4104 context->recover();
4105 }
4106 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004107 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
4108 }
4109 break;
4110
Alexis Hetu17809052015-05-13 11:28:22 -04004111 case 134:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004112
4113 {
4114 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
4115 context->recover();
4116 (yyval.interm.type).qualifier = EvqUniform;
4117 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4118 }
4119 break;
4120
Alexis Hetu17809052015-05-13 11:28:22 -04004121 case 135:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004122
4123 {
John Bauman66b8ab22014-05-06 15:57:45 -04004124 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4125
4126 if ((yyval.interm.type).precision == EbpUndefined) {
4127 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
4128 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
4129 context->recover();
4130 }
4131 }
4132 }
4133 break;
4134
Alexis Hetu17809052015-05-13 11:28:22 -04004135 case 136:
John Bauman66b8ab22014-05-06 15:57:45 -04004136
4137 {
4138 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
4139 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
4140 }
4141 break;
4142
Alexis Hetu17809052015-05-13 11:28:22 -04004143 case 137:
John Bauman66b8ab22014-05-06 15:57:45 -04004144
4145 {
4146 (yyval.interm.precision) = EbpHigh;
4147 }
4148 break;
4149
Alexis Hetu17809052015-05-13 11:28:22 -04004150 case 138:
John Bauman66b8ab22014-05-06 15:57:45 -04004151
4152 {
4153 (yyval.interm.precision) = EbpMedium;
4154 }
4155 break;
4156
Alexis Hetu17809052015-05-13 11:28:22 -04004157 case 139:
John Bauman66b8ab22014-05-06 15:57:45 -04004158
4159 {
4160 (yyval.interm.precision) = EbpLow;
4161 }
4162 break;
4163
Alexis Hetu17809052015-05-13 11:28:22 -04004164 case 140:
Nicolas Capens7d626792015-02-17 17:58:31 -05004165
4166 {
4167 ES3_ONLY("layout", (yyvsp[(1) - (4)].lex).line);
4168 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
4169 }
4170 break;
4171
Alexis Hetu17809052015-05-13 11:28:22 -04004172 case 141:
Nicolas Capens7d626792015-02-17 17:58:31 -05004173
4174 {
4175 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
4176 }
4177 break;
4178
Alexis Hetu17809052015-05-13 11:28:22 -04004179 case 142:
Nicolas Capens7d626792015-02-17 17:58:31 -05004180
4181 {
4182 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
4183 }
4184 break;
4185
Alexis Hetu17809052015-05-13 11:28:22 -04004186 case 143:
Nicolas Capens7d626792015-02-17 17:58:31 -05004187
4188 {
4189 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line);
4190 }
4191 break;
4192
Alexis Hetu17809052015-05-13 11:28:22 -04004193 case 144:
Nicolas Capens7d626792015-02-17 17:58:31 -05004194
4195 {
4196 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line);
4197 }
4198 break;
4199
Alexis Hetu17809052015-05-13 11:28:22 -04004200 case 145:
Nicolas Capens7d626792015-02-17 17:58:31 -05004201
4202 {
4203 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line);
4204 }
4205 break;
4206
Alexis Hetu17809052015-05-13 11:28:22 -04004207 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04004208
4209 {
4210 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4211 }
4212 break;
4213
Alexis Hetu17809052015-05-13 11:28:22 -04004214 case 147:
John Bauman66b8ab22014-05-06 15:57:45 -04004215
4216 {
4217 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
4218
4219 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4220 context->recover();
4221 else {
4222 int size;
4223 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4224 context->recover();
4225 (yyval.interm.type).setArray(true, size);
4226 }
4227 }
4228 break;
4229
Alexis Hetu17809052015-05-13 11:28:22 -04004230 case 148:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004231
4232 {
Nicolas Capens3c20f802015-02-17 17:17:20 -05004233 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004234 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capens7d626792015-02-17 17:58:31 -05004235 }
4236 break;
4237
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004238 case 149:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004239
4240 {
4241 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu17809052015-05-13 11:28:22 -04004242 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004243 }
4244 break;
4245
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004246 case 150:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004247
4248 {
4249 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu17809052015-05-13 11:28:22 -04004250 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004251 }
4252 break;
4253
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004254 case 151:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004255
4256 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004257 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4258 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004259 }
4260 break;
4261
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004262 case 152:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004263
4264 {
Alexis Hetu17809052015-05-13 11:28:22 -04004265 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4266 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4267 }
4268 break;
4269
4270 case 153:
4271
4272 {
4273 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4274 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4275 (yyval.interm.type).setAggregate(2);
4276 }
4277 break;
4278
4279 case 154:
4280
4281 {
4282 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4283 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4284 (yyval.interm.type).setAggregate(3);
4285 }
4286 break;
4287
4288 case 155:
4289
4290 {
4291 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4292 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4293 (yyval.interm.type).setAggregate(4);
4294 }
4295 break;
4296
4297 case 156:
4298
4299 {
4300 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4301 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4302 (yyval.interm.type).setAggregate(2);
4303 }
4304 break;
4305
4306 case 157:
4307
4308 {
4309 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4310 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4311 (yyval.interm.type).setAggregate(3);
4312 }
4313 break;
4314
4315 case 158:
4316
4317 {
4318 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4319 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4320 (yyval.interm.type).setAggregate(4);
4321 }
4322 break;
4323
4324 case 159:
4325
4326 {
4327 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4328 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4329 (yyval.interm.type).setAggregate(2);
4330 }
4331 break;
4332
4333 case 160:
4334
4335 {
4336 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4337 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4338 (yyval.interm.type).setAggregate(3);
4339 }
4340 break;
4341
4342 case 161:
4343
4344 {
4345 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4346 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4347 (yyval.interm.type).setAggregate(4);
4348 }
4349 break;
4350
4351 case 162:
4352
4353 {
4354 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4355 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4356 (yyval.interm.type).setAggregate(2);
4357 }
4358 break;
4359
4360 case 163:
4361
4362 {
4363 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4364 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4365 (yyval.interm.type).setAggregate(3);
4366 }
4367 break;
4368
4369 case 164:
4370
4371 {
4372 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4373 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4374 (yyval.interm.type).setAggregate(4);
4375 }
4376 break;
4377
4378 case 165:
4379
4380 {
John Bauman66b8ab22014-05-06 15:57:45 -04004381 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
4382 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4383 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004384 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004385 }
4386 break;
4387
Alexis Hetu17809052015-05-13 11:28:22 -04004388 case 166:
John Bauman66b8ab22014-05-06 15:57:45 -04004389
4390 {
4391 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
4392 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4393 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004394 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004395 }
4396 break;
4397
Alexis Hetu17809052015-05-13 11:28:22 -04004398 case 167:
John Bauman66b8ab22014-05-06 15:57:45 -04004399
4400 {
4401 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
4402 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4403 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004404 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004405 }
4406 break;
4407
Alexis Hetu17809052015-05-13 11:28:22 -04004408 case 168:
John Bauman66b8ab22014-05-06 15:57:45 -04004409
4410 {
Alexis Hetub14178b2015-04-13 13:23:20 -04004411 FRAG_VERT_ONLY("mat2x3", (yyvsp[(1) - (1)].lex).line);
4412 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4413 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4414 (yyval.interm.type).setMatrix(2, 3);
4415 }
4416 break;
4417
Alexis Hetu17809052015-05-13 11:28:22 -04004418 case 169:
Alexis Hetub14178b2015-04-13 13:23:20 -04004419
4420 {
4421 FRAG_VERT_ONLY("mat3x2", (yyvsp[(1) - (1)].lex).line);
4422 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4423 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4424 (yyval.interm.type).setMatrix(3, 2);
4425 }
4426 break;
4427
Alexis Hetu17809052015-05-13 11:28:22 -04004428 case 170:
Alexis Hetub14178b2015-04-13 13:23:20 -04004429
4430 {
4431 FRAG_VERT_ONLY("mat2x4", (yyvsp[(1) - (1)].lex).line);
4432 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4433 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4434 (yyval.interm.type).setMatrix(2, 4);
4435 }
4436 break;
4437
Alexis Hetu17809052015-05-13 11:28:22 -04004438 case 171:
Alexis Hetub14178b2015-04-13 13:23:20 -04004439
4440 {
4441 FRAG_VERT_ONLY("mat4x2", (yyvsp[(1) - (1)].lex).line);
4442 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4443 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4444 (yyval.interm.type).setMatrix(4, 2);
4445 }
4446 break;
4447
Alexis Hetu17809052015-05-13 11:28:22 -04004448 case 172:
Alexis Hetub14178b2015-04-13 13:23:20 -04004449
4450 {
4451 FRAG_VERT_ONLY("mat3x4", (yyvsp[(1) - (1)].lex).line);
4452 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4453 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4454 (yyval.interm.type).setMatrix(3, 4);
4455 }
4456 break;
4457
Alexis Hetu17809052015-05-13 11:28:22 -04004458 case 173:
Alexis Hetub14178b2015-04-13 13:23:20 -04004459
4460 {
4461 FRAG_VERT_ONLY("mat4x3", (yyvsp[(1) - (1)].lex).line);
4462 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4463 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4464 (yyval.interm.type).setMatrix(4, 3);
4465 }
4466 break;
4467
Alexis Hetu17809052015-05-13 11:28:22 -04004468 case 174:
Alexis Hetub14178b2015-04-13 13:23:20 -04004469
4470 {
John Bauman66b8ab22014-05-06 15:57:45 -04004471 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4472 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4473 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4474 }
4475 break;
4476
Alexis Hetu17809052015-05-13 11:28:22 -04004477 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004478
4479 {
4480 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4481 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4482 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4483 }
4484 break;
4485
Alexis Hetu17809052015-05-13 11:28:22 -04004486 case 176:
John Bauman66b8ab22014-05-06 15:57:45 -04004487
4488 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004489 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
4490 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES", "");
4491 context->recover();
4492 }
4493 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4494 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4495 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
4496 }
4497 break;
4498
Alexis Hetu17809052015-05-13 11:28:22 -04004499 case 177:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004500
4501 {
Alexis Hetub027aa92015-01-19 15:56:12 -05004502 FRAG_VERT_ONLY("sampler3D", (yyvsp[(1) - (1)].lex).line);
4503 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4504 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4505 }
4506 break;
4507
Alexis Hetu17809052015-05-13 11:28:22 -04004508 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004509
4510 {
4511 FRAG_VERT_ONLY("sampler2DArray", (yyvsp[(1) - (1)].lex).line);
4512 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4513 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4514 }
4515 break;
4516
Alexis Hetu17809052015-05-13 11:28:22 -04004517 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004518
4519 {
4520 FRAG_VERT_ONLY("isampler2D", (yyvsp[(1) - (1)].lex).line);
4521 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4522 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4523 }
4524 break;
4525
Alexis Hetu17809052015-05-13 11:28:22 -04004526 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004527
4528 {
4529 FRAG_VERT_ONLY("isampler3D", (yyvsp[(1) - (1)].lex).line);
4530 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4531 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4532 }
4533 break;
4534
Alexis Hetu17809052015-05-13 11:28:22 -04004535 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004536
4537 {
4538 FRAG_VERT_ONLY("isamplerCube", (yyvsp[(1) - (1)].lex).line);
4539 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4540 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4541 }
4542 break;
4543
Alexis Hetu17809052015-05-13 11:28:22 -04004544 case 182:
Alexis Hetub14178b2015-04-13 13:23:20 -04004545
4546 {
4547 FRAG_VERT_ONLY("isampler2DArray", (yyvsp[(1) - (1)].lex).line);
4548 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4549 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4550 }
4551 break;
4552
Alexis Hetu17809052015-05-13 11:28:22 -04004553 case 183:
Alexis Hetub14178b2015-04-13 13:23:20 -04004554
4555 {
4556 FRAG_VERT_ONLY("usampler2D", (yyvsp[(1) - (1)].lex).line);
4557 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4558 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4559 }
4560 break;
4561
Alexis Hetu17809052015-05-13 11:28:22 -04004562 case 184:
Alexis Hetub14178b2015-04-13 13:23:20 -04004563
4564 {
4565 FRAG_VERT_ONLY("usampler3D", (yyvsp[(1) - (1)].lex).line);
4566 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4567 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4568 }
4569 break;
4570
Alexis Hetu17809052015-05-13 11:28:22 -04004571 case 185:
Alexis Hetub14178b2015-04-13 13:23:20 -04004572
4573 {
4574 FRAG_VERT_ONLY("usamplerCube", (yyvsp[(1) - (1)].lex).line);
4575 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4576 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4577 }
4578 break;
4579
Alexis Hetu17809052015-05-13 11:28:22 -04004580 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004581
4582 {
4583 FRAG_VERT_ONLY("usampler2DArray", (yyvsp[(1) - (1)].lex).line);
4584 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4585 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4586 }
4587 break;
4588
Alexis Hetu17809052015-05-13 11:28:22 -04004589 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004590
4591 {
4592 FRAG_VERT_ONLY("sampler2DShadow", (yyvsp[(1) - (1)].lex).line);
4593 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4594 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yyvsp[(1) - (1)].lex).line);
4595 }
4596 break;
4597
Alexis Hetu17809052015-05-13 11:28:22 -04004598 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004599
4600 {
4601 FRAG_VERT_ONLY("samplerCubeShadow", (yyvsp[(1) - (1)].lex).line);
4602 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4603 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yyvsp[(1) - (1)].lex).line);
4604 }
4605 break;
4606
Alexis Hetu17809052015-05-13 11:28:22 -04004607 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004608
4609 {
4610 FRAG_VERT_ONLY("sampler2DArrayShadow", (yyvsp[(1) - (1)].lex).line);
4611 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4612 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yyvsp[(1) - (1)].lex).line);
4613 }
4614 break;
4615
Alexis Hetu17809052015-05-13 11:28:22 -04004616 case 190:
Alexis Hetub027aa92015-01-19 15:56:12 -05004617
4618 {
John Bauman66b8ab22014-05-06 15:57:45 -04004619 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4620 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4621 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4622 }
4623 break;
4624
Alexis Hetu17809052015-05-13 11:28:22 -04004625 case 191:
John Bauman66b8ab22014-05-06 15:57:45 -04004626
4627 {
4628 //
4629 // This is for user defined type names. The lexical phase looked up the
4630 // type.
4631 //
4632 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4633 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4634 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4635 (yyval.interm.type).userDef = &structure;
4636 }
4637 break;
4638
Alexis Hetu17809052015-05-13 11:28:22 -04004639 case 192:
John Bauman66b8ab22014-05-06 15:57:45 -04004640
4641 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
4642 break;
4643
Alexis Hetu17809052015-05-13 11:28:22 -04004644 case 193:
John Bauman66b8ab22014-05-06 15:57:45 -04004645
4646 {
4647 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
4648 context->recover();
4649
4650 TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
4651 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05004652 if (! context->symbolTable.declare(*userTypeDef)) {
John Bauman66b8ab22014-05-06 15:57:45 -04004653 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
4654 context->recover();
4655 }
4656 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
4657 (yyval.interm.type).userDef = structure;
4658 context->exitStructDeclaration();
4659 }
4660 break;
4661
Alexis Hetu17809052015-05-13 11:28:22 -04004662 case 194:
John Bauman66b8ab22014-05-06 15:57:45 -04004663
4664 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
4665 break;
4666
Alexis Hetu17809052015-05-13 11:28:22 -04004667 case 195:
John Bauman66b8ab22014-05-06 15:57:45 -04004668
4669 {
4670 TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
4671 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
4672 (yyval.interm.type).userDef = structure;
4673 context->exitStructDeclaration();
4674 }
4675 break;
4676
Alexis Hetu17809052015-05-13 11:28:22 -04004677 case 196:
John Bauman66b8ab22014-05-06 15:57:45 -04004678
4679 {
4680 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
4681 }
4682 break;
4683
Alexis Hetu17809052015-05-13 11:28:22 -04004684 case 197:
John Bauman66b8ab22014-05-06 15:57:45 -04004685
4686 {
4687 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4688 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4689 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4690 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4691 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());
4692 context->recover();
4693 }
4694 }
4695 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4696 }
4697 }
4698 break;
4699
Alexis Hetu17809052015-05-13 11:28:22 -04004700 case 198:
John Bauman66b8ab22014-05-06 15:57:45 -04004701
4702 {
4703 (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
4704
4705 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
4706 context->recover();
4707 }
4708 for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) {
4709 //
4710 // Careful not to replace already known aspects of type, like array-ness
4711 //
4712 TType* type = (*(yyval.interm.typeList))[i].type;
4713 type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
Alexis Hetub14178b2015-04-13 13:23:20 -04004714 type->setNominalSize((yyvsp[(1) - (3)].interm.type).primarySize);
4715 type->setSecondarySize((yyvsp[(1) - (3)].interm.type).secondarySize);
John Bauman66b8ab22014-05-06 15:57:45 -04004716 type->setPrecision((yyvsp[(1) - (3)].interm.type).precision);
4717
4718 // don't allow arrays of arrays
4719 if (type->isArray()) {
4720 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type)))
4721 context->recover();
4722 }
4723 if ((yyvsp[(1) - (3)].interm.type).array)
4724 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize);
4725 if ((yyvsp[(1) - (3)].interm.type).userDef) {
4726 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
4727 type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName());
4728 }
John Bauman66b8ab22014-05-06 15:57:45 -04004729 }
4730 }
4731 break;
4732
Alexis Hetu17809052015-05-13 11:28:22 -04004733 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004734
4735 {
4736 (yyval.interm.typeList) = NewPoolTTypeList();
4737 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
4738 }
4739 break;
4740
Alexis Hetu17809052015-05-13 11:28:22 -04004741 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004742
4743 {
4744 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
4745 }
4746 break;
4747
Alexis Hetu17809052015-05-13 11:28:22 -04004748 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004749
4750 {
4751 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4752 context->recover();
4753
4754 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4755 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4756 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
4757 }
4758 break;
4759
Alexis Hetu17809052015-05-13 11:28:22 -04004760 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004761
4762 {
4763 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4764 context->recover();
4765
4766 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4767 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4768 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4769
4770 int size;
4771 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4772 context->recover();
4773 (yyval.interm.typeLine).type->setArraySize(size);
4774 }
4775 break;
4776
Alexis Hetu17809052015-05-13 11:28:22 -04004777 case 203:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004778
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004779 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetub027aa92015-01-19 15:56:12 -05004780 break;
4781
Alexis Hetu17809052015-05-13 11:28:22 -04004782 case 204:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004783
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004784 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004785 break;
4786
Alexis Hetu17809052015-05-13 11:28:22 -04004787 case 205:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004788
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004789 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Nicolas Capens3c20f802015-02-17 17:17:20 -05004790 break;
4791
Alexis Hetu17809052015-05-13 11:28:22 -04004792 case 206:
Nicolas Capens3c20f802015-02-17 17:17:20 -05004793
Nicolas Capens7d626792015-02-17 17:58:31 -05004794 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004795 break;
4796
Alexis Hetu17809052015-05-13 11:28:22 -04004797 case 207:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004798
Nicolas Capens7d626792015-02-17 17:58:31 -05004799 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004800 break;
4801
Alexis Hetu17809052015-05-13 11:28:22 -04004802 case 208:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004803
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004804 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004805 break;
4806
Alexis Hetu17809052015-05-13 11:28:22 -04004807 case 209:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004808
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004809 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004810 break;
4811
Alexis Hetu17809052015-05-13 11:28:22 -04004812 case 210:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004813
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004814 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004815 break;
4816
Alexis Hetu17809052015-05-13 11:28:22 -04004817 case 211:
Nicolas Capens7d626792015-02-17 17:58:31 -05004818
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004819 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4820 break;
4821
Alexis Hetu17809052015-05-13 11:28:22 -04004822 case 212:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004823
4824 { (yyval.interm.intermAggregate) = 0; }
4825 break;
4826
Alexis Hetu17809052015-05-13 11:28:22 -04004827 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004828
4829 { context->symbolTable.push(); }
4830 break;
4831
Alexis Hetu17809052015-05-13 11:28:22 -04004832 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004833
4834 { context->symbolTable.pop(); }
4835 break;
4836
Alexis Hetu17809052015-05-13 11:28:22 -04004837 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004838
Nicolas Capens7d626792015-02-17 17:58:31 -05004839 {
4840 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4841 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4842 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4843 }
4844 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4845 }
4846 break;
4847
Alexis Hetu17809052015-05-13 11:28:22 -04004848 case 216:
Nicolas Capens7d626792015-02-17 17:58:31 -05004849
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004850 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004851 break;
4852
Alexis Hetu17809052015-05-13 11:28:22 -04004853 case 217:
Nicolas Capens7d626792015-02-17 17:58:31 -05004854
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004855 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004856 break;
4857
Alexis Hetu17809052015-05-13 11:28:22 -04004858 case 218:
Nicolas Capens7d626792015-02-17 17:58:31 -05004859
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004860 { context->symbolTable.push(); }
4861 break;
4862
Alexis Hetu17809052015-05-13 11:28:22 -04004863 case 219:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004864
4865 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4866 break;
4867
Alexis Hetu17809052015-05-13 11:28:22 -04004868 case 220:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004869
4870 { context->symbolTable.push(); }
4871 break;
4872
Alexis Hetu17809052015-05-13 11:28:22 -04004873 case 221:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004874
4875 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4876 break;
4877
Alexis Hetu17809052015-05-13 11:28:22 -04004878 case 222:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004879
John Bauman66b8ab22014-05-06 15:57:45 -04004880 {
4881 (yyval.interm.intermNode) = 0;
4882 }
4883 break;
4884
Alexis Hetu17809052015-05-13 11:28:22 -04004885 case 223:
John Bauman66b8ab22014-05-06 15:57:45 -04004886
4887 {
4888 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4889 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
4890 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4891 }
4892 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4893 }
4894 break;
4895
Alexis Hetu17809052015-05-13 11:28:22 -04004896 case 224:
John Bauman66b8ab22014-05-06 15:57:45 -04004897
4898 {
4899 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4900 }
4901 break;
4902
Alexis Hetu17809052015-05-13 11:28:22 -04004903 case 225:
John Bauman66b8ab22014-05-06 15:57:45 -04004904
4905 {
4906 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4907 }
4908 break;
4909
Alexis Hetu17809052015-05-13 11:28:22 -04004910 case 226:
John Bauman66b8ab22014-05-06 15:57:45 -04004911
4912 { (yyval.interm.intermNode) = 0; }
4913 break;
4914
Alexis Hetu17809052015-05-13 11:28:22 -04004915 case 227:
John Bauman66b8ab22014-05-06 15:57:45 -04004916
4917 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4918 break;
4919
Alexis Hetu17809052015-05-13 11:28:22 -04004920 case 228:
John Bauman66b8ab22014-05-06 15:57:45 -04004921
4922 {
4923 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4924 context->recover();
4925 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line);
4926 }
4927 break;
4928
Alexis Hetu17809052015-05-13 11:28:22 -04004929 case 229:
John Bauman66b8ab22014-05-06 15:57:45 -04004930
4931 {
4932 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4933 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4934 }
4935 break;
4936
Alexis Hetu17809052015-05-13 11:28:22 -04004937 case 230:
John Bauman66b8ab22014-05-06 15:57:45 -04004938
4939 {
4940 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4941 (yyval.interm.nodePair).node2 = 0;
4942 }
4943 break;
4944
Alexis Hetu17809052015-05-13 11:28:22 -04004945 case 231:
John Bauman66b8ab22014-05-06 15:57:45 -04004946
4947 {
4948 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4949 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4950 context->recover();
4951 }
4952 break;
4953
Alexis Hetu17809052015-05-13 11:28:22 -04004954 case 232:
John Bauman66b8ab22014-05-06 15:57:45 -04004955
4956 {
4957 TIntermNode* intermNode;
4958 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4959 context->recover();
4960 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4961 context->recover();
4962
4963 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4964 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4965 else {
4966 context->recover();
4967 (yyval.interm.intermTypedNode) = 0;
4968 }
4969 }
4970 break;
4971
Alexis Hetu17809052015-05-13 11:28:22 -04004972 case 233:
John Bauman66b8ab22014-05-06 15:57:45 -04004973
4974 { context->symbolTable.push(); ++context->loopNestingLevel; }
4975 break;
4976
Alexis Hetu17809052015-05-13 11:28:22 -04004977 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004978
4979 {
4980 context->symbolTable.pop();
4981 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(1) - (6)].lex).line);
4982 --context->loopNestingLevel;
4983 }
4984 break;
4985
Alexis Hetu17809052015-05-13 11:28:22 -04004986 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004987
4988 { ++context->loopNestingLevel; }
4989 break;
4990
Alexis Hetu17809052015-05-13 11:28:22 -04004991 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004992
4993 {
4994 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4995 context->recover();
4996
4997 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(4) - (8)].lex).line);
4998 --context->loopNestingLevel;
4999 }
5000 break;
5001
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005002 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04005003
Alexis Hetu17809052015-05-13 11:28:22 -04005004 { context->symbolTable.push(); ++context->loopNestingLevel; }
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04005005 break;
5006
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005007 case 238:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04005008
5009 {
Alexis Hetu17809052015-05-13 11:28:22 -04005010 context->symbolTable.pop();
5011 (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);
5012 --context->loopNestingLevel;
Alexis Hetub027aa92015-01-19 15:56:12 -05005013 }
5014 break;
5015
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005016 case 239:
Alexis Hetub027aa92015-01-19 15:56:12 -05005017
5018 {
Nicolas Capens3c20f802015-02-17 17:17:20 -05005019 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5020 }
5021 break;
5022
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005023 case 240:
Nicolas Capens3c20f802015-02-17 17:17:20 -05005024
5025 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05005026 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5027 }
5028 break;
5029
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005030 case 241:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05005031
5032 {
Alexis Hetu17809052015-05-13 11:28:22 -04005033 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
5034 }
5035 break;
5036
5037 case 242:
5038
5039 {
5040 (yyval.interm.intermTypedNode) = 0;
5041 }
5042 break;
5043
5044 case 243:
5045
5046 {
5047 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
5048 (yyval.interm.nodePair).node2 = 0;
5049 }
5050 break;
5051
5052 case 244:
5053
5054 {
5055 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
5056 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
5057 }
5058 break;
5059
5060 case 245:
5061
5062 {
5063 if (context->loopNestingLevel <= 0) {
5064 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
5065 context->recover();
5066 }
5067 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
5068 }
5069 break;
5070
5071 case 246:
5072
5073 {
5074 if (context->loopNestingLevel <= 0) {
5075 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
5076 context->recover();
5077 }
5078 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
5079 }
5080 break;
5081
5082 case 247:
5083
5084 {
5085 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
5086 if (context->currentFunctionType->getBasicType() != EbtVoid) {
5087 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
5088 context->recover();
5089 }
5090 }
5091 break;
5092
5093 case 248:
5094
5095 {
5096 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
5097 context->functionReturnsValue = true;
5098 if (context->currentFunctionType->getBasicType() == EbtVoid) {
5099 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
5100 context->recover();
5101 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
5102 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
5103 context->recover();
5104 }
5105 }
5106 break;
5107
5108 case 249:
5109
5110 {
5111 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
5112 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
5113 }
5114 break;
5115
5116 case 250:
5117
5118 {
5119 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5120 context->treeRoot = (yyval.interm.intermNode);
5121 }
5122 break;
5123
5124 case 251:
5125
5126 {
5127 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
5128 context->treeRoot = (yyval.interm.intermNode);
5129 }
5130 break;
5131
5132 case 252:
5133
5134 {
5135 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5136 }
5137 break;
5138
5139 case 253:
5140
5141 {
5142 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5143 }
5144 break;
5145
5146 case 254:
5147
5148 {
John Bauman66b8ab22014-05-06 15:57:45 -04005149 TFunction* function = (yyvsp[(1) - (1)].interm).function;
5150
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05005151 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
John Bauman66b8ab22014-05-06 15:57:45 -04005152
5153 if (builtIn)
5154 {
5155 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
5156 context->recover();
5157 }
5158
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05005159 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04005160 //
5161 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
5162 // as it would have just been put in the symbol table. Otherwise, we're looking up
5163 // an earlier occurance.
5164 //
5165 if (prevDec->isDefined()) {
5166 //
5167 // Then this function already has a body.
5168 //
5169 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
5170 context->recover();
5171 }
5172 prevDec->setDefined();
5173
5174 //
5175 // Raise error message if main function takes any parameters or return anything other than void
5176 //
5177 if (function->getName() == "main") {
5178 if (function->getParamCount() > 0) {
5179 context->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function->getName().c_str());
5180 context->recover();
5181 }
5182 if (function->getReturnType().getBasicType() != EbtVoid) {
5183 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
5184 context->recover();
5185 }
5186 }
5187
5188 //
5189 // Remember the return type for later checking for RETURN statements.
5190 //
5191 context->currentFunctionType = &(prevDec->getReturnType());
5192 context->functionReturnsValue = false;
5193
5194 //
5195 // Insert parameters into the symbol table.
5196 // If the parameter has no name, it's not an error, just don't insert it
5197 // (could be used for unused args).
5198 //
5199 // Also, accumulate the list of parameters into the HIL, so lower level code
5200 // knows where to find parameters.
5201 //
5202 TIntermAggregate* paramNodes = new TIntermAggregate;
5203 for (int i = 0; i < function->getParamCount(); i++) {
5204 const TParameter& param = function->getParam(i);
5205 if (param.name != 0) {
5206 TVariable *variable = new TVariable(param.name, *param.type);
5207 //
5208 // Insert the parameters with name in the symbol table.
5209 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05005210 if (! context->symbolTable.declare(*variable)) {
John Bauman66b8ab22014-05-06 15:57:45 -04005211 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
5212 context->recover();
5213 delete variable;
5214 }
5215
5216 //
5217 // Add the parameter to the HIL
5218 //
5219 paramNodes = context->intermediate.growAggregate(
5220 paramNodes,
5221 context->intermediate.addSymbol(variable->getUniqueId(),
5222 variable->getName(),
5223 variable->getType(), (yyvsp[(1) - (1)].interm).line),
5224 (yyvsp[(1) - (1)].interm).line);
5225 } else {
5226 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
5227 }
5228 }
5229 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
5230 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
5231 context->loopNestingLevel = 0;
5232 }
5233 break;
5234
Alexis Hetu17809052015-05-13 11:28:22 -04005235 case 255:
John Bauman66b8ab22014-05-06 15:57:45 -04005236
5237 {
5238 //?? Check that all paths return a value if return type != void ?
5239 // May be best done as post process phase on intermediate code
5240 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
5241 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
5242 context->recover();
5243 }
5244
5245 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
5246 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
5247 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
5248 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
5249
5250 // store the pragma information for debug and optimize and other vendor specific
5251 // information. This information can be queried from the parse tree
5252 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
5253 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
5254
5255 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
5256 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
5257
5258 context->symbolTable.pop();
5259 }
5260 break;
5261
5262
5263
5264 default: break;
5265 }
5266 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
5267
5268 YYPOPSTACK (yylen);
5269 yylen = 0;
5270 YY_STACK_PRINT (yyss, yyssp);
5271
5272 *++yyvsp = yyval;
5273
5274 /* Now `shift' the result of the reduction. Determine what state
5275 that goes to, based on the state we popped back to and the rule
5276 number reduced by. */
5277
5278 yyn = yyr1[yyn];
5279
5280 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
5281 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
5282 yystate = yytable[yystate];
5283 else
5284 yystate = yydefgoto[yyn - YYNTOKENS];
5285
5286 goto yynewstate;
5287
5288
5289/*------------------------------------.
5290| yyerrlab -- here on detecting error |
5291`------------------------------------*/
5292yyerrlab:
5293 /* If not already recovering from an error, report this error. */
5294 if (!yyerrstatus)
5295 {
5296 ++yynerrs;
5297#if ! YYERROR_VERBOSE
5298 yyerror (context, YY_("syntax error"));
5299#else
5300 {
5301 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
5302 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
5303 {
5304 YYSIZE_T yyalloc = 2 * yysize;
5305 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
5306 yyalloc = YYSTACK_ALLOC_MAXIMUM;
5307 if (yymsg != yymsgbuf)
5308 YYSTACK_FREE (yymsg);
5309 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
5310 if (yymsg)
5311 yymsg_alloc = yyalloc;
5312 else
5313 {
5314 yymsg = yymsgbuf;
5315 yymsg_alloc = sizeof yymsgbuf;
5316 }
5317 }
5318
5319 if (0 < yysize && yysize <= yymsg_alloc)
5320 {
5321 (void) yysyntax_error (yymsg, yystate, yychar);
5322 yyerror (context, yymsg);
5323 }
5324 else
5325 {
5326 yyerror (context, YY_("syntax error"));
5327 if (yysize != 0)
5328 goto yyexhaustedlab;
5329 }
5330 }
5331#endif
5332 }
5333
5334
5335
5336 if (yyerrstatus == 3)
5337 {
5338 /* If just tried and failed to reuse lookahead token after an
5339 error, discard it. */
5340
5341 if (yychar <= YYEOF)
5342 {
5343 /* Return failure if at end of input. */
5344 if (yychar == YYEOF)
5345 YYABORT;
5346 }
5347 else
5348 {
5349 yydestruct ("Error: discarding",
5350 yytoken, &yylval, context);
5351 yychar = YYEMPTY;
5352 }
5353 }
5354
5355 /* Else will try to reuse lookahead token after shifting the error
5356 token. */
5357 goto yyerrlab1;
5358
5359
5360/*---------------------------------------------------.
5361| yyerrorlab -- error raised explicitly by YYERROR. |
5362`---------------------------------------------------*/
5363yyerrorlab:
5364
5365 /* Pacify compilers like GCC when the user code never invokes
5366 YYERROR and the label yyerrorlab therefore never appears in user
5367 code. */
5368 if (/*CONSTCOND*/ 0)
5369 goto yyerrorlab;
5370
5371 /* Do not reclaim the symbols of the rule which action triggered
5372 this YYERROR. */
5373 YYPOPSTACK (yylen);
5374 yylen = 0;
5375 YY_STACK_PRINT (yyss, yyssp);
5376 yystate = *yyssp;
5377 goto yyerrlab1;
5378
5379
5380/*-------------------------------------------------------------.
5381| yyerrlab1 -- common code for both syntax error and YYERROR. |
5382`-------------------------------------------------------------*/
5383yyerrlab1:
5384 yyerrstatus = 3; /* Each real token shifted decrements this. */
5385
5386 for (;;)
5387 {
5388 yyn = yypact[yystate];
5389 if (yyn != YYPACT_NINF)
5390 {
5391 yyn += YYTERROR;
5392 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5393 {
5394 yyn = yytable[yyn];
5395 if (0 < yyn)
5396 break;
5397 }
5398 }
5399
5400 /* Pop the current state because it cannot handle the error token. */
5401 if (yyssp == yyss)
5402 YYABORT;
5403
5404
5405 yydestruct ("Error: popping",
5406 yystos[yystate], yyvsp, context);
5407 YYPOPSTACK (1);
5408 yystate = *yyssp;
5409 YY_STACK_PRINT (yyss, yyssp);
5410 }
5411
5412 *++yyvsp = yylval;
5413
5414
5415 /* Shift the error token. */
5416 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5417
5418 yystate = yyn;
5419 goto yynewstate;
5420
5421
5422/*-------------------------------------.
5423| yyacceptlab -- YYACCEPT comes here. |
5424`-------------------------------------*/
5425yyacceptlab:
5426 yyresult = 0;
5427 goto yyreturn;
5428
5429/*-----------------------------------.
5430| yyabortlab -- YYABORT comes here. |
5431`-----------------------------------*/
5432yyabortlab:
5433 yyresult = 1;
5434 goto yyreturn;
5435
5436#if !defined(yyoverflow) || YYERROR_VERBOSE
5437/*-------------------------------------------------.
5438| yyexhaustedlab -- memory exhaustion comes here. |
5439`-------------------------------------------------*/
5440yyexhaustedlab:
5441 yyerror (context, YY_("memory exhausted"));
5442 yyresult = 2;
5443 /* Fall through. */
5444#endif
5445
5446yyreturn:
5447 if (yychar != YYEMPTY)
5448 yydestruct ("Cleanup: discarding lookahead",
5449 yytoken, &yylval, context);
5450 /* Do not reclaim the symbols of the rule which action triggered
5451 this YYABORT or YYACCEPT. */
5452 YYPOPSTACK (yylen);
5453 YY_STACK_PRINT (yyss, yyssp);
5454 while (yyssp != yyss)
5455 {
5456 yydestruct ("Cleanup: popping",
5457 yystos[*yyssp], yyvsp, context);
5458 YYPOPSTACK (1);
5459 }
5460#ifndef yyoverflow
5461 if (yyss != yyssa)
5462 YYSTACK_FREE (yyss);
5463#endif
5464#if YYERROR_VERBOSE
5465 if (yymsg != yymsgbuf)
5466 YYSTACK_FREE (yymsg);
5467#endif
5468 /* Make sure YYID is used. */
5469 return YYID (yyresult);
5470}
5471
5472
5473
5474
5475
5476int glslang_parse(TParseContext* context) {
5477 return yyparse(context);
5478}
5479