blob: 31bb692ed27287acd2679ca74399aef03a5a5263 [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;
Alexis Hetu76a343a2015-06-04 17:21:22 -0400280 TIntermSwitch* intermSwitch;
281 TIntermCase* intermCase;
John Bauman66b8ab22014-05-06 15:57:45 -0400282 };
283 union {
284 TPublicType type;
285 TPrecision precision;
Nicolas Capens7d626792015-02-17 17:58:31 -0500286 TLayoutQualifier layoutQualifier;
John Bauman66b8ab22014-05-06 15:57:45 -0400287 TQualifier qualifier;
288 TFunction* function;
289 TParameter param;
Alexis Hetua8b364b2015-06-10 11:48:40 -0400290 TField* field;
291 TFieldList* fieldList;
John Bauman66b8ab22014-05-06 15:57:45 -0400292 };
293 } interm;
294
295
296
297} YYSTYPE;
298# define YYSTYPE_IS_TRIVIAL 1
299# define yystype YYSTYPE /* obsolescent; will be withdrawn */
300# define YYSTYPE_IS_DECLARED 1
301#endif
302
303
304/* Copy the second part of user declarations. */
305
306
307extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
308extern void yyerror(TParseContext* context, const char* reason);
309
310#define FRAG_VERT_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500311 if (context->shaderType != GL_FRAGMENT_SHADER && \
312 context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400313 context->error(L, " supported in vertex/fragment shaders only ", S); \
314 context->recover(); \
315 } \
316}
317
318#define VERTEX_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500319 if (context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400320 context->error(L, " supported in vertex shaders only ", S); \
321 context->recover(); \
322 } \
323}
324
325#define FRAG_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500326 if (context->shaderType != GL_FRAGMENT_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400327 context->error(L, " supported in fragment shaders only ", S); \
328 context->recover(); \
329 } \
330}
331
Nicolas Capensc6841852015-02-15 14:25:37 -0500332#define ES2_ONLY(S, L) { \
333 if (context->shaderVersion != 100) { \
334 context->error(L, " supported in GLSL ES 1.00 only ", S); \
335 context->recover(); \
336 } \
337}
338
339#define ES3_ONLY(S, L) { \
340 if (context->shaderVersion != 300) { \
341 context->error(L, " supported in GLSL ES 3.00 only ", S); \
342 context->recover(); \
343 } \
344}
345
John Bauman66b8ab22014-05-06 15:57:45 -0400346
347
348#ifdef short
349# undef short
350#endif
351
352#ifdef YYTYPE_UINT8
353typedef YYTYPE_UINT8 yytype_uint8;
354#else
355typedef unsigned char yytype_uint8;
356#endif
357
358#ifdef YYTYPE_INT8
359typedef YYTYPE_INT8 yytype_int8;
360#elif (defined __STDC__ || defined __C99__FUNC__ \
361 || defined __cplusplus || defined _MSC_VER)
362typedef signed char yytype_int8;
363#else
364typedef short int yytype_int8;
365#endif
366
367#ifdef YYTYPE_UINT16
368typedef YYTYPE_UINT16 yytype_uint16;
369#else
370typedef unsigned short int yytype_uint16;
371#endif
372
373#ifdef YYTYPE_INT16
374typedef YYTYPE_INT16 yytype_int16;
375#else
376typedef short int yytype_int16;
377#endif
378
379#ifndef YYSIZE_T
380# ifdef __SIZE_TYPE__
381# define YYSIZE_T __SIZE_TYPE__
382# elif defined size_t
383# define YYSIZE_T size_t
384# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
385 || defined __cplusplus || defined _MSC_VER)
386# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
387# define YYSIZE_T size_t
388# else
389# define YYSIZE_T unsigned int
390# endif
391#endif
392
393#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
394
395#ifndef YY_
Nicolas Capense9c5e4f2014-05-28 22:46:43 -0400396# if YYENABLE_NLS
John Bauman66b8ab22014-05-06 15:57:45 -0400397# if ENABLE_NLS
398# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
399# define YY_(msgid) dgettext ("bison-runtime", msgid)
400# endif
401# endif
402# ifndef YY_
403# define YY_(msgid) msgid
404# endif
405#endif
406
407/* Suppress unused-variable warnings by "using" E. */
408#if ! defined lint || defined __GNUC__
409# define YYUSE(e) ((void) (e))
410#else
411# define YYUSE(e) /* empty */
412#endif
413
414/* Identity function, used to suppress warnings about constant conditions. */
415#ifndef lint
416# define YYID(n) (n)
417#else
418#if (defined __STDC__ || defined __C99__FUNC__ \
419 || defined __cplusplus || defined _MSC_VER)
420static int
421YYID (int yyi)
422#else
423static int
424YYID (yyi)
425 int yyi;
426#endif
427{
428 return yyi;
429}
430#endif
431
432#if ! defined yyoverflow || YYERROR_VERBOSE
433
434/* The parser invokes alloca or malloc; define the necessary symbols. */
435
436# ifdef YYSTACK_USE_ALLOCA
437# if YYSTACK_USE_ALLOCA
438# ifdef __GNUC__
439# define YYSTACK_ALLOC __builtin_alloca
440# elif defined __BUILTIN_VA_ARG_INCR
441# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
442# elif defined _AIX
443# define YYSTACK_ALLOC __alloca
444# elif defined _MSC_VER
445# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
446# define alloca _alloca
447# else
448# define YYSTACK_ALLOC alloca
449# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
450 || defined __cplusplus || defined _MSC_VER)
451# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
452# ifndef _STDLIB_H
453# define _STDLIB_H 1
454# endif
455# endif
456# endif
457# endif
458# endif
459
460# ifdef YYSTACK_ALLOC
461 /* Pacify GCC's `empty if-body' warning. */
462# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
463# ifndef YYSTACK_ALLOC_MAXIMUM
464 /* The OS might guarantee only one guard page at the bottom of the stack,
465 and a page size can be as small as 4096 bytes. So we cannot safely
466 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
467 to allow for a few compiler-allocated temporary stack slots. */
468# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
469# endif
470# else
471# define YYSTACK_ALLOC YYMALLOC
472# define YYSTACK_FREE YYFREE
473# ifndef YYSTACK_ALLOC_MAXIMUM
474# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
475# endif
476# if (defined __cplusplus && ! defined _STDLIB_H \
477 && ! ((defined YYMALLOC || defined malloc) \
478 && (defined YYFREE || defined free)))
479# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
480# ifndef _STDLIB_H
481# define _STDLIB_H 1
482# endif
483# endif
484# ifndef YYMALLOC
485# define YYMALLOC malloc
486# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
487 || defined __cplusplus || defined _MSC_VER)
488void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
489# endif
490# endif
491# ifndef YYFREE
492# define YYFREE free
493# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
494 || defined __cplusplus || defined _MSC_VER)
495void free (void *); /* INFRINGES ON USER NAME SPACE */
496# endif
497# endif
498# endif
499#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
500
501
502#if (! defined yyoverflow \
503 && (! defined __cplusplus \
504 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
505
506/* A type that is properly aligned for any stack member. */
507union yyalloc
508{
509 yytype_int16 yyss_alloc;
510 YYSTYPE yyvs_alloc;
511};
512
513/* The size of the maximum gap between one aligned stack and the next. */
514# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
515
516/* The size of an array large to enough to hold all stacks, each with
517 N elements. */
518# define YYSTACK_BYTES(N) \
519 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
520 + YYSTACK_GAP_MAXIMUM)
521
522/* Copy COUNT objects from FROM to TO. The source and destination do
523 not overlap. */
524# ifndef YYCOPY
525# if defined __GNUC__ && 1 < __GNUC__
526# define YYCOPY(To, From, Count) \
527 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
528# else
529# define YYCOPY(To, From, Count) \
530 do \
531 { \
532 YYSIZE_T yyi; \
533 for (yyi = 0; yyi < (Count); yyi++) \
534 (To)[yyi] = (From)[yyi]; \
535 } \
536 while (YYID (0))
537# endif
538# endif
539
540/* Relocate STACK from its old location to the new one. The
541 local variables YYSIZE and YYSTACKSIZE give the old and new number of
542 elements in the stack, and YYPTR gives the new location of the
543 stack. Advance YYPTR to a properly aligned location for the next
544 stack. */
545# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
546 do \
547 { \
548 YYSIZE_T yynewbytes; \
549 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
550 Stack = &yyptr->Stack_alloc; \
551 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
552 yyptr += yynewbytes / sizeof (*yyptr); \
553 } \
554 while (YYID (0))
555
556#endif
557
558/* YYFINAL -- State number of the termination state. */
Alexis Hetua35d8232015-06-11 17:11:06 -0400559#define YYFINAL 110
John Bauman66b8ab22014-05-06 15:57:45 -0400560/* YYLAST -- Last index in YYTABLE. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400561#define YYLAST 2412
John Bauman66b8ab22014-05-06 15:57:45 -0400562
563/* YYNTOKENS -- Number of terminals. */
Alexis Hetub14178b2015-04-13 13:23:20 -0400564#define YYNTOKENS 128
John Bauman66b8ab22014-05-06 15:57:45 -0400565/* YYNNTS -- Number of nonterminals. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400566#define YYNNTS 93
John Bauman66b8ab22014-05-06 15:57:45 -0400567/* YYNRULES -- Number of rules. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400568#define YYNRULES 269
John Bauman66b8ab22014-05-06 15:57:45 -0400569/* YYNRULES -- Number of states. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400570#define YYNSTATES 409
John Bauman66b8ab22014-05-06 15:57:45 -0400571
572/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
573#define YYUNDEFTOK 2
Alexis Hetub14178b2015-04-13 13:23:20 -0400574#define YYMAXUTOK 382
John Bauman66b8ab22014-05-06 15:57:45 -0400575
576#define YYTRANSLATE(YYX) \
577 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
578
579/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
580static const yytype_uint8 yytranslate[] =
581{
582 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
608 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
609 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
610 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
611 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
612 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
613 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
614 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
615 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
Alexis Hetub027aa92015-01-19 15:56:12 -0500616 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500617 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Alexis Hetub14178b2015-04-13 13:23:20 -0400618 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
619 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
620 125, 126, 127
John Bauman66b8ab22014-05-06 15:57:45 -0400621};
622
623#if YYDEBUG
624/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
625 YYRHS. */
626static const yytype_uint16 yyprhs[] =
627{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500628 0, 0, 3, 5, 7, 9, 11, 13, 15, 19,
629 21, 26, 28, 32, 35, 38, 40, 42, 44, 48,
630 51, 54, 57, 59, 62, 66, 69, 71, 73, 75,
Alexis Hetu17809052015-05-13 11:28:22 -0400631 77, 80, 83, 86, 88, 90, 92, 94, 96, 100,
632 104, 108, 110, 114, 118, 120, 124, 128, 130, 134,
633 138, 142, 146, 148, 152, 156, 158, 162, 164, 168,
634 170, 174, 176, 180, 182, 186, 188, 192, 194, 200,
635 202, 206, 208, 210, 212, 214, 216, 218, 220, 222,
Alexis Hetua35d8232015-06-11 17:11:06 -0400636 224, 226, 228, 230, 234, 236, 239, 242, 245, 250,
637 256, 263, 273, 276, 279, 281, 283, 286, 290, 294,
638 297, 303, 307, 310, 314, 317, 318, 320, 322, 324,
639 326, 328, 332, 339, 347, 356, 362, 364, 367, 373,
640 380, 388, 393, 396, 398, 401, 403, 405, 407, 409,
641 411, 414, 416, 419, 421, 423, 426, 428, 430, 432,
642 435, 438, 440, 442, 445, 447, 449, 451, 456, 458,
643 462, 464, 468, 472, 474, 479, 481, 483, 485, 487,
644 489, 491, 493, 495, 497, 499, 501, 503, 505, 507,
645 509, 511, 513, 515, 517, 519, 521, 523, 525, 527,
646 529, 531, 533, 535, 537, 539, 541, 543, 545, 547,
647 549, 551, 553, 555, 557, 559, 561, 563, 565, 567,
648 568, 575, 576, 582, 584, 587, 591, 596, 598, 602,
649 604, 609, 611, 613, 615, 617, 619, 621, 623, 625,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400650 627, 629, 631, 634, 635, 636, 642, 644, 646, 647,
651 650, 651, 654, 657, 661, 663, 666, 668, 671, 677,
652 681, 683, 684, 691, 695, 698, 700, 705, 706, 713,
653 714, 723, 724, 732, 734, 736, 738, 739, 742, 746,
654 749, 752, 755, 759, 762, 764, 767, 769, 771, 772
John Bauman66b8ab22014-05-06 15:57:45 -0400655};
656
657/* YYRHS -- A `-1'-separated list of the rules' RHS. */
658static const yytype_int16 yyrhs[] =
659{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400660 217, 0, -1, 76, -1, 129, -1, 79, -1, 80,
Alexis Hetub14178b2015-04-13 13:23:20 -0400661 -1, 78, -1, 81, -1, 104, 156, 105, -1, 130,
662 -1, 131, 106, 132, 107, -1, 133, -1, 131, 110,
663 82, -1, 131, 85, -1, 131, 86, -1, 156, -1,
664 134, -1, 135, -1, 131, 110, 135, -1, 137, 105,
665 -1, 136, 105, -1, 138, 55, -1, 138, -1, 138,
Alexis Hetua35d8232015-06-11 17:11:06 -0400666 154, -1, 137, 111, 154, -1, 139, 104, -1, 181,
Alexis Hetub14178b2015-04-13 13:23:20 -0400667 -1, 76, -1, 82, -1, 131, -1, 85, 140, -1,
668 86, 140, -1, 141, 140, -1, 118, -1, 116, -1,
Alexis Hetu17809052015-05-13 11:28:22 -0400669 115, -1, 117, -1, 140, -1, 142, 119, 140, -1,
670 142, 120, 140, -1, 142, 121, 140, -1, 142, -1,
671 143, 118, 142, -1, 143, 116, 142, -1, 143, -1,
672 144, 83, 143, -1, 144, 84, 143, -1, 144, -1,
673 145, 122, 144, -1, 145, 123, 144, -1, 145, 87,
674 144, -1, 145, 88, 144, -1, 145, -1, 146, 89,
675 145, -1, 146, 90, 145, -1, 146, -1, 147, 126,
676 146, -1, 147, -1, 148, 125, 147, -1, 148, -1,
677 149, 124, 148, -1, 149, -1, 150, 91, 149, -1,
678 150, -1, 151, 93, 150, -1, 151, -1, 152, 92,
679 151, -1, 152, -1, 152, 127, 156, 112, 154, -1,
680 153, -1, 140, 155, 154, -1, 113, -1, 94, -1,
681 95, -1, 97, -1, 96, -1, 103, -1, 98, -1,
682 99, -1, 100, -1, 101, -1, 102, -1, 154, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400683 156, 111, 154, -1, 153, -1, 76, 108, -1, 160,
684 114, -1, 168, 114, -1, 7, 176, 180, 114, -1,
685 173, 158, 185, 109, 114, -1, 173, 158, 185, 109,
686 76, 114, -1, 173, 158, 185, 109, 76, 106, 157,
687 107, 114, -1, 173, 114, -1, 161, 105, -1, 163,
688 -1, 162, -1, 163, 165, -1, 162, 111, 165, -1,
689 170, 76, 104, -1, 175, 76, -1, 175, 76, 106,
690 157, 107, -1, 172, 166, 164, -1, 166, 164, -1,
691 172, 166, 167, -1, 166, 167, -1, -1, 40, -1,
692 41, -1, 42, -1, 175, -1, 169, -1, 168, 111,
693 76, -1, 168, 111, 76, 106, 157, 107, -1, 168,
694 111, 76, 106, 107, 113, 189, -1, 168, 111, 76,
695 106, 157, 107, 113, 189, -1, 168, 111, 76, 113,
696 189, -1, 170, -1, 170, 76, -1, 170, 76, 106,
697 157, 107, -1, 170, 76, 106, 107, 113, 189, -1,
698 170, 76, 106, 157, 107, 113, 189, -1, 170, 76,
699 113, 189, -1, 3, 76, -1, 175, -1, 173, 175,
700 -1, 53, -1, 52, -1, 9, -1, 8, -1, 44,
701 -1, 3, 44, -1, 174, -1, 171, 174, -1, 171,
702 -1, 177, -1, 177, 174, -1, 9, -1, 40, -1,
703 41, -1, 51, 40, -1, 51, 41, -1, 43, -1,
704 180, -1, 176, 180, -1, 4, -1, 5, -1, 6,
705 -1, 75, 104, 178, 105, -1, 179, -1, 178, 111,
706 179, -1, 76, -1, 76, 113, 79, -1, 76, 113,
707 80, -1, 181, -1, 181, 106, 157, 107, -1, 55,
708 -1, 11, -1, 12, -1, 13, -1, 10, -1, 31,
709 -1, 32, -1, 33, -1, 25, -1, 26, -1, 27,
710 -1, 28, -1, 29, -1, 30, -1, 34, -1, 35,
711 -1, 36, -1, 37, -1, 38, -1, 39, -1, 45,
712 -1, 46, -1, 47, -1, 48, -1, 49, -1, 50,
713 -1, 57, -1, 58, -1, 59, -1, 70, -1, 61,
714 -1, 62, -1, 63, -1, 64, -1, 65, -1, 66,
715 -1, 67, -1, 68, -1, 69, -1, 72, -1, 73,
716 -1, 74, -1, 182, -1, 77, -1, -1, 54, 76,
717 108, 183, 185, 109, -1, -1, 54, 108, 184, 185,
718 109, -1, 186, -1, 185, 186, -1, 175, 187, 114,
719 -1, 173, 175, 187, 114, -1, 188, -1, 187, 111,
720 188, -1, 76, -1, 76, 106, 157, 107, -1, 154,
721 -1, 159, -1, 193, -1, 192, -1, 190, -1, 202,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400722 -1, 203, -1, 205, -1, 207, -1, 209, -1, 216,
723 -1, 108, 109, -1, -1, -1, 108, 194, 201, 195,
724 109, -1, 200, -1, 192, -1, -1, 198, 200, -1,
725 -1, 199, 192, -1, 108, 109, -1, 108, 201, 109,
726 -1, 191, -1, 201, 191, -1, 114, -1, 156, 114,
727 -1, 19, 104, 156, 105, 204, -1, 197, 17, 197,
728 -1, 197, -1, -1, 22, 104, 156, 105, 206, 193,
729 -1, 23, 157, 112, -1, 24, 112, -1, 156, -1,
730 170, 76, 113, 189, -1, -1, 56, 104, 210, 208,
731 105, 196, -1, -1, 16, 211, 197, 56, 104, 156,
732 105, 114, -1, -1, 18, 104, 212, 213, 215, 105,
733 196, -1, 202, -1, 190, -1, 208, -1, -1, 214,
734 114, -1, 214, 114, 156, -1, 15, 114, -1, 14,
735 114, -1, 21, 114, -1, 21, 156, 114, -1, 20,
736 114, -1, 218, -1, 217, 218, -1, 219, -1, 159,
737 -1, -1, 160, 220, 200, -1
John Bauman66b8ab22014-05-06 15:57:45 -0400738};
739
740/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
741static const yytype_uint16 yyrline[] =
742{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400743 0, 196, 196, 231, 234, 239, 244, 249, 254, 260,
744 263, 266, 269, 272, 275, 281, 289, 389, 392, 400,
745 404, 411, 415, 422, 428, 437, 445, 522, 529, 539,
746 542, 552, 562, 584, 585, 586, 587, 595, 596, 605,
747 614, 627, 628, 636, 647, 648, 657, 669, 670, 680,
748 690, 700, 713, 714, 724, 737, 738, 752, 753, 767,
749 768, 782, 783, 796, 797, 810, 811, 824, 825, 842,
750 843, 856, 857, 858, 859, 861, 862, 863, 865, 867,
751 869, 871, 876, 879, 890, 898, 906, 933, 939, 946,
752 950, 954, 958, 965, 1003, 1006, 1013, 1021, 1042, 1063,
753 1074, 1103, 1108, 1118, 1123, 1133, 1136, 1139, 1142, 1148,
754 1155, 1158, 1162, 1166, 1171, 1176, 1183, 1187, 1191, 1195,
755 1200, 1205, 1209, 1285, 1295, 1301, 1304, 1310, 1316, 1323,
756 1332, 1341, 1344, 1347, 1354, 1358, 1365, 1369, 1374, 1379,
757 1389, 1399, 1408, 1418, 1425, 1428, 1431, 1437, 1444, 1447,
758 1453, 1456, 1459, 1465, 1468, 1483, 1487, 1491, 1495, 1499,
759 1503, 1508, 1513, 1518, 1523, 1528, 1533, 1538, 1543, 1548,
760 1553, 1558, 1563, 1569, 1575, 1581, 1587, 1593, 1599, 1605,
761 1611, 1617, 1622, 1627, 1636, 1641, 1646, 1651, 1656, 1661,
762 1666, 1671, 1676, 1681, 1686, 1691, 1696, 1701, 1706, 1719,
763 1719, 1722, 1722, 1728, 1731, 1747, 1750, 1759, 1763, 1769,
764 1776, 1791, 1795, 1799, 1800, 1806, 1807, 1808, 1809, 1810,
765 1811, 1812, 1816, 1817, 1817, 1817, 1827, 1828, 1832, 1832,
766 1833, 1833, 1838, 1841, 1851, 1854, 1860, 1861, 1865, 1873,
767 1877, 1884, 1884, 1891, 1894, 1903, 1908, 1925, 1925, 1930,
768 1930, 1937, 1937, 1945, 1948, 1954, 1957, 1963, 1967, 1974,
769 1977, 1980, 1983, 1986, 1995, 1999, 2006, 2009, 2015, 2015
John Bauman66b8ab22014-05-06 15:57:45 -0400770};
771#endif
772
773#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
774/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
775 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
776static const char *const yytname[] =
777{
778 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
779 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
Nicolas Capens3c20f802015-02-17 17:17:20 -0500780 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE",
781 "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN",
782 "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500783 "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2",
784 "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
Alexis Hetub14178b2015-04-13 13:23:20 -0400785 "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2",
786 "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT",
787 "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES",
788 "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D",
789 "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
790 "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT",
791 "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT",
792 "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
793 "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
794 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
795 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
796 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
797 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500798 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
799 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
800 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
801 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
802 "primary_expression", "postfix_expression", "integer_expression",
803 "function_call", "function_call_or_method", "function_call_generic",
John Bauman66b8ab22014-05-06 15:57:45 -0400804 "function_call_header_no_parameters",
805 "function_call_header_with_parameters", "function_call_header",
806 "function_identifier", "unary_expression", "unary_operator",
807 "multiplicative_expression", "additive_expression", "shift_expression",
808 "relational_expression", "equality_expression", "and_expression",
809 "exclusive_or_expression", "inclusive_or_expression",
810 "logical_and_expression", "logical_xor_expression",
811 "logical_or_expression", "conditional_expression",
812 "assignment_expression", "assignment_operator", "expression",
Alexis Hetua35d8232015-06-11 17:11:06 -0400813 "constant_expression", "enter_struct", "declaration",
814 "function_prototype", "function_declarator",
815 "function_header_with_parameters", "function_header",
816 "parameter_declarator", "parameter_declaration", "parameter_qualifier",
817 "parameter_type_specifier", "init_declarator_list", "single_declaration",
818 "fully_specified_type", "interpolation_qualifier",
819 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
820 "type_specifier", "precision_qualifier", "layout_qualifier",
821 "layout_qualifier_id_list", "layout_qualifier_id",
Nicolas Capens7d626792015-02-17 17:58:31 -0500822 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
823 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
John Bauman66b8ab22014-05-06 15:57:45 -0400824 "struct_declarator_list", "struct_declarator", "initializer",
825 "declaration_statement", "statement", "simple_statement",
826 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
827 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
828 "statement_list", "expression_statement", "selection_statement",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400829 "selection_rest_statement", "switch_statement", "$@7", "case_label",
830 "condition", "iteration_statement", "$@8", "$@9", "$@10",
831 "for_init_statement", "conditionopt", "for_rest_statement",
John Bauman66b8ab22014-05-06 15:57:45 -0400832 "jump_statement", "translation_unit", "external_declaration",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400833 "function_definition", "$@11", 0
John Bauman66b8ab22014-05-06 15:57:45 -0400834};
835#endif
836
837# ifdef YYPRINT
838/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
839 token YYLEX-NUM. */
840static const yytype_uint16 yytoknum[] =
841{
842 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
843 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
844 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
845 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
846 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
847 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
848 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
849 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
850 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
Nicolas Capensc6841852015-02-15 14:25:37 -0500851 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Nicolas Capens7d626792015-02-17 17:58:31 -0500852 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Alexis Hetub14178b2015-04-13 13:23:20 -0400853 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
854 375, 376, 377, 378, 379, 380, 381, 382
John Bauman66b8ab22014-05-06 15:57:45 -0400855};
856# endif
857
858/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
859static const yytype_uint8 yyr1[] =
860{
Alexis Hetub14178b2015-04-13 13:23:20 -0400861 0, 128, 129, 130, 130, 130, 130, 130, 130, 131,
862 131, 131, 131, 131, 131, 132, 133, 134, 134, 135,
863 135, 136, 136, 137, 137, 138, 139, 139, 139, 140,
Alexis Hetu17809052015-05-13 11:28:22 -0400864 140, 140, 140, 141, 141, 141, 141, 142, 142, 142,
865 142, 143, 143, 143, 144, 144, 144, 145, 145, 145,
866 145, 145, 146, 146, 146, 147, 147, 148, 148, 149,
867 149, 150, 150, 151, 151, 152, 152, 153, 153, 154,
868 154, 155, 155, 155, 155, 155, 155, 155, 155, 155,
Alexis Hetua35d8232015-06-11 17:11:06 -0400869 155, 155, 156, 156, 157, 158, 159, 159, 159, 159,
870 159, 159, 159, 160, 161, 161, 162, 162, 163, 164,
871 164, 165, 165, 165, 165, 166, 166, 166, 166, 167,
872 168, 168, 168, 168, 168, 168, 169, 169, 169, 169,
873 169, 169, 169, 170, 170, 171, 171, 172, 173, 173,
874 173, 173, 173, 173, 173, 173, 174, 174, 174, 174,
875 174, 174, 175, 175, 176, 176, 176, 177, 178, 178,
876 179, 179, 179, 180, 180, 181, 181, 181, 181, 181,
877 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
878 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
879 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
880 181, 181, 181, 181, 181, 181, 181, 181, 181, 183,
881 182, 184, 182, 185, 185, 186, 186, 187, 187, 188,
882 188, 189, 190, 191, 191, 192, 192, 192, 192, 192,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400883 192, 192, 193, 194, 195, 193, 196, 196, 198, 197,
884 199, 197, 200, 200, 201, 201, 202, 202, 203, 204,
885 204, 206, 205, 207, 207, 208, 208, 210, 209, 211,
886 209, 212, 209, 213, 213, 214, 214, 215, 215, 216,
887 216, 216, 216, 216, 217, 217, 218, 218, 220, 219
John Bauman66b8ab22014-05-06 15:57:45 -0400888};
889
890/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
891static const yytype_uint8 yyr2[] =
892{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500893 0, 2, 1, 1, 1, 1, 1, 1, 3, 1,
894 4, 1, 3, 2, 2, 1, 1, 1, 3, 2,
895 2, 2, 1, 2, 3, 2, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400896 2, 2, 2, 1, 1, 1, 1, 1, 3, 3,
897 3, 1, 3, 3, 1, 3, 3, 1, 3, 3,
898 3, 3, 1, 3, 3, 1, 3, 1, 3, 1,
899 3, 1, 3, 1, 3, 1, 3, 1, 5, 1,
900 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400901 1, 1, 1, 3, 1, 2, 2, 2, 4, 5,
902 6, 9, 2, 2, 1, 1, 2, 3, 3, 2,
903 5, 3, 2, 3, 2, 0, 1, 1, 1, 1,
904 1, 3, 6, 7, 8, 5, 1, 2, 5, 6,
905 7, 4, 2, 1, 2, 1, 1, 1, 1, 1,
906 2, 1, 2, 1, 1, 2, 1, 1, 1, 2,
907 2, 1, 1, 2, 1, 1, 1, 4, 1, 3,
908 1, 3, 3, 1, 4, 1, 1, 1, 1, 1,
John Bauman66b8ab22014-05-06 15:57:45 -0400909 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetub14178b2015-04-13 13:23:20 -0400910 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
911 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400912 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
913 6, 0, 5, 1, 2, 3, 4, 1, 3, 1,
914 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400915 1, 1, 2, 0, 0, 5, 1, 1, 0, 2,
916 0, 2, 2, 3, 1, 2, 1, 2, 5, 3,
917 1, 0, 6, 3, 2, 1, 4, 0, 6, 0,
918 8, 0, 7, 1, 1, 1, 0, 2, 3, 2,
919 2, 2, 3, 2, 1, 2, 1, 1, 0, 3
John Bauman66b8ab22014-05-06 15:57:45 -0400920};
921
922/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
923 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
924 means the default is an error. */
Alexis Hetuad6b8752015-06-09 16:15:30 -0400925static const yytype_uint16 yydefact[] =
John Bauman66b8ab22014-05-06 15:57:45 -0400926{
Alexis Hetua35d8232015-06-11 17:11:06 -0400927 0, 0, 144, 145, 146, 0, 128, 136, 159, 156,
928 157, 158, 163, 164, 165, 166, 167, 168, 160, 161,
929 162, 169, 170, 171, 172, 173, 174, 137, 138, 141,
930 129, 175, 176, 177, 178, 179, 180, 0, 126, 125,
931 0, 155, 181, 182, 183, 185, 186, 187, 188, 189,
932 190, 191, 192, 193, 184, 194, 195, 196, 0, 198,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400933 267, 268, 0, 95, 105, 0, 110, 116, 133, 0,
934 131, 123, 0, 134, 142, 153, 197, 0, 264, 266,
Alexis Hetua35d8232015-06-11 17:11:06 -0400935 130, 122, 0, 139, 140, 0, 201, 0, 86, 0,
936 93, 105, 127, 106, 107, 108, 96, 0, 105, 0,
937 87, 117, 132, 0, 92, 0, 124, 143, 135, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400938 1, 265, 0, 199, 0, 150, 0, 148, 0, 269,
Alexis Hetua35d8232015-06-11 17:11:06 -0400939 97, 102, 104, 109, 0, 111, 98, 0, 0, 85,
940 0, 0, 0, 0, 203, 2, 6, 4, 5, 7,
941 28, 0, 0, 0, 35, 34, 36, 33, 3, 9,
942 29, 11, 16, 17, 0, 0, 22, 0, 37, 0,
943 41, 44, 47, 52, 55, 57, 59, 61, 63, 65,
944 67, 84, 0, 26, 88, 0, 0, 0, 147, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400945 0, 0, 249, 0, 0, 0, 0, 0, 0, 0,
946 0, 223, 232, 236, 37, 69, 82, 0, 212, 0,
947 153, 215, 234, 214, 213, 0, 216, 217, 218, 219,
948 220, 221, 99, 101, 103, 0, 0, 0, 0, 211,
949 121, 0, 209, 0, 207, 0, 204, 30, 31, 0,
950 13, 14, 0, 0, 20, 19, 0, 21, 23, 25,
951 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -0400952 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400953 0, 154, 0, 202, 151, 152, 149, 260, 259, 230,
954 251, 0, 263, 261, 0, 0, 0, 244, 247, 222,
955 0, 72, 73, 75, 74, 77, 78, 79, 80, 81,
956 76, 71, 0, 0, 237, 233, 235, 0, 0, 0,
957 115, 0, 118, 0, 0, 0, 205, 0, 89, 8,
958 0, 15, 27, 12, 18, 24, 38, 39, 40, 43,
959 42, 45, 46, 50, 51, 48, 49, 53, 54, 56,
960 58, 60, 62, 64, 66, 0, 200, 0, 0, 0,
961 0, 0, 262, 0, 243, 0, 224, 70, 83, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -0400962 0, 112, 119, 0, 206, 0, 208, 0, 90, 10,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400963 0, 0, 229, 231, 254, 253, 256, 230, 241, 245,
964 0, 0, 0, 0, 100, 113, 0, 120, 210, 0,
965 68, 0, 255, 0, 0, 240, 238, 0, 0, 0,
966 225, 114, 0, 0, 257, 0, 230, 242, 0, 227,
967 248, 226, 91, 0, 258, 252, 239, 246, 250
John Bauman66b8ab22014-05-06 15:57:45 -0400968};
969
970/* YYDEFGOTO[NTERM-NUM]. */
971static const yytype_int16 yydefgoto[] =
972{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400973 -1, 148, 149, 150, 310, 151, 152, 153, 154, 155,
974 156, 157, 194, 159, 160, 161, 162, 163, 164, 165,
975 166, 167, 168, 169, 170, 195, 196, 292, 197, 172,
976 105, 198, 199, 62, 63, 64, 121, 96, 97, 122,
Alexis Hetua35d8232015-06-11 17:11:06 -0400977 65, 66, 67, 68, 98, 69, 70, 71, 72, 73,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400978 116, 117, 74, 173, 76, 175, 114, 133, 134, 223,
979 224, 220, 201, 202, 203, 204, 280, 373, 400, 337,
980 338, 339, 401, 205, 206, 207, 386, 208, 387, 209,
981 372, 210, 345, 269, 340, 366, 383, 384, 211, 77,
982 78, 79, 89
John Bauman66b8ab22014-05-06 15:57:45 -0400983};
984
985/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
986 STATE-NUM. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400987#define YYPACT_NINF -333
John Bauman66b8ab22014-05-06 15:57:45 -0400988static const yytype_int16 yypact[] =
989{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400990 2050, -21, -333, -333, -333, 21, -333, -333, -333, -333,
991 -333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
992 -333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
993 -333, -333, -333, -333, -333, -333, -333, 26, -333, -333,
994 -46, -333, -333, -333, -333, -333, -333, -333, -333, -333,
995 -333, -333, -333, -333, -333, -333, -333, -333, -25, -333,
996 -333, -78, -16, -15, -1, -43, -333, 34, 7, 1167,
997 -333, -333, 2335, 7, -333, 31, -333, 1975, -333, -333,
998 -333, -333, 2335, -333, -333, 5, -333, 47, -333, 54,
999 -333, 19, -333, -333, -333, -333, -333, 2199, 114, 49,
1000 -333, -23, -333, 58, -333, 2125, -333, -333, -333, 1528,
1001 -333, -333, 13, -333, 2125, 33, -12, -333, 395, -333,
1002 -333, -333, -333, 104, 2199, -26, -333, 1237, 1528, -333,
1003 139, 2199, 113, 1720, -333, 86, -333, -333, -333, -333,
1004 -333, 1528, 1528, 1528, -333, -333, -333, -333, -333, -333,
1005 30, -333, -333, -333, 88, -5, 1623, 91, -333, 1528,
1006 38, 45, 1, -69, 75, 70, 72, 74, 109, 108,
1007 -70, -333, 95, -333, -333, 2125, 1805, 92, -333, 47,
1008 93, 94, -333, 102, 105, 107, 1335, 118, 1528, 111,
1009 120, 122, -333, -333, 117, -333, -333, -13, -333, -78,
1010 39, -333, -333, -333, -333, 511, -333, -333, -333, -333,
1011 -333, -333, 121, -333, -333, 1430, 1528, 119, 126, -333,
1012 -333, 113, 128, 18, -333, -63, -333, -333, -333, -2,
1013 -333, -333, 1528, 2267, -333, -333, 1528, 131, -333, -333,
1014 -333, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528,
1015 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528,
1016 1528, -333, 1890, -333, -333, -333, -333, -333, -333, 129,
1017 -333, 1528, -333, -333, 27, 1528, 127, -333, -333, -333,
1018 627, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1019 -333, -333, 1528, 1528, -333, -333, -333, 1528, 125, 134,
1020 -333, 1528, 132, 28, 1528, 113, -333, -62, -333, -333,
1021 135, 136, -333, 142, -333, -333, -333, -333, -333, 38,
1022 38, 45, 45, 1, 1, 1, 1, -69, -69, 75,
1023 70, 72, 74, 109, 108, 62, -333, 192, 54, 859,
1024 975, 6, -333, 15, -333, 1072, 627, -333, -333, 143,
1025 1528, 138, -333, 1528, -333, 149, -333, 1528, -333, -333,
1026 1528, 145, -333, -333, -333, -333, 1072, 129, -333, 136,
1027 181, 2199, 153, 150, -333, -333, 1528, -333, -333, 154,
1028 -333, 1528, -333, 146, 160, 249, -333, 159, 155, 743,
1029 -333, -333, 156, 17, 1528, 743, 129, -333, 1528, -333,
1030 -333, -333, -333, 157, 136, -333, -333, -333, -333
John Bauman66b8ab22014-05-06 15:57:45 -04001031};
1032
1033/* YYPGOTO[NTERM-NUM]. */
1034static const yytype_int16 yypgoto[] =
1035{
Alexis Hetu76a343a2015-06-04 17:21:22 -04001036 -333, -333, -333, -333, -333, -333, -333, 36, -333, -333,
1037 -333, -333, 40, -333, -66, -61, -98, -65, 22, 20,
1038 16, 43, 44, 14, -333, -94, -124, -333, -141, -113,
1039 -333, 9, 11, -333, -333, -333, 177, 186, 180, 182,
1040 -333, -333, -324, -333, -333, -102, -30, -68, 274, -333,
1041 -333, 130, -48, 0, -333, -333, -333, -97, -127, 83,
1042 2, -206, -35, -198, -319, -79, -333, -333, -85, -332,
1043 -333, -333, -84, 32, -29, -333, -333, -333, -333, -333,
1044 -53, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1045 237, -333, -333
John Bauman66b8ab22014-05-06 15:57:45 -04001046};
1047
1048/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1049 positive, shift that token. If negative, reduce the rule which
1050 number is the opposite. If zero, do what YYDEFACT says.
1051 If YYTABLE_NINF, syntax error. */
Alexis Hetu76a343a2015-06-04 17:21:22 -04001052#define YYTABLE_NINF -229
John Bauman66b8ab22014-05-06 15:57:45 -04001053static const yytype_int16 yytable[] =
1054{
Alexis Hetu76a343a2015-06-04 17:21:22 -04001055 75, 106, 229, 131, 219, 119, 226, 296, 92, 60,
1056 300, 61, 131, 307, 218, 171, 7, 176, 248, 249,
1057 363, 370, 259, 80, 107, 2, 3, 4, 92, 123,
1058 85, 131, 238, 171, 112, 385, 88, 132, 102, 93,
1059 94, 95, 370, 108, 357, 274, 132, 27, 28, 226,
1060 29, 308, 358, 250, 251, 81, 123, 260, 37, 93,
1061 94, 95, 86, 221, 406, 132, 83, 84, 99, 75,
1062 399, 100, 75, 131, 131, 276, 399, 75, 262, 87,
1063 215, 126, 75, 127, 246, 247, 60, 216, 61, 90,
1064 128, 311, 219, 178, 171, 352, 91, 75, 293, 179,
1065 235, 294, 299, 309, -94, 75, 236, 132, 132, 293,
1066 101, 367, 315, 113, 75, 230, 231, 293, 200, 335,
1067 368, 171, 403, 115, 75, 125, 293, 174, 293, 305,
1068 341, 75, 306, 75, 343, 226, 232, 109, 293, 305,
1069 233, 342, 354, -26, 375, 109, 177, 377, 296, 158,
1070 323, 324, 325, 326, 93, 94, 95, 241, 242, 243,
1071 131, 244, 118, 245, 252, 253, 129, 158, 347, 348,
1072 391, 264, 265, 293, 360, 75, 75, 219, 319, 320,
1073 212, 227, 228, 80, 349, 321, 322, 327, 328, 222,
1074 -27, 355, 407, 234, 132, 239, 254, 255, 256, 240,
1075 257, 258, 261, 171, 369, 200, 270, 267, 268, 271,
1076 171, 281, 282, 283, 284, 285, 286, 287, 288, 289,
1077 290, 272, 275, 277, 278, 369, 219, 297, 158, 219,
1078 291, 279, 301, 302, 304, -155, 380, -228, 350, 344,
1079 393, 351, 359, 371, 379, 353, -28, 293, 361, 381,
1080 374, 376, 219, 404, 362, 158, 378, 388, 389, 390,
1081 394, 392, 75, 171, 371, 395, 396, 191, 398, 314,
1082 402, 408, 331, 334, 219, 330, 329, 120, 124, 82,
1083 200, 316, 317, 318, 158, 158, 158, 158, 158, 158,
Alexis Hetua35d8232015-06-11 17:11:06 -04001084 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001085 332, 213, 333, 106, 303, 364, 214, 356, 397, 266,
1086 405, 365, 346, 382, 111, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001087 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001088 0, 0, 0, 0, 0, 0, 0, 158, 0, 200,
1089 200, 0, 0, 0, 158, 200, 200, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001090 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001091 0, 0, 0, 0, 0, 0, 200, 0, 0, 0,
1092 0, 75, 0, 0, 0, 0, 0, 0, 0, 0,
1093 0, 0, 0, 0, 0, 0, 0, 0, 0, 200,
1094 0, 0, 0, 0, 0, 200, 0, 158, 1, 2,
1095 3, 4, 5, 6, 7, 8, 9, 10, 11, 180,
1096 181, 182, 0, 183, 184, 185, 186, 187, 188, 189,
1097 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1098 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1099 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1100 41, 190, 42, 43, 44, 0, 45, 46, 47, 48,
1101 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1102 58, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1103 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1104 0, 0, 0, 0, 0, 0, 0, 0, 0, 143,
1105 0, 0, 0, 191, 192, 0, 0, 0, 0, 193,
1106 144, 145, 146, 147, 1, 2, 3, 4, 5, 6,
1107 7, 8, 9, 10, 11, 180, 181, 182, 0, 183,
1108 184, 185, 186, 187, 188, 189, 12, 13, 14, 15,
1109 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1110 26, 27, 28, 0, 29, 30, 31, 32, 33, 34,
1111 35, 36, 37, 38, 39, 40, 41, 190, 42, 43,
1112 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
1113 53, 54, 0, 55, 56, 57, 58, 135, 59, 136,
1114 137, 138, 139, 140, 0, 0, 141, 142, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001115 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001116 0, 0, 0, 0, 0, 143, 0, 0, 0, 191,
1117 295, 0, 0, 0, 0, 193, 144, 145, 146, 147,
1118 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1119 11, 180, 181, 182, 0, 183, 184, 185, 186, 187,
1120 188, 189, 12, 13, 14, 15, 16, 17, 18, 19,
1121 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1122 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1123 39, 40, 41, 190, 42, 43, 44, 0, 45, 46,
1124 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1125 56, 57, 58, 135, 59, 136, 137, 138, 139, 140,
1126 0, 0, 141, 142, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001127 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001128 0, 143, 0, 0, 0, 191, 0, 0, 0, 0,
1129 0, 193, 144, 145, 146, 147, 1, 2, 3, 4,
1130 5, 6, 7, 8, 9, 10, 11, 180, 181, 182,
1131 0, 183, 184, 185, 186, 187, 188, 189, 12, 13,
1132 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1133 24, 25, 26, 27, 28, 0, 29, 30, 31, 32,
1134 33, 34, 35, 36, 37, 38, 39, 40, 41, 190,
1135 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1136 51, 52, 53, 54, 0, 55, 56, 57, 58, 135,
1137 59, 136, 137, 138, 139, 140, 0, 0, 141, 142,
1138 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1139 0, 0, 0, 0, 0, 0, 0, 143, 0, 0,
1140 0, 118, 0, 0, 0, 0, 0, 193, 144, 145,
1141 146, 147, 1, 2, 3, 4, 5, 6, 7, 8,
1142 9, 10, 11, 180, 181, 182, 0, 183, 184, 185,
1143 186, 187, 188, 189, 12, 13, 14, 15, 16, 17,
1144 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1145 28, 0, 29, 30, 31, 32, 33, 34, 35, 36,
1146 37, 38, 39, 40, 41, 190, 42, 43, 44, 0,
1147 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1148 0, 55, 56, 57, 58, 135, 59, 136, 137, 138,
1149 139, 140, 0, 0, 141, 142, 0, 0, 0, 0,
1150 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1151 0, 0, 0, 143, 0, 0, 0, 0, 0, 0,
1152 0, 0, 0, 193, 144, 145, 146, 147, 1, 2,
1153 3, 4, 5, 6, 7, 8, 9, 10, 11, 0,
1154 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1155 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1156 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1157 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1158 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1159 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1160 58, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1161 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1162 0, 0, 0, 0, 0, 130, 2, 3, 4, 143,
1163 6, 7, 8, 9, 10, 11, 0, 0, 0, 193,
1164 144, 145, 146, 147, 0, 0, 0, 12, 13, 14,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001165 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001166 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001167 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001168 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
Alexis Hetua35d8232015-06-11 17:11:06 -04001169 52, 53, 54, 0, 55, 56, 57, 58, 135, 59,
1170 136, 137, 138, 139, 140, 0, 0, 141, 142, 0,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001172 0, 2, 3, 4, 0, 0, 143, 8, 9, 10,
1173 11, 0, 0, 0, 0, 0, 0, 144, 145, 146,
1174 147, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1175 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1176 0, 0, 31, 32, 33, 34, 35, 36, 0, 0,
1177 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
Alexis Hetua35d8232015-06-11 17:11:06 -04001178 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001179 56, 57, 0, 103, 59, 0, 0, 8, 9, 10,
1180 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1181 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1182 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1183 0, 104, 31, 32, 33, 34, 35, 36, 0, 0,
1184 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1185 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1186 56, 57, 0, 135, 59, 136, 137, 138, 139, 140,
Alexis Hetua35d8232015-06-11 17:11:06 -04001187 0, 0, 141, 142, 0, 0, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001188 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001189 0, 143, 0, 0, 217, 8, 9, 10, 11, 0,
1190 0, 0, 144, 145, 146, 147, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001191 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1192 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
1193 31, 32, 33, 34, 35, 36, 0, 0, 0, 40,
1194 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1195 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1196 0, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1197 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1198 0, 0, 0, 0, 0, 0, 0, 0, 0, 143,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001199 8, 9, 10, 11, 0, 0, 0, 0, 0, 273,
1200 144, 145, 146, 147, 0, 12, 13, 14, 15, 16,
1201 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1202 0, 0, 0, 0, 0, 31, 32, 33, 34, 35,
1203 36, 0, 0, 0, 40, 41, 0, 42, 43, 44,
1204 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1205 54, 0, 55, 56, 57, 0, 135, 59, 136, 137,
1206 138, 139, 140, 0, 0, 141, 142, 0, 0, 0,
1207 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1208 0, 0, 0, 0, 143, 0, 0, 298, 8, 9,
1209 10, 11, 0, 0, 0, 144, 145, 146, 147, 0,
1210 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1211 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
1212 0, 0, 0, 31, 32, 33, 34, 35, 36, 0,
1213 0, 0, 40, 41, 0, 42, 43, 44, 0, 45,
1214 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1215 55, 56, 57, 0, 135, 59, 136, 137, 138, 139,
1216 140, 0, 0, 141, 142, 0, 0, 0, 0, 0,
1217 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1218 0, 0, 143, 8, 9, 10, 11, 0, 0, 0,
1219 0, 0, 0, 144, 145, 146, 147, 0, 12, 13,
Alexis Hetua35d8232015-06-11 17:11:06 -04001220 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1221 24, 25, 26, 0, 0, 0, 0, 0, 31, 32,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001222 33, 34, 35, 36, 0, 0, 0, 40, 237, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001223 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1224 51, 52, 53, 54, 0, 55, 56, 57, 0, 135,
1225 59, 136, 137, 138, 139, 140, 0, 0, 141, 142,
1226 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001227 0, 0, 0, 130, 2, 3, 4, 143, 6, 7,
1228 8, 9, 10, 11, 0, 0, 0, 0, 144, 145,
1229 146, 147, 0, 0, 0, 12, 13, 14, 15, 16,
1230 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1231 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1232 36, 37, 38, 39, 40, 41, 0, 42, 43, 44,
1233 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1234 54, 0, 55, 56, 57, 58, 0, 59, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001235 0, 0, 0, 0, 0, 0, 0, 0, 130, 2,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001236 3, 4, 0, 6, 7, 8, 9, 10, 11, 0,
1237 0, 0, 0, 0, 0, 0, 0, 0, 0, 225,
Alexis Hetua35d8232015-06-11 17:11:06 -04001238 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1239 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1240 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1241 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1242 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1243 58, 0, 59, 0, 0, 0, 0, 0, 0, 0,
1244 0, 0, 0, 130, 2, 3, 4, 0, 6, 7,
1245 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001246 0, 0, 0, 0, 263, 12, 13, 14, 15, 16,
Alexis Hetua35d8232015-06-11 17:11:06 -04001247 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1248 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1249 36, 37, 38, 39, 40, 41, 0, 42, 43, 44,
1250 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1251 54, 0, 55, 56, 57, 58, 0, 59, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001252 0, 0, 0, 0, 0, 110, 0, 0, 1, 2,
1253 3, 4, 5, 6, 7, 8, 9, 10, 11, 0,
1254 0, 0, 0, 0, 0, 0, 0, 0, 0, 336,
Alexis Hetua35d8232015-06-11 17:11:06 -04001255 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1256 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1257 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1258 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1259 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001260 58, 0, 59, 1, 2, 3, 4, 5, 6, 7,
Alexis Hetua35d8232015-06-11 17:11:06 -04001261 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001262 0, 0, 0, 0, 0, 12, 13, 14, 15, 16,
Alexis Hetua35d8232015-06-11 17:11:06 -04001263 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1264 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1265 36, 37, 38, 39, 40, 41, 0, 42, 43, 44,
1266 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001267 54, 0, 55, 56, 57, 58, 0, 59, 130, 2,
1268 3, 4, 0, 6, 7, 8, 9, 10, 11, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001269 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001270 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1271 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1272 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1273 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1274 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001275 58, 0, 59, 2, 3, 4, 0, 0, 0, 8,
1276 9, 10, 11, 0, 0, 0, 0, 0, 0, 0,
1277 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
1278 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1279 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1280 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1281 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1282 0, 55, 56, 57, 0, 0, 59, 8, 9, 10,
1283 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1284 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1285 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1286 0, 0, 31, 32, 33, 34, 35, 36, 0, 0,
1287 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1288 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1289 56, 57, 0, 312, 59, 8, 9, 10, 11, 313,
1290 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1291 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1292 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
1293 31, 32, 33, 34, 35, 36, 0, 0, 0, 40,
1294 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1295 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1296 0, 0, 59
John Bauman66b8ab22014-05-06 15:57:45 -04001297};
1298
1299static const yytype_int16 yycheck[] =
1300{
Alexis Hetu76a343a2015-06-04 17:21:22 -04001301 0, 69, 143, 105, 128, 89, 133, 205, 9, 0,
1302 216, 0, 114, 76, 127, 109, 9, 114, 87, 88,
1303 339, 345, 92, 44, 72, 4, 5, 6, 9, 97,
1304 76, 133, 156, 127, 82, 367, 114, 105, 68, 40,
1305 41, 42, 366, 73, 106, 186, 114, 40, 41, 176,
1306 43, 114, 114, 122, 123, 76, 124, 127, 51, 40,
1307 41, 42, 108, 131, 396, 133, 40, 41, 111, 69,
1308 389, 114, 72, 175, 176, 188, 395, 77, 175, 104,
1309 106, 104, 82, 106, 83, 84, 77, 113, 77, 105,
1310 113, 232, 216, 105, 188, 301, 111, 97, 111, 111,
1311 105, 114, 215, 105, 105, 105, 111, 175, 176, 111,
1312 76, 105, 236, 108, 114, 85, 86, 111, 118, 260,
1313 105, 215, 105, 76, 124, 76, 111, 114, 111, 111,
1314 271, 131, 114, 133, 275, 262, 106, 106, 111, 111,
1315 110, 114, 114, 104, 350, 106, 113, 353, 346, 109,
1316 248, 249, 250, 251, 40, 41, 42, 119, 120, 121,
1317 262, 116, 108, 118, 89, 90, 108, 127, 292, 293,
1318 376, 79, 80, 111, 112, 175, 176, 301, 244, 245,
1319 76, 141, 142, 44, 297, 246, 247, 252, 253, 76,
1320 104, 304, 398, 105, 262, 104, 126, 125, 124, 159,
1321 91, 93, 107, 297, 345, 205, 104, 114, 114, 104,
1322 304, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1323 103, 114, 104, 112, 104, 366, 350, 106, 188, 353,
1324 113, 109, 113, 107, 106, 104, 360, 108, 113, 112,
1325 381, 107, 107, 345, 357, 113, 104, 111, 56, 104,
1326 107, 113, 376, 394, 338, 215, 107, 76, 105, 109,
1327 114, 107, 262, 357, 366, 105, 17, 108, 113, 233,
1328 114, 114, 256, 259, 398, 255, 254, 91, 98, 5,
1329 280, 241, 242, 243, 244, 245, 246, 247, 248, 249,
1330 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
1331 257, 124, 258, 371, 221, 340, 124, 305, 387, 179,
1332 395, 340, 280, 366, 77, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001334 -1, -1, -1, -1, -1, -1, -1, 297, -1, 339,
1335 340, -1, -1, -1, 304, 345, 346, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001337 -1, -1, -1, -1, -1, -1, 366, -1, -1, -1,
1338 -1, 371, -1, -1, -1, -1, -1, -1, -1, -1,
1339 -1, -1, -1, -1, -1, -1, -1, -1, -1, 389,
1340 -1, -1, -1, -1, -1, 395, -1, 357, 3, 4,
1341 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1342 15, 16, -1, 18, 19, 20, 21, 22, 23, 24,
1343 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1344 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1345 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1346 55, 56, 57, 58, 59, -1, 61, 62, 63, 64,
1347 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1348 75, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1349 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1350 -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
1351 -1, -1, -1, 108, 109, -1, -1, -1, -1, 114,
1352 115, 116, 117, 118, 3, 4, 5, 6, 7, 8,
1353 9, 10, 11, 12, 13, 14, 15, 16, -1, 18,
1354 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1355 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1356 39, 40, 41, -1, 43, 44, 45, 46, 47, 48,
1357 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
1358 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
1359 69, 70, -1, 72, 73, 74, 75, 76, 77, 78,
1360 79, 80, 81, 82, -1, -1, 85, 86, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001361 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001362 -1, -1, -1, -1, -1, 104, -1, -1, -1, 108,
1363 109, -1, -1, -1, -1, 114, 115, 116, 117, 118,
1364 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1365 13, 14, 15, 16, -1, 18, 19, 20, 21, 22,
1366 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1367 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1368 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1369 53, 54, 55, 56, 57, 58, 59, -1, 61, 62,
1370 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1371 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1372 -1, -1, 85, 86, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001373 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001374 -1, 104, -1, -1, -1, 108, -1, -1, -1, -1,
1375 -1, 114, 115, 116, 117, 118, 3, 4, 5, 6,
1376 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1377 -1, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1378 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1379 37, 38, 39, 40, 41, -1, 43, 44, 45, 46,
1380 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
1381 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1382 67, 68, 69, 70, -1, 72, 73, 74, 75, 76,
1383 77, 78, 79, 80, 81, 82, -1, -1, 85, 86,
1384 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1385 -1, -1, -1, -1, -1, -1, -1, 104, -1, -1,
1386 -1, 108, -1, -1, -1, -1, -1, 114, 115, 116,
1387 117, 118, 3, 4, 5, 6, 7, 8, 9, 10,
1388 11, 12, 13, 14, 15, 16, -1, 18, 19, 20,
1389 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1390 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1391 41, -1, 43, 44, 45, 46, 47, 48, 49, 50,
1392 51, 52, 53, 54, 55, 56, 57, 58, 59, -1,
1393 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1394 -1, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1395 81, 82, -1, -1, 85, 86, -1, -1, -1, -1,
1396 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1397 -1, -1, -1, 104, -1, -1, -1, -1, -1, -1,
1398 -1, -1, -1, 114, 115, 116, 117, 118, 3, 4,
1399 5, 6, 7, 8, 9, 10, 11, 12, 13, -1,
1400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1401 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1402 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1403 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1404 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1405 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1406 75, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1407 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1408 -1, -1, -1, -1, -1, 3, 4, 5, 6, 104,
1409 8, 9, 10, 11, 12, 13, -1, -1, -1, 114,
1410 115, 116, 117, 118, -1, -1, -1, 25, 26, 27,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001411 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001412 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001413 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001414 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001415 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001416 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1417 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001418 -1, 4, 5, 6, -1, -1, 104, 10, 11, 12,
1419 13, -1, -1, -1, -1, -1, -1, 115, 116, 117,
1420 118, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1421 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1422 -1, -1, 45, 46, 47, 48, 49, 50, -1, -1,
1423 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
Alexis Hetua35d8232015-06-11 17:11:06 -04001424 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001425 73, 74, -1, 76, 77, -1, -1, 10, 11, 12,
1426 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1427 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1428 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1429 -1, 114, 45, 46, 47, 48, 49, 50, -1, -1,
1430 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1431 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1432 73, 74, -1, 76, 77, 78, 79, 80, 81, 82,
Alexis Hetua35d8232015-06-11 17:11:06 -04001433 -1, -1, 85, 86, -1, -1, -1, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001434 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001435 -1, 104, -1, -1, 107, 10, 11, 12, 13, -1,
1436 -1, -1, 115, 116, 117, 118, -1, -1, -1, -1,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001437 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1438 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
1439 45, 46, 47, 48, 49, 50, -1, -1, -1, 54,
1440 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1441 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1442 -1, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1443 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1444 -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001445 10, 11, 12, 13, -1, -1, -1, -1, -1, 114,
1446 115, 116, 117, 118, -1, 25, 26, 27, 28, 29,
1447 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1448 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
1449 50, -1, -1, -1, 54, 55, -1, 57, 58, 59,
1450 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1451 70, -1, 72, 73, 74, -1, 76, 77, 78, 79,
1452 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
1453 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1454 -1, -1, -1, -1, 104, -1, -1, 107, 10, 11,
1455 12, 13, -1, -1, -1, 115, 116, 117, 118, -1,
1456 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1457 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
1458 -1, -1, -1, 45, 46, 47, 48, 49, 50, -1,
1459 -1, -1, 54, 55, -1, 57, 58, 59, -1, 61,
1460 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1461 72, 73, 74, -1, 76, 77, 78, 79, 80, 81,
1462 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1463 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1464 -1, -1, 104, 10, 11, 12, 13, -1, -1, -1,
1465 -1, -1, -1, 115, 116, 117, 118, -1, 25, 26,
Alexis Hetub14178b2015-04-13 13:23:20 -04001466 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001467 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
1468 47, 48, 49, 50, -1, -1, -1, 54, 55, -1,
Alexis Hetub14178b2015-04-13 13:23:20 -04001469 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001470 67, 68, 69, 70, -1, 72, 73, 74, -1, 76,
Alexis Hetub14178b2015-04-13 13:23:20 -04001471 77, 78, 79, 80, 81, 82, -1, -1, 85, 86,
1472 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001473 -1, -1, -1, 3, 4, 5, 6, 104, 8, 9,
1474 10, 11, 12, 13, -1, -1, -1, -1, 115, 116,
1475 117, 118, -1, -1, -1, 25, 26, 27, 28, 29,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001476 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1477 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1478 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
1479 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001480 70, -1, 72, 73, 74, 75, -1, 77, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001481 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
1482 5, 6, -1, 8, 9, 10, 11, 12, 13, -1,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001483 -1, -1, -1, -1, -1, -1, -1, -1, -1, 109,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001484 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1485 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1486 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1487 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1488 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
Alexis Hetua35d8232015-06-11 17:11:06 -04001489 75, -1, 77, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001490 -1, -1, -1, 3, 4, 5, 6, -1, 8, 9,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001491 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001492 -1, -1, -1, -1, 109, 25, 26, 27, 28, 29,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001493 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1494 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1495 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
1496 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001497 70, -1, 72, 73, 74, 75, -1, 77, -1, -1,
1498 -1, -1, -1, -1, -1, 0, -1, -1, 3, 4,
Alexis Hetua35d8232015-06-11 17:11:06 -04001499 5, 6, 7, 8, 9, 10, 11, 12, 13, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001500 -1, -1, -1, -1, -1, -1, -1, -1, -1, 109,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001501 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1502 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1503 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1504 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1505 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001506 75, -1, 77, 3, 4, 5, 6, 7, 8, 9,
Alexis Hetua35d8232015-06-11 17:11:06 -04001507 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
1508 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
1509 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1510 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1511 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
1512 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001513 70, -1, 72, 73, 74, 75, -1, 77, 3, 4,
1514 5, 6, -1, 8, 9, 10, 11, 12, 13, -1,
1515 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1516 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1517 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1518 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1519 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1520 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1521 75, -1, 77, 4, 5, 6, -1, -1, -1, 10,
1522 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
1523 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
1524 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1525 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1526 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1527 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1528 -1, 72, 73, 74, -1, -1, 77, 10, 11, 12,
1529 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1530 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1531 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1532 -1, -1, 45, 46, 47, 48, 49, 50, -1, -1,
1533 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1534 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1535 73, 74, -1, 76, 77, 10, 11, 12, 13, 82,
1536 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1537 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1538 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
1539 45, 46, 47, 48, 49, 50, -1, -1, -1, 54,
1540 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1541 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1542 -1, -1, 77
John Bauman66b8ab22014-05-06 15:57:45 -04001543};
1544
1545/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1546 symbol of state STATE-NUM. */
1547static const yytype_uint8 yystos[] =
1548{
1549 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Nicolas Capens3c20f802015-02-17 17:17:20 -05001550 12, 13, 25, 26, 27, 28, 29, 30, 31, 32,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05001551 33, 34, 35, 36, 37, 38, 39, 40, 41, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001552 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1553 54, 55, 57, 58, 59, 61, 62, 63, 64, 65,
1554 66, 67, 68, 69, 70, 72, 73, 74, 75, 77,
Alexis Hetua35d8232015-06-11 17:11:06 -04001555 159, 160, 161, 162, 163, 168, 169, 170, 171, 173,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001556 174, 175, 176, 177, 180, 181, 182, 217, 218, 219,
1557 44, 76, 176, 40, 41, 76, 108, 104, 114, 220,
Alexis Hetua35d8232015-06-11 17:11:06 -04001558 105, 111, 9, 40, 41, 42, 165, 166, 172, 111,
1559 114, 76, 174, 76, 114, 158, 175, 180, 174, 106,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001560 0, 218, 180, 108, 184, 76, 178, 179, 108, 200,
Alexis Hetua35d8232015-06-11 17:11:06 -04001561 165, 164, 167, 175, 166, 76, 104, 106, 113, 108,
1562 3, 173, 175, 185, 186, 76, 78, 79, 80, 81,
1563 82, 85, 86, 104, 115, 116, 117, 118, 129, 130,
1564 131, 133, 134, 135, 136, 137, 138, 139, 140, 141,
1565 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
1566 152, 153, 157, 181, 114, 183, 185, 113, 105, 111,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001567 14, 15, 16, 18, 19, 20, 21, 22, 23, 24,
1568 56, 108, 109, 114, 140, 153, 154, 156, 159, 160,
1569 181, 190, 191, 192, 193, 201, 202, 203, 205, 207,
1570 209, 216, 76, 164, 167, 106, 113, 107, 157, 154,
1571 189, 175, 76, 187, 188, 109, 186, 140, 140, 156,
1572 85, 86, 106, 110, 105, 105, 111, 55, 154, 104,
1573 140, 119, 120, 121, 116, 118, 83, 84, 87, 88,
1574 122, 123, 89, 90, 126, 125, 124, 91, 93, 92,
1575 127, 107, 185, 109, 79, 80, 179, 114, 114, 211,
1576 104, 104, 114, 114, 156, 104, 157, 112, 104, 109,
1577 194, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1578 103, 113, 155, 111, 114, 109, 191, 106, 107, 157,
1579 189, 113, 107, 187, 106, 111, 114, 76, 114, 105,
1580 132, 156, 76, 82, 135, 154, 140, 140, 140, 142,
1581 142, 143, 143, 144, 144, 144, 144, 145, 145, 146,
1582 147, 148, 149, 150, 151, 156, 109, 197, 198, 199,
1583 212, 156, 114, 156, 112, 210, 201, 154, 154, 157,
Alexis Hetua35d8232015-06-11 17:11:06 -04001584 113, 107, 189, 113, 114, 157, 188, 106, 114, 107,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001585 112, 56, 200, 192, 190, 202, 213, 105, 105, 156,
1586 170, 173, 208, 195, 107, 189, 113, 189, 107, 157,
1587 154, 104, 208, 214, 215, 197, 204, 206, 76, 105,
1588 109, 189, 107, 156, 114, 105, 17, 193, 113, 192,
1589 196, 200, 114, 105, 156, 196, 197, 189, 114
John Bauman66b8ab22014-05-06 15:57:45 -04001590};
1591
1592#define yyerrok (yyerrstatus = 0)
1593#define yyclearin (yychar = YYEMPTY)
1594#define YYEMPTY (-2)
1595#define YYEOF 0
1596
1597#define YYACCEPT goto yyacceptlab
1598#define YYABORT goto yyabortlab
1599#define YYERROR goto yyerrorlab
1600
1601
1602/* Like YYERROR except do call yyerror. This remains here temporarily
1603 to ease the transition to the new meaning of YYERROR, for GCC.
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001604 Once GCC version 2 has supplanted version 1, this can go. */
John Bauman66b8ab22014-05-06 15:57:45 -04001605
1606#define YYFAIL goto yyerrlab
John Bauman66b8ab22014-05-06 15:57:45 -04001607
1608#define YYRECOVERING() (!!yyerrstatus)
1609
1610#define YYBACKUP(Token, Value) \
1611do \
1612 if (yychar == YYEMPTY && yylen == 1) \
1613 { \
1614 yychar = (Token); \
1615 yylval = (Value); \
1616 yytoken = YYTRANSLATE (yychar); \
1617 YYPOPSTACK (1); \
1618 goto yybackup; \
1619 } \
1620 else \
1621 { \
1622 yyerror (context, YY_("syntax error: cannot back up")); \
1623 YYERROR; \
1624 } \
1625while (YYID (0))
1626
1627
1628#define YYTERROR 1
1629#define YYERRCODE 256
1630
1631
1632/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1633 If N is 0, then set CURRENT to the empty location which ends
1634 the previous symbol: RHS[0] (always defined). */
1635
1636#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1637#ifndef YYLLOC_DEFAULT
1638# define YYLLOC_DEFAULT(Current, Rhs, N) \
1639 do \
1640 if (YYID (N)) \
1641 { \
1642 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1643 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1644 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1645 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1646 } \
1647 else \
1648 { \
1649 (Current).first_line = (Current).last_line = \
1650 YYRHSLOC (Rhs, 0).last_line; \
1651 (Current).first_column = (Current).last_column = \
1652 YYRHSLOC (Rhs, 0).last_column; \
1653 } \
1654 while (YYID (0))
1655#endif
1656
1657
1658/* YY_LOCATION_PRINT -- Print the location on the stream.
1659 This macro was not mandated originally: define only if we know
1660 we won't break user code: when these are the locations we know. */
1661
1662#ifndef YY_LOCATION_PRINT
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001663# if YYLTYPE_IS_TRIVIAL
John Bauman66b8ab22014-05-06 15:57:45 -04001664# define YY_LOCATION_PRINT(File, Loc) \
1665 fprintf (File, "%d.%d-%d.%d", \
1666 (Loc).first_line, (Loc).first_column, \
1667 (Loc).last_line, (Loc).last_column)
1668# else
1669# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1670# endif
1671#endif
1672
1673
1674/* YYLEX -- calling `yylex' with the right arguments. */
1675
1676#ifdef YYLEX_PARAM
1677# define YYLEX yylex (&yylval, YYLEX_PARAM)
1678#else
1679# define YYLEX yylex (&yylval)
1680#endif
1681
1682/* Enable debugging if requested. */
1683#if YYDEBUG
1684
1685# ifndef YYFPRINTF
1686# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1687# define YYFPRINTF fprintf
1688# endif
1689
1690# define YYDPRINTF(Args) \
1691do { \
1692 if (yydebug) \
1693 YYFPRINTF Args; \
1694} while (YYID (0))
1695
1696# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1697do { \
1698 if (yydebug) \
1699 { \
1700 YYFPRINTF (stderr, "%s ", Title); \
1701 yy_symbol_print (stderr, \
1702 Type, Value, context); \
1703 YYFPRINTF (stderr, "\n"); \
1704 } \
1705} while (YYID (0))
1706
1707
1708/*--------------------------------.
1709| Print this symbol on YYOUTPUT. |
1710`--------------------------------*/
1711
1712/*ARGSUSED*/
1713#if (defined __STDC__ || defined __C99__FUNC__ \
1714 || defined __cplusplus || defined _MSC_VER)
1715static void
1716yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1717#else
1718static void
1719yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1720 FILE *yyoutput;
1721 int yytype;
1722 YYSTYPE const * const yyvaluep;
1723 TParseContext* context;
1724#endif
1725{
1726 if (!yyvaluep)
1727 return;
1728 YYUSE (context);
1729# ifdef YYPRINT
1730 if (yytype < YYNTOKENS)
1731 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1732# else
1733 YYUSE (yyoutput);
1734# endif
1735 switch (yytype)
1736 {
1737 default:
1738 break;
1739 }
1740}
1741
1742
1743/*--------------------------------.
1744| Print this symbol on YYOUTPUT. |
1745`--------------------------------*/
1746
1747#if (defined __STDC__ || defined __C99__FUNC__ \
1748 || defined __cplusplus || defined _MSC_VER)
1749static void
1750yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1751#else
1752static void
1753yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1754 FILE *yyoutput;
1755 int yytype;
1756 YYSTYPE const * const yyvaluep;
1757 TParseContext* context;
1758#endif
1759{
1760 if (yytype < YYNTOKENS)
1761 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1762 else
1763 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1764
1765 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1766 YYFPRINTF (yyoutput, ")");
1767}
1768
1769/*------------------------------------------------------------------.
1770| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1771| TOP (included). |
1772`------------------------------------------------------------------*/
1773
1774#if (defined __STDC__ || defined __C99__FUNC__ \
1775 || defined __cplusplus || defined _MSC_VER)
1776static void
1777yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1778#else
1779static void
1780yy_stack_print (yybottom, yytop)
1781 yytype_int16 *yybottom;
1782 yytype_int16 *yytop;
1783#endif
1784{
1785 YYFPRINTF (stderr, "Stack now");
1786 for (; yybottom <= yytop; yybottom++)
1787 {
1788 int yybot = *yybottom;
1789 YYFPRINTF (stderr, " %d", yybot);
1790 }
1791 YYFPRINTF (stderr, "\n");
1792}
1793
1794# define YY_STACK_PRINT(Bottom, Top) \
1795do { \
1796 if (yydebug) \
1797 yy_stack_print ((Bottom), (Top)); \
1798} while (YYID (0))
1799
1800
1801/*------------------------------------------------.
1802| Report that the YYRULE is going to be reduced. |
1803`------------------------------------------------*/
1804
1805#if (defined __STDC__ || defined __C99__FUNC__ \
1806 || defined __cplusplus || defined _MSC_VER)
1807static void
1808yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1809#else
1810static void
1811yy_reduce_print (yyvsp, yyrule, context)
1812 YYSTYPE *yyvsp;
1813 int yyrule;
1814 TParseContext* context;
1815#endif
1816{
1817 int yynrhs = yyr2[yyrule];
1818 int yyi;
1819 unsigned long int yylno = yyrline[yyrule];
1820 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1821 yyrule - 1, yylno);
1822 /* The symbols being reduced. */
1823 for (yyi = 0; yyi < yynrhs; yyi++)
1824 {
1825 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1826 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1827 &(yyvsp[(yyi + 1) - (yynrhs)])
1828 , context);
1829 YYFPRINTF (stderr, "\n");
1830 }
1831}
1832
1833# define YY_REDUCE_PRINT(Rule) \
1834do { \
1835 if (yydebug) \
1836 yy_reduce_print (yyvsp, Rule, context); \
1837} while (YYID (0))
1838
1839/* Nonzero means print parse trace. It is left uninitialized so that
1840 multiple parsers can coexist. */
1841int yydebug;
1842#else /* !YYDEBUG */
1843# define YYDPRINTF(Args)
1844# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1845# define YY_STACK_PRINT(Bottom, Top)
1846# define YY_REDUCE_PRINT(Rule)
1847#endif /* !YYDEBUG */
1848
1849
1850/* YYINITDEPTH -- initial size of the parser's stacks. */
1851#ifndef YYINITDEPTH
1852# define YYINITDEPTH 200
1853#endif
1854
1855/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1856 if the built-in stack extension method is used).
1857
1858 Do not make this value too large; the results are undefined if
1859 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1860 evaluated with infinite-precision integer arithmetic. */
1861
1862#ifndef YYMAXDEPTH
1863# define YYMAXDEPTH 10000
1864#endif
1865
1866
1867
1868#if YYERROR_VERBOSE
1869
1870# ifndef yystrlen
1871# if defined __GLIBC__ && defined _STRING_H
1872# define yystrlen strlen
1873# else
1874/* Return the length of YYSTR. */
1875#if (defined __STDC__ || defined __C99__FUNC__ \
1876 || defined __cplusplus || defined _MSC_VER)
1877static YYSIZE_T
1878yystrlen (const char *yystr)
1879#else
1880static YYSIZE_T
1881yystrlen (yystr)
1882 const char *yystr;
1883#endif
1884{
1885 YYSIZE_T yylen;
1886 for (yylen = 0; yystr[yylen]; yylen++)
1887 continue;
1888 return yylen;
1889}
1890# endif
1891# endif
1892
1893# ifndef yystpcpy
1894# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1895# define yystpcpy stpcpy
1896# else
1897/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1898 YYDEST. */
1899#if (defined __STDC__ || defined __C99__FUNC__ \
1900 || defined __cplusplus || defined _MSC_VER)
1901static char *
1902yystpcpy (char *yydest, const char *yysrc)
1903#else
1904static char *
1905yystpcpy (yydest, yysrc)
1906 char *yydest;
1907 const char *yysrc;
1908#endif
1909{
1910 char *yyd = yydest;
1911 const char *yys = yysrc;
1912
1913 while ((*yyd++ = *yys++) != '\0')
1914 continue;
1915
1916 return yyd - 1;
1917}
1918# endif
1919# endif
1920
1921# ifndef yytnamerr
1922/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1923 quotes and backslashes, so that it's suitable for yyerror. The
1924 heuristic is that double-quoting is unnecessary unless the string
1925 contains an apostrophe, a comma, or backslash (other than
1926 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1927 null, do not copy; instead, return the length of what the result
1928 would have been. */
1929static YYSIZE_T
1930yytnamerr (char *yyres, const char *yystr)
1931{
1932 if (*yystr == '"')
1933 {
1934 YYSIZE_T yyn = 0;
1935 char const *yyp = yystr;
1936
1937 for (;;)
1938 switch (*++yyp)
1939 {
1940 case '\'':
1941 case ',':
1942 goto do_not_strip_quotes;
1943
1944 case '\\':
1945 if (*++yyp != '\\')
1946 goto do_not_strip_quotes;
1947 /* Fall through. */
1948 default:
1949 if (yyres)
1950 yyres[yyn] = *yyp;
1951 yyn++;
1952 break;
1953
1954 case '"':
1955 if (yyres)
1956 yyres[yyn] = '\0';
1957 return yyn;
1958 }
1959 do_not_strip_quotes: ;
1960 }
1961
1962 if (! yyres)
1963 return yystrlen (yystr);
1964
1965 return yystpcpy (yyres, yystr) - yyres;
1966}
1967# endif
1968
1969/* Copy into YYRESULT an error message about the unexpected token
1970 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1971 including the terminating null byte. If YYRESULT is null, do not
1972 copy anything; just return the number of bytes that would be
1973 copied. As a special case, return 0 if an ordinary "syntax error"
1974 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1975 size calculation. */
1976static YYSIZE_T
1977yysyntax_error (char *yyresult, int yystate, int yychar)
1978{
1979 int yyn = yypact[yystate];
1980
1981 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1982 return 0;
1983 else
1984 {
1985 int yytype = YYTRANSLATE (yychar);
1986 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1987 YYSIZE_T yysize = yysize0;
1988 YYSIZE_T yysize1;
1989 int yysize_overflow = 0;
1990 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1991 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1992 int yyx;
1993
1994# if 0
1995 /* This is so xgettext sees the translatable formats that are
1996 constructed on the fly. */
1997 YY_("syntax error, unexpected %s");
1998 YY_("syntax error, unexpected %s, expecting %s");
1999 YY_("syntax error, unexpected %s, expecting %s or %s");
2000 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2001 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2002# endif
2003 char *yyfmt;
2004 char const *yyf;
2005 static char const yyunexpected[] = "syntax error, unexpected %s";
2006 static char const yyexpecting[] = ", expecting %s";
2007 static char const yyor[] = " or %s";
2008 char yyformat[sizeof yyunexpected
2009 + sizeof yyexpecting - 1
2010 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2011 * (sizeof yyor - 1))];
2012 char const *yyprefix = yyexpecting;
2013
2014 /* Start YYX at -YYN if negative to avoid negative indexes in
2015 YYCHECK. */
2016 int yyxbegin = yyn < 0 ? -yyn : 0;
2017
2018 /* Stay within bounds of both yycheck and yytname. */
2019 int yychecklim = YYLAST - yyn + 1;
2020 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2021 int yycount = 1;
2022
2023 yyarg[0] = yytname[yytype];
2024 yyfmt = yystpcpy (yyformat, yyunexpected);
2025
2026 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2027 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2028 {
2029 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2030 {
2031 yycount = 1;
2032 yysize = yysize0;
2033 yyformat[sizeof yyunexpected - 1] = '\0';
2034 break;
2035 }
2036 yyarg[yycount++] = yytname[yyx];
2037 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2038 yysize_overflow |= (yysize1 < yysize);
2039 yysize = yysize1;
2040 yyfmt = yystpcpy (yyfmt, yyprefix);
2041 yyprefix = yyor;
2042 }
2043
2044 yyf = YY_(yyformat);
2045 yysize1 = yysize + yystrlen (yyf);
2046 yysize_overflow |= (yysize1 < yysize);
2047 yysize = yysize1;
2048
2049 if (yysize_overflow)
2050 return YYSIZE_MAXIMUM;
2051
2052 if (yyresult)
2053 {
2054 /* Avoid sprintf, as that infringes on the user's name space.
2055 Don't have undefined behavior even if the translation
2056 produced a string with the wrong number of "%s"s. */
2057 char *yyp = yyresult;
2058 int yyi = 0;
2059 while ((*yyp = *yyf) != '\0')
2060 {
2061 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2062 {
2063 yyp += yytnamerr (yyp, yyarg[yyi++]);
2064 yyf += 2;
2065 }
2066 else
2067 {
2068 yyp++;
2069 yyf++;
2070 }
2071 }
2072 }
2073 return yysize;
2074 }
2075}
2076#endif /* YYERROR_VERBOSE */
2077
2078
2079/*-----------------------------------------------.
2080| Release the memory associated to this symbol. |
2081`-----------------------------------------------*/
2082
2083/*ARGSUSED*/
2084#if (defined __STDC__ || defined __C99__FUNC__ \
2085 || defined __cplusplus || defined _MSC_VER)
2086static void
2087yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
2088#else
2089static void
2090yydestruct (yymsg, yytype, yyvaluep, context)
2091 const char *yymsg;
2092 int yytype;
2093 YYSTYPE *yyvaluep;
2094 TParseContext* context;
2095#endif
2096{
2097 YYUSE (yyvaluep);
2098 YYUSE (context);
2099
2100 if (!yymsg)
2101 yymsg = "Deleting";
2102 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2103
2104 switch (yytype)
2105 {
2106
2107 default:
2108 break;
2109 }
2110}
2111
2112/* Prevent warnings from -Wmissing-prototypes. */
2113#ifdef YYPARSE_PARAM
2114#if defined __STDC__ || defined __cplusplus
2115int yyparse (void *YYPARSE_PARAM);
2116#else
2117int yyparse ();
2118#endif
2119#else /* ! YYPARSE_PARAM */
2120#if defined __STDC__ || defined __cplusplus
2121int yyparse (TParseContext* context);
2122#else
2123int yyparse ();
2124#endif
2125#endif /* ! YYPARSE_PARAM */
2126
2127
2128
2129
2130
2131/*-------------------------.
2132| yyparse or yypush_parse. |
2133`-------------------------*/
2134
2135#ifdef YYPARSE_PARAM
2136#if (defined __STDC__ || defined __C99__FUNC__ \
2137 || defined __cplusplus || defined _MSC_VER)
2138int
2139yyparse (void *YYPARSE_PARAM)
2140#else
2141int
2142yyparse (YYPARSE_PARAM)
2143 void *YYPARSE_PARAM;
2144#endif
2145#else /* ! YYPARSE_PARAM */
2146#if (defined __STDC__ || defined __C99__FUNC__ \
2147 || defined __cplusplus || defined _MSC_VER)
2148int
2149yyparse (TParseContext* context)
2150#else
2151int
2152yyparse (context)
2153 TParseContext* context;
2154#endif
2155#endif
2156{
2157/* The lookahead symbol. */
2158int yychar;
2159
2160/* The semantic value of the lookahead symbol. */
2161YYSTYPE yylval;
2162
2163 /* Number of syntax errors so far. */
2164 int yynerrs;
2165
2166 int yystate;
2167 /* Number of tokens to shift before error messages enabled. */
2168 int yyerrstatus;
2169
2170 /* The stacks and their tools:
2171 `yyss': related to states.
2172 `yyvs': related to semantic values.
2173
2174 Refer to the stacks thru separate pointers, to allow yyoverflow
2175 to reallocate them elsewhere. */
2176
2177 /* The state stack. */
2178 yytype_int16 yyssa[YYINITDEPTH];
2179 yytype_int16 *yyss;
2180 yytype_int16 *yyssp;
2181
2182 /* The semantic value stack. */
2183 YYSTYPE yyvsa[YYINITDEPTH];
2184 YYSTYPE *yyvs;
2185 YYSTYPE *yyvsp;
2186
2187 YYSIZE_T yystacksize;
2188
2189 int yyn;
2190 int yyresult;
2191 /* Lookahead token as an internal (translated) token number. */
2192 int yytoken;
2193 /* The variables used to return semantic value and location from the
2194 action routines. */
2195 YYSTYPE yyval;
2196
2197#if YYERROR_VERBOSE
2198 /* Buffer for error messages, and its allocated size. */
2199 char yymsgbuf[128];
2200 char *yymsg = yymsgbuf;
2201 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2202#endif
2203
2204#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2205
2206 /* The number of symbols on the RHS of the reduced rule.
2207 Keep to zero when no symbol should be popped. */
2208 int yylen = 0;
2209
2210 yytoken = 0;
2211 yyss = yyssa;
2212 yyvs = yyvsa;
2213 yystacksize = YYINITDEPTH;
2214
2215 YYDPRINTF ((stderr, "Starting parse\n"));
2216
2217 yystate = 0;
2218 yyerrstatus = 0;
2219 yynerrs = 0;
2220 yychar = YYEMPTY; /* Cause a token to be read. */
2221
2222 /* Initialize stack pointers.
2223 Waste one element of value and location stack
2224 so that they stay on the same level as the state stack.
2225 The wasted elements are never initialized. */
2226 yyssp = yyss;
2227 yyvsp = yyvs;
2228
2229 goto yysetstate;
2230
2231/*------------------------------------------------------------.
2232| yynewstate -- Push a new state, which is found in yystate. |
2233`------------------------------------------------------------*/
2234 yynewstate:
2235 /* In all cases, when you get here, the value and location stacks
2236 have just been pushed. So pushing a state here evens the stacks. */
2237 yyssp++;
2238
2239 yysetstate:
2240 *yyssp = yystate;
2241
2242 if (yyss + yystacksize - 1 <= yyssp)
2243 {
2244 /* Get the current used size of the three stacks, in elements. */
2245 YYSIZE_T yysize = yyssp - yyss + 1;
2246
2247#ifdef yyoverflow
2248 {
2249 /* Give user a chance to reallocate the stack. Use copies of
2250 these so that the &'s don't force the real ones into
2251 memory. */
2252 YYSTYPE *yyvs1 = yyvs;
2253 yytype_int16 *yyss1 = yyss;
2254
2255 /* Each stack pointer address is followed by the size of the
2256 data in use in that stack, in bytes. This used to be a
2257 conditional around just the two extra args, but that might
2258 be undefined if yyoverflow is a macro. */
2259 yyoverflow (YY_("memory exhausted"),
2260 &yyss1, yysize * sizeof (*yyssp),
2261 &yyvs1, yysize * sizeof (*yyvsp),
2262 &yystacksize);
2263
2264 yyss = yyss1;
2265 yyvs = yyvs1;
2266 }
2267#else /* no yyoverflow */
2268# ifndef YYSTACK_RELOCATE
2269 goto yyexhaustedlab;
2270# else
2271 /* Extend the stack our own way. */
2272 if (YYMAXDEPTH <= yystacksize)
2273 goto yyexhaustedlab;
2274 yystacksize *= 2;
2275 if (YYMAXDEPTH < yystacksize)
2276 yystacksize = YYMAXDEPTH;
2277
2278 {
2279 yytype_int16 *yyss1 = yyss;
2280 union yyalloc *yyptr =
2281 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2282 if (! yyptr)
2283 goto yyexhaustedlab;
2284 YYSTACK_RELOCATE (yyss_alloc, yyss);
2285 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2286# undef YYSTACK_RELOCATE
2287 if (yyss1 != yyssa)
2288 YYSTACK_FREE (yyss1);
2289 }
2290# endif
2291#endif /* no yyoverflow */
2292
2293 yyssp = yyss + yysize - 1;
2294 yyvsp = yyvs + yysize - 1;
2295
2296 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2297 (unsigned long int) yystacksize));
2298
2299 if (yyss + yystacksize - 1 <= yyssp)
2300 YYABORT;
2301 }
2302
2303 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2304
2305 if (yystate == YYFINAL)
2306 YYACCEPT;
2307
2308 goto yybackup;
2309
2310/*-----------.
2311| yybackup. |
2312`-----------*/
2313yybackup:
2314
2315 /* Do appropriate processing given the current state. Read a
2316 lookahead token if we need one and don't already have one. */
2317
2318 /* First try to decide what to do without reference to lookahead token. */
2319 yyn = yypact[yystate];
2320 if (yyn == YYPACT_NINF)
2321 goto yydefault;
2322
2323 /* Not known => get a lookahead token if don't already have one. */
2324
2325 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2326 if (yychar == YYEMPTY)
2327 {
2328 YYDPRINTF ((stderr, "Reading a token: "));
2329 yychar = YYLEX;
2330 }
2331
2332 if (yychar <= YYEOF)
2333 {
2334 yychar = yytoken = YYEOF;
2335 YYDPRINTF ((stderr, "Now at end of input.\n"));
2336 }
2337 else
2338 {
2339 yytoken = YYTRANSLATE (yychar);
2340 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2341 }
2342
2343 /* If the proper action on seeing token YYTOKEN is to reduce or to
2344 detect an error, take that action. */
2345 yyn += yytoken;
2346 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2347 goto yydefault;
2348 yyn = yytable[yyn];
2349 if (yyn <= 0)
2350 {
2351 if (yyn == 0 || yyn == YYTABLE_NINF)
2352 goto yyerrlab;
2353 yyn = -yyn;
2354 goto yyreduce;
2355 }
2356
2357 /* Count tokens shifted since error; after three, turn off error
2358 status. */
2359 if (yyerrstatus)
2360 yyerrstatus--;
2361
2362 /* Shift the lookahead token. */
2363 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2364
2365 /* Discard the shifted token. */
2366 yychar = YYEMPTY;
2367
2368 yystate = yyn;
2369 *++yyvsp = yylval;
2370
2371 goto yynewstate;
2372
2373
2374/*-----------------------------------------------------------.
2375| yydefault -- do the default action for the current state. |
2376`-----------------------------------------------------------*/
2377yydefault:
2378 yyn = yydefact[yystate];
2379 if (yyn == 0)
2380 goto yyerrlab;
2381 goto yyreduce;
2382
2383
2384/*-----------------------------.
2385| yyreduce -- Do a reduction. |
2386`-----------------------------*/
2387yyreduce:
2388 /* yyn is the number of a rule to reduce with. */
2389 yylen = yyr2[yyn];
2390
2391 /* If YYLEN is nonzero, implement the default value of the action:
2392 `$$ = $1'.
2393
2394 Otherwise, the following line sets YYVAL to garbage.
2395 This behavior is undocumented and Bison
2396 users should not rely upon it. Assigning to YYVAL
2397 unconditionally makes the parser a bit smaller, and it avoids a
2398 GCC warning that YYVAL may be used uninitialized. */
2399 yyval = yyvsp[1-yylen];
2400
2401
2402 YY_REDUCE_PRINT (yyn);
2403 switch (yyn)
2404 {
2405 case 2:
2406
2407 {
2408 // The symbol table search was done in the lexical phase
2409 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2410 const TVariable* variable;
2411 if (symbol == 0) {
2412 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
2413 context->recover();
2414 TType type(EbtFloat, EbpUndefined);
2415 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05002416 context->symbolTable.declare(*fakeVariable);
John Bauman66b8ab22014-05-06 15:57:45 -04002417 variable = fakeVariable;
2418 } else {
2419 // This identifier can only be a variable type symbol
2420 if (! symbol->isVariable()) {
2421 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
2422 context->recover();
2423 }
2424 variable = static_cast<const TVariable*>(symbol);
2425 }
2426
2427 // don't delete $1.string, it's used by error recovery, and the pool
2428 // pop will reclaim the memory
2429
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002430 if (variable->getType().getQualifier() == EvqConstExpr ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002431 ConstantUnion* constArray = variable->getConstPointer();
2432 TType t(variable->getType());
2433 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2434 } else
2435 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2436 variable->getName(),
2437 variable->getType(), (yyvsp[(1) - (1)].lex).line);
2438 }
2439 break;
2440
2441 case 3:
2442
2443 {
2444 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2445 }
2446 break;
2447
2448 case 4:
2449
2450 {
John Bauman66b8ab22014-05-06 15:57:45 -04002451 ConstantUnion *unionArray = new ConstantUnion[1];
2452 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002453 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002454 }
2455 break;
2456
2457 case 5:
2458
2459 {
2460 ConstantUnion *unionArray = new ConstantUnion[1];
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002461 unionArray->setUConst((yyvsp[(1) - (1)].lex).u);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002462 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002463 }
2464 break;
2465
2466 case 6:
2467
2468 {
2469 ConstantUnion *unionArray = new ConstantUnion[1];
John Bauman66b8ab22014-05-06 15:57:45 -04002470 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002471 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002472 }
2473 break;
2474
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002475 case 7:
John Bauman66b8ab22014-05-06 15:57:45 -04002476
2477 {
2478 ConstantUnion *unionArray = new ConstantUnion[1];
2479 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002480 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002481 }
2482 break;
2483
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002484 case 8:
John Bauman66b8ab22014-05-06 15:57:45 -04002485
2486 {
2487 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
2488 }
2489 break;
2490
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002491 case 9:
John Bauman66b8ab22014-05-06 15:57:45 -04002492
2493 {
2494 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2495 }
2496 break;
2497
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002498 case 10:
John Bauman66b8ab22014-05-06 15:57:45 -04002499
2500 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04002501 (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04002502 }
2503 break;
2504
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002505 case 11:
John Bauman66b8ab22014-05-06 15:57:45 -04002506
2507 {
2508 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2509 }
2510 break;
2511
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002512 case 12:
John Bauman66b8ab22014-05-06 15:57:45 -04002513
2514 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04002515 (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002516 }
2517 break;
2518
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002519 case 13:
John Bauman66b8ab22014-05-06 15:57:45 -04002520
2521 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04002522 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002523 }
2524 break;
2525
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002526 case 14:
John Bauman66b8ab22014-05-06 15:57:45 -04002527
2528 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04002529 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002530 }
2531 break;
2532
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002533 case 15:
John Bauman66b8ab22014-05-06 15:57:45 -04002534
2535 {
2536 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2537 context->recover();
2538 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2539 }
2540 break;
2541
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002542 case 16:
John Bauman66b8ab22014-05-06 15:57:45 -04002543
2544 {
2545 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2546 TOperator op = fnCall->getBuiltInOp();
2547
2548 if (op != EOpNull)
2549 {
2550 //
2551 // Then this should be a constructor.
2552 // Don't go through the symbol table for constructors.
2553 // Their parameters will be verified algorithmically.
2554 //
2555 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2556 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2557 (yyval.interm.intermTypedNode) = 0;
2558 } else {
2559 //
2560 // It's a constructor, of type 'type'.
2561 //
2562 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2563 }
2564
2565 if ((yyval.interm.intermTypedNode) == 0) {
2566 context->recover();
2567 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2568 }
2569 (yyval.interm.intermTypedNode)->setType(type);
2570 } else {
2571 //
2572 // Not a constructor. Find it in the symbol table.
2573 //
2574 const TFunction* fnCandidate;
2575 bool builtIn;
2576 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn);
2577 if (fnCandidate) {
2578 //
2579 // A declared function.
2580 //
2581 if (builtIn && !fnCandidate->getExtension().empty() &&
2582 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2583 context->recover();
2584 }
2585 op = fnCandidate->getBuiltInOp();
2586 if (builtIn && op != EOpNull) {
2587 //
2588 // A function call mapped to a built-in operation.
2589 //
2590 if (fnCandidate->getParamCount() == 1) {
2591 //
2592 // Treat it like a built-in unary operator.
2593 //
John Baumand4ae8632014-05-06 16:18:33 -04002594 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0);
John Bauman66b8ab22014-05-06 15:57:45 -04002595 if ((yyval.interm.intermTypedNode) == 0) {
2596 std::stringstream extraInfoStream;
2597 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2598 std::string extraInfo = extraInfoStream.str();
2599 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
2600 YYERROR;
2601 }
2602 } else {
2603 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2604 }
2605 } else {
2606 // This is a real function call
2607
2608 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2609 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2610
2611 // this is how we know whether the given function is a builtIn function or a user defined function
2612 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2613 // if builtIn == true, it's definitely a builtIn function with EOpNull
2614 if (!builtIn)
2615 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2616 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2617
2618 TQualifier qual;
Alexis Hetu76a343a2015-06-04 17:21:22 -04002619 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04002620 qual = fnCandidate->getParam(i).type->getQualifier();
2621 if (qual == EvqOut || qual == EvqInOut) {
2622 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
2623 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
2624 context->recover();
2625 }
2626 }
2627 }
2628 }
2629 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2630 } else {
2631 // error message was put out by PaFindFunction()
2632 // Put on a dummy node for error recovery
2633 ConstantUnion *unionArray = new ConstantUnion[1];
2634 unionArray->setFConst(0.0f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002635 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002636 context->recover();
2637 }
2638 }
2639 delete fnCall;
2640 }
2641 break;
2642
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002643 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002644
2645 {
2646 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2647 }
2648 break;
2649
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002650 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002651
2652 {
2653 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
2654 context->recover();
2655 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2656 }
2657 break;
2658
John Bauman66b8ab22014-05-06 15:57:45 -04002659 case 19:
2660
2661 {
2662 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2663 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2664 }
2665 break;
2666
2667 case 20:
2668
2669 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002670 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2671 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2672 }
2673 break;
2674
2675 case 21:
2676
2677 {
John Bauman66b8ab22014-05-06 15:57:45 -04002678 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2679 (yyval.interm).intermNode = 0;
2680 }
2681 break;
2682
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002683 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002684
2685 {
2686 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2687 (yyval.interm).intermNode = 0;
2688 }
2689 break;
2690
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002691 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002692
2693 {
2694 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2695 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2696 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2697 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2698 }
2699 break;
2700
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002701 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002702
2703 {
2704 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2705 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2706 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2707 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2708 }
2709 break;
2710
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002711 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002712
2713 {
2714 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2715 }
2716 break;
2717
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002718 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002719
2720 {
2721 //
2722 // Constructor
2723 //
2724 TOperator op = EOpNull;
2725 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2726 op = EOpConstructStruct;
2727 } else {
2728 switch ((yyvsp[(1) - (1)].interm.type).type) {
2729 case EbtFloat:
Alexis Hetub14178b2015-04-13 13:23:20 -04002730 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2731 case 1:
2732 op = EOpConstructFloat; break;
2733 case 2:
2734 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2735 case 1: op = EOpConstructVec2; break;
2736 case 2: op = EOpConstructMat2; break;
2737 case 3: op = EOpConstructMat2x3; break;
2738 case 4: op = EOpConstructMat2x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002739 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002740 break;
2741 case 3:
2742 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2743 case 1: op = EOpConstructVec3; break;
2744 case 2: op = EOpConstructMat3x2; break;
2745 case 3: op = EOpConstructMat3; break;
2746 case 4: op = EOpConstructMat3x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002747 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002748 break;
2749 case 4:
2750 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2751 case 1: op = EOpConstructVec4; break;
2752 case 2: op = EOpConstructMat4x2; break;
2753 case 3: op = EOpConstructMat4x3; break;
2754 case 4: op = EOpConstructMat4; break;
2755 }
2756 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002757 }
2758 break;
2759 case EbtInt:
Alexis Hetub14178b2015-04-13 13:23:20 -04002760 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002761 case 1: op = EOpConstructInt; break;
2762 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2763 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2764 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2765 }
2766 break;
Alexis Hetub7c46af2015-05-12 15:58:09 -04002767 case EbtUInt:
2768 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2769 case 1: op = EOpConstructUInt; break;
2770 case 2: FRAG_VERT_ONLY("uvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec2; break;
2771 case 3: FRAG_VERT_ONLY("uvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec3; break;
2772 case 4: FRAG_VERT_ONLY("uvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec4; break;
2773 }
2774 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002775 case EbtBool:
Alexis Hetub14178b2015-04-13 13:23:20 -04002776 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002777 case 1: op = EOpConstructBool; break;
2778 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2779 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2780 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2781 }
2782 break;
2783 default: break;
2784 }
2785 if (op == EOpNull) {
2786 context->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type));
2787 context->recover();
2788 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2789 op = EOpConstructFloat;
2790 }
2791 }
2792 TString tempString;
2793 TType type((yyvsp[(1) - (1)].interm.type));
2794 TFunction *function = new TFunction(&tempString, type, op);
2795 (yyval.interm.function) = function;
2796 }
2797 break;
2798
John Bauman66b8ab22014-05-06 15:57:45 -04002799 case 27:
2800
2801 {
2802 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2803 context->recover();
2804 TType type(EbtVoid, EbpUndefined);
2805 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2806 (yyval.interm.function) = function;
2807 }
2808 break;
2809
2810 case 28:
2811
2812 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002813 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2814 context->recover();
2815 TType type(EbtVoid, EbpUndefined);
2816 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2817 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002818 }
2819 break;
2820
2821 case 29:
2822
2823 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002824 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2825 }
2826 break;
2827
2828 case 30:
2829
2830 {
John Bauman66b8ab22014-05-06 15:57:45 -04002831 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2832 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002833 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002834 if ((yyval.interm.intermTypedNode) == 0) {
2835 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2836 context->recover();
2837 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2838 }
2839 }
2840 break;
2841
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002842 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002843
2844 {
2845 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2846 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002847 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002848 if ((yyval.interm.intermTypedNode) == 0) {
2849 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2850 context->recover();
2851 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2852 }
2853 }
2854 break;
2855
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002856 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002857
2858 {
2859 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
John Baumand4ae8632014-05-06 16:18:33 -04002860 (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 -04002861 if ((yyval.interm.intermTypedNode) == 0) {
2862 const char* errorOp = "";
2863 switch((yyvsp[(1) - (2)].interm).op) {
2864 case EOpNegative: errorOp = "-"; break;
2865 case EOpLogicalNot: errorOp = "!"; break;
Alexis Hetud061e422015-05-13 16:37:50 -04002866 case EOpBitwiseNot: errorOp = "~"; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002867 default: break;
2868 }
2869 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2870 context->recover();
2871 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2872 }
2873 } else
2874 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2875 }
2876 break;
2877
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002878 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002879
2880 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
2881 break;
2882
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002883 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002884
2885 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
2886 break;
2887
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002888 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002889
2890 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
2891 break;
2892
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002893 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002894
Alexis Hetu17809052015-05-13 11:28:22 -04002895 {
2896 ES3_ONLY("~", (yyvsp[(1) - (1)].lex).line);
2897 (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseNot;
2898 }
John Bauman66b8ab22014-05-06 15:57:45 -04002899 break;
2900
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002901 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002902
Alexis Hetu17809052015-05-13 11:28:22 -04002903 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2904 break;
2905
2906 case 38:
2907
John Bauman66b8ab22014-05-06 15:57:45 -04002908 {
2909 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04002910 (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 -04002911 if ((yyval.interm.intermTypedNode) == 0) {
2912 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2913 context->recover();
2914 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2915 }
2916 }
2917 break;
2918
Alexis Hetu17809052015-05-13 11:28:22 -04002919 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04002920
2921 {
2922 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04002923 (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 -04002924 if ((yyval.interm.intermTypedNode) == 0) {
2925 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2926 context->recover();
2927 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2928 }
2929 }
2930 break;
2931
Alexis Hetu17809052015-05-13 11:28:22 -04002932 case 40:
2933
2934 {
2935 FRAG_VERT_ONLY("%", (yyvsp[(2) - (3)].lex).line);
2936 ES3_ONLY("%", (yyvsp[(2) - (3)].lex).line);
2937 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpIMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2938 if ((yyval.interm.intermTypedNode) == 0) {
2939 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "%", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2940 context->recover();
2941 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2942 }
2943 }
2944 break;
2945
2946 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04002947
2948 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2949 break;
2950
Alexis Hetu17809052015-05-13 11:28:22 -04002951 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04002952
2953 {
John Baumand4ae8632014-05-06 16:18:33 -04002954 (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 -04002955 if ((yyval.interm.intermTypedNode) == 0) {
2956 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2957 context->recover();
2958 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2959 }
2960 }
2961 break;
2962
Alexis Hetu17809052015-05-13 11:28:22 -04002963 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04002964
2965 {
John Baumand4ae8632014-05-06 16:18:33 -04002966 (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 -04002967 if ((yyval.interm.intermTypedNode) == 0) {
2968 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2969 context->recover();
2970 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2971 }
2972 }
2973 break;
2974
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002975 case 44:
2976
Alexis Hetu17809052015-05-13 11:28:22 -04002977 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2978 break;
2979
2980 case 45:
2981
2982 {
2983 ES3_ONLY("<<", (yyvsp[(2) - (3)].lex).line);
2984 context->intermediate.addBinaryMath(EOpBitShiftLeft, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2985 if ((yyval.interm.intermTypedNode) == 0) {
2986 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2987 context->recover();
2988 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2989 }
2990 }
2991 break;
2992
2993 case 46:
2994
2995 {
2996 ES3_ONLY(">>", (yyvsp[(2) - (3)].lex).line);
2997 context->intermediate.addBinaryMath(EOpBitShiftRight, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2998 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
3006 case 47:
3007
3008 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3009 break;
3010
3011 case 48:
3012
John Bauman66b8ab22014-05-06 15:57:45 -04003013 {
John Baumand4ae8632014-05-06 16:18:33 -04003014 (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 -04003015 if ((yyval.interm.intermTypedNode) == 0) {
3016 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3017 context->recover();
3018 ConstantUnion *unionArray = new ConstantUnion[1];
3019 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003020 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003021 }
3022 }
3023 break;
3024
Alexis Hetu17809052015-05-13 11:28:22 -04003025 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04003026
3027 {
John Baumand4ae8632014-05-06 16:18:33 -04003028 (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 -04003029 if ((yyval.interm.intermTypedNode) == 0) {
3030 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3031 context->recover();
3032 ConstantUnion *unionArray = new ConstantUnion[1];
3033 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003034 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003035 }
3036 }
3037 break;
3038
Alexis Hetu17809052015-05-13 11:28:22 -04003039 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04003040
3041 {
John Baumand4ae8632014-05-06 16:18:33 -04003042 (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 -04003043 if ((yyval.interm.intermTypedNode) == 0) {
3044 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3045 context->recover();
3046 ConstantUnion *unionArray = new ConstantUnion[1];
3047 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003048 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003049 }
3050 }
3051 break;
3052
Alexis Hetu17809052015-05-13 11:28:22 -04003053 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04003054
3055 {
John Baumand4ae8632014-05-06 16:18:33 -04003056 (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 -04003057 if ((yyval.interm.intermTypedNode) == 0) {
3058 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3059 context->recover();
3060 ConstantUnion *unionArray = new ConstantUnion[1];
3061 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003062 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003063 }
3064 }
3065 break;
3066
Alexis Hetu17809052015-05-13 11:28:22 -04003067 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04003068
3069 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3070 break;
3071
Alexis Hetu17809052015-05-13 11:28:22 -04003072 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04003073
3074 {
John Baumand4ae8632014-05-06 16:18:33 -04003075 (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 -04003076 if ((yyval.interm.intermTypedNode) == 0) {
3077 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3078 context->recover();
3079 ConstantUnion *unionArray = new ConstantUnion[1];
3080 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003081 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003082 }
3083 }
3084 break;
3085
Alexis Hetu17809052015-05-13 11:28:22 -04003086 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04003087
3088 {
John Baumand4ae8632014-05-06 16:18:33 -04003089 (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 -04003090 if ((yyval.interm.intermTypedNode) == 0) {
3091 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3092 context->recover();
3093 ConstantUnion *unionArray = new ConstantUnion[1];
3094 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003095 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003096 }
3097 }
3098 break;
3099
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003100 case 55:
3101
Alexis Hetu17809052015-05-13 11:28:22 -04003102 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3103 break;
3104
3105 case 56:
3106
3107 {
3108 ES3_ONLY("&", (yyvsp[(2) - (3)].lex).line);
3109 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3110 if ((yyval.interm.intermTypedNode) == 0) {
3111 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3112 context->recover();
3113 ConstantUnion *unionArray = new ConstantUnion[1];
3114 unionArray->setBConst(false);
3115 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3116 }
3117 }
3118 break;
3119
3120 case 57:
3121
3122 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3123 break;
3124
3125 case 58:
3126
3127 {
3128 ES3_ONLY("^", (yyvsp[(2) - (3)].lex).line);
3129 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3130 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);
3135 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3136 }
3137 }
3138 break;
3139
3140 case 59:
3141
3142 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3143 break;
3144
3145 case 60:
3146
3147 {
3148 ES3_ONLY("|", (yyvsp[(2) - (3)].lex).line);
3149 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3150 if ((yyval.interm.intermTypedNode) == 0) {
3151 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "|", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3152 context->recover();
3153 ConstantUnion *unionArray = new ConstantUnion[1];
3154 unionArray->setBConst(false);
3155 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3156 }
3157 }
3158 break;
3159
3160 case 61:
3161
3162 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3163 break;
3164
3165 case 62:
3166
John Bauman66b8ab22014-05-06 15:57:45 -04003167 {
John Baumand4ae8632014-05-06 16:18:33 -04003168 (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 -04003169 if ((yyval.interm.intermTypedNode) == 0) {
3170 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3171 context->recover();
3172 ConstantUnion *unionArray = new ConstantUnion[1];
3173 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003174 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003175 }
3176 }
3177 break;
3178
Alexis Hetu17809052015-05-13 11:28:22 -04003179 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04003180
3181 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3182 break;
3183
Alexis Hetu17809052015-05-13 11:28:22 -04003184 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003185
3186 {
John Baumand4ae8632014-05-06 16:18:33 -04003187 (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 -04003188 if ((yyval.interm.intermTypedNode) == 0) {
3189 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3190 context->recover();
3191 ConstantUnion *unionArray = new ConstantUnion[1];
3192 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003193 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003194 }
3195 }
3196 break;
3197
Alexis Hetu17809052015-05-13 11:28:22 -04003198 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003199
3200 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3201 break;
3202
Alexis Hetu17809052015-05-13 11:28:22 -04003203 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003204
3205 {
John Baumand4ae8632014-05-06 16:18:33 -04003206 (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 -04003207 if ((yyval.interm.intermTypedNode) == 0) {
3208 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3209 context->recover();
3210 ConstantUnion *unionArray = new ConstantUnion[1];
3211 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003212 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003213 }
3214 }
3215 break;
3216
Alexis Hetu17809052015-05-13 11:28:22 -04003217 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003218
3219 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3220 break;
3221
Alexis Hetu17809052015-05-13 11:28:22 -04003222 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003223
3224 {
3225 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3226 context->recover();
3227
3228 (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);
3229 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3230 (yyval.interm.intermTypedNode) = 0;
3231
3232 if ((yyval.interm.intermTypedNode) == 0) {
3233 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3234 context->recover();
3235 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3236 }
3237 }
3238 break;
3239
Alexis Hetu17809052015-05-13 11:28:22 -04003240 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003241
3242 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3243 break;
3244
Alexis Hetu17809052015-05-13 11:28:22 -04003245 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003246
3247 {
3248 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3249 context->recover();
3250 (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);
3251 if ((yyval.interm.intermTypedNode) == 0) {
3252 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3253 context->recover();
3254 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3255 }
3256 }
3257 break;
3258
Alexis Hetu17809052015-05-13 11:28:22 -04003259 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003260
3261 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
3262 break;
3263
Alexis Hetu17809052015-05-13 11:28:22 -04003264 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003265
3266 { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; }
3267 break;
3268
Alexis Hetu17809052015-05-13 11:28:22 -04003269 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003270
3271 { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; }
3272 break;
3273
Alexis Hetu17809052015-05-13 11:28:22 -04003274 case 74:
3275
3276 { ES3_ONLY("%=", (yyvsp[(1) - (1)].lex).line);
3277 FRAG_VERT_ONLY("%=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpIModAssign; }
3278 break;
3279
3280 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003281
3282 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
3283 break;
3284
Alexis Hetu17809052015-05-13 11:28:22 -04003285 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003286
3287 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
3288 break;
3289
Alexis Hetu17809052015-05-13 11:28:22 -04003290 case 77:
3291
3292 { ES3_ONLY("<<=", (yyvsp[(1) - (1)].lex).line);
3293 FRAG_VERT_ONLY("<<=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftLeftAssign; }
3294 break;
3295
3296 case 78:
3297
3298 { ES3_ONLY(">>=", (yyvsp[(1) - (1)].lex).line);
3299 FRAG_VERT_ONLY(">>=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftRightAssign; }
3300 break;
3301
3302 case 79:
3303
3304 { ES3_ONLY("&=", (yyvsp[(1) - (1)].lex).line);
3305 FRAG_VERT_ONLY("&=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseAndAssign; }
3306 break;
3307
3308 case 80:
3309
3310 { ES3_ONLY("^=", (yyvsp[(1) - (1)].lex).line);
3311 FRAG_VERT_ONLY("^=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseXorAssign; }
3312 break;
3313
3314 case 81:
3315
3316 { ES3_ONLY("|=", (yyvsp[(1) - (1)].lex).line);
3317 FRAG_VERT_ONLY("|=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseOrAssign; }
3318 break;
3319
3320 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003321
3322 {
3323 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3324 }
3325 break;
3326
Alexis Hetu17809052015-05-13 11:28:22 -04003327 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003328
3329 {
3330 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3331 if ((yyval.interm.intermTypedNode) == 0) {
3332 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3333 context->recover();
3334 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3335 }
3336 }
3337 break;
3338
Alexis Hetu17809052015-05-13 11:28:22 -04003339 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003340
3341 {
3342 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3343 context->recover();
3344 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3345 }
3346 break;
3347
Alexis Hetu17809052015-05-13 11:28:22 -04003348 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003349
3350 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003351 if (context->enterStructDeclaration((yyvsp[(1) - (2)].lex).line, *(yyvsp[(1) - (2)].lex).string))
3352 context->recover();
3353 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3354 }
3355 break;
3356
3357 case 86:
3358
3359 {
John Bauman66b8ab22014-05-06 15:57:45 -04003360 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3361
3362 TIntermAggregate *prototype = new TIntermAggregate;
3363 prototype->setType(function.getReturnType());
3364 prototype->setName(function.getName());
3365
Alexis Hetu76a343a2015-06-04 17:21:22 -04003366 for (size_t i = 0; i < function.getParamCount(); i++)
John Bauman66b8ab22014-05-06 15:57:45 -04003367 {
3368 const TParameter &param = function.getParam(i);
3369 if (param.name != 0)
3370 {
John Baumand4ae8632014-05-06 16:18:33 -04003371 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003372
John Baumand4ae8632014-05-06 16:18:33 -04003373 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 -04003374 }
3375 else
3376 {
3377 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3378 }
3379 }
3380
3381 prototype->setOp(EOpPrototype);
3382 (yyval.interm.intermNode) = prototype;
3383
3384 context->symbolTable.pop();
3385 }
3386 break;
3387
Alexis Hetua35d8232015-06-11 17:11:06 -04003388 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003389
3390 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003391 TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
3392 if (aggNode && aggNode->getOp() == EOpNull)
3393 aggNode->setOp(EOpDeclaration);
3394 (yyval.interm.intermNode) = aggNode;
John Bauman66b8ab22014-05-06 15:57:45 -04003395 }
3396 break;
3397
Alexis Hetua35d8232015-06-11 17:11:06 -04003398 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003399
3400 {
John Baumand4ae8632014-05-06 16:18:33 -04003401 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3402 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3403 context->recover();
3404 }
John Bauman66b8ab22014-05-06 15:57:45 -04003405 (yyval.interm.intermNode) = 0;
3406 }
3407 break;
3408
Alexis Hetua35d8232015-06-11 17:11:06 -04003409 case 89:
3410
3411 {
3412 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yyvsp[(1) - (5)].interm.type).line);
3413 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (5)].interm.type), (yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].interm.fieldList), NULL, (yyvsp[(1) - (5)].interm.type).line, NULL, (yyvsp[(1) - (5)].interm.type).line);
3414 }
3415 break;
3416
3417 case 90:
3418
3419 {
3420 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yyvsp[(1) - (6)].interm.type).line);
3421 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (6)].interm.type), (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].interm.fieldList), (yyvsp[(5) - (6)].lex).string, (yyvsp[(5) - (6)].lex).line, NULL, (yyvsp[(1) - (6)].interm.type).line);
3422 }
3423 break;
3424
3425 case 91:
3426
3427 {
3428 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yyvsp[(1) - (9)].interm.type).line);
3429 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (9)].interm.type), (yyvsp[(2) - (9)].lex).line, *(yyvsp[(2) - (9)].lex).string, (yyvsp[(3) - (9)].interm.fieldList), (yyvsp[(5) - (9)].lex).string, (yyvsp[(5) - (9)].lex).line, (yyvsp[(7) - (9)].interm.intermTypedNode), (yyvsp[(6) - (9)].lex).line);
3430 }
3431 break;
3432
3433 case 92:
3434
3435 {
3436 context->parseGlobalLayoutQualifier((yyvsp[(1) - (2)].interm.type));
3437 (yyval.interm.intermNode) = 0;
3438 }
3439 break;
3440
3441 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003442
3443 {
3444 //
3445 // Multiple declarations of the same function are allowed.
3446 //
3447 // If this is a definition, the definition production code will check for redefinitions
3448 // (we don't know at this point if it's a definition or not).
3449 //
3450 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3451 //
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05003452 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04003453 if (prevDec) {
3454 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
3455 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
3456 context->recover();
3457 }
Alexis Hetu76a343a2015-06-04 17:21:22 -04003458 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04003459 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
3460 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
3461 context->recover();
3462 }
3463 }
3464 }
3465
3466 //
3467 // If this is a redeclaration, it could also be a definition,
3468 // in which case, we want to use the variable names from this one, and not the one that's
3469 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3470 //
3471 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3472 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3473
3474 // We're at the inner scope level of the function's arguments and body statement.
3475 // Add the function prototype to the surrounding scope instead.
3476 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3477 }
3478 break;
3479
Alexis Hetua35d8232015-06-11 17:11:06 -04003480 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003481
3482 {
3483 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3484 }
3485 break;
3486
Alexis Hetua35d8232015-06-11 17:11:06 -04003487 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003488
3489 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003490 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3491 }
3492 break;
3493
Alexis Hetua35d8232015-06-11 17:11:06 -04003494 case 96:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003495
3496 {
John Bauman66b8ab22014-05-06 15:57:45 -04003497 // Add the parameter
3498 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3499 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3500 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3501 else
3502 delete (yyvsp[(2) - (2)].interm).param.type;
3503 }
3504 break;
3505
Alexis Hetua35d8232015-06-11 17:11:06 -04003506 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003507
3508 {
3509 //
3510 // Only first parameter of one-parameter functions can be void
3511 // The check for named parameters not being void is done in parameter_declarator
3512 //
3513 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3514 //
3515 // This parameter > first is void
3516 //
3517 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
3518 context->recover();
3519 delete (yyvsp[(3) - (3)].interm).param.type;
3520 } else {
3521 // Add the parameter
3522 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3523 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3524 }
3525 }
3526 break;
3527
Alexis Hetua35d8232015-06-11 17:11:06 -04003528 case 98:
John Bauman66b8ab22014-05-06 15:57:45 -04003529
3530 {
3531 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
3532 context->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));
3533 context->recover();
3534 }
3535 // make sure a sampler is not involved as well...
3536 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3537 context->recover();
3538
3539 // Add the function as a prototype after parsing it (we do not support recursion)
3540 TFunction *function;
3541 TType type((yyvsp[(1) - (3)].interm.type));
3542 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3543 (yyval.interm.function) = function;
3544
3545 context->symbolTable.push();
3546 }
3547 break;
3548
Alexis Hetua35d8232015-06-11 17:11:06 -04003549 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003550
3551 {
3552 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
3553 context->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
3554 context->recover();
3555 }
3556 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3557 context->recover();
3558 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3559 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3560 (yyval.interm).param = param;
3561 }
3562 break;
3563
Alexis Hetua35d8232015-06-11 17:11:06 -04003564 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003565
3566 {
3567 // Check that we can make an array out of this type
3568 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3569 context->recover();
3570
3571 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3572 context->recover();
3573
3574 int size;
3575 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3576 context->recover();
3577 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3578
3579 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3580 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3581 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3582 (yyval.interm).param = param;
3583 }
3584 break;
3585
Alexis Hetu17809052015-05-13 11:28:22 -04003586 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003587
3588 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003589 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3590 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3591 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003592 }
3593 break;
3594
Alexis Hetu17809052015-05-13 11:28:22 -04003595 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003596
3597 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003598 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3599 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3600 context->recover();
3601 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3602 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003603 }
3604 break;
3605
Alexis Hetu17809052015-05-13 11:28:22 -04003606 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003607
3608 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003609 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3610 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3611 context->recover();
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003612 }
3613 break;
3614
Alexis Hetu17809052015-05-13 11:28:22 -04003615 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003616
3617 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003618 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3619 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3620 context->recover();
3621 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3622 context->recover();
3623 }
3624 break;
3625
3626 case 105:
3627
3628 {
3629 (yyval.interm.qualifier) = EvqIn;
3630 }
3631 break;
3632
3633 case 106:
3634
3635 {
3636 (yyval.interm.qualifier) = EvqIn;
3637 }
3638 break;
3639
3640 case 107:
3641
3642 {
3643 (yyval.interm.qualifier) = EvqOut;
3644 }
3645 break;
3646
3647 case 108:
3648
3649 {
3650 (yyval.interm.qualifier) = EvqInOut;
3651 }
3652 break;
3653
3654 case 109:
3655
3656 {
John Bauman66b8ab22014-05-06 15:57:45 -04003657 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3658 (yyval.interm).param = param;
3659 }
3660 break;
3661
Alexis Hetua35d8232015-06-11 17:11:06 -04003662 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003663
3664 {
3665 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3666 }
3667 break;
3668
Alexis Hetua35d8232015-06-11 17:11:06 -04003669 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003670
3671 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003672 (yyval.interm) = (yyvsp[(1) - (3)].interm);
3673 (yyval.interm).intermAggregate = context->parseDeclarator((yyval.interm).type, (yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string);
John Bauman66b8ab22014-05-06 15:57:45 -04003674 }
3675 break;
3676
Alexis Hetua35d8232015-06-11 17:11:06 -04003677 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003678
3679 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003680 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3681 (yyval.interm).intermAggregate = context->parseArrayDeclarator((yyval.interm).type, (yyvsp[(1) - (6)].interm).intermAggregate, (yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003682 }
3683 break;
3684
Alexis Hetua35d8232015-06-11 17:11:06 -04003685 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003686
3687 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003688 ES3_ONLY("[]", (yyvsp[(3) - (7)].lex).line);
3689 (yyval.interm) = (yyvsp[(1) - (7)].interm);
3690 (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (7)].interm).intermAggregate, (yyvsp[(3) - (7)].lex).line, *(yyvsp[(3) - (7)].lex).string, (yyvsp[(4) - (7)].lex).line, nullptr, (yyvsp[(6) - (7)].lex).line, (yyvsp[(7) - (7)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003691 }
3692 break;
3693
Alexis Hetua35d8232015-06-11 17:11:06 -04003694 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003695
3696 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003697 ES3_ONLY("=", (yyvsp[(7) - (8)].lex).line);
3698 (yyval.interm) = (yyvsp[(1) - (8)].interm);
3699 (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (8)].interm).intermAggregate, (yyvsp[(3) - (8)].lex).line, *(yyvsp[(3) - (8)].lex).string, (yyvsp[(4) - (8)].lex).line, (yyvsp[(5) - (8)].interm.intermTypedNode), (yyvsp[(7) - (8)].lex).line, (yyvsp[(8) - (8)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003700 }
3701 break;
3702
Alexis Hetua35d8232015-06-11 17:11:06 -04003703 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003704
3705 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003706 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3707 (yyval.interm).intermAggregate = context->parseInitDeclarator((yyval.interm).type, (yyvsp[(1) - (5)].interm).intermAggregate, (yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(4) - (5)].lex).line, (yyvsp[(5) - (5)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003708 }
3709 break;
3710
Alexis Hetua35d8232015-06-11 17:11:06 -04003711 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003712
3713 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003714 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3715 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yyvsp[(1) - (1)].interm.type).line, "");
John Bauman66b8ab22014-05-06 15:57:45 -04003716 }
3717 break;
3718
Alexis Hetua35d8232015-06-11 17:11:06 -04003719 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003720
3721 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003722 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3723 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string);
John Bauman66b8ab22014-05-06 15:57:45 -04003724 }
3725 break;
3726
Alexis Hetua35d8232015-06-11 17:11:06 -04003727 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003728
3729 {
John Bauman66b8ab22014-05-06 15:57:45 -04003730 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003731 (yyval.interm).intermAggregate = context->parseSingleArrayDeclaration((yyval.interm).type, (yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003732 }
3733 break;
3734
Alexis Hetua35d8232015-06-11 17:11:06 -04003735 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003736
3737 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003738 ES3_ONLY("[]", (yyvsp[(3) - (6)].lex).line);
3739 (yyval.interm).type = (yyvsp[(1) - (6)].interm.type);
3740 (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].lex).line, nullptr, (yyvsp[(5) - (6)].lex).line, (yyvsp[(6) - (6)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003741 }
3742 break;
3743
Alexis Hetua35d8232015-06-11 17:11:06 -04003744 case 120:
John Bauman66b8ab22014-05-06 15:57:45 -04003745
3746 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003747 ES3_ONLY("=", (yyvsp[(6) - (7)].lex).line);
3748 (yyval.interm).type = (yyvsp[(1) - (7)].interm.type);
3749 (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yyvsp[(2) - (7)].lex).line, *(yyvsp[(2) - (7)].lex).string, (yyvsp[(3) - (7)].lex).line, (yyvsp[(4) - (7)].interm.intermTypedNode), (yyvsp[(6) - (7)].lex).line, (yyvsp[(7) - (7)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003750 }
3751 break;
3752
Alexis Hetua35d8232015-06-11 17:11:06 -04003753 case 121:
John Bauman66b8ab22014-05-06 15:57:45 -04003754
3755 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003756 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3757 (yyval.interm).intermAggregate = context->parseSingleInitDeclaration((yyval.interm).type, (yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(3) - (4)].lex).line, (yyvsp[(4) - (4)].interm.intermTypedNode));
3758 }
3759 break;
3760
Alexis Hetua35d8232015-06-11 17:11:06 -04003761 case 122:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003762
3763 {
3764 // $$.type is not used in invariant declarations.
3765 (yyval.interm).intermAggregate = context->parseInvariantDeclaration((yyvsp[(1) - (2)].lex).line, (yyvsp[(2) - (2)].lex).line, (yyvsp[(2) - (2)].lex).string, (yyvsp[(2) - (2)].lex).symbol);
3766 }
3767 break;
3768
Alexis Hetua35d8232015-06-11 17:11:06 -04003769 case 123:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003770
3771 {
John Bauman66b8ab22014-05-06 15:57:45 -04003772 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3773
3774 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003775 ES3_ONLY("[]", (yyvsp[(1) - (1)].interm.type).line);
3776 if (context->getShaderVersion() != 300) {
3777 (yyvsp[(1) - (1)].interm.type).clearArrayness();
3778 }
John Bauman66b8ab22014-05-06 15:57:45 -04003779 }
3780 }
3781 break;
3782
Alexis Hetua35d8232015-06-11 17:11:06 -04003783 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04003784
3785 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003786 (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 -04003787 }
3788 break;
3789
Alexis Hetua35d8232015-06-11 17:11:06 -04003790 case 125:
John Bauman66b8ab22014-05-06 15:57:45 -04003791
3792 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003793 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003794 }
3795 break;
3796
Alexis Hetua35d8232015-06-11 17:11:06 -04003797 case 126:
John Bauman66b8ab22014-05-06 15:57:45 -04003798
3799 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003800 (yyval.interm.type).qualifier = EvqFlat;
3801 }
3802 break;
3803
Alexis Hetua35d8232015-06-11 17:11:06 -04003804 case 127:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003805
3806 {
3807 (yyval.interm.qualifier) = EvqConstReadOnly;
3808 }
3809 break;
3810
Alexis Hetua35d8232015-06-11 17:11:06 -04003811 case 128:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003812
3813 {
John Bauman66b8ab22014-05-06 15:57:45 -04003814 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
Nicolas Capensc6841852015-02-15 14:25:37 -05003815 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003816 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3817 context->recover();
3818 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3819 }
3820 break;
3821
Alexis Hetua35d8232015-06-11 17:11:06 -04003822 case 129:
John Bauman66b8ab22014-05-06 15:57:45 -04003823
3824 {
Nicolas Capensc6841852015-02-15 14:25:37 -05003825 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003826 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3827 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05003828 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04003829 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3830 else
3831 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
3832 }
3833 break;
3834
Alexis Hetua35d8232015-06-11 17:11:06 -04003835 case 130:
John Bauman66b8ab22014-05-06 15:57:45 -04003836
3837 {
Nicolas Capensc6841852015-02-15 14:25:37 -05003838 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003839 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3840 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05003841 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04003842 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
3843 else
3844 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
3845 }
3846 break;
3847
Alexis Hetua35d8232015-06-11 17:11:06 -04003848 case 131:
John Bauman66b8ab22014-05-06 15:57:45 -04003849
3850 {
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003851 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yyvsp[(1) - (1)].interm.type).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003852 }
3853 break;
3854
Alexis Hetua35d8232015-06-11 17:11:06 -04003855 case 132:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003856
3857 {
3858 (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);
3859 }
3860 break;
3861
Alexis Hetua35d8232015-06-11 17:11:06 -04003862 case 133:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003863
3864 {
3865 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));
3866 context->recover();
3867
3868 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3869 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
3870 }
3871 break;
3872
Alexis Hetua35d8232015-06-11 17:11:06 -04003873 case 134:
John Bauman66b8ab22014-05-06 15:57:45 -04003874
3875 {
Nicolas Capens7d626792015-02-17 17:58:31 -05003876 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3877 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
3878 }
3879 break;
3880
Alexis Hetua35d8232015-06-11 17:11:06 -04003881 case 135:
Nicolas Capens7d626792015-02-17 17:58:31 -05003882
3883 {
3884 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
3885 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
3886 }
3887 break;
3888
Alexis Hetua35d8232015-06-11 17:11:06 -04003889 case 136:
Nicolas Capens7d626792015-02-17 17:58:31 -05003890
3891 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003892 (yyval.interm.type).qualifier = EvqConstExpr;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003893 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3894 }
3895 break;
3896
Alexis Hetua35d8232015-06-11 17:11:06 -04003897 case 137:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003898
3899 {
3900 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003901 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003902 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3903 }
3904 break;
3905
Alexis Hetua35d8232015-06-11 17:11:06 -04003906 case 138:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003907
3908 {
3909 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003910 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003911 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3912 }
3913 break;
3914
Alexis Hetua35d8232015-06-11 17:11:06 -04003915 case 139:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003916
3917 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003918 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line);
3919 if (context->shaderType == GL_VERTEX_SHADER)
3920 {
3921 context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader");
3922 context->recover();
3923 }
3924 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003925 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
3926 }
3927 break;
3928
Alexis Hetua35d8232015-06-11 17:11:06 -04003929 case 140:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003930
3931 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003932 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line);
3933 if (context->shaderType == GL_FRAGMENT_SHADER)
3934 {
3935 context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader");
3936 context->recover();
3937 }
3938 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003939 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
3940 }
3941 break;
3942
Alexis Hetua35d8232015-06-11 17:11:06 -04003943 case 141:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003944
3945 {
3946 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
3947 context->recover();
3948 (yyval.interm.type).qualifier = EvqUniform;
3949 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
3950 }
3951 break;
3952
Alexis Hetua35d8232015-06-11 17:11:06 -04003953 case 142:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003954
3955 {
John Bauman66b8ab22014-05-06 15:57:45 -04003956 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3957
3958 if ((yyval.interm.type).precision == EbpUndefined) {
3959 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3960 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3961 context->recover();
3962 }
3963 }
3964 }
3965 break;
3966
Alexis Hetua35d8232015-06-11 17:11:06 -04003967 case 143:
John Bauman66b8ab22014-05-06 15:57:45 -04003968
3969 {
3970 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3971 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
3972 }
3973 break;
3974
Alexis Hetua35d8232015-06-11 17:11:06 -04003975 case 144:
John Bauman66b8ab22014-05-06 15:57:45 -04003976
3977 {
3978 (yyval.interm.precision) = EbpHigh;
3979 }
3980 break;
3981
Alexis Hetua35d8232015-06-11 17:11:06 -04003982 case 145:
John Bauman66b8ab22014-05-06 15:57:45 -04003983
3984 {
3985 (yyval.interm.precision) = EbpMedium;
3986 }
3987 break;
3988
Alexis Hetua35d8232015-06-11 17:11:06 -04003989 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04003990
3991 {
3992 (yyval.interm.precision) = EbpLow;
3993 }
3994 break;
3995
Alexis Hetua35d8232015-06-11 17:11:06 -04003996 case 147:
Nicolas Capens7d626792015-02-17 17:58:31 -05003997
3998 {
3999 ES3_ONLY("layout", (yyvsp[(1) - (4)].lex).line);
4000 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
4001 }
4002 break;
4003
Alexis Hetua35d8232015-06-11 17:11:06 -04004004 case 148:
Nicolas Capens7d626792015-02-17 17:58:31 -05004005
4006 {
4007 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
4008 }
4009 break;
4010
Alexis Hetua35d8232015-06-11 17:11:06 -04004011 case 149:
Nicolas Capens7d626792015-02-17 17:58:31 -05004012
4013 {
4014 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
4015 }
4016 break;
4017
Alexis Hetua35d8232015-06-11 17:11:06 -04004018 case 150:
Nicolas Capens7d626792015-02-17 17:58:31 -05004019
4020 {
4021 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line);
4022 }
4023 break;
4024
Alexis Hetua35d8232015-06-11 17:11:06 -04004025 case 151:
John Bauman66b8ab22014-05-06 15:57:45 -04004026
4027 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004028 (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);
4029 }
4030 break;
4031
Alexis Hetua35d8232015-06-11 17:11:06 -04004032 case 152:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004033
4034 {
4035 (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);
4036 }
4037 break;
4038
Alexis Hetua35d8232015-06-11 17:11:06 -04004039 case 153:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004040
4041 {
John Bauman66b8ab22014-05-06 15:57:45 -04004042 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4043 }
4044 break;
4045
Alexis Hetua35d8232015-06-11 17:11:06 -04004046 case 154:
John Bauman66b8ab22014-05-06 15:57:45 -04004047
4048 {
4049 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
4050
4051 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4052 context->recover();
4053 else {
4054 int size;
4055 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4056 context->recover();
4057 (yyval.interm.type).setArray(true, size);
4058 }
4059 }
4060 break;
4061
Alexis Hetu17809052015-05-13 11:28:22 -04004062 case 155:
4063
4064 {
4065 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetua35d8232015-06-11 17:11:06 -04004066 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004067 }
4068 break;
4069
4070 case 156:
4071
4072 {
4073 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004074 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004075 }
4076 break;
4077
4078 case 157:
4079
4080 {
4081 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetua35d8232015-06-11 17:11:06 -04004082 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004083 }
4084 break;
4085
4086 case 158:
4087
4088 {
4089 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetua35d8232015-06-11 17:11:06 -04004090 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004091 }
4092 break;
4093
4094 case 159:
4095
4096 {
4097 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004098 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004099 }
4100 break;
4101
4102 case 160:
4103
4104 {
4105 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetua35d8232015-06-11 17:11:06 -04004106 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4107 (yyval.interm.type).setAggregate(2);
4108 }
4109 break;
4110
4111 case 161:
4112
4113 {
4114 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4115 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4116 (yyval.interm.type).setAggregate(3);
4117 }
4118 break;
4119
4120 case 162:
4121
4122 {
4123 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4124 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4125 (yyval.interm.type).setAggregate(4);
4126 }
4127 break;
4128
4129 case 163:
4130
4131 {
4132 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4133 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4134 (yyval.interm.type).setAggregate(2);
4135 }
4136 break;
4137
4138 case 164:
4139
4140 {
4141 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4142 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4143 (yyval.interm.type).setAggregate(3);
4144 }
4145 break;
4146
4147 case 165:
4148
4149 {
4150 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004151 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4152 (yyval.interm.type).setAggregate(4);
Alexis Hetu17809052015-05-13 11:28:22 -04004153 }
4154 break;
4155
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004156 case 166:
4157
4158 {
4159 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetua35d8232015-06-11 17:11:06 -04004160 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4161 (yyval.interm.type).setAggregate(2);
4162 }
4163 break;
4164
4165 case 167:
4166
4167 {
4168 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4169 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4170 (yyval.interm.type).setAggregate(3);
4171 }
4172 break;
4173
4174 case 168:
4175
4176 {
4177 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4178 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4179 (yyval.interm.type).setAggregate(4);
4180 }
4181 break;
4182
4183 case 169:
4184
4185 {
4186 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4187 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4188 (yyval.interm.type).setAggregate(2);
4189 }
4190 break;
4191
4192 case 170:
4193
4194 {
4195 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4196 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4197 (yyval.interm.type).setAggregate(3);
4198 }
4199 break;
4200
4201 case 171:
4202
4203 {
4204 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004205 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4206 (yyval.interm.type).setAggregate(4);
4207 }
4208 break;
4209
Alexis Hetua35d8232015-06-11 17:11:06 -04004210 case 172:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004211
4212 {
John Bauman66b8ab22014-05-06 15:57:45 -04004213 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
4214 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4215 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004216 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004217 }
4218 break;
4219
Alexis Hetua35d8232015-06-11 17:11:06 -04004220 case 173:
John Bauman66b8ab22014-05-06 15:57:45 -04004221
4222 {
4223 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
4224 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4225 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004226 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004227 }
4228 break;
4229
Alexis Hetua35d8232015-06-11 17:11:06 -04004230 case 174:
John Bauman66b8ab22014-05-06 15:57:45 -04004231
4232 {
4233 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
4234 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4235 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004236 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004237 }
4238 break;
4239
Alexis Hetua35d8232015-06-11 17:11:06 -04004240 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004241
4242 {
Alexis Hetub14178b2015-04-13 13:23:20 -04004243 FRAG_VERT_ONLY("mat2x3", (yyvsp[(1) - (1)].lex).line);
4244 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4245 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4246 (yyval.interm.type).setMatrix(2, 3);
4247 }
4248 break;
4249
Alexis Hetua35d8232015-06-11 17:11:06 -04004250 case 176:
Alexis Hetub14178b2015-04-13 13:23:20 -04004251
4252 {
4253 FRAG_VERT_ONLY("mat3x2", (yyvsp[(1) - (1)].lex).line);
4254 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4255 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4256 (yyval.interm.type).setMatrix(3, 2);
4257 }
4258 break;
4259
Alexis Hetua35d8232015-06-11 17:11:06 -04004260 case 177:
Alexis Hetub14178b2015-04-13 13:23:20 -04004261
4262 {
4263 FRAG_VERT_ONLY("mat2x4", (yyvsp[(1) - (1)].lex).line);
4264 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4265 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4266 (yyval.interm.type).setMatrix(2, 4);
4267 }
4268 break;
4269
Alexis Hetua35d8232015-06-11 17:11:06 -04004270 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004271
4272 {
4273 FRAG_VERT_ONLY("mat4x2", (yyvsp[(1) - (1)].lex).line);
4274 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4275 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4276 (yyval.interm.type).setMatrix(4, 2);
4277 }
4278 break;
4279
Alexis Hetua35d8232015-06-11 17:11:06 -04004280 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004281
4282 {
4283 FRAG_VERT_ONLY("mat3x4", (yyvsp[(1) - (1)].lex).line);
4284 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4285 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4286 (yyval.interm.type).setMatrix(3, 4);
4287 }
4288 break;
4289
Alexis Hetua35d8232015-06-11 17:11:06 -04004290 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004291
4292 {
4293 FRAG_VERT_ONLY("mat4x3", (yyvsp[(1) - (1)].lex).line);
4294 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4295 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4296 (yyval.interm.type).setMatrix(4, 3);
4297 }
4298 break;
4299
Alexis Hetua35d8232015-06-11 17:11:06 -04004300 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004301
4302 {
John Bauman66b8ab22014-05-06 15:57:45 -04004303 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4304 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4305 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4306 }
4307 break;
4308
Alexis Hetua35d8232015-06-11 17:11:06 -04004309 case 182:
John Bauman66b8ab22014-05-06 15:57:45 -04004310
4311 {
4312 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4313 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4314 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4315 }
4316 break;
4317
Alexis Hetua35d8232015-06-11 17:11:06 -04004318 case 183:
John Bauman66b8ab22014-05-06 15:57:45 -04004319
4320 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004321 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
4322 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES", "");
4323 context->recover();
4324 }
4325 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4326 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4327 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
4328 }
4329 break;
4330
Alexis Hetua35d8232015-06-11 17:11:06 -04004331 case 184:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004332
4333 {
Alexis Hetub027aa92015-01-19 15:56:12 -05004334 FRAG_VERT_ONLY("sampler3D", (yyvsp[(1) - (1)].lex).line);
4335 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4336 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4337 }
4338 break;
4339
Alexis Hetua35d8232015-06-11 17:11:06 -04004340 case 185:
Alexis Hetub14178b2015-04-13 13:23:20 -04004341
4342 {
4343 FRAG_VERT_ONLY("sampler2DArray", (yyvsp[(1) - (1)].lex).line);
4344 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4345 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4346 }
4347 break;
4348
Alexis Hetua35d8232015-06-11 17:11:06 -04004349 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004350
4351 {
4352 FRAG_VERT_ONLY("isampler2D", (yyvsp[(1) - (1)].lex).line);
4353 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4354 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4355 }
4356 break;
4357
Alexis Hetua35d8232015-06-11 17:11:06 -04004358 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004359
4360 {
4361 FRAG_VERT_ONLY("isampler3D", (yyvsp[(1) - (1)].lex).line);
4362 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4363 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4364 }
4365 break;
4366
Alexis Hetua35d8232015-06-11 17:11:06 -04004367 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004368
4369 {
4370 FRAG_VERT_ONLY("isamplerCube", (yyvsp[(1) - (1)].lex).line);
4371 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4372 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4373 }
4374 break;
4375
Alexis Hetua35d8232015-06-11 17:11:06 -04004376 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004377
4378 {
4379 FRAG_VERT_ONLY("isampler2DArray", (yyvsp[(1) - (1)].lex).line);
4380 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4381 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4382 }
4383 break;
4384
Alexis Hetua35d8232015-06-11 17:11:06 -04004385 case 190:
Alexis Hetub14178b2015-04-13 13:23:20 -04004386
4387 {
4388 FRAG_VERT_ONLY("usampler2D", (yyvsp[(1) - (1)].lex).line);
4389 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4390 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4391 }
4392 break;
4393
Alexis Hetua35d8232015-06-11 17:11:06 -04004394 case 191:
Alexis Hetub14178b2015-04-13 13:23:20 -04004395
4396 {
4397 FRAG_VERT_ONLY("usampler3D", (yyvsp[(1) - (1)].lex).line);
4398 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4399 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4400 }
4401 break;
4402
Alexis Hetua35d8232015-06-11 17:11:06 -04004403 case 192:
Alexis Hetub14178b2015-04-13 13:23:20 -04004404
4405 {
4406 FRAG_VERT_ONLY("usamplerCube", (yyvsp[(1) - (1)].lex).line);
4407 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4408 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4409 }
4410 break;
4411
Alexis Hetua35d8232015-06-11 17:11:06 -04004412 case 193:
Alexis Hetub14178b2015-04-13 13:23:20 -04004413
4414 {
4415 FRAG_VERT_ONLY("usampler2DArray", (yyvsp[(1) - (1)].lex).line);
4416 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4417 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4418 }
4419 break;
4420
Alexis Hetua35d8232015-06-11 17:11:06 -04004421 case 194:
Alexis Hetub14178b2015-04-13 13:23:20 -04004422
4423 {
4424 FRAG_VERT_ONLY("sampler2DShadow", (yyvsp[(1) - (1)].lex).line);
4425 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4426 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yyvsp[(1) - (1)].lex).line);
4427 }
4428 break;
4429
Alexis Hetua35d8232015-06-11 17:11:06 -04004430 case 195:
Alexis Hetub14178b2015-04-13 13:23:20 -04004431
4432 {
4433 FRAG_VERT_ONLY("samplerCubeShadow", (yyvsp[(1) - (1)].lex).line);
4434 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4435 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yyvsp[(1) - (1)].lex).line);
4436 }
4437 break;
4438
Alexis Hetua35d8232015-06-11 17:11:06 -04004439 case 196:
Alexis Hetub14178b2015-04-13 13:23:20 -04004440
4441 {
4442 FRAG_VERT_ONLY("sampler2DArrayShadow", (yyvsp[(1) - (1)].lex).line);
4443 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4444 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yyvsp[(1) - (1)].lex).line);
4445 }
4446 break;
4447
Alexis Hetua35d8232015-06-11 17:11:06 -04004448 case 197:
Alexis Hetub027aa92015-01-19 15:56:12 -05004449
4450 {
John Bauman66b8ab22014-05-06 15:57:45 -04004451 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4452 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4453 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4454 }
4455 break;
4456
Alexis Hetua35d8232015-06-11 17:11:06 -04004457 case 198:
John Bauman66b8ab22014-05-06 15:57:45 -04004458
4459 {
4460 //
4461 // This is for user defined type names. The lexical phase looked up the
4462 // type.
4463 //
4464 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4465 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4466 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4467 (yyval.interm.type).userDef = &structure;
4468 }
4469 break;
4470
Alexis Hetua35d8232015-06-11 17:11:06 -04004471 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004472
4473 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
4474 break;
4475
Alexis Hetua35d8232015-06-11 17:11:06 -04004476 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004477
4478 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004479 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (6)].lex).line, (yyvsp[(2) - (6)].lex).line, (yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004480 }
4481 break;
4482
Alexis Hetua35d8232015-06-11 17:11:06 -04004483 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004484
4485 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
4486 break;
4487
Alexis Hetua35d8232015-06-11 17:11:06 -04004488 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004489
4490 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004491 (yyval.interm.type) = context->addStructure((yyvsp[(1) - (5)].lex).line, (yyvsp[(1) - (5)].lex).line, NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004492 }
4493 break;
4494
Alexis Hetua35d8232015-06-11 17:11:06 -04004495 case 203:
John Bauman66b8ab22014-05-06 15:57:45 -04004496
4497 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004498 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
John Bauman66b8ab22014-05-06 15:57:45 -04004499 }
4500 break;
4501
Alexis Hetua35d8232015-06-11 17:11:06 -04004502 case 204:
John Bauman66b8ab22014-05-06 15:57:45 -04004503
4504 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004505 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
4506 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) {
4507 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i];
4508 for (unsigned int j = 0; j < (yyval.interm.fieldList)->size(); ++j) {
4509 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) {
4510 context->error((*(yyvsp[(2) - (2)].interm.fieldList))[i]->line(), "duplicate field name in structure:", "struct", field->name().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004511 context->recover();
4512 }
4513 }
Alexis Hetua8b364b2015-06-10 11:48:40 -04004514 (yyval.interm.fieldList)->push_back((*(yyvsp[(2) - (2)].interm.fieldList))[i]);
John Bauman66b8ab22014-05-06 15:57:45 -04004515 }
4516 }
4517 break;
4518
Alexis Hetua35d8232015-06-11 17:11:06 -04004519 case 205:
John Bauman66b8ab22014-05-06 15:57:45 -04004520
4521 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004522 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004523 }
4524 break;
4525
Alexis Hetua35d8232015-06-11 17:11:06 -04004526 case 206:
John Bauman66b8ab22014-05-06 15:57:45 -04004527
4528 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004529 // ES3 Only, but errors should be handled elsewhere
4530 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4531 (yyvsp[(2) - (4)].interm.type).layoutQualifier = (yyvsp[(1) - (4)].interm.type).layoutQualifier;
4532 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.fieldList));
4533 }
4534 break;
4535
Alexis Hetua35d8232015-06-11 17:11:06 -04004536 case 207:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004537
4538 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004539 (yyval.interm.fieldList) = NewPoolTFieldList();
4540 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004541 }
4542 break;
4543
Alexis Hetua35d8232015-06-11 17:11:06 -04004544 case 208:
John Bauman66b8ab22014-05-06 15:57:45 -04004545
4546 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004547 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004548 }
4549 break;
4550
Alexis Hetua35d8232015-06-11 17:11:06 -04004551 case 209:
John Bauman66b8ab22014-05-06 15:57:45 -04004552
4553 {
4554 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4555 context->recover();
4556
Alexis Hetua8b364b2015-06-10 11:48:40 -04004557 TType* type = new TType(EbtVoid, EbpUndefined);
4558 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004559 }
4560 break;
4561
Alexis Hetua35d8232015-06-11 17:11:06 -04004562 case 210:
John Bauman66b8ab22014-05-06 15:57:45 -04004563
4564 {
4565 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4566 context->recover();
4567
Alexis Hetua8b364b2015-06-10 11:48:40 -04004568 TType* type = new TType(EbtVoid, EbpUndefined);
John Bauman66b8ab22014-05-06 15:57:45 -04004569 int size;
Alexis Hetua8b364b2015-06-10 11:48:40 -04004570 if (context->arraySizeErrorCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLine(), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04004571 context->recover();
Alexis Hetua8b364b2015-06-10 11:48:40 -04004572 type->setArraySize(size);
4573
4574 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yyvsp[(1) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004575 }
4576 break;
4577
Alexis Hetu17809052015-05-13 11:28:22 -04004578 case 211:
Nicolas Capens7d626792015-02-17 17:58:31 -05004579
Alexis Hetua35d8232015-06-11 17:11:06 -04004580 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004581 break;
4582
Alexis Hetu17809052015-05-13 11:28:22 -04004583 case 212:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004584
Alexis Hetuad6b8752015-06-09 16:15:30 -04004585 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004586 break;
4587
Alexis Hetu17809052015-05-13 11:28:22 -04004588 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004589
Alexis Hetua35d8232015-06-11 17:11:06 -04004590 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004591 break;
4592
Alexis Hetu17809052015-05-13 11:28:22 -04004593 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004594
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004595 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004596 break;
4597
Alexis Hetu17809052015-05-13 11:28:22 -04004598 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004599
Alexis Hetua35d8232015-06-11 17:11:06 -04004600 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetuad6b8752015-06-09 16:15:30 -04004601 break;
4602
4603 case 216:
4604
Alexis Hetua35d8232015-06-11 17:11:06 -04004605 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004606 break;
4607
4608 case 217:
4609
Alexis Hetua35d8232015-06-11 17:11:06 -04004610 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004611 break;
4612
4613 case 218:
4614
Alexis Hetu76a343a2015-06-04 17:21:22 -04004615 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermSwitch); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004616 break;
4617
4618 case 219:
4619
Alexis Hetu76a343a2015-06-04 17:21:22 -04004620 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermCase); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004621 break;
4622
4623 case 220:
4624
Alexis Hetu76a343a2015-06-04 17:21:22 -04004625 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004626 break;
4627
4628 case 221:
4629
Alexis Hetu76a343a2015-06-04 17:21:22 -04004630 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004631 break;
4632
4633 case 222:
4634
Alexis Hetu76a343a2015-06-04 17:21:22 -04004635 { (yyval.interm.intermAggregate) = 0; }
Alexis Hetua35d8232015-06-11 17:11:06 -04004636 break;
4637
4638 case 223:
4639
Alexis Hetu76a343a2015-06-04 17:21:22 -04004640 { context->symbolTable.push(); }
4641 break;
4642
4643 case 224:
4644
4645 { context->symbolTable.pop(); }
4646 break;
4647
4648 case 225:
4649
Nicolas Capens7d626792015-02-17 17:58:31 -05004650 {
4651 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4652 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4653 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4654 }
4655 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4656 }
4657 break;
4658
Alexis Hetua35d8232015-06-11 17:11:06 -04004659 case 226:
4660
Alexis Hetu76a343a2015-06-04 17:21:22 -04004661 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004662 break;
4663
4664 case 227:
4665
Alexis Hetu76a343a2015-06-04 17:21:22 -04004666 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004667 break;
4668
4669 case 228:
4670
4671 { context->symbolTable.push(); }
4672 break;
4673
4674 case 229:
4675
4676 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4677 break;
4678
4679 case 230:
4680
Alexis Hetu76a343a2015-06-04 17:21:22 -04004681 { context->symbolTable.push(); }
4682 break;
4683
4684 case 231:
4685
4686 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4687 break;
4688
4689 case 232:
4690
John Bauman66b8ab22014-05-06 15:57:45 -04004691 {
4692 (yyval.interm.intermNode) = 0;
4693 }
4694 break;
4695
Alexis Hetu76a343a2015-06-04 17:21:22 -04004696 case 233:
John Bauman66b8ab22014-05-06 15:57:45 -04004697
4698 {
4699 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4700 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
4701 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4702 }
4703 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4704 }
4705 break;
4706
Alexis Hetu76a343a2015-06-04 17:21:22 -04004707 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004708
4709 {
4710 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4711 }
4712 break;
4713
Alexis Hetu76a343a2015-06-04 17:21:22 -04004714 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004715
4716 {
4717 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4718 }
4719 break;
4720
Alexis Hetu76a343a2015-06-04 17:21:22 -04004721 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004722
4723 { (yyval.interm.intermNode) = 0; }
4724 break;
4725
Alexis Hetu76a343a2015-06-04 17:21:22 -04004726 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04004727
4728 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4729 break;
4730
Alexis Hetu76a343a2015-06-04 17:21:22 -04004731 case 238:
John Bauman66b8ab22014-05-06 15:57:45 -04004732
4733 {
4734 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4735 context->recover();
4736 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line);
4737 }
4738 break;
4739
Alexis Hetu76a343a2015-06-04 17:21:22 -04004740 case 239:
John Bauman66b8ab22014-05-06 15:57:45 -04004741
4742 {
4743 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4744 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4745 }
4746 break;
4747
Alexis Hetu76a343a2015-06-04 17:21:22 -04004748 case 240:
John Bauman66b8ab22014-05-06 15:57:45 -04004749
4750 {
4751 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4752 (yyval.interm.nodePair).node2 = 0;
4753 }
4754 break;
4755
Alexis Hetu76a343a2015-06-04 17:21:22 -04004756 case 241:
4757
4758 { context->incrSwitchNestingLevel(); }
4759 break;
4760
4761 case 242:
4762
4763 {
4764 (yyval.interm.intermSwitch) = context->addSwitch((yyvsp[(3) - (6)].interm.intermTypedNode), (yyvsp[(6) - (6)].interm.intermAggregate), (yyvsp[(1) - (6)].lex).line);
4765 context->decrSwitchNestingLevel();
4766 }
4767 break;
4768
4769 case 243:
4770
4771 {
4772 (yyval.interm.intermCase) = context->addCase((yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4773 }
4774 break;
4775
4776 case 244:
4777
4778 {
4779 (yyval.interm.intermCase) = context->addDefault((yyvsp[(1) - (2)].lex).line);
4780 }
4781 break;
4782
4783 case 245:
John Bauman66b8ab22014-05-06 15:57:45 -04004784
4785 {
4786 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4787 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4788 context->recover();
4789 }
4790 break;
4791
Alexis Hetu76a343a2015-06-04 17:21:22 -04004792 case 246:
John Bauman66b8ab22014-05-06 15:57:45 -04004793
4794 {
4795 TIntermNode* intermNode;
4796 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4797 context->recover();
4798 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4799 context->recover();
4800
4801 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4802 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4803 else {
4804 context->recover();
4805 (yyval.interm.intermTypedNode) = 0;
4806 }
4807 }
4808 break;
4809
Alexis Hetu76a343a2015-06-04 17:21:22 -04004810 case 247:
John Bauman66b8ab22014-05-06 15:57:45 -04004811
4812 { context->symbolTable.push(); ++context->loopNestingLevel; }
4813 break;
4814
Alexis Hetu76a343a2015-06-04 17:21:22 -04004815 case 248:
John Bauman66b8ab22014-05-06 15:57:45 -04004816
4817 {
4818 context->symbolTable.pop();
4819 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(1) - (6)].lex).line);
4820 --context->loopNestingLevel;
4821 }
4822 break;
4823
Alexis Hetu76a343a2015-06-04 17:21:22 -04004824 case 249:
John Bauman66b8ab22014-05-06 15:57:45 -04004825
4826 { ++context->loopNestingLevel; }
4827 break;
4828
Alexis Hetu76a343a2015-06-04 17:21:22 -04004829 case 250:
John Bauman66b8ab22014-05-06 15:57:45 -04004830
4831 {
4832 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4833 context->recover();
4834
4835 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(4) - (8)].lex).line);
4836 --context->loopNestingLevel;
4837 }
4838 break;
4839
Alexis Hetu76a343a2015-06-04 17:21:22 -04004840 case 251:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004841
Alexis Hetuad6b8752015-06-09 16:15:30 -04004842 { context->symbolTable.push(); ++context->loopNestingLevel; }
Alexis Hetub027aa92015-01-19 15:56:12 -05004843 break;
4844
Alexis Hetu76a343a2015-06-04 17:21:22 -04004845 case 252:
Alexis Hetub027aa92015-01-19 15:56:12 -05004846
4847 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004848 context->symbolTable.pop();
4849 (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);
4850 --context->loopNestingLevel;
Nicolas Capens3c20f802015-02-17 17:17:20 -05004851 }
4852 break;
4853
Alexis Hetu76a343a2015-06-04 17:21:22 -04004854 case 253:
Alexis Hetu17809052015-05-13 11:28:22 -04004855
4856 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004857 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetu17809052015-05-13 11:28:22 -04004858 }
4859 break;
4860
Alexis Hetu76a343a2015-06-04 17:21:22 -04004861 case 254:
Alexis Hetu17809052015-05-13 11:28:22 -04004862
4863 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004864 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetuad6b8752015-06-09 16:15:30 -04004865 }
4866 break;
4867
Alexis Hetu76a343a2015-06-04 17:21:22 -04004868 case 255:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004869
4870 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004871 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4872 }
4873 break;
4874
Alexis Hetu76a343a2015-06-04 17:21:22 -04004875 case 256:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004876
4877 {
4878 (yyval.interm.intermTypedNode) = 0;
4879 }
4880 break;
4881
Alexis Hetu76a343a2015-06-04 17:21:22 -04004882 case 257:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004883
4884 {
Alexis Hetu17809052015-05-13 11:28:22 -04004885 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4886 (yyval.interm.nodePair).node2 = 0;
4887 }
4888 break;
4889
Alexis Hetu76a343a2015-06-04 17:21:22 -04004890 case 258:
Alexis Hetu17809052015-05-13 11:28:22 -04004891
4892 {
4893 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4894 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
4895 }
4896 break;
4897
Alexis Hetu76a343a2015-06-04 17:21:22 -04004898 case 259:
Alexis Hetu17809052015-05-13 11:28:22 -04004899
4900 {
Alexis Hetu76a343a2015-06-04 17:21:22 -04004901 (yyval.interm.intermNode) = context->addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004902 }
4903 break;
4904
Alexis Hetu76a343a2015-06-04 17:21:22 -04004905 case 260:
Alexis Hetu17809052015-05-13 11:28:22 -04004906
4907 {
Alexis Hetu76a343a2015-06-04 17:21:22 -04004908 (yyval.interm.intermNode) = context->addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004909 }
4910 break;
4911
Alexis Hetu76a343a2015-06-04 17:21:22 -04004912 case 261:
Alexis Hetu17809052015-05-13 11:28:22 -04004913
4914 {
Alexis Hetu76a343a2015-06-04 17:21:22 -04004915 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004916 }
4917 break;
4918
Alexis Hetu76a343a2015-06-04 17:21:22 -04004919 case 262:
Alexis Hetu17809052015-05-13 11:28:22 -04004920
4921 {
Alexis Hetu76a343a2015-06-04 17:21:22 -04004922 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004923 }
4924 break;
4925
Alexis Hetu76a343a2015-06-04 17:21:22 -04004926 case 263:
Alexis Hetu17809052015-05-13 11:28:22 -04004927
4928 {
4929 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
Alexis Hetu76a343a2015-06-04 17:21:22 -04004930 (yyval.interm.intermNode) = context->addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
Alexis Hetu17809052015-05-13 11:28:22 -04004931 }
4932 break;
4933
Alexis Hetu76a343a2015-06-04 17:21:22 -04004934 case 264:
Alexis Hetu17809052015-05-13 11:28:22 -04004935
4936 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004937 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetu17809052015-05-13 11:28:22 -04004938 context->treeRoot = (yyval.interm.intermNode);
4939 }
4940 break;
4941
Alexis Hetu76a343a2015-06-04 17:21:22 -04004942 case 265:
Alexis Hetu17809052015-05-13 11:28:22 -04004943
4944 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004945 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4946 context->treeRoot = (yyval.interm.intermNode);
Alexis Hetu17809052015-05-13 11:28:22 -04004947 }
4948 break;
4949
Alexis Hetu76a343a2015-06-04 17:21:22 -04004950 case 266:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004951
4952 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004953 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4954 }
4955 break;
4956
Alexis Hetu76a343a2015-06-04 17:21:22 -04004957 case 267:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004958
4959 {
4960 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4961 }
4962 break;
4963
Alexis Hetu76a343a2015-06-04 17:21:22 -04004964 case 268:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004965
4966 {
John Bauman66b8ab22014-05-06 15:57:45 -04004967 TFunction* function = (yyvsp[(1) - (1)].interm).function;
4968
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05004969 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
John Bauman66b8ab22014-05-06 15:57:45 -04004970
4971 if (builtIn)
4972 {
4973 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
4974 context->recover();
4975 }
4976
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05004977 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04004978 //
4979 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4980 // as it would have just been put in the symbol table. Otherwise, we're looking up
4981 // an earlier occurance.
4982 //
4983 if (prevDec->isDefined()) {
4984 //
4985 // Then this function already has a body.
4986 //
4987 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
4988 context->recover();
4989 }
4990 prevDec->setDefined();
4991
4992 //
4993 // Raise error message if main function takes any parameters or return anything other than void
4994 //
4995 if (function->getName() == "main") {
4996 if (function->getParamCount() > 0) {
4997 context->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function->getName().c_str());
4998 context->recover();
4999 }
5000 if (function->getReturnType().getBasicType() != EbtVoid) {
5001 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
5002 context->recover();
5003 }
5004 }
5005
5006 //
5007 // Remember the return type for later checking for RETURN statements.
5008 //
5009 context->currentFunctionType = &(prevDec->getReturnType());
5010 context->functionReturnsValue = false;
5011
5012 //
5013 // Insert parameters into the symbol table.
5014 // If the parameter has no name, it's not an error, just don't insert it
5015 // (could be used for unused args).
5016 //
5017 // Also, accumulate the list of parameters into the HIL, so lower level code
5018 // knows where to find parameters.
5019 //
5020 TIntermAggregate* paramNodes = new TIntermAggregate;
Alexis Hetu76a343a2015-06-04 17:21:22 -04005021 for (size_t i = 0; i < function->getParamCount(); i++) {
John Bauman66b8ab22014-05-06 15:57:45 -04005022 const TParameter& param = function->getParam(i);
5023 if (param.name != 0) {
5024 TVariable *variable = new TVariable(param.name, *param.type);
5025 //
5026 // Insert the parameters with name in the symbol table.
5027 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05005028 if (! context->symbolTable.declare(*variable)) {
John Bauman66b8ab22014-05-06 15:57:45 -04005029 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
5030 context->recover();
5031 delete variable;
5032 }
5033
5034 //
5035 // Add the parameter to the HIL
5036 //
5037 paramNodes = context->intermediate.growAggregate(
5038 paramNodes,
5039 context->intermediate.addSymbol(variable->getUniqueId(),
5040 variable->getName(),
5041 variable->getType(), (yyvsp[(1) - (1)].interm).line),
5042 (yyvsp[(1) - (1)].interm).line);
5043 } else {
5044 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
5045 }
5046 }
5047 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
5048 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
5049 context->loopNestingLevel = 0;
5050 }
5051 break;
5052
Alexis Hetu76a343a2015-06-04 17:21:22 -04005053 case 269:
John Bauman66b8ab22014-05-06 15:57:45 -04005054
5055 {
5056 //?? Check that all paths return a value if return type != void ?
5057 // May be best done as post process phase on intermediate code
5058 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
5059 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
5060 context->recover();
5061 }
5062
5063 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
5064 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
5065 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
5066 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
5067
5068 // store the pragma information for debug and optimize and other vendor specific
5069 // information. This information can be queried from the parse tree
5070 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
5071 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
5072
5073 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
5074 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
5075
5076 context->symbolTable.pop();
5077 }
5078 break;
5079
5080
5081
5082 default: break;
5083 }
5084 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
5085
5086 YYPOPSTACK (yylen);
5087 yylen = 0;
5088 YY_STACK_PRINT (yyss, yyssp);
5089
5090 *++yyvsp = yyval;
5091
5092 /* Now `shift' the result of the reduction. Determine what state
5093 that goes to, based on the state we popped back to and the rule
5094 number reduced by. */
5095
5096 yyn = yyr1[yyn];
5097
5098 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
5099 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
5100 yystate = yytable[yystate];
5101 else
5102 yystate = yydefgoto[yyn - YYNTOKENS];
5103
5104 goto yynewstate;
5105
5106
5107/*------------------------------------.
5108| yyerrlab -- here on detecting error |
5109`------------------------------------*/
5110yyerrlab:
5111 /* If not already recovering from an error, report this error. */
5112 if (!yyerrstatus)
5113 {
5114 ++yynerrs;
5115#if ! YYERROR_VERBOSE
5116 yyerror (context, YY_("syntax error"));
5117#else
5118 {
5119 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
5120 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
5121 {
5122 YYSIZE_T yyalloc = 2 * yysize;
5123 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
5124 yyalloc = YYSTACK_ALLOC_MAXIMUM;
5125 if (yymsg != yymsgbuf)
5126 YYSTACK_FREE (yymsg);
5127 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
5128 if (yymsg)
5129 yymsg_alloc = yyalloc;
5130 else
5131 {
5132 yymsg = yymsgbuf;
5133 yymsg_alloc = sizeof yymsgbuf;
5134 }
5135 }
5136
5137 if (0 < yysize && yysize <= yymsg_alloc)
5138 {
5139 (void) yysyntax_error (yymsg, yystate, yychar);
5140 yyerror (context, yymsg);
5141 }
5142 else
5143 {
5144 yyerror (context, YY_("syntax error"));
5145 if (yysize != 0)
5146 goto yyexhaustedlab;
5147 }
5148 }
5149#endif
5150 }
5151
5152
5153
5154 if (yyerrstatus == 3)
5155 {
5156 /* If just tried and failed to reuse lookahead token after an
5157 error, discard it. */
5158
5159 if (yychar <= YYEOF)
5160 {
5161 /* Return failure if at end of input. */
5162 if (yychar == YYEOF)
5163 YYABORT;
5164 }
5165 else
5166 {
5167 yydestruct ("Error: discarding",
5168 yytoken, &yylval, context);
5169 yychar = YYEMPTY;
5170 }
5171 }
5172
5173 /* Else will try to reuse lookahead token after shifting the error
5174 token. */
5175 goto yyerrlab1;
5176
5177
5178/*---------------------------------------------------.
5179| yyerrorlab -- error raised explicitly by YYERROR. |
5180`---------------------------------------------------*/
5181yyerrorlab:
5182
5183 /* Pacify compilers like GCC when the user code never invokes
5184 YYERROR and the label yyerrorlab therefore never appears in user
5185 code. */
5186 if (/*CONSTCOND*/ 0)
5187 goto yyerrorlab;
5188
5189 /* Do not reclaim the symbols of the rule which action triggered
5190 this YYERROR. */
5191 YYPOPSTACK (yylen);
5192 yylen = 0;
5193 YY_STACK_PRINT (yyss, yyssp);
5194 yystate = *yyssp;
5195 goto yyerrlab1;
5196
5197
5198/*-------------------------------------------------------------.
5199| yyerrlab1 -- common code for both syntax error and YYERROR. |
5200`-------------------------------------------------------------*/
5201yyerrlab1:
5202 yyerrstatus = 3; /* Each real token shifted decrements this. */
5203
5204 for (;;)
5205 {
5206 yyn = yypact[yystate];
5207 if (yyn != YYPACT_NINF)
5208 {
5209 yyn += YYTERROR;
5210 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5211 {
5212 yyn = yytable[yyn];
5213 if (0 < yyn)
5214 break;
5215 }
5216 }
5217
5218 /* Pop the current state because it cannot handle the error token. */
5219 if (yyssp == yyss)
5220 YYABORT;
5221
5222
5223 yydestruct ("Error: popping",
5224 yystos[yystate], yyvsp, context);
5225 YYPOPSTACK (1);
5226 yystate = *yyssp;
5227 YY_STACK_PRINT (yyss, yyssp);
5228 }
5229
5230 *++yyvsp = yylval;
5231
5232
5233 /* Shift the error token. */
5234 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5235
5236 yystate = yyn;
5237 goto yynewstate;
5238
5239
5240/*-------------------------------------.
5241| yyacceptlab -- YYACCEPT comes here. |
5242`-------------------------------------*/
5243yyacceptlab:
5244 yyresult = 0;
5245 goto yyreturn;
5246
5247/*-----------------------------------.
5248| yyabortlab -- YYABORT comes here. |
5249`-----------------------------------*/
5250yyabortlab:
5251 yyresult = 1;
5252 goto yyreturn;
5253
5254#if !defined(yyoverflow) || YYERROR_VERBOSE
5255/*-------------------------------------------------.
5256| yyexhaustedlab -- memory exhaustion comes here. |
5257`-------------------------------------------------*/
5258yyexhaustedlab:
5259 yyerror (context, YY_("memory exhausted"));
5260 yyresult = 2;
5261 /* Fall through. */
5262#endif
5263
5264yyreturn:
5265 if (yychar != YYEMPTY)
5266 yydestruct ("Cleanup: discarding lookahead",
5267 yytoken, &yylval, context);
5268 /* Do not reclaim the symbols of the rule which action triggered
5269 this YYABORT or YYACCEPT. */
5270 YYPOPSTACK (yylen);
5271 YY_STACK_PRINT (yyss, yyssp);
5272 while (yyssp != yyss)
5273 {
5274 yydestruct ("Cleanup: popping",
5275 yystos[*yyssp], yyvsp, context);
5276 YYPOPSTACK (1);
5277 }
5278#ifndef yyoverflow
5279 if (yyss != yyssa)
5280 YYSTACK_FREE (yyss);
5281#endif
5282#if YYERROR_VERBOSE
5283 if (yymsg != yymsgbuf)
5284 YYSTACK_FREE (yymsg);
5285#endif
5286 /* Make sure YYID is used. */
5287 return YYID (yyresult);
5288}
5289
5290
5291
5292
5293
5294int glslang_parse(TParseContext* context) {
5295 return yyparse(context);
5296}
5297