blob: 7541572825feb0a1485ac6299a263b7ac78039b4 [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. */
Alexis Hetu15ae36c2015-06-18 21:10:09 -040064#define YYLSP_NEEDED 1
John Bauman66b8ab22014-05-06 15:57:45 -040065
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
John Baumand4ae8632014-05-06 16:18:33 -040095
John Bauman66b8ab22014-05-06 15:57:45 -040096#define YYLEX_PARAM context->scanner
97
98
99
100/* Enabling traces. */
101#ifndef YYDEBUG
102# define YYDEBUG 0
103#endif
104
105/* Enabling verbose error messages. */
106#ifdef YYERROR_VERBOSE
107# undef YYERROR_VERBOSE
108# define YYERROR_VERBOSE 1
109#else
110# define YYERROR_VERBOSE 0
111#endif
112
113/* Enabling the token table. */
114#ifndef YYTOKEN_TABLE
115# define YYTOKEN_TABLE 0
116#endif
117
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400118/* "%code requires" blocks. */
119
120
121#define YYLTYPE TSourceLoc
122#define YYLTYPE_IS_DECLARED 1
123
124
125
John Bauman66b8ab22014-05-06 15:57:45 -0400126
127/* Tokens. */
128#ifndef YYTOKENTYPE
129# define YYTOKENTYPE
130 /* Put the tokens into the symbol table, so that GDB and other debuggers
131 know about them. */
132 enum yytokentype {
133 INVARIANT = 258,
134 HIGH_PRECISION = 259,
135 MEDIUM_PRECISION = 260,
136 LOW_PRECISION = 261,
137 PRECISION = 262,
138 ATTRIBUTE = 263,
139 CONST_QUAL = 264,
140 BOOL_TYPE = 265,
141 FLOAT_TYPE = 266,
142 INT_TYPE = 267,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500143 UINT_TYPE = 268,
144 BREAK = 269,
145 CONTINUE = 270,
146 DO = 271,
147 ELSE = 272,
148 FOR = 273,
149 IF = 274,
150 DISCARD = 275,
151 RETURN = 276,
152 SWITCH = 277,
153 CASE = 278,
154 DEFAULT = 279,
155 BVEC2 = 280,
156 BVEC3 = 281,
157 BVEC4 = 282,
158 IVEC2 = 283,
159 IVEC3 = 284,
160 IVEC4 = 285,
161 VEC2 = 286,
162 VEC3 = 287,
163 VEC4 = 288,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500164 UVEC2 = 289,
165 UVEC3 = 290,
166 UVEC4 = 291,
167 MATRIX2 = 292,
168 MATRIX3 = 293,
169 MATRIX4 = 294,
170 IN_QUAL = 295,
171 OUT_QUAL = 296,
172 INOUT_QUAL = 297,
173 UNIFORM = 298,
174 VARYING = 299,
Alexis Hetub14178b2015-04-13 13:23:20 -0400175 MATRIX2x3 = 300,
176 MATRIX3x2 = 301,
177 MATRIX2x4 = 302,
178 MATRIX4x2 = 303,
179 MATRIX3x4 = 304,
180 MATRIX4x3 = 305,
181 CENTROID = 306,
182 FLAT = 307,
183 SMOOTH = 308,
184 STRUCT = 309,
185 VOID_TYPE = 310,
186 WHILE = 311,
187 SAMPLER2D = 312,
188 SAMPLERCUBE = 313,
189 SAMPLER_EXTERNAL_OES = 314,
190 SAMPLER2DRECT = 315,
191 SAMPLER2DARRAY = 316,
192 ISAMPLER2D = 317,
193 ISAMPLER3D = 318,
194 ISAMPLERCUBE = 319,
195 ISAMPLER2DARRAY = 320,
196 USAMPLER2D = 321,
197 USAMPLER3D = 322,
198 USAMPLERCUBE = 323,
199 USAMPLER2DARRAY = 324,
200 SAMPLER3D = 325,
201 SAMPLER3DRECT = 326,
202 SAMPLER2DSHADOW = 327,
203 SAMPLERCUBESHADOW = 328,
204 SAMPLER2DARRAYSHADOW = 329,
205 LAYOUT = 330,
206 IDENTIFIER = 331,
207 TYPE_NAME = 332,
208 FLOATCONSTANT = 333,
209 INTCONSTANT = 334,
210 UINTCONSTANT = 335,
211 BOOLCONSTANT = 336,
212 FIELD_SELECTION = 337,
213 LEFT_OP = 338,
214 RIGHT_OP = 339,
215 INC_OP = 340,
216 DEC_OP = 341,
217 LE_OP = 342,
218 GE_OP = 343,
219 EQ_OP = 344,
220 NE_OP = 345,
221 AND_OP = 346,
222 OR_OP = 347,
223 XOR_OP = 348,
224 MUL_ASSIGN = 349,
225 DIV_ASSIGN = 350,
226 ADD_ASSIGN = 351,
227 MOD_ASSIGN = 352,
228 LEFT_ASSIGN = 353,
229 RIGHT_ASSIGN = 354,
230 AND_ASSIGN = 355,
231 XOR_ASSIGN = 356,
232 OR_ASSIGN = 357,
233 SUB_ASSIGN = 358,
234 LEFT_PAREN = 359,
235 RIGHT_PAREN = 360,
236 LEFT_BRACKET = 361,
237 RIGHT_BRACKET = 362,
238 LEFT_BRACE = 363,
239 RIGHT_BRACE = 364,
240 DOT = 365,
241 COMMA = 366,
242 COLON = 367,
243 EQUAL = 368,
244 SEMICOLON = 369,
245 BANG = 370,
246 DASH = 371,
247 TILDE = 372,
248 PLUS = 373,
249 STAR = 374,
250 SLASH = 375,
251 PERCENT = 376,
252 LEFT_ANGLE = 377,
253 RIGHT_ANGLE = 378,
254 VERTICAL_BAR = 379,
255 CARET = 380,
256 AMPERSAND = 381,
257 QUESTION = 382
John Bauman66b8ab22014-05-06 15:57:45 -0400258 };
259#endif
260
261
262
263#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
264typedef union YYSTYPE
265{
266
267
268 struct {
269 TSourceLoc line;
270 union {
271 TString *string;
272 float f;
273 int i;
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500274 unsigned int u;
John Bauman66b8ab22014-05-06 15:57:45 -0400275 bool b;
276 };
277 TSymbol* symbol;
278 } lex;
279 struct {
280 TSourceLoc line;
281 TOperator op;
282 union {
283 TIntermNode* intermNode;
284 TIntermNodePair nodePair;
285 TIntermTyped* intermTypedNode;
286 TIntermAggregate* intermAggregate;
Alexis Hetu76a343a2015-06-04 17:21:22 -0400287 TIntermSwitch* intermSwitch;
288 TIntermCase* intermCase;
John Bauman66b8ab22014-05-06 15:57:45 -0400289 };
290 union {
291 TPublicType type;
292 TPrecision precision;
Nicolas Capens7d626792015-02-17 17:58:31 -0500293 TLayoutQualifier layoutQualifier;
John Bauman66b8ab22014-05-06 15:57:45 -0400294 TQualifier qualifier;
295 TFunction* function;
296 TParameter param;
Alexis Hetua8b364b2015-06-10 11:48:40 -0400297 TField* field;
298 TFieldList* fieldList;
John Bauman66b8ab22014-05-06 15:57:45 -0400299 };
300 } interm;
301
302
303
304} YYSTYPE;
305# define YYSTYPE_IS_TRIVIAL 1
306# define yystype YYSTYPE /* obsolescent; will be withdrawn */
307# define YYSTYPE_IS_DECLARED 1
308#endif
309
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400310#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
311typedef struct YYLTYPE
312{
313 int first_line;
314 int first_column;
315 int last_line;
316 int last_column;
317} YYLTYPE;
318# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
319# define YYLTYPE_IS_DECLARED 1
320# define YYLTYPE_IS_TRIVIAL 1
321#endif
322
John Bauman66b8ab22014-05-06 15:57:45 -0400323
324/* Copy the second part of user declarations. */
325
326
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400327extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner);
328extern void yyerror(YYLTYPE* lloc, TParseContext* context, const char* reason);
329
330#define YYLLOC_DEFAULT(Current, Rhs, N) do { (Current) = YYRHSLOC(Rhs, N ? 1 : 0); } while (0)
John Bauman66b8ab22014-05-06 15:57:45 -0400331
332#define FRAG_VERT_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500333 if (context->shaderType != GL_FRAGMENT_SHADER && \
334 context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400335 context->error(L, " supported in vertex/fragment shaders only ", S); \
336 context->recover(); \
337 } \
338}
339
340#define VERTEX_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500341 if (context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400342 context->error(L, " supported in vertex shaders only ", S); \
343 context->recover(); \
344 } \
345}
346
347#define FRAG_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500348 if (context->shaderType != GL_FRAGMENT_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400349 context->error(L, " supported in fragment shaders only ", S); \
350 context->recover(); \
351 } \
352}
353
Nicolas Capensc6841852015-02-15 14:25:37 -0500354#define ES2_ONLY(S, L) { \
355 if (context->shaderVersion != 100) { \
356 context->error(L, " supported in GLSL ES 1.00 only ", S); \
357 context->recover(); \
358 } \
359}
360
361#define ES3_ONLY(S, L) { \
362 if (context->shaderVersion != 300) { \
363 context->error(L, " supported in GLSL ES 3.00 only ", S); \
364 context->recover(); \
365 } \
366}
367
John Bauman66b8ab22014-05-06 15:57:45 -0400368
369
370#ifdef short
371# undef short
372#endif
373
374#ifdef YYTYPE_UINT8
375typedef YYTYPE_UINT8 yytype_uint8;
376#else
377typedef unsigned char yytype_uint8;
378#endif
379
380#ifdef YYTYPE_INT8
381typedef YYTYPE_INT8 yytype_int8;
382#elif (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384typedef signed char yytype_int8;
385#else
386typedef short int yytype_int8;
387#endif
388
389#ifdef YYTYPE_UINT16
390typedef YYTYPE_UINT16 yytype_uint16;
391#else
392typedef unsigned short int yytype_uint16;
393#endif
394
395#ifdef YYTYPE_INT16
396typedef YYTYPE_INT16 yytype_int16;
397#else
398typedef short int yytype_int16;
399#endif
400
401#ifndef YYSIZE_T
402# ifdef __SIZE_TYPE__
403# define YYSIZE_T __SIZE_TYPE__
404# elif defined size_t
405# define YYSIZE_T size_t
406# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
407 || defined __cplusplus || defined _MSC_VER)
408# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
409# define YYSIZE_T size_t
410# else
411# define YYSIZE_T unsigned int
412# endif
413#endif
414
415#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
416
417#ifndef YY_
Nicolas Capense9c5e4f2014-05-28 22:46:43 -0400418# if YYENABLE_NLS
John Bauman66b8ab22014-05-06 15:57:45 -0400419# if ENABLE_NLS
420# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
421# define YY_(msgid) dgettext ("bison-runtime", msgid)
422# endif
423# endif
424# ifndef YY_
425# define YY_(msgid) msgid
426# endif
427#endif
428
429/* Suppress unused-variable warnings by "using" E. */
430#if ! defined lint || defined __GNUC__
431# define YYUSE(e) ((void) (e))
432#else
433# define YYUSE(e) /* empty */
434#endif
435
436/* Identity function, used to suppress warnings about constant conditions. */
437#ifndef lint
438# define YYID(n) (n)
439#else
440#if (defined __STDC__ || defined __C99__FUNC__ \
441 || defined __cplusplus || defined _MSC_VER)
442static int
443YYID (int yyi)
444#else
445static int
446YYID (yyi)
447 int yyi;
448#endif
449{
450 return yyi;
451}
452#endif
453
454#if ! defined yyoverflow || YYERROR_VERBOSE
455
456/* The parser invokes alloca or malloc; define the necessary symbols. */
457
458# ifdef YYSTACK_USE_ALLOCA
459# if YYSTACK_USE_ALLOCA
460# ifdef __GNUC__
461# define YYSTACK_ALLOC __builtin_alloca
462# elif defined __BUILTIN_VA_ARG_INCR
463# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
464# elif defined _AIX
465# define YYSTACK_ALLOC __alloca
466# elif defined _MSC_VER
467# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
468# define alloca _alloca
469# else
470# define YYSTACK_ALLOC alloca
471# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
473# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
474# ifndef _STDLIB_H
475# define _STDLIB_H 1
476# endif
477# endif
478# endif
479# endif
480# endif
481
482# ifdef YYSTACK_ALLOC
483 /* Pacify GCC's `empty if-body' warning. */
484# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
485# ifndef YYSTACK_ALLOC_MAXIMUM
486 /* The OS might guarantee only one guard page at the bottom of the stack,
487 and a page size can be as small as 4096 bytes. So we cannot safely
488 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
489 to allow for a few compiler-allocated temporary stack slots. */
490# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
491# endif
492# else
493# define YYSTACK_ALLOC YYMALLOC
494# define YYSTACK_FREE YYFREE
495# ifndef YYSTACK_ALLOC_MAXIMUM
496# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
497# endif
498# if (defined __cplusplus && ! defined _STDLIB_H \
499 && ! ((defined YYMALLOC || defined malloc) \
500 && (defined YYFREE || defined free)))
501# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
502# ifndef _STDLIB_H
503# define _STDLIB_H 1
504# endif
505# endif
506# ifndef YYMALLOC
507# define YYMALLOC malloc
508# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
509 || defined __cplusplus || defined _MSC_VER)
510void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
511# endif
512# endif
513# ifndef YYFREE
514# define YYFREE free
515# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
516 || defined __cplusplus || defined _MSC_VER)
517void free (void *); /* INFRINGES ON USER NAME SPACE */
518# endif
519# endif
520# endif
521#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
522
523
524#if (! defined yyoverflow \
525 && (! defined __cplusplus \
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400526 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
527 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
John Bauman66b8ab22014-05-06 15:57:45 -0400528
529/* A type that is properly aligned for any stack member. */
530union yyalloc
531{
532 yytype_int16 yyss_alloc;
533 YYSTYPE yyvs_alloc;
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400534 YYLTYPE yyls_alloc;
John Bauman66b8ab22014-05-06 15:57:45 -0400535};
536
537/* The size of the maximum gap between one aligned stack and the next. */
538# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
539
540/* The size of an array large to enough to hold all stacks, each with
541 N elements. */
542# define YYSTACK_BYTES(N) \
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400543 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
544 + 2 * YYSTACK_GAP_MAXIMUM)
John Bauman66b8ab22014-05-06 15:57:45 -0400545
546/* Copy COUNT objects from FROM to TO. The source and destination do
547 not overlap. */
548# ifndef YYCOPY
549# if defined __GNUC__ && 1 < __GNUC__
550# define YYCOPY(To, From, Count) \
551 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
552# else
553# define YYCOPY(To, From, Count) \
554 do \
555 { \
556 YYSIZE_T yyi; \
557 for (yyi = 0; yyi < (Count); yyi++) \
558 (To)[yyi] = (From)[yyi]; \
559 } \
560 while (YYID (0))
561# endif
562# endif
563
564/* Relocate STACK from its old location to the new one. The
565 local variables YYSIZE and YYSTACKSIZE give the old and new number of
566 elements in the stack, and YYPTR gives the new location of the
567 stack. Advance YYPTR to a properly aligned location for the next
568 stack. */
569# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
570 do \
571 { \
572 YYSIZE_T yynewbytes; \
573 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
574 Stack = &yyptr->Stack_alloc; \
575 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
576 yyptr += yynewbytes / sizeof (*yyptr); \
577 } \
578 while (YYID (0))
579
580#endif
581
582/* YYFINAL -- State number of the termination state. */
Alexis Hetua35d8232015-06-11 17:11:06 -0400583#define YYFINAL 110
John Bauman66b8ab22014-05-06 15:57:45 -0400584/* YYLAST -- Last index in YYTABLE. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400585#define YYLAST 2412
John Bauman66b8ab22014-05-06 15:57:45 -0400586
587/* YYNTOKENS -- Number of terminals. */
Alexis Hetub14178b2015-04-13 13:23:20 -0400588#define YYNTOKENS 128
John Bauman66b8ab22014-05-06 15:57:45 -0400589/* YYNNTS -- Number of nonterminals. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400590#define YYNNTS 93
John Bauman66b8ab22014-05-06 15:57:45 -0400591/* YYNRULES -- Number of rules. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400592#define YYNRULES 269
John Bauman66b8ab22014-05-06 15:57:45 -0400593/* YYNRULES -- Number of states. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400594#define YYNSTATES 409
John Bauman66b8ab22014-05-06 15:57:45 -0400595
596/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
597#define YYUNDEFTOK 2
Alexis Hetub14178b2015-04-13 13:23:20 -0400598#define YYMAXUTOK 382
John Bauman66b8ab22014-05-06 15:57:45 -0400599
600#define YYTRANSLATE(YYX) \
601 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
602
603/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
604static const yytype_uint8 yytranslate[] =
605{
606 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
632 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
633 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
634 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
635 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
636 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
637 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
638 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
639 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
Alexis Hetub027aa92015-01-19 15:56:12 -0500640 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500641 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Alexis Hetub14178b2015-04-13 13:23:20 -0400642 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
643 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
644 125, 126, 127
John Bauman66b8ab22014-05-06 15:57:45 -0400645};
646
647#if YYDEBUG
648/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
649 YYRHS. */
650static const yytype_uint16 yyprhs[] =
651{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500652 0, 0, 3, 5, 7, 9, 11, 13, 15, 19,
653 21, 26, 28, 32, 35, 38, 40, 42, 44, 48,
654 51, 54, 57, 59, 62, 66, 69, 71, 73, 75,
Alexis Hetu17809052015-05-13 11:28:22 -0400655 77, 80, 83, 86, 88, 90, 92, 94, 96, 100,
656 104, 108, 110, 114, 118, 120, 124, 128, 130, 134,
657 138, 142, 146, 148, 152, 156, 158, 162, 164, 168,
658 170, 174, 176, 180, 182, 186, 188, 192, 194, 200,
659 202, 206, 208, 210, 212, 214, 216, 218, 220, 222,
Alexis Hetua35d8232015-06-11 17:11:06 -0400660 224, 226, 228, 230, 234, 236, 239, 242, 245, 250,
661 256, 263, 273, 276, 279, 281, 283, 286, 290, 294,
662 297, 303, 307, 310, 314, 317, 318, 320, 322, 324,
663 326, 328, 332, 339, 347, 356, 362, 364, 367, 373,
664 380, 388, 393, 396, 398, 401, 403, 405, 407, 409,
665 411, 414, 416, 419, 421, 423, 426, 428, 430, 432,
666 435, 438, 440, 442, 445, 447, 449, 451, 456, 458,
667 462, 464, 468, 472, 474, 479, 481, 483, 485, 487,
668 489, 491, 493, 495, 497, 499, 501, 503, 505, 507,
669 509, 511, 513, 515, 517, 519, 521, 523, 525, 527,
670 529, 531, 533, 535, 537, 539, 541, 543, 545, 547,
671 549, 551, 553, 555, 557, 559, 561, 563, 565, 567,
672 568, 575, 576, 582, 584, 587, 591, 596, 598, 602,
673 604, 609, 611, 613, 615, 617, 619, 621, 623, 625,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400674 627, 629, 631, 634, 635, 636, 642, 644, 646, 647,
675 650, 651, 654, 657, 661, 663, 666, 668, 671, 677,
676 681, 683, 684, 691, 695, 698, 700, 705, 706, 713,
677 714, 723, 724, 732, 734, 736, 738, 739, 742, 746,
678 749, 752, 755, 759, 762, 764, 767, 769, 771, 772
John Bauman66b8ab22014-05-06 15:57:45 -0400679};
680
681/* YYRHS -- A `-1'-separated list of the rules' RHS. */
682static const yytype_int16 yyrhs[] =
683{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400684 217, 0, -1, 76, -1, 129, -1, 79, -1, 80,
Alexis Hetub14178b2015-04-13 13:23:20 -0400685 -1, 78, -1, 81, -1, 104, 156, 105, -1, 130,
686 -1, 131, 106, 132, 107, -1, 133, -1, 131, 110,
687 82, -1, 131, 85, -1, 131, 86, -1, 156, -1,
688 134, -1, 135, -1, 131, 110, 135, -1, 137, 105,
689 -1, 136, 105, -1, 138, 55, -1, 138, -1, 138,
Alexis Hetua35d8232015-06-11 17:11:06 -0400690 154, -1, 137, 111, 154, -1, 139, 104, -1, 181,
Alexis Hetub14178b2015-04-13 13:23:20 -0400691 -1, 76, -1, 82, -1, 131, -1, 85, 140, -1,
692 86, 140, -1, 141, 140, -1, 118, -1, 116, -1,
Alexis Hetu17809052015-05-13 11:28:22 -0400693 115, -1, 117, -1, 140, -1, 142, 119, 140, -1,
694 142, 120, 140, -1, 142, 121, 140, -1, 142, -1,
695 143, 118, 142, -1, 143, 116, 142, -1, 143, -1,
696 144, 83, 143, -1, 144, 84, 143, -1, 144, -1,
697 145, 122, 144, -1, 145, 123, 144, -1, 145, 87,
698 144, -1, 145, 88, 144, -1, 145, -1, 146, 89,
699 145, -1, 146, 90, 145, -1, 146, -1, 147, 126,
700 146, -1, 147, -1, 148, 125, 147, -1, 148, -1,
701 149, 124, 148, -1, 149, -1, 150, 91, 149, -1,
702 150, -1, 151, 93, 150, -1, 151, -1, 152, 92,
703 151, -1, 152, -1, 152, 127, 156, 112, 154, -1,
704 153, -1, 140, 155, 154, -1, 113, -1, 94, -1,
705 95, -1, 97, -1, 96, -1, 103, -1, 98, -1,
706 99, -1, 100, -1, 101, -1, 102, -1, 154, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400707 156, 111, 154, -1, 153, -1, 76, 108, -1, 160,
708 114, -1, 168, 114, -1, 7, 176, 180, 114, -1,
709 173, 158, 185, 109, 114, -1, 173, 158, 185, 109,
710 76, 114, -1, 173, 158, 185, 109, 76, 106, 157,
711 107, 114, -1, 173, 114, -1, 161, 105, -1, 163,
712 -1, 162, -1, 163, 165, -1, 162, 111, 165, -1,
713 170, 76, 104, -1, 175, 76, -1, 175, 76, 106,
714 157, 107, -1, 172, 166, 164, -1, 166, 164, -1,
715 172, 166, 167, -1, 166, 167, -1, -1, 40, -1,
716 41, -1, 42, -1, 175, -1, 169, -1, 168, 111,
717 76, -1, 168, 111, 76, 106, 157, 107, -1, 168,
718 111, 76, 106, 107, 113, 189, -1, 168, 111, 76,
719 106, 157, 107, 113, 189, -1, 168, 111, 76, 113,
720 189, -1, 170, -1, 170, 76, -1, 170, 76, 106,
721 157, 107, -1, 170, 76, 106, 107, 113, 189, -1,
722 170, 76, 106, 157, 107, 113, 189, -1, 170, 76,
723 113, 189, -1, 3, 76, -1, 175, -1, 173, 175,
724 -1, 53, -1, 52, -1, 9, -1, 8, -1, 44,
725 -1, 3, 44, -1, 174, -1, 171, 174, -1, 171,
726 -1, 177, -1, 177, 174, -1, 9, -1, 40, -1,
727 41, -1, 51, 40, -1, 51, 41, -1, 43, -1,
728 180, -1, 176, 180, -1, 4, -1, 5, -1, 6,
729 -1, 75, 104, 178, 105, -1, 179, -1, 178, 111,
730 179, -1, 76, -1, 76, 113, 79, -1, 76, 113,
731 80, -1, 181, -1, 181, 106, 157, 107, -1, 55,
732 -1, 11, -1, 12, -1, 13, -1, 10, -1, 31,
733 -1, 32, -1, 33, -1, 25, -1, 26, -1, 27,
734 -1, 28, -1, 29, -1, 30, -1, 34, -1, 35,
735 -1, 36, -1, 37, -1, 38, -1, 39, -1, 45,
736 -1, 46, -1, 47, -1, 48, -1, 49, -1, 50,
737 -1, 57, -1, 58, -1, 59, -1, 70, -1, 61,
738 -1, 62, -1, 63, -1, 64, -1, 65, -1, 66,
739 -1, 67, -1, 68, -1, 69, -1, 72, -1, 73,
740 -1, 74, -1, 182, -1, 77, -1, -1, 54, 76,
741 108, 183, 185, 109, -1, -1, 54, 108, 184, 185,
742 109, -1, 186, -1, 185, 186, -1, 175, 187, 114,
743 -1, 173, 175, 187, 114, -1, 188, -1, 187, 111,
744 188, -1, 76, -1, 76, 106, 157, 107, -1, 154,
745 -1, 159, -1, 193, -1, 192, -1, 190, -1, 202,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400746 -1, 203, -1, 205, -1, 207, -1, 209, -1, 216,
747 -1, 108, 109, -1, -1, -1, 108, 194, 201, 195,
748 109, -1, 200, -1, 192, -1, -1, 198, 200, -1,
749 -1, 199, 192, -1, 108, 109, -1, 108, 201, 109,
750 -1, 191, -1, 201, 191, -1, 114, -1, 156, 114,
751 -1, 19, 104, 156, 105, 204, -1, 197, 17, 197,
752 -1, 197, -1, -1, 22, 104, 156, 105, 206, 193,
753 -1, 23, 157, 112, -1, 24, 112, -1, 156, -1,
754 170, 76, 113, 189, -1, -1, 56, 104, 210, 208,
755 105, 196, -1, -1, 16, 211, 197, 56, 104, 156,
756 105, 114, -1, -1, 18, 104, 212, 213, 215, 105,
757 196, -1, 202, -1, 190, -1, 208, -1, -1, 214,
758 114, -1, 214, 114, 156, -1, 15, 114, -1, 14,
759 114, -1, 21, 114, -1, 21, 156, 114, -1, 20,
760 114, -1, 218, -1, 217, 218, -1, 219, -1, 159,
761 -1, -1, 160, 220, 200, -1
John Bauman66b8ab22014-05-06 15:57:45 -0400762};
763
764/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
765static const yytype_uint16 yyrline[] =
766{
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400767 0, 202, 202, 237, 240, 245, 250, 255, 260, 266,
768 269, 272, 275, 278, 281, 287, 295, 395, 398, 406,
769 410, 417, 421, 428, 434, 443, 451, 528, 535, 545,
Alexis Hetub4769582015-06-16 12:19:50 -0400770 548, 558, 568, 590, 591, 592, 593, 601, 602, 606,
771 610, 618, 619, 622, 628, 629, 633, 640, 641, 644,
772 647, 650, 656, 657, 660, 666, 667, 674, 675, 682,
773 683, 690, 691, 697, 698, 704, 705, 711, 712, 729,
774 730, 743, 744, 745, 746, 748, 749, 750, 752, 754,
775 756, 758, 763, 766, 777, 785, 793, 820, 826, 833,
776 837, 841, 845, 852, 890, 893, 900, 908, 929, 950,
777 961, 990, 995, 1005, 1010, 1020, 1023, 1026, 1029, 1035,
778 1042, 1045, 1049, 1053, 1058, 1063, 1070, 1074, 1078, 1082,
779 1087, 1092, 1096, 1172, 1182, 1188, 1191, 1197, 1203, 1210,
780 1219, 1228, 1231, 1234, 1241, 1245, 1252, 1256, 1261, 1266,
781 1276, 1286, 1295, 1305, 1312, 1315, 1318, 1324, 1331, 1334,
782 1340, 1343, 1346, 1352, 1355, 1370, 1374, 1378, 1382, 1386,
783 1390, 1395, 1400, 1405, 1410, 1415, 1420, 1425, 1430, 1435,
784 1440, 1445, 1450, 1456, 1462, 1468, 1474, 1480, 1486, 1492,
785 1498, 1504, 1509, 1514, 1523, 1528, 1533, 1538, 1543, 1548,
786 1553, 1558, 1563, 1568, 1573, 1578, 1583, 1588, 1593, 1606,
787 1606, 1609, 1609, 1615, 1618, 1634, 1637, 1646, 1650, 1656,
788 1663, 1678, 1682, 1686, 1687, 1693, 1694, 1695, 1696, 1697,
789 1698, 1699, 1703, 1704, 1704, 1704, 1714, 1715, 1719, 1719,
790 1720, 1720, 1725, 1728, 1738, 1741, 1747, 1748, 1752, 1760,
791 1764, 1771, 1771, 1778, 1781, 1790, 1795, 1812, 1812, 1817,
792 1817, 1824, 1824, 1832, 1835, 1841, 1844, 1850, 1854, 1861,
793 1864, 1867, 1870, 1873, 1882, 1886, 1893, 1896, 1902, 1902
John Bauman66b8ab22014-05-06 15:57:45 -0400794};
795#endif
796
797#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
798/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
799 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
800static const char *const yytname[] =
801{
802 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
803 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
Nicolas Capens3c20f802015-02-17 17:17:20 -0500804 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE",
805 "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN",
806 "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500807 "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2",
808 "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
Alexis Hetub14178b2015-04-13 13:23:20 -0400809 "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2",
810 "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT",
811 "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES",
812 "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D",
813 "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
814 "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT",
815 "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT",
816 "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
817 "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
818 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
819 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
820 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
821 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500822 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
823 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
824 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
825 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
826 "primary_expression", "postfix_expression", "integer_expression",
827 "function_call", "function_call_or_method", "function_call_generic",
John Bauman66b8ab22014-05-06 15:57:45 -0400828 "function_call_header_no_parameters",
829 "function_call_header_with_parameters", "function_call_header",
830 "function_identifier", "unary_expression", "unary_operator",
831 "multiplicative_expression", "additive_expression", "shift_expression",
832 "relational_expression", "equality_expression", "and_expression",
833 "exclusive_or_expression", "inclusive_or_expression",
834 "logical_and_expression", "logical_xor_expression",
835 "logical_or_expression", "conditional_expression",
836 "assignment_expression", "assignment_operator", "expression",
Alexis Hetua35d8232015-06-11 17:11:06 -0400837 "constant_expression", "enter_struct", "declaration",
838 "function_prototype", "function_declarator",
839 "function_header_with_parameters", "function_header",
840 "parameter_declarator", "parameter_declaration", "parameter_qualifier",
841 "parameter_type_specifier", "init_declarator_list", "single_declaration",
842 "fully_specified_type", "interpolation_qualifier",
843 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
844 "type_specifier", "precision_qualifier", "layout_qualifier",
845 "layout_qualifier_id_list", "layout_qualifier_id",
Nicolas Capens7d626792015-02-17 17:58:31 -0500846 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
847 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
John Bauman66b8ab22014-05-06 15:57:45 -0400848 "struct_declarator_list", "struct_declarator", "initializer",
849 "declaration_statement", "statement", "simple_statement",
850 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
851 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
852 "statement_list", "expression_statement", "selection_statement",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400853 "selection_rest_statement", "switch_statement", "$@7", "case_label",
854 "condition", "iteration_statement", "$@8", "$@9", "$@10",
855 "for_init_statement", "conditionopt", "for_rest_statement",
John Bauman66b8ab22014-05-06 15:57:45 -0400856 "jump_statement", "translation_unit", "external_declaration",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400857 "function_definition", "$@11", 0
John Bauman66b8ab22014-05-06 15:57:45 -0400858};
859#endif
860
861# ifdef YYPRINT
862/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
863 token YYLEX-NUM. */
864static const yytype_uint16 yytoknum[] =
865{
866 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
867 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
868 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
869 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
870 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
871 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
872 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
873 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
874 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
Nicolas Capensc6841852015-02-15 14:25:37 -0500875 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Nicolas Capens7d626792015-02-17 17:58:31 -0500876 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Alexis Hetub14178b2015-04-13 13:23:20 -0400877 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
878 375, 376, 377, 378, 379, 380, 381, 382
John Bauman66b8ab22014-05-06 15:57:45 -0400879};
880# endif
881
882/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
883static const yytype_uint8 yyr1[] =
884{
Alexis Hetub14178b2015-04-13 13:23:20 -0400885 0, 128, 129, 130, 130, 130, 130, 130, 130, 131,
886 131, 131, 131, 131, 131, 132, 133, 134, 134, 135,
887 135, 136, 136, 137, 137, 138, 139, 139, 139, 140,
Alexis Hetu17809052015-05-13 11:28:22 -0400888 140, 140, 140, 141, 141, 141, 141, 142, 142, 142,
889 142, 143, 143, 143, 144, 144, 144, 145, 145, 145,
890 145, 145, 146, 146, 146, 147, 147, 148, 148, 149,
891 149, 150, 150, 151, 151, 152, 152, 153, 153, 154,
892 154, 155, 155, 155, 155, 155, 155, 155, 155, 155,
Alexis Hetua35d8232015-06-11 17:11:06 -0400893 155, 155, 156, 156, 157, 158, 159, 159, 159, 159,
894 159, 159, 159, 160, 161, 161, 162, 162, 163, 164,
895 164, 165, 165, 165, 165, 166, 166, 166, 166, 167,
896 168, 168, 168, 168, 168, 168, 169, 169, 169, 169,
897 169, 169, 169, 170, 170, 171, 171, 172, 173, 173,
898 173, 173, 173, 173, 173, 173, 174, 174, 174, 174,
899 174, 174, 175, 175, 176, 176, 176, 177, 178, 178,
900 179, 179, 179, 180, 180, 181, 181, 181, 181, 181,
901 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
902 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
903 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
904 181, 181, 181, 181, 181, 181, 181, 181, 181, 183,
905 182, 184, 182, 185, 185, 186, 186, 187, 187, 188,
906 188, 189, 190, 191, 191, 192, 192, 192, 192, 192,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400907 192, 192, 193, 194, 195, 193, 196, 196, 198, 197,
908 199, 197, 200, 200, 201, 201, 202, 202, 203, 204,
909 204, 206, 205, 207, 207, 208, 208, 210, 209, 211,
910 209, 212, 209, 213, 213, 214, 214, 215, 215, 216,
911 216, 216, 216, 216, 217, 217, 218, 218, 220, 219
John Bauman66b8ab22014-05-06 15:57:45 -0400912};
913
914/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
915static const yytype_uint8 yyr2[] =
916{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500917 0, 2, 1, 1, 1, 1, 1, 1, 3, 1,
918 4, 1, 3, 2, 2, 1, 1, 1, 3, 2,
919 2, 2, 1, 2, 3, 2, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400920 2, 2, 2, 1, 1, 1, 1, 1, 3, 3,
921 3, 1, 3, 3, 1, 3, 3, 1, 3, 3,
922 3, 3, 1, 3, 3, 1, 3, 1, 3, 1,
923 3, 1, 3, 1, 3, 1, 3, 1, 5, 1,
924 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400925 1, 1, 1, 3, 1, 2, 2, 2, 4, 5,
926 6, 9, 2, 2, 1, 1, 2, 3, 3, 2,
927 5, 3, 2, 3, 2, 0, 1, 1, 1, 1,
928 1, 3, 6, 7, 8, 5, 1, 2, 5, 6,
929 7, 4, 2, 1, 2, 1, 1, 1, 1, 1,
930 2, 1, 2, 1, 1, 2, 1, 1, 1, 2,
931 2, 1, 1, 2, 1, 1, 1, 4, 1, 3,
932 1, 3, 3, 1, 4, 1, 1, 1, 1, 1,
John Bauman66b8ab22014-05-06 15:57:45 -0400933 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetub14178b2015-04-13 13:23:20 -0400934 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
935 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400936 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
937 6, 0, 5, 1, 2, 3, 4, 1, 3, 1,
938 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400939 1, 1, 2, 0, 0, 5, 1, 1, 0, 2,
940 0, 2, 2, 3, 1, 2, 1, 2, 5, 3,
941 1, 0, 6, 3, 2, 1, 4, 0, 6, 0,
942 8, 0, 7, 1, 1, 1, 0, 2, 3, 2,
943 2, 2, 3, 2, 1, 2, 1, 1, 0, 3
John Bauman66b8ab22014-05-06 15:57:45 -0400944};
945
946/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
947 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
948 means the default is an error. */
Alexis Hetuad6b8752015-06-09 16:15:30 -0400949static const yytype_uint16 yydefact[] =
John Bauman66b8ab22014-05-06 15:57:45 -0400950{
Alexis Hetua35d8232015-06-11 17:11:06 -0400951 0, 0, 144, 145, 146, 0, 128, 136, 159, 156,
952 157, 158, 163, 164, 165, 166, 167, 168, 160, 161,
953 162, 169, 170, 171, 172, 173, 174, 137, 138, 141,
954 129, 175, 176, 177, 178, 179, 180, 0, 126, 125,
955 0, 155, 181, 182, 183, 185, 186, 187, 188, 189,
956 190, 191, 192, 193, 184, 194, 195, 196, 0, 198,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400957 267, 268, 0, 95, 105, 0, 110, 116, 133, 0,
958 131, 123, 0, 134, 142, 153, 197, 0, 264, 266,
Alexis Hetua35d8232015-06-11 17:11:06 -0400959 130, 122, 0, 139, 140, 0, 201, 0, 86, 0,
960 93, 105, 127, 106, 107, 108, 96, 0, 105, 0,
961 87, 117, 132, 0, 92, 0, 124, 143, 135, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400962 1, 265, 0, 199, 0, 150, 0, 148, 0, 269,
Alexis Hetua35d8232015-06-11 17:11:06 -0400963 97, 102, 104, 109, 0, 111, 98, 0, 0, 85,
964 0, 0, 0, 0, 203, 2, 6, 4, 5, 7,
965 28, 0, 0, 0, 35, 34, 36, 33, 3, 9,
966 29, 11, 16, 17, 0, 0, 22, 0, 37, 0,
967 41, 44, 47, 52, 55, 57, 59, 61, 63, 65,
968 67, 84, 0, 26, 88, 0, 0, 0, 147, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400969 0, 0, 249, 0, 0, 0, 0, 0, 0, 0,
970 0, 223, 232, 236, 37, 69, 82, 0, 212, 0,
971 153, 215, 234, 214, 213, 0, 216, 217, 218, 219,
972 220, 221, 99, 101, 103, 0, 0, 0, 0, 211,
973 121, 0, 209, 0, 207, 0, 204, 30, 31, 0,
974 13, 14, 0, 0, 20, 19, 0, 21, 23, 25,
975 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -0400976 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400977 0, 154, 0, 202, 151, 152, 149, 260, 259, 230,
978 251, 0, 263, 261, 0, 0, 0, 244, 247, 222,
979 0, 72, 73, 75, 74, 77, 78, 79, 80, 81,
980 76, 71, 0, 0, 237, 233, 235, 0, 0, 0,
981 115, 0, 118, 0, 0, 0, 205, 0, 89, 8,
982 0, 15, 27, 12, 18, 24, 38, 39, 40, 43,
983 42, 45, 46, 50, 51, 48, 49, 53, 54, 56,
984 58, 60, 62, 64, 66, 0, 200, 0, 0, 0,
985 0, 0, 262, 0, 243, 0, 224, 70, 83, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -0400986 0, 112, 119, 0, 206, 0, 208, 0, 90, 10,
Alexis Hetu76a343a2015-06-04 17:21:22 -0400987 0, 0, 229, 231, 254, 253, 256, 230, 241, 245,
988 0, 0, 0, 0, 100, 113, 0, 120, 210, 0,
989 68, 0, 255, 0, 0, 240, 238, 0, 0, 0,
990 225, 114, 0, 0, 257, 0, 230, 242, 0, 227,
991 248, 226, 91, 0, 258, 252, 239, 246, 250
John Bauman66b8ab22014-05-06 15:57:45 -0400992};
993
994/* YYDEFGOTO[NTERM-NUM]. */
995static const yytype_int16 yydefgoto[] =
996{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400997 -1, 148, 149, 150, 310, 151, 152, 153, 154, 155,
998 156, 157, 194, 159, 160, 161, 162, 163, 164, 165,
999 166, 167, 168, 169, 170, 195, 196, 292, 197, 172,
1000 105, 198, 199, 62, 63, 64, 121, 96, 97, 122,
Alexis Hetua35d8232015-06-11 17:11:06 -04001001 65, 66, 67, 68, 98, 69, 70, 71, 72, 73,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001002 116, 117, 74, 173, 76, 175, 114, 133, 134, 223,
1003 224, 220, 201, 202, 203, 204, 280, 373, 400, 337,
1004 338, 339, 401, 205, 206, 207, 386, 208, 387, 209,
1005 372, 210, 345, 269, 340, 366, 383, 384, 211, 77,
1006 78, 79, 89
John Bauman66b8ab22014-05-06 15:57:45 -04001007};
1008
1009/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1010 STATE-NUM. */
Alexis Hetu76a343a2015-06-04 17:21:22 -04001011#define YYPACT_NINF -333
John Bauman66b8ab22014-05-06 15:57:45 -04001012static const yytype_int16 yypact[] =
1013{
Alexis Hetu76a343a2015-06-04 17:21:22 -04001014 2050, -21, -333, -333, -333, 21, -333, -333, -333, -333,
1015 -333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1016 -333, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1017 -333, -333, -333, -333, -333, -333, -333, 26, -333, -333,
1018 -46, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1019 -333, -333, -333, -333, -333, -333, -333, -333, -25, -333,
1020 -333, -78, -16, -15, -1, -43, -333, 34, 7, 1167,
1021 -333, -333, 2335, 7, -333, 31, -333, 1975, -333, -333,
1022 -333, -333, 2335, -333, -333, 5, -333, 47, -333, 54,
1023 -333, 19, -333, -333, -333, -333, -333, 2199, 114, 49,
1024 -333, -23, -333, 58, -333, 2125, -333, -333, -333, 1528,
1025 -333, -333, 13, -333, 2125, 33, -12, -333, 395, -333,
1026 -333, -333, -333, 104, 2199, -26, -333, 1237, 1528, -333,
1027 139, 2199, 113, 1720, -333, 86, -333, -333, -333, -333,
1028 -333, 1528, 1528, 1528, -333, -333, -333, -333, -333, -333,
1029 30, -333, -333, -333, 88, -5, 1623, 91, -333, 1528,
1030 38, 45, 1, -69, 75, 70, 72, 74, 109, 108,
1031 -70, -333, 95, -333, -333, 2125, 1805, 92, -333, 47,
1032 93, 94, -333, 102, 105, 107, 1335, 118, 1528, 111,
1033 120, 122, -333, -333, 117, -333, -333, -13, -333, -78,
1034 39, -333, -333, -333, -333, 511, -333, -333, -333, -333,
1035 -333, -333, 121, -333, -333, 1430, 1528, 119, 126, -333,
1036 -333, 113, 128, 18, -333, -63, -333, -333, -333, -2,
1037 -333, -333, 1528, 2267, -333, -333, 1528, 131, -333, -333,
1038 -333, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528,
1039 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528, 1528,
1040 1528, -333, 1890, -333, -333, -333, -333, -333, -333, 129,
1041 -333, 1528, -333, -333, 27, 1528, 127, -333, -333, -333,
1042 627, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1043 -333, -333, 1528, 1528, -333, -333, -333, 1528, 125, 134,
1044 -333, 1528, 132, 28, 1528, 113, -333, -62, -333, -333,
1045 135, 136, -333, 142, -333, -333, -333, -333, -333, 38,
1046 38, 45, 45, 1, 1, 1, 1, -69, -69, 75,
1047 70, 72, 74, 109, 108, 62, -333, 192, 54, 859,
1048 975, 6, -333, 15, -333, 1072, 627, -333, -333, 143,
1049 1528, 138, -333, 1528, -333, 149, -333, 1528, -333, -333,
1050 1528, 145, -333, -333, -333, -333, 1072, 129, -333, 136,
1051 181, 2199, 153, 150, -333, -333, 1528, -333, -333, 154,
1052 -333, 1528, -333, 146, 160, 249, -333, 159, 155, 743,
1053 -333, -333, 156, 17, 1528, 743, 129, -333, 1528, -333,
1054 -333, -333, -333, 157, 136, -333, -333, -333, -333
John Bauman66b8ab22014-05-06 15:57:45 -04001055};
1056
1057/* YYPGOTO[NTERM-NUM]. */
1058static const yytype_int16 yypgoto[] =
1059{
Alexis Hetu76a343a2015-06-04 17:21:22 -04001060 -333, -333, -333, -333, -333, -333, -333, 36, -333, -333,
1061 -333, -333, 40, -333, -66, -61, -98, -65, 22, 20,
1062 16, 43, 44, 14, -333, -94, -124, -333, -141, -113,
1063 -333, 9, 11, -333, -333, -333, 177, 186, 180, 182,
1064 -333, -333, -324, -333, -333, -102, -30, -68, 274, -333,
1065 -333, 130, -48, 0, -333, -333, -333, -97, -127, 83,
1066 2, -206, -35, -198, -319, -79, -333, -333, -85, -332,
1067 -333, -333, -84, 32, -29, -333, -333, -333, -333, -333,
1068 -53, -333, -333, -333, -333, -333, -333, -333, -333, -333,
1069 237, -333, -333
John Bauman66b8ab22014-05-06 15:57:45 -04001070};
1071
1072/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1073 positive, shift that token. If negative, reduce the rule which
1074 number is the opposite. If zero, do what YYDEFACT says.
1075 If YYTABLE_NINF, syntax error. */
Alexis Hetu76a343a2015-06-04 17:21:22 -04001076#define YYTABLE_NINF -229
John Bauman66b8ab22014-05-06 15:57:45 -04001077static const yytype_int16 yytable[] =
1078{
Alexis Hetu76a343a2015-06-04 17:21:22 -04001079 75, 106, 229, 131, 219, 119, 226, 296, 92, 60,
1080 300, 61, 131, 307, 218, 171, 7, 176, 248, 249,
1081 363, 370, 259, 80, 107, 2, 3, 4, 92, 123,
1082 85, 131, 238, 171, 112, 385, 88, 132, 102, 93,
1083 94, 95, 370, 108, 357, 274, 132, 27, 28, 226,
1084 29, 308, 358, 250, 251, 81, 123, 260, 37, 93,
1085 94, 95, 86, 221, 406, 132, 83, 84, 99, 75,
1086 399, 100, 75, 131, 131, 276, 399, 75, 262, 87,
1087 215, 126, 75, 127, 246, 247, 60, 216, 61, 90,
1088 128, 311, 219, 178, 171, 352, 91, 75, 293, 179,
1089 235, 294, 299, 309, -94, 75, 236, 132, 132, 293,
1090 101, 367, 315, 113, 75, 230, 231, 293, 200, 335,
1091 368, 171, 403, 115, 75, 125, 293, 174, 293, 305,
1092 341, 75, 306, 75, 343, 226, 232, 109, 293, 305,
1093 233, 342, 354, -26, 375, 109, 177, 377, 296, 158,
1094 323, 324, 325, 326, 93, 94, 95, 241, 242, 243,
1095 131, 244, 118, 245, 252, 253, 129, 158, 347, 348,
1096 391, 264, 265, 293, 360, 75, 75, 219, 319, 320,
1097 212, 227, 228, 80, 349, 321, 322, 327, 328, 222,
1098 -27, 355, 407, 234, 132, 239, 254, 255, 256, 240,
1099 257, 258, 261, 171, 369, 200, 270, 267, 268, 271,
1100 171, 281, 282, 283, 284, 285, 286, 287, 288, 289,
1101 290, 272, 275, 277, 278, 369, 219, 297, 158, 219,
1102 291, 279, 301, 302, 304, -155, 380, -228, 350, 344,
1103 393, 351, 359, 371, 379, 353, -28, 293, 361, 381,
1104 374, 376, 219, 404, 362, 158, 378, 388, 389, 390,
1105 394, 392, 75, 171, 371, 395, 396, 191, 398, 314,
1106 402, 408, 331, 334, 219, 330, 329, 120, 124, 82,
1107 200, 316, 317, 318, 158, 158, 158, 158, 158, 158,
Alexis Hetua35d8232015-06-11 17:11:06 -04001108 158, 158, 158, 158, 158, 158, 158, 158, 158, 158,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001109 332, 213, 333, 106, 303, 364, 214, 356, 397, 266,
1110 405, 365, 346, 382, 111, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001111 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001112 0, 0, 0, 0, 0, 0, 0, 158, 0, 200,
1113 200, 0, 0, 0, 158, 200, 200, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001114 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001115 0, 0, 0, 0, 0, 0, 200, 0, 0, 0,
1116 0, 75, 0, 0, 0, 0, 0, 0, 0, 0,
1117 0, 0, 0, 0, 0, 0, 0, 0, 0, 200,
1118 0, 0, 0, 0, 0, 200, 0, 158, 1, 2,
1119 3, 4, 5, 6, 7, 8, 9, 10, 11, 180,
1120 181, 182, 0, 183, 184, 185, 186, 187, 188, 189,
1121 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1122 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1123 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1124 41, 190, 42, 43, 44, 0, 45, 46, 47, 48,
1125 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1126 58, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1127 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1128 0, 0, 0, 0, 0, 0, 0, 0, 0, 143,
1129 0, 0, 0, 191, 192, 0, 0, 0, 0, 193,
1130 144, 145, 146, 147, 1, 2, 3, 4, 5, 6,
1131 7, 8, 9, 10, 11, 180, 181, 182, 0, 183,
1132 184, 185, 186, 187, 188, 189, 12, 13, 14, 15,
1133 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1134 26, 27, 28, 0, 29, 30, 31, 32, 33, 34,
1135 35, 36, 37, 38, 39, 40, 41, 190, 42, 43,
1136 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
1137 53, 54, 0, 55, 56, 57, 58, 135, 59, 136,
1138 137, 138, 139, 140, 0, 0, 141, 142, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001139 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001140 0, 0, 0, 0, 0, 143, 0, 0, 0, 191,
1141 295, 0, 0, 0, 0, 193, 144, 145, 146, 147,
1142 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
1143 11, 180, 181, 182, 0, 183, 184, 185, 186, 187,
1144 188, 189, 12, 13, 14, 15, 16, 17, 18, 19,
1145 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1146 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1147 39, 40, 41, 190, 42, 43, 44, 0, 45, 46,
1148 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1149 56, 57, 58, 135, 59, 136, 137, 138, 139, 140,
1150 0, 0, 141, 142, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001151 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001152 0, 143, 0, 0, 0, 191, 0, 0, 0, 0,
1153 0, 193, 144, 145, 146, 147, 1, 2, 3, 4,
1154 5, 6, 7, 8, 9, 10, 11, 180, 181, 182,
1155 0, 183, 184, 185, 186, 187, 188, 189, 12, 13,
1156 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1157 24, 25, 26, 27, 28, 0, 29, 30, 31, 32,
1158 33, 34, 35, 36, 37, 38, 39, 40, 41, 190,
1159 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1160 51, 52, 53, 54, 0, 55, 56, 57, 58, 135,
1161 59, 136, 137, 138, 139, 140, 0, 0, 141, 142,
1162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1163 0, 0, 0, 0, 0, 0, 0, 143, 0, 0,
1164 0, 118, 0, 0, 0, 0, 0, 193, 144, 145,
1165 146, 147, 1, 2, 3, 4, 5, 6, 7, 8,
1166 9, 10, 11, 180, 181, 182, 0, 183, 184, 185,
1167 186, 187, 188, 189, 12, 13, 14, 15, 16, 17,
1168 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1169 28, 0, 29, 30, 31, 32, 33, 34, 35, 36,
1170 37, 38, 39, 40, 41, 190, 42, 43, 44, 0,
1171 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1172 0, 55, 56, 57, 58, 135, 59, 136, 137, 138,
1173 139, 140, 0, 0, 141, 142, 0, 0, 0, 0,
1174 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1175 0, 0, 0, 143, 0, 0, 0, 0, 0, 0,
1176 0, 0, 0, 193, 144, 145, 146, 147, 1, 2,
1177 3, 4, 5, 6, 7, 8, 9, 10, 11, 0,
1178 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1179 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1180 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1181 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1182 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1183 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1184 58, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1185 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1186 0, 0, 0, 0, 0, 130, 2, 3, 4, 143,
1187 6, 7, 8, 9, 10, 11, 0, 0, 0, 193,
1188 144, 145, 146, 147, 0, 0, 0, 12, 13, 14,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001189 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001190 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001191 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001192 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
Alexis Hetua35d8232015-06-11 17:11:06 -04001193 52, 53, 54, 0, 55, 56, 57, 58, 135, 59,
1194 136, 137, 138, 139, 140, 0, 0, 141, 142, 0,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001195 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001196 0, 2, 3, 4, 0, 0, 143, 8, 9, 10,
1197 11, 0, 0, 0, 0, 0, 0, 144, 145, 146,
1198 147, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1199 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1200 0, 0, 31, 32, 33, 34, 35, 36, 0, 0,
1201 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
Alexis Hetua35d8232015-06-11 17:11:06 -04001202 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001203 56, 57, 0, 103, 59, 0, 0, 8, 9, 10,
1204 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1205 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1206 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1207 0, 104, 31, 32, 33, 34, 35, 36, 0, 0,
1208 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1209 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1210 56, 57, 0, 135, 59, 136, 137, 138, 139, 140,
Alexis Hetua35d8232015-06-11 17:11:06 -04001211 0, 0, 141, 142, 0, 0, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001212 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001213 0, 143, 0, 0, 217, 8, 9, 10, 11, 0,
1214 0, 0, 144, 145, 146, 147, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001215 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1216 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
1217 31, 32, 33, 34, 35, 36, 0, 0, 0, 40,
1218 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1219 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1220 0, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1221 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1222 0, 0, 0, 0, 0, 0, 0, 0, 0, 143,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001223 8, 9, 10, 11, 0, 0, 0, 0, 0, 273,
1224 144, 145, 146, 147, 0, 12, 13, 14, 15, 16,
1225 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1226 0, 0, 0, 0, 0, 31, 32, 33, 34, 35,
1227 36, 0, 0, 0, 40, 41, 0, 42, 43, 44,
1228 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1229 54, 0, 55, 56, 57, 0, 135, 59, 136, 137,
1230 138, 139, 140, 0, 0, 141, 142, 0, 0, 0,
1231 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1232 0, 0, 0, 0, 143, 0, 0, 298, 8, 9,
1233 10, 11, 0, 0, 0, 144, 145, 146, 147, 0,
1234 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1235 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
1236 0, 0, 0, 31, 32, 33, 34, 35, 36, 0,
1237 0, 0, 40, 41, 0, 42, 43, 44, 0, 45,
1238 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1239 55, 56, 57, 0, 135, 59, 136, 137, 138, 139,
1240 140, 0, 0, 141, 142, 0, 0, 0, 0, 0,
1241 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1242 0, 0, 143, 8, 9, 10, 11, 0, 0, 0,
1243 0, 0, 0, 144, 145, 146, 147, 0, 12, 13,
Alexis Hetua35d8232015-06-11 17:11:06 -04001244 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1245 24, 25, 26, 0, 0, 0, 0, 0, 31, 32,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001246 33, 34, 35, 36, 0, 0, 0, 40, 237, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001247 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1248 51, 52, 53, 54, 0, 55, 56, 57, 0, 135,
1249 59, 136, 137, 138, 139, 140, 0, 0, 141, 142,
1250 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001251 0, 0, 0, 130, 2, 3, 4, 143, 6, 7,
1252 8, 9, 10, 11, 0, 0, 0, 0, 144, 145,
1253 146, 147, 0, 0, 0, 12, 13, 14, 15, 16,
1254 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1255 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1256 36, 37, 38, 39, 40, 41, 0, 42, 43, 44,
1257 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1258 54, 0, 55, 56, 57, 58, 0, 59, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001259 0, 0, 0, 0, 0, 0, 0, 0, 130, 2,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001260 3, 4, 0, 6, 7, 8, 9, 10, 11, 0,
1261 0, 0, 0, 0, 0, 0, 0, 0, 0, 225,
Alexis Hetua35d8232015-06-11 17:11:06 -04001262 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1263 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1264 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1265 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1266 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1267 58, 0, 59, 0, 0, 0, 0, 0, 0, 0,
1268 0, 0, 0, 130, 2, 3, 4, 0, 6, 7,
1269 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001270 0, 0, 0, 0, 263, 12, 13, 14, 15, 16,
Alexis Hetua35d8232015-06-11 17:11:06 -04001271 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1272 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1273 36, 37, 38, 39, 40, 41, 0, 42, 43, 44,
1274 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1275 54, 0, 55, 56, 57, 58, 0, 59, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001276 0, 0, 0, 0, 0, 110, 0, 0, 1, 2,
1277 3, 4, 5, 6, 7, 8, 9, 10, 11, 0,
1278 0, 0, 0, 0, 0, 0, 0, 0, 0, 336,
Alexis Hetua35d8232015-06-11 17:11:06 -04001279 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1280 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1281 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1282 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1283 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001284 58, 0, 59, 1, 2, 3, 4, 5, 6, 7,
Alexis Hetua35d8232015-06-11 17:11:06 -04001285 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001286 0, 0, 0, 0, 0, 12, 13, 14, 15, 16,
Alexis Hetua35d8232015-06-11 17:11:06 -04001287 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1288 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1289 36, 37, 38, 39, 40, 41, 0, 42, 43, 44,
1290 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001291 54, 0, 55, 56, 57, 58, 0, 59, 130, 2,
1292 3, 4, 0, 6, 7, 8, 9, 10, 11, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001293 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001294 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1295 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1296 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1297 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1298 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001299 58, 0, 59, 2, 3, 4, 0, 0, 0, 8,
1300 9, 10, 11, 0, 0, 0, 0, 0, 0, 0,
1301 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
1302 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1303 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1304 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1305 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1306 0, 55, 56, 57, 0, 0, 59, 8, 9, 10,
1307 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1308 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1309 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1310 0, 0, 31, 32, 33, 34, 35, 36, 0, 0,
1311 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1312 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1313 56, 57, 0, 312, 59, 8, 9, 10, 11, 313,
1314 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1315 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1316 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
1317 31, 32, 33, 34, 35, 36, 0, 0, 0, 40,
1318 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1319 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1320 0, 0, 59
John Bauman66b8ab22014-05-06 15:57:45 -04001321};
1322
1323static const yytype_int16 yycheck[] =
1324{
Alexis Hetu76a343a2015-06-04 17:21:22 -04001325 0, 69, 143, 105, 128, 89, 133, 205, 9, 0,
1326 216, 0, 114, 76, 127, 109, 9, 114, 87, 88,
1327 339, 345, 92, 44, 72, 4, 5, 6, 9, 97,
1328 76, 133, 156, 127, 82, 367, 114, 105, 68, 40,
1329 41, 42, 366, 73, 106, 186, 114, 40, 41, 176,
1330 43, 114, 114, 122, 123, 76, 124, 127, 51, 40,
1331 41, 42, 108, 131, 396, 133, 40, 41, 111, 69,
1332 389, 114, 72, 175, 176, 188, 395, 77, 175, 104,
1333 106, 104, 82, 106, 83, 84, 77, 113, 77, 105,
1334 113, 232, 216, 105, 188, 301, 111, 97, 111, 111,
1335 105, 114, 215, 105, 105, 105, 111, 175, 176, 111,
1336 76, 105, 236, 108, 114, 85, 86, 111, 118, 260,
1337 105, 215, 105, 76, 124, 76, 111, 114, 111, 111,
1338 271, 131, 114, 133, 275, 262, 106, 106, 111, 111,
1339 110, 114, 114, 104, 350, 106, 113, 353, 346, 109,
1340 248, 249, 250, 251, 40, 41, 42, 119, 120, 121,
1341 262, 116, 108, 118, 89, 90, 108, 127, 292, 293,
1342 376, 79, 80, 111, 112, 175, 176, 301, 244, 245,
1343 76, 141, 142, 44, 297, 246, 247, 252, 253, 76,
1344 104, 304, 398, 105, 262, 104, 126, 125, 124, 159,
1345 91, 93, 107, 297, 345, 205, 104, 114, 114, 104,
1346 304, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1347 103, 114, 104, 112, 104, 366, 350, 106, 188, 353,
1348 113, 109, 113, 107, 106, 104, 360, 108, 113, 112,
1349 381, 107, 107, 345, 357, 113, 104, 111, 56, 104,
1350 107, 113, 376, 394, 338, 215, 107, 76, 105, 109,
1351 114, 107, 262, 357, 366, 105, 17, 108, 113, 233,
1352 114, 114, 256, 259, 398, 255, 254, 91, 98, 5,
1353 280, 241, 242, 243, 244, 245, 246, 247, 248, 249,
1354 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
1355 257, 124, 258, 371, 221, 340, 124, 305, 387, 179,
1356 395, 340, 280, 366, 77, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001357 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001358 -1, -1, -1, -1, -1, -1, -1, 297, -1, 339,
1359 340, -1, -1, -1, 304, 345, 346, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001360 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001361 -1, -1, -1, -1, -1, -1, 366, -1, -1, -1,
1362 -1, 371, -1, -1, -1, -1, -1, -1, -1, -1,
1363 -1, -1, -1, -1, -1, -1, -1, -1, -1, 389,
1364 -1, -1, -1, -1, -1, 395, -1, 357, 3, 4,
1365 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1366 15, 16, -1, 18, 19, 20, 21, 22, 23, 24,
1367 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1368 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1369 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1370 55, 56, 57, 58, 59, -1, 61, 62, 63, 64,
1371 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1372 75, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1373 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1374 -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
1375 -1, -1, -1, 108, 109, -1, -1, -1, -1, 114,
1376 115, 116, 117, 118, 3, 4, 5, 6, 7, 8,
1377 9, 10, 11, 12, 13, 14, 15, 16, -1, 18,
1378 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1379 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1380 39, 40, 41, -1, 43, 44, 45, 46, 47, 48,
1381 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
1382 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
1383 69, 70, -1, 72, 73, 74, 75, 76, 77, 78,
1384 79, 80, 81, 82, -1, -1, 85, 86, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001385 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001386 -1, -1, -1, -1, -1, 104, -1, -1, -1, 108,
1387 109, -1, -1, -1, -1, 114, 115, 116, 117, 118,
1388 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
1389 13, 14, 15, 16, -1, 18, 19, 20, 21, 22,
1390 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
1391 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1392 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1393 53, 54, 55, 56, 57, 58, 59, -1, 61, 62,
1394 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1395 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
1396 -1, -1, 85, 86, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001397 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001398 -1, 104, -1, -1, -1, 108, -1, -1, -1, -1,
1399 -1, 114, 115, 116, 117, 118, 3, 4, 5, 6,
1400 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
1401 -1, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1402 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1403 37, 38, 39, 40, 41, -1, 43, 44, 45, 46,
1404 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
1405 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1406 67, 68, 69, 70, -1, 72, 73, 74, 75, 76,
1407 77, 78, 79, 80, 81, 82, -1, -1, 85, 86,
1408 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1409 -1, -1, -1, -1, -1, -1, -1, 104, -1, -1,
1410 -1, 108, -1, -1, -1, -1, -1, 114, 115, 116,
1411 117, 118, 3, 4, 5, 6, 7, 8, 9, 10,
1412 11, 12, 13, 14, 15, 16, -1, 18, 19, 20,
1413 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
1414 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1415 41, -1, 43, 44, 45, 46, 47, 48, 49, 50,
1416 51, 52, 53, 54, 55, 56, 57, 58, 59, -1,
1417 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1418 -1, 72, 73, 74, 75, 76, 77, 78, 79, 80,
1419 81, 82, -1, -1, 85, 86, -1, -1, -1, -1,
1420 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1421 -1, -1, -1, 104, -1, -1, -1, -1, -1, -1,
1422 -1, -1, -1, 114, 115, 116, 117, 118, 3, 4,
1423 5, 6, 7, 8, 9, 10, 11, 12, 13, -1,
1424 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1425 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1426 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1427 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1428 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1429 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1430 75, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1431 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1432 -1, -1, -1, -1, -1, 3, 4, 5, 6, 104,
1433 8, 9, 10, 11, 12, 13, -1, -1, -1, 114,
1434 115, 116, 117, 118, -1, -1, -1, 25, 26, 27,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001435 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001436 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001437 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001438 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001439 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001440 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1441 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001442 -1, 4, 5, 6, -1, -1, 104, 10, 11, 12,
1443 13, -1, -1, -1, -1, -1, -1, 115, 116, 117,
1444 118, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1445 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1446 -1, -1, 45, 46, 47, 48, 49, 50, -1, -1,
1447 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
Alexis Hetua35d8232015-06-11 17:11:06 -04001448 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001449 73, 74, -1, 76, 77, -1, -1, 10, 11, 12,
1450 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1451 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1452 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1453 -1, 114, 45, 46, 47, 48, 49, 50, -1, -1,
1454 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1455 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1456 73, 74, -1, 76, 77, 78, 79, 80, 81, 82,
Alexis Hetua35d8232015-06-11 17:11:06 -04001457 -1, -1, 85, 86, -1, -1, -1, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001458 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001459 -1, 104, -1, -1, 107, 10, 11, 12, 13, -1,
1460 -1, -1, 115, 116, 117, 118, -1, -1, -1, -1,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001461 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1462 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
1463 45, 46, 47, 48, 49, 50, -1, -1, -1, 54,
1464 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1465 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1466 -1, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1467 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1468 -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001469 10, 11, 12, 13, -1, -1, -1, -1, -1, 114,
1470 115, 116, 117, 118, -1, 25, 26, 27, 28, 29,
1471 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1472 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
1473 50, -1, -1, -1, 54, 55, -1, 57, 58, 59,
1474 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1475 70, -1, 72, 73, 74, -1, 76, 77, 78, 79,
1476 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
1477 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1478 -1, -1, -1, -1, 104, -1, -1, 107, 10, 11,
1479 12, 13, -1, -1, -1, 115, 116, 117, 118, -1,
1480 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1481 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
1482 -1, -1, -1, 45, 46, 47, 48, 49, 50, -1,
1483 -1, -1, 54, 55, -1, 57, 58, 59, -1, 61,
1484 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1485 72, 73, 74, -1, 76, 77, 78, 79, 80, 81,
1486 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1487 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1488 -1, -1, 104, 10, 11, 12, 13, -1, -1, -1,
1489 -1, -1, -1, 115, 116, 117, 118, -1, 25, 26,
Alexis Hetub14178b2015-04-13 13:23:20 -04001490 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001491 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
1492 47, 48, 49, 50, -1, -1, -1, 54, 55, -1,
Alexis Hetub14178b2015-04-13 13:23:20 -04001493 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001494 67, 68, 69, 70, -1, 72, 73, 74, -1, 76,
Alexis Hetub14178b2015-04-13 13:23:20 -04001495 77, 78, 79, 80, 81, 82, -1, -1, 85, 86,
1496 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001497 -1, -1, -1, 3, 4, 5, 6, 104, 8, 9,
1498 10, 11, 12, 13, -1, -1, -1, -1, 115, 116,
1499 117, 118, -1, -1, -1, 25, 26, 27, 28, 29,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001500 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1501 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1502 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
1503 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001504 70, -1, 72, 73, 74, 75, -1, 77, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001505 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
1506 5, 6, -1, 8, 9, 10, 11, 12, 13, -1,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001507 -1, -1, -1, -1, -1, -1, -1, -1, -1, 109,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001508 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1509 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1510 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1511 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1512 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
Alexis Hetua35d8232015-06-11 17:11:06 -04001513 75, -1, 77, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001514 -1, -1, -1, 3, 4, 5, 6, -1, 8, 9,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001515 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001516 -1, -1, -1, -1, 109, 25, 26, 27, 28, 29,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001517 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1518 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1519 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
1520 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001521 70, -1, 72, 73, 74, 75, -1, 77, -1, -1,
1522 -1, -1, -1, -1, -1, 0, -1, -1, 3, 4,
Alexis Hetua35d8232015-06-11 17:11:06 -04001523 5, 6, 7, 8, 9, 10, 11, 12, 13, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001524 -1, -1, -1, -1, -1, -1, -1, -1, -1, 109,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001525 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1526 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1527 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1528 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1529 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001530 75, -1, 77, 3, 4, 5, 6, 7, 8, 9,
Alexis Hetua35d8232015-06-11 17:11:06 -04001531 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
1532 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
1533 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1534 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1535 50, 51, 52, 53, 54, 55, -1, 57, 58, 59,
1536 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001537 70, -1, 72, 73, 74, 75, -1, 77, 3, 4,
1538 5, 6, -1, 8, 9, 10, 11, 12, 13, -1,
1539 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1540 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1541 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1542 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1543 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1544 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1545 75, -1, 77, 4, 5, 6, -1, -1, -1, 10,
1546 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
1547 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
1548 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1549 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1550 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1551 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1552 -1, 72, 73, 74, -1, -1, 77, 10, 11, 12,
1553 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1554 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1555 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1556 -1, -1, 45, 46, 47, 48, 49, 50, -1, -1,
1557 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1558 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1559 73, 74, -1, 76, 77, 10, 11, 12, 13, 82,
1560 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1561 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1562 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
1563 45, 46, 47, 48, 49, 50, -1, -1, -1, 54,
1564 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1565 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1566 -1, -1, 77
John Bauman66b8ab22014-05-06 15:57:45 -04001567};
1568
1569/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1570 symbol of state STATE-NUM. */
1571static const yytype_uint8 yystos[] =
1572{
1573 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Nicolas Capens3c20f802015-02-17 17:17:20 -05001574 12, 13, 25, 26, 27, 28, 29, 30, 31, 32,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05001575 33, 34, 35, 36, 37, 38, 39, 40, 41, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001576 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1577 54, 55, 57, 58, 59, 61, 62, 63, 64, 65,
1578 66, 67, 68, 69, 70, 72, 73, 74, 75, 77,
Alexis Hetua35d8232015-06-11 17:11:06 -04001579 159, 160, 161, 162, 163, 168, 169, 170, 171, 173,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001580 174, 175, 176, 177, 180, 181, 182, 217, 218, 219,
1581 44, 76, 176, 40, 41, 76, 108, 104, 114, 220,
Alexis Hetua35d8232015-06-11 17:11:06 -04001582 105, 111, 9, 40, 41, 42, 165, 166, 172, 111,
1583 114, 76, 174, 76, 114, 158, 175, 180, 174, 106,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001584 0, 218, 180, 108, 184, 76, 178, 179, 108, 200,
Alexis Hetua35d8232015-06-11 17:11:06 -04001585 165, 164, 167, 175, 166, 76, 104, 106, 113, 108,
1586 3, 173, 175, 185, 186, 76, 78, 79, 80, 81,
1587 82, 85, 86, 104, 115, 116, 117, 118, 129, 130,
1588 131, 133, 134, 135, 136, 137, 138, 139, 140, 141,
1589 142, 143, 144, 145, 146, 147, 148, 149, 150, 151,
1590 152, 153, 157, 181, 114, 183, 185, 113, 105, 111,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001591 14, 15, 16, 18, 19, 20, 21, 22, 23, 24,
1592 56, 108, 109, 114, 140, 153, 154, 156, 159, 160,
1593 181, 190, 191, 192, 193, 201, 202, 203, 205, 207,
1594 209, 216, 76, 164, 167, 106, 113, 107, 157, 154,
1595 189, 175, 76, 187, 188, 109, 186, 140, 140, 156,
1596 85, 86, 106, 110, 105, 105, 111, 55, 154, 104,
1597 140, 119, 120, 121, 116, 118, 83, 84, 87, 88,
1598 122, 123, 89, 90, 126, 125, 124, 91, 93, 92,
1599 127, 107, 185, 109, 79, 80, 179, 114, 114, 211,
1600 104, 104, 114, 114, 156, 104, 157, 112, 104, 109,
1601 194, 94, 95, 96, 97, 98, 99, 100, 101, 102,
1602 103, 113, 155, 111, 114, 109, 191, 106, 107, 157,
1603 189, 113, 107, 187, 106, 111, 114, 76, 114, 105,
1604 132, 156, 76, 82, 135, 154, 140, 140, 140, 142,
1605 142, 143, 143, 144, 144, 144, 144, 145, 145, 146,
1606 147, 148, 149, 150, 151, 156, 109, 197, 198, 199,
1607 212, 156, 114, 156, 112, 210, 201, 154, 154, 157,
Alexis Hetua35d8232015-06-11 17:11:06 -04001608 113, 107, 189, 113, 114, 157, 188, 106, 114, 107,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001609 112, 56, 200, 192, 190, 202, 213, 105, 105, 156,
1610 170, 173, 208, 195, 107, 189, 113, 189, 107, 157,
1611 154, 104, 208, 214, 215, 197, 204, 206, 76, 105,
1612 109, 189, 107, 156, 114, 105, 17, 193, 113, 192,
1613 196, 200, 114, 105, 156, 196, 197, 189, 114
John Bauman66b8ab22014-05-06 15:57:45 -04001614};
1615
1616#define yyerrok (yyerrstatus = 0)
1617#define yyclearin (yychar = YYEMPTY)
1618#define YYEMPTY (-2)
1619#define YYEOF 0
1620
1621#define YYACCEPT goto yyacceptlab
1622#define YYABORT goto yyabortlab
1623#define YYERROR goto yyerrorlab
1624
1625
1626/* Like YYERROR except do call yyerror. This remains here temporarily
1627 to ease the transition to the new meaning of YYERROR, for GCC.
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001628 Once GCC version 2 has supplanted version 1, this can go. */
John Bauman66b8ab22014-05-06 15:57:45 -04001629
1630#define YYFAIL goto yyerrlab
John Bauman66b8ab22014-05-06 15:57:45 -04001631
1632#define YYRECOVERING() (!!yyerrstatus)
1633
1634#define YYBACKUP(Token, Value) \
1635do \
1636 if (yychar == YYEMPTY && yylen == 1) \
1637 { \
1638 yychar = (Token); \
1639 yylval = (Value); \
1640 yytoken = YYTRANSLATE (yychar); \
1641 YYPOPSTACK (1); \
1642 goto yybackup; \
1643 } \
1644 else \
1645 { \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001646 yyerror (&yylloc, context, YY_("syntax error: cannot back up")); \
John Bauman66b8ab22014-05-06 15:57:45 -04001647 YYERROR; \
1648 } \
1649while (YYID (0))
1650
1651
1652#define YYTERROR 1
1653#define YYERRCODE 256
1654
1655
1656/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1657 If N is 0, then set CURRENT to the empty location which ends
1658 the previous symbol: RHS[0] (always defined). */
1659
1660#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1661#ifndef YYLLOC_DEFAULT
1662# define YYLLOC_DEFAULT(Current, Rhs, N) \
1663 do \
1664 if (YYID (N)) \
1665 { \
1666 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1667 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1668 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1669 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1670 } \
1671 else \
1672 { \
1673 (Current).first_line = (Current).last_line = \
1674 YYRHSLOC (Rhs, 0).last_line; \
1675 (Current).first_column = (Current).last_column = \
1676 YYRHSLOC (Rhs, 0).last_column; \
1677 } \
1678 while (YYID (0))
1679#endif
1680
1681
1682/* YY_LOCATION_PRINT -- Print the location on the stream.
1683 This macro was not mandated originally: define only if we know
1684 we won't break user code: when these are the locations we know. */
1685
1686#ifndef YY_LOCATION_PRINT
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001687# if YYLTYPE_IS_TRIVIAL
John Bauman66b8ab22014-05-06 15:57:45 -04001688# define YY_LOCATION_PRINT(File, Loc) \
1689 fprintf (File, "%d.%d-%d.%d", \
1690 (Loc).first_line, (Loc).first_column, \
1691 (Loc).last_line, (Loc).last_column)
1692# else
1693# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1694# endif
1695#endif
1696
1697
1698/* YYLEX -- calling `yylex' with the right arguments. */
1699
1700#ifdef YYLEX_PARAM
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001701# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
John Bauman66b8ab22014-05-06 15:57:45 -04001702#else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001703# define YYLEX yylex (&yylval, &yylloc)
John Bauman66b8ab22014-05-06 15:57:45 -04001704#endif
1705
1706/* Enable debugging if requested. */
1707#if YYDEBUG
1708
1709# ifndef YYFPRINTF
1710# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1711# define YYFPRINTF fprintf
1712# endif
1713
1714# define YYDPRINTF(Args) \
1715do { \
1716 if (yydebug) \
1717 YYFPRINTF Args; \
1718} while (YYID (0))
1719
1720# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1721do { \
1722 if (yydebug) \
1723 { \
1724 YYFPRINTF (stderr, "%s ", Title); \
1725 yy_symbol_print (stderr, \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001726 Type, Value, Location, context); \
John Bauman66b8ab22014-05-06 15:57:45 -04001727 YYFPRINTF (stderr, "\n"); \
1728 } \
1729} while (YYID (0))
1730
1731
1732/*--------------------------------.
1733| Print this symbol on YYOUTPUT. |
1734`--------------------------------*/
1735
1736/*ARGSUSED*/
1737#if (defined __STDC__ || defined __C99__FUNC__ \
1738 || defined __cplusplus || defined _MSC_VER)
1739static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001740yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001741#else
1742static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001743yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001744 FILE *yyoutput;
1745 int yytype;
1746 YYSTYPE const * const yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001747 YYLTYPE const * const yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04001748 TParseContext* context;
1749#endif
1750{
1751 if (!yyvaluep)
1752 return;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001753 YYUSE (yylocationp);
John Bauman66b8ab22014-05-06 15:57:45 -04001754 YYUSE (context);
1755# ifdef YYPRINT
1756 if (yytype < YYNTOKENS)
1757 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1758# else
1759 YYUSE (yyoutput);
1760# endif
1761 switch (yytype)
1762 {
1763 default:
1764 break;
1765 }
1766}
1767
1768
1769/*--------------------------------.
1770| Print this symbol on YYOUTPUT. |
1771`--------------------------------*/
1772
1773#if (defined __STDC__ || defined __C99__FUNC__ \
1774 || defined __cplusplus || defined _MSC_VER)
1775static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001776yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001777#else
1778static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001779yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001780 FILE *yyoutput;
1781 int yytype;
1782 YYSTYPE const * const yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001783 YYLTYPE const * const yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04001784 TParseContext* context;
1785#endif
1786{
1787 if (yytype < YYNTOKENS)
1788 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1789 else
1790 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1791
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001792 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1793 YYFPRINTF (yyoutput, ": ");
1794 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04001795 YYFPRINTF (yyoutput, ")");
1796}
1797
1798/*------------------------------------------------------------------.
1799| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1800| TOP (included). |
1801`------------------------------------------------------------------*/
1802
1803#if (defined __STDC__ || defined __C99__FUNC__ \
1804 || defined __cplusplus || defined _MSC_VER)
1805static void
1806yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1807#else
1808static void
1809yy_stack_print (yybottom, yytop)
1810 yytype_int16 *yybottom;
1811 yytype_int16 *yytop;
1812#endif
1813{
1814 YYFPRINTF (stderr, "Stack now");
1815 for (; yybottom <= yytop; yybottom++)
1816 {
1817 int yybot = *yybottom;
1818 YYFPRINTF (stderr, " %d", yybot);
1819 }
1820 YYFPRINTF (stderr, "\n");
1821}
1822
1823# define YY_STACK_PRINT(Bottom, Top) \
1824do { \
1825 if (yydebug) \
1826 yy_stack_print ((Bottom), (Top)); \
1827} while (YYID (0))
1828
1829
1830/*------------------------------------------------.
1831| Report that the YYRULE is going to be reduced. |
1832`------------------------------------------------*/
1833
1834#if (defined __STDC__ || defined __C99__FUNC__ \
1835 || defined __cplusplus || defined _MSC_VER)
1836static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001837yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001838#else
1839static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001840yy_reduce_print (yyvsp, yylsp, yyrule, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001841 YYSTYPE *yyvsp;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001842 YYLTYPE *yylsp;
John Bauman66b8ab22014-05-06 15:57:45 -04001843 int yyrule;
1844 TParseContext* context;
1845#endif
1846{
1847 int yynrhs = yyr2[yyrule];
1848 int yyi;
1849 unsigned long int yylno = yyrline[yyrule];
1850 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1851 yyrule - 1, yylno);
1852 /* The symbols being reduced. */
1853 for (yyi = 0; yyi < yynrhs; yyi++)
1854 {
1855 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1856 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1857 &(yyvsp[(yyi + 1) - (yynrhs)])
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001858 , &(yylsp[(yyi + 1) - (yynrhs)]) , context);
John Bauman66b8ab22014-05-06 15:57:45 -04001859 YYFPRINTF (stderr, "\n");
1860 }
1861}
1862
1863# define YY_REDUCE_PRINT(Rule) \
1864do { \
1865 if (yydebug) \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001866 yy_reduce_print (yyvsp, yylsp, Rule, context); \
John Bauman66b8ab22014-05-06 15:57:45 -04001867} while (YYID (0))
1868
1869/* Nonzero means print parse trace. It is left uninitialized so that
1870 multiple parsers can coexist. */
1871int yydebug;
1872#else /* !YYDEBUG */
1873# define YYDPRINTF(Args)
1874# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1875# define YY_STACK_PRINT(Bottom, Top)
1876# define YY_REDUCE_PRINT(Rule)
1877#endif /* !YYDEBUG */
1878
1879
1880/* YYINITDEPTH -- initial size of the parser's stacks. */
1881#ifndef YYINITDEPTH
1882# define YYINITDEPTH 200
1883#endif
1884
1885/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1886 if the built-in stack extension method is used).
1887
1888 Do not make this value too large; the results are undefined if
1889 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1890 evaluated with infinite-precision integer arithmetic. */
1891
1892#ifndef YYMAXDEPTH
1893# define YYMAXDEPTH 10000
1894#endif
1895
1896
1897
1898#if YYERROR_VERBOSE
1899
1900# ifndef yystrlen
1901# if defined __GLIBC__ && defined _STRING_H
1902# define yystrlen strlen
1903# else
1904/* Return the length of YYSTR. */
1905#if (defined __STDC__ || defined __C99__FUNC__ \
1906 || defined __cplusplus || defined _MSC_VER)
1907static YYSIZE_T
1908yystrlen (const char *yystr)
1909#else
1910static YYSIZE_T
1911yystrlen (yystr)
1912 const char *yystr;
1913#endif
1914{
1915 YYSIZE_T yylen;
1916 for (yylen = 0; yystr[yylen]; yylen++)
1917 continue;
1918 return yylen;
1919}
1920# endif
1921# endif
1922
1923# ifndef yystpcpy
1924# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1925# define yystpcpy stpcpy
1926# else
1927/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1928 YYDEST. */
1929#if (defined __STDC__ || defined __C99__FUNC__ \
1930 || defined __cplusplus || defined _MSC_VER)
1931static char *
1932yystpcpy (char *yydest, const char *yysrc)
1933#else
1934static char *
1935yystpcpy (yydest, yysrc)
1936 char *yydest;
1937 const char *yysrc;
1938#endif
1939{
1940 char *yyd = yydest;
1941 const char *yys = yysrc;
1942
1943 while ((*yyd++ = *yys++) != '\0')
1944 continue;
1945
1946 return yyd - 1;
1947}
1948# endif
1949# endif
1950
1951# ifndef yytnamerr
1952/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1953 quotes and backslashes, so that it's suitable for yyerror. The
1954 heuristic is that double-quoting is unnecessary unless the string
1955 contains an apostrophe, a comma, or backslash (other than
1956 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1957 null, do not copy; instead, return the length of what the result
1958 would have been. */
1959static YYSIZE_T
1960yytnamerr (char *yyres, const char *yystr)
1961{
1962 if (*yystr == '"')
1963 {
1964 YYSIZE_T yyn = 0;
1965 char const *yyp = yystr;
1966
1967 for (;;)
1968 switch (*++yyp)
1969 {
1970 case '\'':
1971 case ',':
1972 goto do_not_strip_quotes;
1973
1974 case '\\':
1975 if (*++yyp != '\\')
1976 goto do_not_strip_quotes;
1977 /* Fall through. */
1978 default:
1979 if (yyres)
1980 yyres[yyn] = *yyp;
1981 yyn++;
1982 break;
1983
1984 case '"':
1985 if (yyres)
1986 yyres[yyn] = '\0';
1987 return yyn;
1988 }
1989 do_not_strip_quotes: ;
1990 }
1991
1992 if (! yyres)
1993 return yystrlen (yystr);
1994
1995 return yystpcpy (yyres, yystr) - yyres;
1996}
1997# endif
1998
1999/* Copy into YYRESULT an error message about the unexpected token
2000 YYCHAR while in state YYSTATE. Return the number of bytes copied,
2001 including the terminating null byte. If YYRESULT is null, do not
2002 copy anything; just return the number of bytes that would be
2003 copied. As a special case, return 0 if an ordinary "syntax error"
2004 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
2005 size calculation. */
2006static YYSIZE_T
2007yysyntax_error (char *yyresult, int yystate, int yychar)
2008{
2009 int yyn = yypact[yystate];
2010
2011 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
2012 return 0;
2013 else
2014 {
2015 int yytype = YYTRANSLATE (yychar);
2016 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2017 YYSIZE_T yysize = yysize0;
2018 YYSIZE_T yysize1;
2019 int yysize_overflow = 0;
2020 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2021 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2022 int yyx;
2023
2024# if 0
2025 /* This is so xgettext sees the translatable formats that are
2026 constructed on the fly. */
2027 YY_("syntax error, unexpected %s");
2028 YY_("syntax error, unexpected %s, expecting %s");
2029 YY_("syntax error, unexpected %s, expecting %s or %s");
2030 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2031 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2032# endif
2033 char *yyfmt;
2034 char const *yyf;
2035 static char const yyunexpected[] = "syntax error, unexpected %s";
2036 static char const yyexpecting[] = ", expecting %s";
2037 static char const yyor[] = " or %s";
2038 char yyformat[sizeof yyunexpected
2039 + sizeof yyexpecting - 1
2040 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2041 * (sizeof yyor - 1))];
2042 char const *yyprefix = yyexpecting;
2043
2044 /* Start YYX at -YYN if negative to avoid negative indexes in
2045 YYCHECK. */
2046 int yyxbegin = yyn < 0 ? -yyn : 0;
2047
2048 /* Stay within bounds of both yycheck and yytname. */
2049 int yychecklim = YYLAST - yyn + 1;
2050 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2051 int yycount = 1;
2052
2053 yyarg[0] = yytname[yytype];
2054 yyfmt = yystpcpy (yyformat, yyunexpected);
2055
2056 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2057 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2058 {
2059 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2060 {
2061 yycount = 1;
2062 yysize = yysize0;
2063 yyformat[sizeof yyunexpected - 1] = '\0';
2064 break;
2065 }
2066 yyarg[yycount++] = yytname[yyx];
2067 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2068 yysize_overflow |= (yysize1 < yysize);
2069 yysize = yysize1;
2070 yyfmt = yystpcpy (yyfmt, yyprefix);
2071 yyprefix = yyor;
2072 }
2073
2074 yyf = YY_(yyformat);
2075 yysize1 = yysize + yystrlen (yyf);
2076 yysize_overflow |= (yysize1 < yysize);
2077 yysize = yysize1;
2078
2079 if (yysize_overflow)
2080 return YYSIZE_MAXIMUM;
2081
2082 if (yyresult)
2083 {
2084 /* Avoid sprintf, as that infringes on the user's name space.
2085 Don't have undefined behavior even if the translation
2086 produced a string with the wrong number of "%s"s. */
2087 char *yyp = yyresult;
2088 int yyi = 0;
2089 while ((*yyp = *yyf) != '\0')
2090 {
2091 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2092 {
2093 yyp += yytnamerr (yyp, yyarg[yyi++]);
2094 yyf += 2;
2095 }
2096 else
2097 {
2098 yyp++;
2099 yyf++;
2100 }
2101 }
2102 }
2103 return yysize;
2104 }
2105}
2106#endif /* YYERROR_VERBOSE */
2107
2108
2109/*-----------------------------------------------.
2110| Release the memory associated to this symbol. |
2111`-----------------------------------------------*/
2112
2113/*ARGSUSED*/
2114#if (defined __STDC__ || defined __C99__FUNC__ \
2115 || defined __cplusplus || defined _MSC_VER)
2116static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002117yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04002118#else
2119static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002120yydestruct (yymsg, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04002121 const char *yymsg;
2122 int yytype;
2123 YYSTYPE *yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002124 YYLTYPE *yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04002125 TParseContext* context;
2126#endif
2127{
2128 YYUSE (yyvaluep);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002129 YYUSE (yylocationp);
John Bauman66b8ab22014-05-06 15:57:45 -04002130 YYUSE (context);
2131
2132 if (!yymsg)
2133 yymsg = "Deleting";
2134 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2135
2136 switch (yytype)
2137 {
2138
2139 default:
2140 break;
2141 }
2142}
2143
2144/* Prevent warnings from -Wmissing-prototypes. */
2145#ifdef YYPARSE_PARAM
2146#if defined __STDC__ || defined __cplusplus
2147int yyparse (void *YYPARSE_PARAM);
2148#else
2149int yyparse ();
2150#endif
2151#else /* ! YYPARSE_PARAM */
2152#if defined __STDC__ || defined __cplusplus
2153int yyparse (TParseContext* context);
2154#else
2155int yyparse ();
2156#endif
2157#endif /* ! YYPARSE_PARAM */
2158
2159
2160
2161
2162
2163/*-------------------------.
2164| yyparse or yypush_parse. |
2165`-------------------------*/
2166
2167#ifdef YYPARSE_PARAM
2168#if (defined __STDC__ || defined __C99__FUNC__ \
2169 || defined __cplusplus || defined _MSC_VER)
2170int
2171yyparse (void *YYPARSE_PARAM)
2172#else
2173int
2174yyparse (YYPARSE_PARAM)
2175 void *YYPARSE_PARAM;
2176#endif
2177#else /* ! YYPARSE_PARAM */
2178#if (defined __STDC__ || defined __C99__FUNC__ \
2179 || defined __cplusplus || defined _MSC_VER)
2180int
2181yyparse (TParseContext* context)
2182#else
2183int
2184yyparse (context)
2185 TParseContext* context;
2186#endif
2187#endif
2188{
2189/* The lookahead symbol. */
2190int yychar;
2191
2192/* The semantic value of the lookahead symbol. */
2193YYSTYPE yylval;
2194
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002195/* Location data for the lookahead symbol. */
2196YYLTYPE yylloc;
2197
John Bauman66b8ab22014-05-06 15:57:45 -04002198 /* Number of syntax errors so far. */
2199 int yynerrs;
2200
2201 int yystate;
2202 /* Number of tokens to shift before error messages enabled. */
2203 int yyerrstatus;
2204
2205 /* The stacks and their tools:
2206 `yyss': related to states.
2207 `yyvs': related to semantic values.
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002208 `yyls': related to locations.
John Bauman66b8ab22014-05-06 15:57:45 -04002209
2210 Refer to the stacks thru separate pointers, to allow yyoverflow
2211 to reallocate them elsewhere. */
2212
2213 /* The state stack. */
2214 yytype_int16 yyssa[YYINITDEPTH];
2215 yytype_int16 *yyss;
2216 yytype_int16 *yyssp;
2217
2218 /* The semantic value stack. */
2219 YYSTYPE yyvsa[YYINITDEPTH];
2220 YYSTYPE *yyvs;
2221 YYSTYPE *yyvsp;
2222
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002223 /* The location stack. */
2224 YYLTYPE yylsa[YYINITDEPTH];
2225 YYLTYPE *yyls;
2226 YYLTYPE *yylsp;
2227
2228 /* The locations where the error started and ended. */
2229 YYLTYPE yyerror_range[2];
2230
John Bauman66b8ab22014-05-06 15:57:45 -04002231 YYSIZE_T yystacksize;
2232
2233 int yyn;
2234 int yyresult;
2235 /* Lookahead token as an internal (translated) token number. */
2236 int yytoken;
2237 /* The variables used to return semantic value and location from the
2238 action routines. */
2239 YYSTYPE yyval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002240 YYLTYPE yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04002241
2242#if YYERROR_VERBOSE
2243 /* Buffer for error messages, and its allocated size. */
2244 char yymsgbuf[128];
2245 char *yymsg = yymsgbuf;
2246 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2247#endif
2248
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002249#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
John Bauman66b8ab22014-05-06 15:57:45 -04002250
2251 /* The number of symbols on the RHS of the reduced rule.
2252 Keep to zero when no symbol should be popped. */
2253 int yylen = 0;
2254
2255 yytoken = 0;
2256 yyss = yyssa;
2257 yyvs = yyvsa;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002258 yyls = yylsa;
John Bauman66b8ab22014-05-06 15:57:45 -04002259 yystacksize = YYINITDEPTH;
2260
2261 YYDPRINTF ((stderr, "Starting parse\n"));
2262
2263 yystate = 0;
2264 yyerrstatus = 0;
2265 yynerrs = 0;
2266 yychar = YYEMPTY; /* Cause a token to be read. */
2267
2268 /* Initialize stack pointers.
2269 Waste one element of value and location stack
2270 so that they stay on the same level as the state stack.
2271 The wasted elements are never initialized. */
2272 yyssp = yyss;
2273 yyvsp = yyvs;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002274 yylsp = yyls;
2275
2276#if YYLTYPE_IS_TRIVIAL
2277 /* Initialize the default location before parsing starts. */
2278 yylloc.first_line = yylloc.last_line = 1;
2279 yylloc.first_column = yylloc.last_column = 1;
2280#endif
John Bauman66b8ab22014-05-06 15:57:45 -04002281
2282 goto yysetstate;
2283
2284/*------------------------------------------------------------.
2285| yynewstate -- Push a new state, which is found in yystate. |
2286`------------------------------------------------------------*/
2287 yynewstate:
2288 /* In all cases, when you get here, the value and location stacks
2289 have just been pushed. So pushing a state here evens the stacks. */
2290 yyssp++;
2291
2292 yysetstate:
2293 *yyssp = yystate;
2294
2295 if (yyss + yystacksize - 1 <= yyssp)
2296 {
2297 /* Get the current used size of the three stacks, in elements. */
2298 YYSIZE_T yysize = yyssp - yyss + 1;
2299
2300#ifdef yyoverflow
2301 {
2302 /* Give user a chance to reallocate the stack. Use copies of
2303 these so that the &'s don't force the real ones into
2304 memory. */
2305 YYSTYPE *yyvs1 = yyvs;
2306 yytype_int16 *yyss1 = yyss;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002307 YYLTYPE *yyls1 = yyls;
John Bauman66b8ab22014-05-06 15:57:45 -04002308
2309 /* Each stack pointer address is followed by the size of the
2310 data in use in that stack, in bytes. This used to be a
2311 conditional around just the two extra args, but that might
2312 be undefined if yyoverflow is a macro. */
2313 yyoverflow (YY_("memory exhausted"),
2314 &yyss1, yysize * sizeof (*yyssp),
2315 &yyvs1, yysize * sizeof (*yyvsp),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002316 &yyls1, yysize * sizeof (*yylsp),
John Bauman66b8ab22014-05-06 15:57:45 -04002317 &yystacksize);
2318
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002319 yyls = yyls1;
John Bauman66b8ab22014-05-06 15:57:45 -04002320 yyss = yyss1;
2321 yyvs = yyvs1;
2322 }
2323#else /* no yyoverflow */
2324# ifndef YYSTACK_RELOCATE
2325 goto yyexhaustedlab;
2326# else
2327 /* Extend the stack our own way. */
2328 if (YYMAXDEPTH <= yystacksize)
2329 goto yyexhaustedlab;
2330 yystacksize *= 2;
2331 if (YYMAXDEPTH < yystacksize)
2332 yystacksize = YYMAXDEPTH;
2333
2334 {
2335 yytype_int16 *yyss1 = yyss;
2336 union yyalloc *yyptr =
2337 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2338 if (! yyptr)
2339 goto yyexhaustedlab;
2340 YYSTACK_RELOCATE (yyss_alloc, yyss);
2341 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002342 YYSTACK_RELOCATE (yyls_alloc, yyls);
John Bauman66b8ab22014-05-06 15:57:45 -04002343# undef YYSTACK_RELOCATE
2344 if (yyss1 != yyssa)
2345 YYSTACK_FREE (yyss1);
2346 }
2347# endif
2348#endif /* no yyoverflow */
2349
2350 yyssp = yyss + yysize - 1;
2351 yyvsp = yyvs + yysize - 1;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002352 yylsp = yyls + yysize - 1;
John Bauman66b8ab22014-05-06 15:57:45 -04002353
2354 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2355 (unsigned long int) yystacksize));
2356
2357 if (yyss + yystacksize - 1 <= yyssp)
2358 YYABORT;
2359 }
2360
2361 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2362
2363 if (yystate == YYFINAL)
2364 YYACCEPT;
2365
2366 goto yybackup;
2367
2368/*-----------.
2369| yybackup. |
2370`-----------*/
2371yybackup:
2372
2373 /* Do appropriate processing given the current state. Read a
2374 lookahead token if we need one and don't already have one. */
2375
2376 /* First try to decide what to do without reference to lookahead token. */
2377 yyn = yypact[yystate];
2378 if (yyn == YYPACT_NINF)
2379 goto yydefault;
2380
2381 /* Not known => get a lookahead token if don't already have one. */
2382
2383 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2384 if (yychar == YYEMPTY)
2385 {
2386 YYDPRINTF ((stderr, "Reading a token: "));
2387 yychar = YYLEX;
2388 }
2389
2390 if (yychar <= YYEOF)
2391 {
2392 yychar = yytoken = YYEOF;
2393 YYDPRINTF ((stderr, "Now at end of input.\n"));
2394 }
2395 else
2396 {
2397 yytoken = YYTRANSLATE (yychar);
2398 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2399 }
2400
2401 /* If the proper action on seeing token YYTOKEN is to reduce or to
2402 detect an error, take that action. */
2403 yyn += yytoken;
2404 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2405 goto yydefault;
2406 yyn = yytable[yyn];
2407 if (yyn <= 0)
2408 {
2409 if (yyn == 0 || yyn == YYTABLE_NINF)
2410 goto yyerrlab;
2411 yyn = -yyn;
2412 goto yyreduce;
2413 }
2414
2415 /* Count tokens shifted since error; after three, turn off error
2416 status. */
2417 if (yyerrstatus)
2418 yyerrstatus--;
2419
2420 /* Shift the lookahead token. */
2421 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2422
2423 /* Discard the shifted token. */
2424 yychar = YYEMPTY;
2425
2426 yystate = yyn;
2427 *++yyvsp = yylval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002428 *++yylsp = yylloc;
John Bauman66b8ab22014-05-06 15:57:45 -04002429 goto yynewstate;
2430
2431
2432/*-----------------------------------------------------------.
2433| yydefault -- do the default action for the current state. |
2434`-----------------------------------------------------------*/
2435yydefault:
2436 yyn = yydefact[yystate];
2437 if (yyn == 0)
2438 goto yyerrlab;
2439 goto yyreduce;
2440
2441
2442/*-----------------------------.
2443| yyreduce -- Do a reduction. |
2444`-----------------------------*/
2445yyreduce:
2446 /* yyn is the number of a rule to reduce with. */
2447 yylen = yyr2[yyn];
2448
2449 /* If YYLEN is nonzero, implement the default value of the action:
2450 `$$ = $1'.
2451
2452 Otherwise, the following line sets YYVAL to garbage.
2453 This behavior is undocumented and Bison
2454 users should not rely upon it. Assigning to YYVAL
2455 unconditionally makes the parser a bit smaller, and it avoids a
2456 GCC warning that YYVAL may be used uninitialized. */
2457 yyval = yyvsp[1-yylen];
2458
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002459 /* Default location. */
2460 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
John Bauman66b8ab22014-05-06 15:57:45 -04002461 YY_REDUCE_PRINT (yyn);
2462 switch (yyn)
2463 {
2464 case 2:
2465
2466 {
2467 // The symbol table search was done in the lexical phase
2468 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2469 const TVariable* variable;
2470 if (symbol == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002471 context->error((yylsp[(1) - (1)]), "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04002472 context->recover();
2473 TType type(EbtFloat, EbpUndefined);
2474 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05002475 context->symbolTable.declare(*fakeVariable);
John Bauman66b8ab22014-05-06 15:57:45 -04002476 variable = fakeVariable;
2477 } else {
2478 // This identifier can only be a variable type symbol
2479 if (! symbol->isVariable()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002480 context->error((yylsp[(1) - (1)]), "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04002481 context->recover();
2482 }
2483 variable = static_cast<const TVariable*>(symbol);
2484 }
2485
2486 // don't delete $1.string, it's used by error recovery, and the pool
2487 // pop will reclaim the memory
2488
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002489 if (variable->getType().getQualifier() == EvqConstExpr ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002490 ConstantUnion* constArray = variable->getConstPointer();
2491 TType t(variable->getType());
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002492 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002493 } else
2494 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2495 variable->getName(),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002496 variable->getType(), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002497 }
2498 break;
2499
2500 case 3:
2501
2502 {
2503 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2504 }
2505 break;
2506
2507 case 4:
2508
2509 {
John Bauman66b8ab22014-05-06 15:57:45 -04002510 ConstantUnion *unionArray = new ConstantUnion[1];
2511 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002512 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002513 }
2514 break;
2515
2516 case 5:
2517
2518 {
2519 ConstantUnion *unionArray = new ConstantUnion[1];
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002520 unionArray->setUConst((yyvsp[(1) - (1)].lex).u);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002521 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002522 }
2523 break;
2524
2525 case 6:
2526
2527 {
2528 ConstantUnion *unionArray = new ConstantUnion[1];
John Bauman66b8ab22014-05-06 15:57:45 -04002529 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002530 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002531 }
2532 break;
2533
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002534 case 7:
John Bauman66b8ab22014-05-06 15:57:45 -04002535
2536 {
2537 ConstantUnion *unionArray = new ConstantUnion[1];
2538 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002539 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002540 }
2541 break;
2542
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002543 case 8:
John Bauman66b8ab22014-05-06 15:57:45 -04002544
2545 {
2546 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
2547 }
2548 break;
2549
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002550 case 9:
John Bauman66b8ab22014-05-06 15:57:45 -04002551
2552 {
2553 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2554 }
2555 break;
2556
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002557 case 10:
John Bauman66b8ab22014-05-06 15:57:45 -04002558
2559 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002560 (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[(1) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04002561 }
2562 break;
2563
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002564 case 11:
John Bauman66b8ab22014-05-06 15:57:45 -04002565
2566 {
2567 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2568 }
2569 break;
2570
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002571 case 12:
John Bauman66b8ab22014-05-06 15:57:45 -04002572
2573 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002574 (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[(1) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yylsp[(3) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002575 }
2576 break;
2577
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002578 case 13:
John Bauman66b8ab22014-05-06 15:57:45 -04002579
2580 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002581 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002582 }
2583 break;
2584
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002585 case 14:
John Bauman66b8ab22014-05-06 15:57:45 -04002586
2587 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002588 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002589 }
2590 break;
2591
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002592 case 15:
John Bauman66b8ab22014-05-06 15:57:45 -04002593
2594 {
2595 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2596 context->recover();
2597 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2598 }
2599 break;
2600
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002601 case 16:
John Bauman66b8ab22014-05-06 15:57:45 -04002602
2603 {
2604 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2605 TOperator op = fnCall->getBuiltInOp();
2606
2607 if (op != EOpNull)
2608 {
2609 //
2610 // Then this should be a constructor.
2611 // Don't go through the symbol table for constructors.
2612 // Their parameters will be verified algorithmically.
2613 //
2614 TType type(EbtVoid, EbpUndefined); // use this to get the type back
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002615 if (context->constructorErrorCheck((yylsp[(1) - (1)]), (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
John Bauman66b8ab22014-05-06 15:57:45 -04002616 (yyval.interm.intermTypedNode) = 0;
2617 } else {
2618 //
2619 // It's a constructor, of type 'type'.
2620 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002621 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002622 }
2623
2624 if ((yyval.interm.intermTypedNode) == 0) {
2625 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002626 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002627 }
2628 (yyval.interm.intermTypedNode)->setType(type);
2629 } else {
2630 //
2631 // Not a constructor. Find it in the symbol table.
2632 //
2633 const TFunction* fnCandidate;
2634 bool builtIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002635 fnCandidate = context->findFunction((yylsp[(1) - (1)]), fnCall, &builtIn);
John Bauman66b8ab22014-05-06 15:57:45 -04002636 if (fnCandidate) {
2637 //
2638 // A declared function.
2639 //
2640 if (builtIn && !fnCandidate->getExtension().empty() &&
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002641 context->extensionErrorCheck((yylsp[(1) - (1)]), fnCandidate->getExtension())) {
John Bauman66b8ab22014-05-06 15:57:45 -04002642 context->recover();
2643 }
2644 op = fnCandidate->getBuiltInOp();
2645 if (builtIn && op != EOpNull) {
2646 //
2647 // A function call mapped to a built-in operation.
2648 //
2649 if (fnCandidate->getParamCount() == 1) {
2650 //
2651 // Treat it like a built-in unary operator.
2652 //
John Baumand4ae8632014-05-06 16:18:33 -04002653 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0);
John Bauman66b8ab22014-05-06 15:57:45 -04002654 if ((yyval.interm.intermTypedNode) == 0) {
2655 std::stringstream extraInfoStream;
2656 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2657 std::string extraInfo = extraInfoStream.str();
2658 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
2659 YYERROR;
2660 }
2661 } else {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002662 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002663 }
2664 } else {
2665 // This is a real function call
2666
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002667 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002668 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2669
2670 // this is how we know whether the given function is a builtIn function or a user defined function
2671 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2672 // if builtIn == true, it's definitely a builtIn function with EOpNull
2673 if (!builtIn)
2674 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2675 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2676
2677 TQualifier qual;
Alexis Hetu76a343a2015-06-04 17:21:22 -04002678 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04002679 qual = fnCandidate->getParam(i).type->getQualifier();
2680 if (qual == EvqOut || qual == EvqInOut) {
2681 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
2682 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
2683 context->recover();
2684 }
2685 }
2686 }
2687 }
2688 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2689 } else {
2690 // error message was put out by PaFindFunction()
2691 // Put on a dummy node for error recovery
2692 ConstantUnion *unionArray = new ConstantUnion[1];
2693 unionArray->setFConst(0.0f);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002694 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002695 context->recover();
2696 }
2697 }
2698 delete fnCall;
2699 }
2700 break;
2701
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002702 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002703
2704 {
2705 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2706 }
2707 break;
2708
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002709 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002710
2711 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002712 context->error((yylsp[(3) - (3)]), "methods are not supported", "");
John Bauman66b8ab22014-05-06 15:57:45 -04002713 context->recover();
2714 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2715 }
2716 break;
2717
John Bauman66b8ab22014-05-06 15:57:45 -04002718 case 19:
2719
2720 {
2721 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002722 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04002723 }
2724 break;
2725
2726 case 20:
2727
2728 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002729 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002730 (yyval.interm).line = (yylsp[(2) - (2)]);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002731 }
2732 break;
2733
2734 case 21:
2735
2736 {
John Bauman66b8ab22014-05-06 15:57:45 -04002737 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2738 (yyval.interm).intermNode = 0;
2739 }
2740 break;
2741
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002742 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002743
2744 {
2745 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2746 (yyval.interm).intermNode = 0;
2747 }
2748 break;
2749
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002750 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002751
2752 {
2753 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2754 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2755 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2756 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2757 }
2758 break;
2759
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002760 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002761
2762 {
2763 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2764 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2765 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002766 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002767 }
2768 break;
2769
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002770 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002771
2772 {
2773 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2774 }
2775 break;
2776
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002777 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002778
2779 {
2780 //
2781 // Constructor
2782 //
2783 TOperator op = EOpNull;
2784 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2785 op = EOpConstructStruct;
2786 } else {
2787 switch ((yyvsp[(1) - (1)].interm.type).type) {
2788 case EbtFloat:
Alexis Hetub14178b2015-04-13 13:23:20 -04002789 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2790 case 1:
2791 op = EOpConstructFloat; break;
2792 case 2:
2793 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2794 case 1: op = EOpConstructVec2; break;
2795 case 2: op = EOpConstructMat2; break;
2796 case 3: op = EOpConstructMat2x3; break;
2797 case 4: op = EOpConstructMat2x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002798 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002799 break;
2800 case 3:
2801 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2802 case 1: op = EOpConstructVec3; break;
2803 case 2: op = EOpConstructMat3x2; break;
2804 case 3: op = EOpConstructMat3; break;
2805 case 4: op = EOpConstructMat3x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002806 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002807 break;
2808 case 4:
2809 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2810 case 1: op = EOpConstructVec4; break;
2811 case 2: op = EOpConstructMat4x2; break;
2812 case 3: op = EOpConstructMat4x3; break;
2813 case 4: op = EOpConstructMat4; break;
2814 }
2815 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002816 }
2817 break;
2818 case EbtInt:
Alexis Hetub14178b2015-04-13 13:23:20 -04002819 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002820 case 1: op = EOpConstructInt; break;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002821 case 2: FRAG_VERT_ONLY("ivec2", (yylsp[(1) - (1)])); op = EOpConstructIVec2; break;
2822 case 3: FRAG_VERT_ONLY("ivec3", (yylsp[(1) - (1)])); op = EOpConstructIVec3; break;
2823 case 4: FRAG_VERT_ONLY("ivec4", (yylsp[(1) - (1)])); op = EOpConstructIVec4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002824 }
2825 break;
Alexis Hetub7c46af2015-05-12 15:58:09 -04002826 case EbtUInt:
2827 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2828 case 1: op = EOpConstructUInt; break;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002829 case 2: FRAG_VERT_ONLY("uvec2", (yylsp[(1) - (1)])); op = EOpConstructUVec2; break;
2830 case 3: FRAG_VERT_ONLY("uvec3", (yylsp[(1) - (1)])); op = EOpConstructUVec3; break;
2831 case 4: FRAG_VERT_ONLY("uvec4", (yylsp[(1) - (1)])); op = EOpConstructUVec4; break;
Alexis Hetub7c46af2015-05-12 15:58:09 -04002832 }
2833 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002834 case EbtBool:
Alexis Hetub14178b2015-04-13 13:23:20 -04002835 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002836 case 1: op = EOpConstructBool; break;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002837 case 2: FRAG_VERT_ONLY("bvec2", (yylsp[(1) - (1)])); op = EOpConstructBVec2; break;
2838 case 3: FRAG_VERT_ONLY("bvec3", (yylsp[(1) - (1)])); op = EOpConstructBVec3; break;
2839 case 4: FRAG_VERT_ONLY("bvec4", (yylsp[(1) - (1)])); op = EOpConstructBVec4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002840 }
2841 break;
2842 default: break;
2843 }
2844 if (op == EOpNull) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002845 context->error((yylsp[(1) - (1)]), "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type));
John Bauman66b8ab22014-05-06 15:57:45 -04002846 context->recover();
2847 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2848 op = EOpConstructFloat;
2849 }
2850 }
2851 TString tempString;
2852 TType type((yyvsp[(1) - (1)].interm.type));
2853 TFunction *function = new TFunction(&tempString, type, op);
2854 (yyval.interm.function) = function;
2855 }
2856 break;
2857
John Bauman66b8ab22014-05-06 15:57:45 -04002858 case 27:
2859
2860 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002861 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04002862 context->recover();
2863 TType type(EbtVoid, EbpUndefined);
2864 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2865 (yyval.interm.function) = function;
2866 }
2867 break;
2868
2869 case 28:
2870
2871 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002872 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002873 context->recover();
2874 TType type(EbtVoid, EbpUndefined);
2875 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2876 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002877 }
2878 break;
2879
2880 case 29:
2881
2882 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002883 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2884 }
2885 break;
2886
2887 case 30:
2888
2889 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002890 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002891 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002892 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002893 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002894 context->unaryOpError((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002895 context->recover();
2896 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2897 }
2898 }
2899 break;
2900
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002901 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002902
2903 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002904 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002905 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002906 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002907 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002908 context->unaryOpError((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002909 context->recover();
2910 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2911 }
2912 }
2913 break;
2914
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002915 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002916
2917 {
2918 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002919 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002920 if ((yyval.interm.intermTypedNode) == 0) {
2921 const char* errorOp = "";
2922 switch((yyvsp[(1) - (2)].interm).op) {
2923 case EOpNegative: errorOp = "-"; break;
2924 case EOpLogicalNot: errorOp = "!"; break;
Alexis Hetud061e422015-05-13 16:37:50 -04002925 case EOpBitwiseNot: errorOp = "~"; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002926 default: break;
2927 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002928 context->unaryOpError((yylsp[(1) - (2)]), errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002929 context->recover();
2930 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2931 }
2932 } else
2933 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2934 }
2935 break;
2936
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002937 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002938
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002939 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNull; }
John Bauman66b8ab22014-05-06 15:57:45 -04002940 break;
2941
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002942 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002943
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002944 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNegative; }
John Bauman66b8ab22014-05-06 15:57:45 -04002945 break;
2946
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002947 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002948
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002949 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpLogicalNot; }
John Bauman66b8ab22014-05-06 15:57:45 -04002950 break;
2951
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002952 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002953
Alexis Hetu17809052015-05-13 11:28:22 -04002954 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002955 ES3_ONLY("~", (yylsp[(1) - (1)]));
2956 (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseNot;
Alexis Hetu17809052015-05-13 11:28:22 -04002957 }
John Bauman66b8ab22014-05-06 15:57:45 -04002958 break;
2959
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002960 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002961
Alexis Hetu17809052015-05-13 11:28:22 -04002962 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2963 break;
2964
2965 case 38:
2966
John Bauman66b8ab22014-05-06 15:57:45 -04002967 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002968 FRAG_VERT_ONLY("*", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002969 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002970 }
2971 break;
2972
Alexis Hetu17809052015-05-13 11:28:22 -04002973 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04002974
2975 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002976 FRAG_VERT_ONLY("/", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002977 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002978 }
2979 break;
2980
Alexis Hetu17809052015-05-13 11:28:22 -04002981 case 40:
2982
2983 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002984 FRAG_VERT_ONLY("%", (yylsp[(2) - (3)]));
2985 ES3_ONLY("%", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002986 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpIMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04002987 }
2988 break;
2989
2990 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04002991
2992 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2993 break;
2994
Alexis Hetu17809052015-05-13 11:28:22 -04002995 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04002996
2997 {
Alexis Hetub4769582015-06-16 12:19:50 -04002998 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002999 }
3000 break;
3001
Alexis Hetu17809052015-05-13 11:28:22 -04003002 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04003003
3004 {
Alexis Hetub4769582015-06-16 12:19:50 -04003005 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003006 }
3007 break;
3008
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003009 case 44:
3010
Alexis Hetu17809052015-05-13 11:28:22 -04003011 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3012 break;
3013
3014 case 45:
3015
3016 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003017 ES3_ONLY("<<", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003018 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitShiftLeft, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003019 }
3020 break;
3021
3022 case 46:
3023
3024 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003025 ES3_ONLY(">>", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003026 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitShiftRight, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003027 }
3028 break;
3029
3030 case 47:
3031
3032 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3033 break;
3034
3035 case 48:
3036
John Bauman66b8ab22014-05-06 15:57:45 -04003037 {
Alexis Hetub4769582015-06-16 12:19:50 -04003038 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003039 }
3040 break;
3041
Alexis Hetu17809052015-05-13 11:28:22 -04003042 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04003043
3044 {
Alexis Hetub4769582015-06-16 12:19:50 -04003045 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003046 }
3047 break;
3048
Alexis Hetu17809052015-05-13 11:28:22 -04003049 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04003050
3051 {
Alexis Hetub4769582015-06-16 12:19:50 -04003052 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003053 }
3054 break;
3055
Alexis Hetu17809052015-05-13 11:28:22 -04003056 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04003057
3058 {
Alexis Hetub4769582015-06-16 12:19:50 -04003059 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003060 }
3061 break;
3062
Alexis Hetu17809052015-05-13 11:28:22 -04003063 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04003064
3065 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3066 break;
3067
Alexis Hetu17809052015-05-13 11:28:22 -04003068 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04003069
3070 {
Alexis Hetub4769582015-06-16 12:19:50 -04003071 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003072 }
3073 break;
3074
Alexis Hetu17809052015-05-13 11:28:22 -04003075 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04003076
3077 {
Alexis Hetub4769582015-06-16 12:19:50 -04003078 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003079 }
3080 break;
3081
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003082 case 55:
3083
Alexis Hetu17809052015-05-13 11:28:22 -04003084 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3085 break;
3086
3087 case 56:
3088
3089 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003090 ES3_ONLY("&", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003091 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitwiseAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003092 }
3093 break;
3094
3095 case 57:
3096
3097 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3098 break;
3099
3100 case 58:
3101
3102 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003103 ES3_ONLY("^", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003104 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitwiseXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003105 }
3106 break;
3107
3108 case 59:
3109
3110 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3111 break;
3112
3113 case 60:
3114
3115 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003116 ES3_ONLY("|", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003117 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitwiseOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003118 }
3119 break;
3120
3121 case 61:
3122
3123 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3124 break;
3125
3126 case 62:
3127
John Bauman66b8ab22014-05-06 15:57:45 -04003128 {
Alexis Hetub4769582015-06-16 12:19:50 -04003129 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003130 }
3131 break;
3132
Alexis Hetu17809052015-05-13 11:28:22 -04003133 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04003134
3135 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3136 break;
3137
Alexis Hetu17809052015-05-13 11:28:22 -04003138 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003139
3140 {
Alexis Hetub4769582015-06-16 12:19:50 -04003141 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003142 }
3143 break;
3144
Alexis Hetu17809052015-05-13 11:28:22 -04003145 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003146
3147 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3148 break;
3149
Alexis Hetu17809052015-05-13 11:28:22 -04003150 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003151
3152 {
Alexis Hetub4769582015-06-16 12:19:50 -04003153 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003154 }
3155 break;
3156
Alexis Hetu17809052015-05-13 11:28:22 -04003157 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003158
3159 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3160 break;
3161
Alexis Hetu17809052015-05-13 11:28:22 -04003162 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003163
3164 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003165 if (context->boolErrorCheck((yylsp[(2) - (5)]), (yyvsp[(1) - (5)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04003166 context->recover();
3167
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003168 (yyval.interm.intermTypedNode) = context->intermediate.addSelection((yyvsp[(1) - (5)].interm.intermTypedNode), (yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.intermTypedNode), (yylsp[(2) - (5)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003169 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3170 (yyval.interm.intermTypedNode) = 0;
3171
3172 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003173 context->binaryOpError((yylsp[(2) - (5)]), ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003174 context->recover();
3175 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3176 }
3177 }
3178 break;
3179
Alexis Hetu17809052015-05-13 11:28:22 -04003180 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003181
3182 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3183 break;
3184
Alexis Hetu17809052015-05-13 11:28:22 -04003185 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003186
3187 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003188 if (context->lValueErrorCheck((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04003189 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003190 (yyval.interm.intermTypedNode) = context->intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003191 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003192 context->assignError((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003193 context->recover();
3194 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3195 }
3196 }
3197 break;
3198
Alexis Hetu17809052015-05-13 11:28:22 -04003199 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003200
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003201 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003202 break;
3203
Alexis Hetu17809052015-05-13 11:28:22 -04003204 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003205
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003206 { FRAG_VERT_ONLY("*=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpMulAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003207 break;
3208
Alexis Hetu17809052015-05-13 11:28:22 -04003209 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003210
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003211 { FRAG_VERT_ONLY("/=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpDivAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003212 break;
3213
Alexis Hetu17809052015-05-13 11:28:22 -04003214 case 74:
3215
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003216 { ES3_ONLY("%=", (yylsp[(1) - (1)]));
3217 FRAG_VERT_ONLY("%=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpIModAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003218 break;
3219
3220 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003221
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003222 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAddAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003223 break;
3224
Alexis Hetu17809052015-05-13 11:28:22 -04003225 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003226
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003227 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpSubAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003228 break;
3229
Alexis Hetu17809052015-05-13 11:28:22 -04003230 case 77:
3231
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003232 { ES3_ONLY("<<=", (yylsp[(1) - (1)]));
3233 FRAG_VERT_ONLY("<<=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftLeftAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003234 break;
3235
3236 case 78:
3237
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003238 { ES3_ONLY(">>=", (yylsp[(1) - (1)]));
3239 FRAG_VERT_ONLY(">>=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftRightAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003240 break;
3241
3242 case 79:
3243
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003244 { ES3_ONLY("&=", (yylsp[(1) - (1)]));
3245 FRAG_VERT_ONLY("&=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseAndAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003246 break;
3247
3248 case 80:
3249
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003250 { ES3_ONLY("^=", (yylsp[(1) - (1)]));
3251 FRAG_VERT_ONLY("^=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseXorAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003252 break;
3253
3254 case 81:
3255
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003256 { ES3_ONLY("|=", (yylsp[(1) - (1)]));
3257 FRAG_VERT_ONLY("|=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseOrAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003258 break;
3259
3260 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003261
3262 {
3263 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3264 }
3265 break;
3266
Alexis Hetu17809052015-05-13 11:28:22 -04003267 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003268
3269 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003270 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003271 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003272 context->binaryOpError((yylsp[(2) - (3)]), ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003273 context->recover();
3274 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3275 }
3276 }
3277 break;
3278
Alexis Hetu17809052015-05-13 11:28:22 -04003279 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003280
3281 {
3282 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3283 context->recover();
3284 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3285 }
3286 break;
3287
Alexis Hetu17809052015-05-13 11:28:22 -04003288 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003289
3290 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003291 if (context->enterStructDeclaration((yyvsp[(1) - (2)].lex).line, *(yyvsp[(1) - (2)].lex).string))
3292 context->recover();
3293 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3294 }
3295 break;
3296
3297 case 86:
3298
3299 {
John Bauman66b8ab22014-05-06 15:57:45 -04003300 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3301
3302 TIntermAggregate *prototype = new TIntermAggregate;
3303 prototype->setType(function.getReturnType());
3304 prototype->setName(function.getName());
3305
Alexis Hetu76a343a2015-06-04 17:21:22 -04003306 for (size_t i = 0; i < function.getParamCount(); i++)
John Bauman66b8ab22014-05-06 15:57:45 -04003307 {
3308 const TParameter &param = function.getParam(i);
3309 if (param.name != 0)
3310 {
John Baumand4ae8632014-05-06 16:18:33 -04003311 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003312
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003313 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003314 }
3315 else
3316 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003317 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003318 }
3319 }
3320
3321 prototype->setOp(EOpPrototype);
3322 (yyval.interm.intermNode) = prototype;
3323
3324 context->symbolTable.pop();
3325 }
3326 break;
3327
Alexis Hetua35d8232015-06-11 17:11:06 -04003328 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003329
3330 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003331 TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
3332 if (aggNode && aggNode->getOp() == EOpNull)
3333 aggNode->setOp(EOpDeclaration);
3334 (yyval.interm.intermNode) = aggNode;
John Bauman66b8ab22014-05-06 15:57:45 -04003335 }
3336 break;
3337
Alexis Hetua35d8232015-06-11 17:11:06 -04003338 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003339
3340 {
John Baumand4ae8632014-05-06 16:18:33 -04003341 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003342 context->error((yylsp[(1) - (4)]), "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
John Baumand4ae8632014-05-06 16:18:33 -04003343 context->recover();
3344 }
John Bauman66b8ab22014-05-06 15:57:45 -04003345 (yyval.interm.intermNode) = 0;
3346 }
3347 break;
3348
Alexis Hetua35d8232015-06-11 17:11:06 -04003349 case 89:
3350
3351 {
3352 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yyvsp[(1) - (5)].interm.type).line);
3353 (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);
3354 }
3355 break;
3356
3357 case 90:
3358
3359 {
3360 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yyvsp[(1) - (6)].interm.type).line);
3361 (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);
3362 }
3363 break;
3364
3365 case 91:
3366
3367 {
3368 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yyvsp[(1) - (9)].interm.type).line);
3369 (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);
3370 }
3371 break;
3372
3373 case 92:
3374
3375 {
3376 context->parseGlobalLayoutQualifier((yyvsp[(1) - (2)].interm.type));
3377 (yyval.interm.intermNode) = 0;
3378 }
3379 break;
3380
3381 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003382
3383 {
3384 //
3385 // Multiple declarations of the same function are allowed.
3386 //
3387 // If this is a definition, the definition production code will check for redefinitions
3388 // (we don't know at this point if it's a definition or not).
3389 //
3390 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3391 //
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05003392 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04003393 if (prevDec) {
3394 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003395 context->error((yylsp[(2) - (2)]), "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
John Bauman66b8ab22014-05-06 15:57:45 -04003396 context->recover();
3397 }
Alexis Hetu76a343a2015-06-04 17:21:22 -04003398 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04003399 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003400 context->error((yylsp[(2) - (2)]), "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
John Bauman66b8ab22014-05-06 15:57:45 -04003401 context->recover();
3402 }
3403 }
3404 }
3405
3406 //
3407 // If this is a redeclaration, it could also be a definition,
3408 // in which case, we want to use the variable names from this one, and not the one that's
3409 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3410 //
3411 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003412 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003413
3414 // We're at the inner scope level of the function's arguments and body statement.
3415 // Add the function prototype to the surrounding scope instead.
3416 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3417 }
3418 break;
3419
Alexis Hetua35d8232015-06-11 17:11:06 -04003420 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003421
3422 {
3423 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3424 }
3425 break;
3426
Alexis Hetua35d8232015-06-11 17:11:06 -04003427 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003428
3429 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003430 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3431 }
3432 break;
3433
Alexis Hetua35d8232015-06-11 17:11:06 -04003434 case 96:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003435
3436 {
John Bauman66b8ab22014-05-06 15:57:45 -04003437 // Add the parameter
3438 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3439 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3440 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3441 else
3442 delete (yyvsp[(2) - (2)].interm).param.type;
3443 }
3444 break;
3445
Alexis Hetua35d8232015-06-11 17:11:06 -04003446 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003447
3448 {
3449 //
3450 // Only first parameter of one-parameter functions can be void
3451 // The check for named parameters not being void is done in parameter_declarator
3452 //
3453 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3454 //
3455 // This parameter > first is void
3456 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003457 context->error((yylsp[(2) - (3)]), "cannot be an argument type except for '(void)'", "void");
John Bauman66b8ab22014-05-06 15:57:45 -04003458 context->recover();
3459 delete (yyvsp[(3) - (3)].interm).param.type;
3460 } else {
3461 // Add the parameter
3462 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3463 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3464 }
3465 }
3466 break;
3467
Alexis Hetua35d8232015-06-11 17:11:06 -04003468 case 98:
John Bauman66b8ab22014-05-06 15:57:45 -04003469
3470 {
3471 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003472 context->error((yylsp[(2) - (3)]), "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));
John Bauman66b8ab22014-05-06 15:57:45 -04003473 context->recover();
3474 }
3475 // make sure a sampler is not involved as well...
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003476 if (context->structQualifierErrorCheck((yylsp[(2) - (3)]), (yyvsp[(1) - (3)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003477 context->recover();
3478
3479 // Add the function as a prototype after parsing it (we do not support recursion)
3480 TFunction *function;
3481 TType type((yyvsp[(1) - (3)].interm.type));
3482 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3483 (yyval.interm.function) = function;
3484
3485 context->symbolTable.push();
3486 }
3487 break;
3488
Alexis Hetua35d8232015-06-11 17:11:06 -04003489 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003490
3491 {
3492 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003493 context->error((yylsp[(2) - (2)]), "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04003494 context->recover();
3495 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003496 if (context->reservedErrorCheck((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003497 context->recover();
3498 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003499 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003500 (yyval.interm).param = param;
3501 }
3502 break;
3503
Alexis Hetua35d8232015-06-11 17:11:06 -04003504 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003505
3506 {
3507 // Check that we can make an array out of this type
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003508 if (context->arrayTypeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003509 context->recover();
3510
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003511 if (context->reservedErrorCheck((yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003512 context->recover();
3513
3514 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003515 if (context->arraySizeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003516 context->recover();
3517 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3518
3519 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3520 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003521 (yyval.interm).line = (yylsp[(2) - (5)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003522 (yyval.interm).param = param;
3523 }
3524 break;
3525
Alexis Hetu17809052015-05-13 11:28:22 -04003526 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003527
3528 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003529 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003530 if (context->paramErrorCheck((yylsp[(3) - (3)]), (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003531 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003532 }
3533 break;
3534
Alexis Hetu17809052015-05-13 11:28:22 -04003535 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003536
3537 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003538 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003539 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003540 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003541 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003542 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003543 }
3544 break;
3545
Alexis Hetu17809052015-05-13 11:28:22 -04003546 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003547
3548 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003549 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003550 if (context->paramErrorCheck((yylsp[(3) - (3)]), (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003551 context->recover();
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003552 }
3553 break;
3554
Alexis Hetu17809052015-05-13 11:28:22 -04003555 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003556
3557 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003558 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003559 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003560 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003561 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003562 context->recover();
3563 }
3564 break;
3565
3566 case 105:
3567
3568 {
3569 (yyval.interm.qualifier) = EvqIn;
3570 }
3571 break;
3572
3573 case 106:
3574
3575 {
3576 (yyval.interm.qualifier) = EvqIn;
3577 }
3578 break;
3579
3580 case 107:
3581
3582 {
3583 (yyval.interm.qualifier) = EvqOut;
3584 }
3585 break;
3586
3587 case 108:
3588
3589 {
3590 (yyval.interm.qualifier) = EvqInOut;
3591 }
3592 break;
3593
3594 case 109:
3595
3596 {
John Bauman66b8ab22014-05-06 15:57:45 -04003597 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3598 (yyval.interm).param = param;
3599 }
3600 break;
3601
Alexis Hetua35d8232015-06-11 17:11:06 -04003602 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003603
3604 {
3605 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3606 }
3607 break;
3608
Alexis Hetua35d8232015-06-11 17:11:06 -04003609 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003610
3611 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003612 (yyval.interm) = (yyvsp[(1) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003613 (yyval.interm).intermAggregate = context->parseDeclarator((yyval.interm).type, (yyvsp[(1) - (3)].interm).intermAggregate, (yylsp[(3) - (3)]), *(yyvsp[(3) - (3)].lex).string);
John Bauman66b8ab22014-05-06 15:57:45 -04003614 }
3615 break;
3616
Alexis Hetua35d8232015-06-11 17:11:06 -04003617 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003618
3619 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003620 (yyval.interm) = (yyvsp[(1) - (6)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003621 (yyval.interm).intermAggregate = context->parseArrayDeclarator((yyval.interm).type, (yyvsp[(1) - (6)].interm).intermAggregate, (yylsp[(3) - (6)]), *(yyvsp[(3) - (6)].lex).string, (yylsp[(4) - (6)]), (yyvsp[(5) - (6)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003622 }
3623 break;
3624
Alexis Hetua35d8232015-06-11 17:11:06 -04003625 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003626
3627 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003628 ES3_ONLY("[]", (yylsp[(3) - (7)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003629 (yyval.interm) = (yyvsp[(1) - (7)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003630 (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (7)].interm).intermAggregate, (yylsp[(3) - (7)]), *(yyvsp[(3) - (7)].lex).string, (yylsp[(4) - (7)]), nullptr, (yylsp[(6) - (7)]), (yyvsp[(7) - (7)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003631 }
3632 break;
3633
Alexis Hetua35d8232015-06-11 17:11:06 -04003634 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003635
3636 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003637 ES3_ONLY("=", (yylsp[(7) - (8)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003638 (yyval.interm) = (yyvsp[(1) - (8)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003639 (yyval.interm).intermAggregate = context->parseArrayInitDeclarator((yyval.interm).type, (yyvsp[(1) - (8)].interm).intermAggregate, (yylsp[(3) - (8)]), *(yyvsp[(3) - (8)].lex).string, (yylsp[(4) - (8)]), (yyvsp[(5) - (8)].interm.intermTypedNode), (yylsp[(7) - (8)]), (yyvsp[(8) - (8)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003640 }
3641 break;
3642
Alexis Hetua35d8232015-06-11 17:11:06 -04003643 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003644
3645 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003646 (yyval.interm) = (yyvsp[(1) - (5)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003647 (yyval.interm).intermAggregate = context->parseInitDeclarator((yyval.interm).type, (yyvsp[(1) - (5)].interm).intermAggregate, (yylsp[(3) - (5)]), *(yyvsp[(3) - (5)].lex).string, (yylsp[(4) - (5)]), (yyvsp[(5) - (5)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003648 }
3649 break;
3650
Alexis Hetua35d8232015-06-11 17:11:06 -04003651 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003652
3653 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003654 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003655 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(1) - (1)]), "");
John Bauman66b8ab22014-05-06 15:57:45 -04003656 }
3657 break;
3658
Alexis Hetua35d8232015-06-11 17:11:06 -04003659 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003660
3661 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003662 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003663 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string);
John Bauman66b8ab22014-05-06 15:57:45 -04003664 }
3665 break;
3666
Alexis Hetua35d8232015-06-11 17:11:06 -04003667 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003668
3669 {
John Bauman66b8ab22014-05-06 15:57:45 -04003670 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003671 (yyval.interm).intermAggregate = context->parseSingleArrayDeclaration((yyval.interm).type, (yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string, (yylsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003672 }
3673 break;
3674
Alexis Hetua35d8232015-06-11 17:11:06 -04003675 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003676
3677 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003678 ES3_ONLY("[]", (yylsp[(3) - (6)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003679 (yyval.interm).type = (yyvsp[(1) - (6)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003680 (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yylsp[(2) - (6)]), *(yyvsp[(2) - (6)].lex).string, (yylsp[(3) - (6)]), nullptr, (yylsp[(5) - (6)]), (yyvsp[(6) - (6)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003681 }
3682 break;
3683
Alexis Hetua35d8232015-06-11 17:11:06 -04003684 case 120:
John Bauman66b8ab22014-05-06 15:57:45 -04003685
3686 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003687 ES3_ONLY("=", (yylsp[(6) - (7)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003688 (yyval.interm).type = (yyvsp[(1) - (7)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003689 (yyval.interm).intermAggregate = context->parseSingleArrayInitDeclaration((yyval.interm).type, (yylsp[(2) - (7)]), *(yyvsp[(2) - (7)].lex).string, (yylsp[(3) - (7)]), (yyvsp[(4) - (7)].interm.intermTypedNode), (yylsp[(6) - (7)]), (yyvsp[(7) - (7)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04003690 }
3691 break;
3692
Alexis Hetua35d8232015-06-11 17:11:06 -04003693 case 121:
John Bauman66b8ab22014-05-06 15:57:45 -04003694
3695 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003696 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003697 (yyval.interm).intermAggregate = context->parseSingleInitDeclaration((yyval.interm).type, (yylsp[(2) - (4)]), *(yyvsp[(2) - (4)].lex).string, (yylsp[(3) - (4)]), (yyvsp[(4) - (4)].interm.intermTypedNode));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003698 }
3699 break;
3700
Alexis Hetua35d8232015-06-11 17:11:06 -04003701 case 122:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003702
3703 {
3704 // $$.type is not used in invariant declarations.
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003705 (yyval.interm).intermAggregate = context->parseInvariantDeclaration((yylsp[(1) - (2)]), (yylsp[(2) - (2)]), (yyvsp[(2) - (2)].lex).string, (yyvsp[(2) - (2)].lex).symbol);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003706 }
3707 break;
3708
Alexis Hetua35d8232015-06-11 17:11:06 -04003709 case 123:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003710
3711 {
John Bauman66b8ab22014-05-06 15:57:45 -04003712 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3713
3714 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003715 ES3_ONLY("[]", (yylsp[(1) - (1)]));
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003716 if (context->getShaderVersion() != 300) {
3717 (yyvsp[(1) - (1)].interm.type).clearArrayness();
3718 }
John Bauman66b8ab22014-05-06 15:57:45 -04003719 }
3720 }
3721 break;
3722
Alexis Hetua35d8232015-06-11 17:11:06 -04003723 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04003724
3725 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003726 (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 -04003727 }
3728 break;
3729
Alexis Hetua35d8232015-06-11 17:11:06 -04003730 case 125:
John Bauman66b8ab22014-05-06 15:57:45 -04003731
3732 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003733 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003734 }
3735 break;
3736
Alexis Hetua35d8232015-06-11 17:11:06 -04003737 case 126:
John Bauman66b8ab22014-05-06 15:57:45 -04003738
3739 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003740 (yyval.interm.type).qualifier = EvqFlat;
3741 }
3742 break;
3743
Alexis Hetua35d8232015-06-11 17:11:06 -04003744 case 127:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003745
3746 {
3747 (yyval.interm.qualifier) = EvqConstReadOnly;
3748 }
3749 break;
3750
Alexis Hetua35d8232015-06-11 17:11:06 -04003751 case 128:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003752
3753 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003754 VERTEX_ONLY("attribute", (yylsp[(1) - (1)]));
3755 ES2_ONLY("attribute", (yylsp[(1) - (1)]));
3756 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "attribute"))
John Bauman66b8ab22014-05-06 15:57:45 -04003757 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003758 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003759 }
3760 break;
3761
Alexis Hetua35d8232015-06-11 17:11:06 -04003762 case 129:
John Bauman66b8ab22014-05-06 15:57:45 -04003763
3764 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003765 ES2_ONLY("varying", (yylsp[(1) - (1)]));
3766 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003767 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05003768 if (context->shaderType == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003769 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003770 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003771 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003772 }
3773 break;
3774
Alexis Hetua35d8232015-06-11 17:11:06 -04003775 case 130:
John Bauman66b8ab22014-05-06 15:57:45 -04003776
3777 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003778 ES2_ONLY("varying", (yylsp[(1) - (2)]));
3779 if (context->globalErrorCheck((yylsp[(1) - (2)]), context->symbolTable.atGlobalLevel(), "invariant varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003780 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05003781 if (context->shaderType == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003782 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003783 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003784 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003785 }
3786 break;
3787
Alexis Hetua35d8232015-06-11 17:11:06 -04003788 case 131:
John Bauman66b8ab22014-05-06 15:57:45 -04003789
3790 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003791 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003792 }
3793 break;
3794
Alexis Hetua35d8232015-06-11 17:11:06 -04003795 case 132:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003796
3797 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003798 (yyval.interm.type) = context->joinInterpolationQualifiers((yylsp[(1) - (2)]), (yyvsp[(1) - (2)].interm.type).qualifier, (yylsp[(2) - (2)]), (yyvsp[(2) - (2)].interm.type).qualifier);
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003799 }
3800 break;
3801
Alexis Hetua35d8232015-06-11 17:11:06 -04003802 case 133:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003803
3804 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003805 context->error((yylsp[(1) - (1)]), "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getQualifierString((yyvsp[(1) - (1)].interm.type).qualifier));
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003806 context->recover();
3807
3808 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003809 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003810 }
3811 break;
3812
Alexis Hetua35d8232015-06-11 17:11:06 -04003813 case 134:
John Bauman66b8ab22014-05-06 15:57:45 -04003814
3815 {
Nicolas Capens7d626792015-02-17 17:58:31 -05003816 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3817 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
3818 }
3819 break;
3820
Alexis Hetua35d8232015-06-11 17:11:06 -04003821 case 135:
Nicolas Capens7d626792015-02-17 17:58:31 -05003822
3823 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003824 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yylsp[(2) - (2)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003825 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
3826 }
3827 break;
3828
Alexis Hetua35d8232015-06-11 17:11:06 -04003829 case 136:
Nicolas Capens7d626792015-02-17 17:58:31 -05003830
3831 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003832 (yyval.interm.type).qualifier = EvqConstExpr;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003833 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003834 }
3835 break;
3836
Alexis Hetua35d8232015-06-11 17:11:06 -04003837 case 137:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003838
3839 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003840 ES3_ONLY("in", (yylsp[(1) - (1)]));
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003841 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003842 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003843 }
3844 break;
3845
Alexis Hetua35d8232015-06-11 17:11:06 -04003846 case 138:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003847
3848 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003849 ES3_ONLY("out", (yylsp[(1) - (1)]));
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003850 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003851 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003852 }
3853 break;
3854
Alexis Hetua35d8232015-06-11 17:11:06 -04003855 case 139:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003856
3857 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003858 ES3_ONLY("centroid in", (yylsp[(1) - (2)]));
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003859 if (context->shaderType == GL_VERTEX_SHADER)
3860 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003861 context->error((yylsp[(1) - (2)]), "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader");
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003862 context->recover();
3863 }
3864 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003865 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003866 }
3867 break;
3868
Alexis Hetua35d8232015-06-11 17:11:06 -04003869 case 140:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003870
3871 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003872 ES3_ONLY("centroid out", (yylsp[(1) - (2)]));
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003873 if (context->shaderType == GL_FRAGMENT_SHADER)
3874 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003875 context->error((yylsp[(1) - (2)]), "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader");
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003876 context->recover();
3877 }
3878 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003879 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003880 }
3881 break;
3882
Alexis Hetua35d8232015-06-11 17:11:06 -04003883 case 141:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003884
3885 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003886 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "uniform"))
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003887 context->recover();
3888 (yyval.interm.type).qualifier = EvqUniform;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003889 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003890 }
3891 break;
3892
Alexis Hetua35d8232015-06-11 17:11:06 -04003893 case 142:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003894
3895 {
John Bauman66b8ab22014-05-06 15:57:45 -04003896 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3897
3898 if ((yyval.interm.type).precision == EbpUndefined) {
3899 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003900 if (context->precisionErrorCheck((yylsp[(1) - (1)]), (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
John Bauman66b8ab22014-05-06 15:57:45 -04003901 context->recover();
3902 }
3903 }
3904 }
3905 break;
3906
Alexis Hetua35d8232015-06-11 17:11:06 -04003907 case 143:
John Bauman66b8ab22014-05-06 15:57:45 -04003908
3909 {
3910 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3911 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
3912 }
3913 break;
3914
Alexis Hetua35d8232015-06-11 17:11:06 -04003915 case 144:
John Bauman66b8ab22014-05-06 15:57:45 -04003916
3917 {
3918 (yyval.interm.precision) = EbpHigh;
3919 }
3920 break;
3921
Alexis Hetua35d8232015-06-11 17:11:06 -04003922 case 145:
John Bauman66b8ab22014-05-06 15:57:45 -04003923
3924 {
3925 (yyval.interm.precision) = EbpMedium;
3926 }
3927 break;
3928
Alexis Hetua35d8232015-06-11 17:11:06 -04003929 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04003930
3931 {
3932 (yyval.interm.precision) = EbpLow;
3933 }
3934 break;
3935
Alexis Hetua35d8232015-06-11 17:11:06 -04003936 case 147:
Nicolas Capens7d626792015-02-17 17:58:31 -05003937
3938 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003939 ES3_ONLY("layout", (yylsp[(1) - (4)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003940 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
3941 }
3942 break;
3943
Alexis Hetua35d8232015-06-11 17:11:06 -04003944 case 148:
Nicolas Capens7d626792015-02-17 17:58:31 -05003945
3946 {
3947 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
3948 }
3949 break;
3950
Alexis Hetua35d8232015-06-11 17:11:06 -04003951 case 149:
Nicolas Capens7d626792015-02-17 17:58:31 -05003952
3953 {
3954 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
3955 }
3956 break;
3957
Alexis Hetua35d8232015-06-11 17:11:06 -04003958 case 150:
Nicolas Capens7d626792015-02-17 17:58:31 -05003959
3960 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003961 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003962 }
3963 break;
3964
Alexis Hetua35d8232015-06-11 17:11:06 -04003965 case 151:
John Bauman66b8ab22014-05-06 15:57:45 -04003966
3967 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003968 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yylsp[(1) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yylsp[(3) - (3)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003969 }
3970 break;
3971
Alexis Hetua35d8232015-06-11 17:11:06 -04003972 case 152:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003973
3974 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003975 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yylsp[(1) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yylsp[(3) - (3)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003976 }
3977 break;
3978
Alexis Hetua35d8232015-06-11 17:11:06 -04003979 case 153:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003980
3981 {
John Bauman66b8ab22014-05-06 15:57:45 -04003982 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3983 }
3984 break;
3985
Alexis Hetua35d8232015-06-11 17:11:06 -04003986 case 154:
John Bauman66b8ab22014-05-06 15:57:45 -04003987
3988 {
3989 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3990
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003991 if (context->arrayTypeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003992 context->recover();
3993 else {
3994 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003995 if (context->arraySizeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003996 context->recover();
3997 (yyval.interm.type).setArray(true, size);
3998 }
3999 }
4000 break;
4001
Alexis Hetu17809052015-05-13 11:28:22 -04004002 case 155:
4003
4004 {
4005 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004006 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004007 }
4008 break;
4009
4010 case 156:
4011
4012 {
4013 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004014 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004015 }
4016 break;
4017
4018 case 157:
4019
4020 {
4021 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004022 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004023 }
4024 break;
4025
4026 case 158:
4027
4028 {
4029 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004030 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004031 }
4032 break;
4033
4034 case 159:
4035
4036 {
4037 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004038 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004039 }
4040 break;
4041
4042 case 160:
4043
4044 {
4045 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004046 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004047 (yyval.interm.type).setAggregate(2);
4048 }
4049 break;
4050
4051 case 161:
4052
4053 {
4054 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004055 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004056 (yyval.interm.type).setAggregate(3);
4057 }
4058 break;
4059
4060 case 162:
4061
4062 {
4063 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004064 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004065 (yyval.interm.type).setAggregate(4);
4066 }
4067 break;
4068
4069 case 163:
4070
4071 {
4072 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004073 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004074 (yyval.interm.type).setAggregate(2);
4075 }
4076 break;
4077
4078 case 164:
4079
4080 {
4081 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004082 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004083 (yyval.interm.type).setAggregate(3);
4084 }
4085 break;
4086
4087 case 165:
4088
4089 {
4090 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004091 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004092 (yyval.interm.type).setAggregate(4);
Alexis Hetu17809052015-05-13 11:28:22 -04004093 }
4094 break;
4095
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004096 case 166:
4097
4098 {
4099 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004100 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004101 (yyval.interm.type).setAggregate(2);
4102 }
4103 break;
4104
4105 case 167:
4106
4107 {
4108 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004109 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004110 (yyval.interm.type).setAggregate(3);
4111 }
4112 break;
4113
4114 case 168:
4115
4116 {
4117 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004118 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004119 (yyval.interm.type).setAggregate(4);
4120 }
4121 break;
4122
4123 case 169:
4124
4125 {
4126 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004127 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004128 (yyval.interm.type).setAggregate(2);
4129 }
4130 break;
4131
4132 case 170:
4133
4134 {
4135 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004136 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04004137 (yyval.interm.type).setAggregate(3);
4138 }
4139 break;
4140
4141 case 171:
4142
4143 {
4144 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004145 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004146 (yyval.interm.type).setAggregate(4);
4147 }
4148 break;
4149
Alexis Hetua35d8232015-06-11 17:11:06 -04004150 case 172:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004151
4152 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004153 FRAG_VERT_ONLY("mat2", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004154 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004155 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004156 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004157 }
4158 break;
4159
Alexis Hetua35d8232015-06-11 17:11:06 -04004160 case 173:
John Bauman66b8ab22014-05-06 15:57:45 -04004161
4162 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004163 FRAG_VERT_ONLY("mat3", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004164 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004165 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004166 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004167 }
4168 break;
4169
Alexis Hetua35d8232015-06-11 17:11:06 -04004170 case 174:
John Bauman66b8ab22014-05-06 15:57:45 -04004171
4172 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004173 FRAG_VERT_ONLY("mat4", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004174 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004175 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004176 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004177 }
4178 break;
4179
Alexis Hetua35d8232015-06-11 17:11:06 -04004180 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004181
4182 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004183 FRAG_VERT_ONLY("mat2x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004184 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004185 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004186 (yyval.interm.type).setMatrix(2, 3);
4187 }
4188 break;
4189
Alexis Hetua35d8232015-06-11 17:11:06 -04004190 case 176:
Alexis Hetub14178b2015-04-13 13:23:20 -04004191
4192 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004193 FRAG_VERT_ONLY("mat3x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004194 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004195 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004196 (yyval.interm.type).setMatrix(3, 2);
4197 }
4198 break;
4199
Alexis Hetua35d8232015-06-11 17:11:06 -04004200 case 177:
Alexis Hetub14178b2015-04-13 13:23:20 -04004201
4202 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004203 FRAG_VERT_ONLY("mat2x4", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004204 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004205 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004206 (yyval.interm.type).setMatrix(2, 4);
4207 }
4208 break;
4209
Alexis Hetua35d8232015-06-11 17:11:06 -04004210 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004211
4212 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004213 FRAG_VERT_ONLY("mat4x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004214 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004215 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004216 (yyval.interm.type).setMatrix(4, 2);
4217 }
4218 break;
4219
Alexis Hetua35d8232015-06-11 17:11:06 -04004220 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004221
4222 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004223 FRAG_VERT_ONLY("mat3x4", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004224 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004225 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004226 (yyval.interm.type).setMatrix(3, 4);
4227 }
4228 break;
4229
Alexis Hetua35d8232015-06-11 17:11:06 -04004230 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004231
4232 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004233 FRAG_VERT_ONLY("mat4x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004234 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004235 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004236 (yyval.interm.type).setMatrix(4, 3);
4237 }
4238 break;
4239
Alexis Hetua35d8232015-06-11 17:11:06 -04004240 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004241
4242 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004243 FRAG_VERT_ONLY("sampler2D", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004244 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004245 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004246 }
4247 break;
4248
Alexis Hetua35d8232015-06-11 17:11:06 -04004249 case 182:
John Bauman66b8ab22014-05-06 15:57:45 -04004250
4251 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004252 FRAG_VERT_ONLY("samplerCube", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004253 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004254 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004255 }
4256 break;
4257
Alexis Hetua35d8232015-06-11 17:11:06 -04004258 case 183:
John Bauman66b8ab22014-05-06 15:57:45 -04004259
4260 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004261 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004262 context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES", "");
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004263 context->recover();
4264 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004265 FRAG_VERT_ONLY("samplerExternalOES", (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004266 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004267 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004268 }
4269 break;
4270
Alexis Hetua35d8232015-06-11 17:11:06 -04004271 case 184:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004272
4273 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004274 FRAG_VERT_ONLY("sampler3D", (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004275 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004276 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004277 }
4278 break;
4279
Alexis Hetua35d8232015-06-11 17:11:06 -04004280 case 185:
Alexis Hetub14178b2015-04-13 13:23:20 -04004281
4282 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004283 FRAG_VERT_ONLY("sampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004284 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004285 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004286 }
4287 break;
4288
Alexis Hetua35d8232015-06-11 17:11:06 -04004289 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004290
4291 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004292 FRAG_VERT_ONLY("isampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004293 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004294 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004295 }
4296 break;
4297
Alexis Hetua35d8232015-06-11 17:11:06 -04004298 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004299
4300 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004301 FRAG_VERT_ONLY("isampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004302 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004303 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004304 }
4305 break;
4306
Alexis Hetua35d8232015-06-11 17:11:06 -04004307 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004308
4309 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004310 FRAG_VERT_ONLY("isamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004311 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004312 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004313 }
4314 break;
4315
Alexis Hetua35d8232015-06-11 17:11:06 -04004316 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004317
4318 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004319 FRAG_VERT_ONLY("isampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004320 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004321 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004322 }
4323 break;
4324
Alexis Hetua35d8232015-06-11 17:11:06 -04004325 case 190:
Alexis Hetub14178b2015-04-13 13:23:20 -04004326
4327 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004328 FRAG_VERT_ONLY("usampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004329 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004330 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004331 }
4332 break;
4333
Alexis Hetua35d8232015-06-11 17:11:06 -04004334 case 191:
Alexis Hetub14178b2015-04-13 13:23:20 -04004335
4336 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004337 FRAG_VERT_ONLY("usampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004338 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004339 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004340 }
4341 break;
4342
Alexis Hetua35d8232015-06-11 17:11:06 -04004343 case 192:
Alexis Hetub14178b2015-04-13 13:23:20 -04004344
4345 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004346 FRAG_VERT_ONLY("usamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004347 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004348 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004349 }
4350 break;
4351
Alexis Hetua35d8232015-06-11 17:11:06 -04004352 case 193:
Alexis Hetub14178b2015-04-13 13:23:20 -04004353
4354 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004355 FRAG_VERT_ONLY("usampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004356 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004357 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004358 }
4359 break;
4360
Alexis Hetua35d8232015-06-11 17:11:06 -04004361 case 194:
Alexis Hetub14178b2015-04-13 13:23:20 -04004362
4363 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004364 FRAG_VERT_ONLY("sampler2DShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004365 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004366 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004367 }
4368 break;
4369
Alexis Hetua35d8232015-06-11 17:11:06 -04004370 case 195:
Alexis Hetub14178b2015-04-13 13:23:20 -04004371
4372 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004373 FRAG_VERT_ONLY("samplerCubeShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004374 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004375 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004376 }
4377 break;
4378
Alexis Hetua35d8232015-06-11 17:11:06 -04004379 case 196:
Alexis Hetub14178b2015-04-13 13:23:20 -04004380
4381 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004382 FRAG_VERT_ONLY("sampler2DArrayShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004383 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004384 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004385 }
4386 break;
4387
Alexis Hetua35d8232015-06-11 17:11:06 -04004388 case 197:
Alexis Hetub027aa92015-01-19 15:56:12 -05004389
4390 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004391 FRAG_VERT_ONLY("struct", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004392 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4393 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4394 }
4395 break;
4396
Alexis Hetua35d8232015-06-11 17:11:06 -04004397 case 198:
John Bauman66b8ab22014-05-06 15:57:45 -04004398
4399 {
4400 //
4401 // This is for user defined type names. The lexical phase looked up the
4402 // type.
4403 //
4404 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4405 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004406 (yyval.interm.type).setBasic(EbtStruct, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004407 (yyval.interm.type).userDef = &structure;
4408 }
4409 break;
4410
Alexis Hetua35d8232015-06-11 17:11:06 -04004411 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004412
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004413 { if (context->enterStructDeclaration((yylsp[(2) - (3)]), *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004414 break;
4415
Alexis Hetua35d8232015-06-11 17:11:06 -04004416 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004417
4418 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004419 (yyval.interm.type) = context->addStructure((yylsp[(1) - (6)]), (yylsp[(2) - (6)]), (yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004420 }
4421 break;
4422
Alexis Hetua35d8232015-06-11 17:11:06 -04004423 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004424
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004425 { if (context->enterStructDeclaration((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004426 break;
4427
Alexis Hetua35d8232015-06-11 17:11:06 -04004428 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004429
4430 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004431 (yyval.interm.type) = context->addStructure((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004432 }
4433 break;
4434
Alexis Hetua35d8232015-06-11 17:11:06 -04004435 case 203:
John Bauman66b8ab22014-05-06 15:57:45 -04004436
4437 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004438 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
John Bauman66b8ab22014-05-06 15:57:45 -04004439 }
4440 break;
4441
Alexis Hetua35d8232015-06-11 17:11:06 -04004442 case 204:
John Bauman66b8ab22014-05-06 15:57:45 -04004443
4444 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004445 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
4446 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) {
4447 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i];
4448 for (unsigned int j = 0; j < (yyval.interm.fieldList)->size(); ++j) {
4449 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) {
4450 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 -04004451 context->recover();
4452 }
4453 }
Alexis Hetua8b364b2015-06-10 11:48:40 -04004454 (yyval.interm.fieldList)->push_back((*(yyvsp[(2) - (2)].interm.fieldList))[i]);
John Bauman66b8ab22014-05-06 15:57:45 -04004455 }
4456 }
4457 break;
4458
Alexis Hetua35d8232015-06-11 17:11:06 -04004459 case 205:
John Bauman66b8ab22014-05-06 15:57:45 -04004460
4461 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004462 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004463 }
4464 break;
4465
Alexis Hetua35d8232015-06-11 17:11:06 -04004466 case 206:
John Bauman66b8ab22014-05-06 15:57:45 -04004467
4468 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004469 // ES3 Only, but errors should be handled elsewhere
4470 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4471 (yyvsp[(2) - (4)].interm.type).layoutQualifier = (yyvsp[(1) - (4)].interm.type).layoutQualifier;
4472 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.fieldList));
4473 }
4474 break;
4475
Alexis Hetua35d8232015-06-11 17:11:06 -04004476 case 207:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004477
4478 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004479 (yyval.interm.fieldList) = NewPoolTFieldList();
4480 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004481 }
4482 break;
4483
Alexis Hetua35d8232015-06-11 17:11:06 -04004484 case 208:
John Bauman66b8ab22014-05-06 15:57:45 -04004485
4486 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004487 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004488 }
4489 break;
4490
Alexis Hetua35d8232015-06-11 17:11:06 -04004491 case 209:
John Bauman66b8ab22014-05-06 15:57:45 -04004492
4493 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004494 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004495 context->recover();
4496
Alexis Hetua8b364b2015-06-10 11:48:40 -04004497 TType* type = new TType(EbtVoid, EbpUndefined);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004498 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004499 }
4500 break;
4501
Alexis Hetua35d8232015-06-11 17:11:06 -04004502 case 210:
John Bauman66b8ab22014-05-06 15:57:45 -04004503
4504 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004505 if (context->reservedErrorCheck((yylsp[(1) - (4)]), *(yyvsp[(1) - (4)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004506 context->recover();
4507
Alexis Hetua8b364b2015-06-10 11:48:40 -04004508 TType* type = new TType(EbtVoid, EbpUndefined);
John Bauman66b8ab22014-05-06 15:57:45 -04004509 int size;
Alexis Hetua8b364b2015-06-10 11:48:40 -04004510 if (context->arraySizeErrorCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLine(), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04004511 context->recover();
Alexis Hetua8b364b2015-06-10 11:48:40 -04004512 type->setArraySize(size);
4513
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004514 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yylsp[(1) - (4)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004515 }
4516 break;
4517
Alexis Hetu17809052015-05-13 11:28:22 -04004518 case 211:
Nicolas Capens7d626792015-02-17 17:58:31 -05004519
Alexis Hetua35d8232015-06-11 17:11:06 -04004520 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004521 break;
4522
Alexis Hetu17809052015-05-13 11:28:22 -04004523 case 212:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004524
Alexis Hetuad6b8752015-06-09 16:15:30 -04004525 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004526 break;
4527
Alexis Hetu17809052015-05-13 11:28:22 -04004528 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004529
Alexis Hetua35d8232015-06-11 17:11:06 -04004530 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004531 break;
4532
Alexis Hetu17809052015-05-13 11:28:22 -04004533 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004534
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004535 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004536 break;
4537
Alexis Hetu17809052015-05-13 11:28:22 -04004538 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004539
Alexis Hetua35d8232015-06-11 17:11:06 -04004540 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetuad6b8752015-06-09 16:15:30 -04004541 break;
4542
4543 case 216:
4544
Alexis Hetua35d8232015-06-11 17:11:06 -04004545 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004546 break;
4547
4548 case 217:
4549
Alexis Hetua35d8232015-06-11 17:11:06 -04004550 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004551 break;
4552
4553 case 218:
4554
Alexis Hetu76a343a2015-06-04 17:21:22 -04004555 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermSwitch); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004556 break;
4557
4558 case 219:
4559
Alexis Hetu76a343a2015-06-04 17:21:22 -04004560 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermCase); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004561 break;
4562
4563 case 220:
4564
Alexis Hetu76a343a2015-06-04 17:21:22 -04004565 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004566 break;
4567
4568 case 221:
4569
Alexis Hetu76a343a2015-06-04 17:21:22 -04004570 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004571 break;
4572
4573 case 222:
4574
Alexis Hetu76a343a2015-06-04 17:21:22 -04004575 { (yyval.interm.intermAggregate) = 0; }
Alexis Hetua35d8232015-06-11 17:11:06 -04004576 break;
4577
4578 case 223:
4579
Alexis Hetu76a343a2015-06-04 17:21:22 -04004580 { context->symbolTable.push(); }
4581 break;
4582
4583 case 224:
4584
4585 { context->symbolTable.pop(); }
4586 break;
4587
4588 case 225:
4589
Nicolas Capens7d626792015-02-17 17:58:31 -05004590 {
4591 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4592 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004593 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yylsp[(5) - (5)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05004594 }
4595 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4596 }
4597 break;
4598
Alexis Hetua35d8232015-06-11 17:11:06 -04004599 case 226:
4600
Alexis Hetu76a343a2015-06-04 17:21:22 -04004601 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004602 break;
4603
4604 case 227:
4605
Alexis Hetu76a343a2015-06-04 17:21:22 -04004606 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004607 break;
4608
4609 case 228:
4610
4611 { context->symbolTable.push(); }
4612 break;
4613
4614 case 229:
4615
4616 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4617 break;
4618
4619 case 230:
4620
Alexis Hetu76a343a2015-06-04 17:21:22 -04004621 { context->symbolTable.push(); }
4622 break;
4623
4624 case 231:
4625
4626 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4627 break;
4628
4629 case 232:
4630
John Bauman66b8ab22014-05-06 15:57:45 -04004631 {
4632 (yyval.interm.intermNode) = 0;
4633 }
4634 break;
4635
Alexis Hetu76a343a2015-06-04 17:21:22 -04004636 case 233:
John Bauman66b8ab22014-05-06 15:57:45 -04004637
4638 {
4639 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4640 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004641 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yylsp[(3) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004642 }
4643 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4644 }
4645 break;
4646
Alexis Hetu76a343a2015-06-04 17:21:22 -04004647 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004648
4649 {
4650 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4651 }
4652 break;
4653
Alexis Hetu76a343a2015-06-04 17:21:22 -04004654 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004655
4656 {
4657 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4658 }
4659 break;
4660
Alexis Hetu76a343a2015-06-04 17:21:22 -04004661 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004662
4663 { (yyval.interm.intermNode) = 0; }
4664 break;
4665
Alexis Hetu76a343a2015-06-04 17:21:22 -04004666 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04004667
4668 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4669 break;
4670
Alexis Hetu76a343a2015-06-04 17:21:22 -04004671 case 238:
John Bauman66b8ab22014-05-06 15:57:45 -04004672
4673 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004674 if (context->boolErrorCheck((yylsp[(1) - (5)]), (yyvsp[(3) - (5)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004675 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004676 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yylsp[(1) - (5)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004677 }
4678 break;
4679
Alexis Hetu76a343a2015-06-04 17:21:22 -04004680 case 239:
John Bauman66b8ab22014-05-06 15:57:45 -04004681
4682 {
4683 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4684 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4685 }
4686 break;
4687
Alexis Hetu76a343a2015-06-04 17:21:22 -04004688 case 240:
John Bauman66b8ab22014-05-06 15:57:45 -04004689
4690 {
4691 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4692 (yyval.interm.nodePair).node2 = 0;
4693 }
4694 break;
4695
Alexis Hetu76a343a2015-06-04 17:21:22 -04004696 case 241:
4697
4698 { context->incrSwitchNestingLevel(); }
4699 break;
4700
4701 case 242:
4702
4703 {
4704 (yyval.interm.intermSwitch) = context->addSwitch((yyvsp[(3) - (6)].interm.intermTypedNode), (yyvsp[(6) - (6)].interm.intermAggregate), (yyvsp[(1) - (6)].lex).line);
4705 context->decrSwitchNestingLevel();
4706 }
4707 break;
4708
4709 case 243:
4710
4711 {
4712 (yyval.interm.intermCase) = context->addCase((yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
4713 }
4714 break;
4715
4716 case 244:
4717
4718 {
4719 (yyval.interm.intermCase) = context->addDefault((yyvsp[(1) - (2)].lex).line);
4720 }
4721 break;
4722
4723 case 245:
John Bauman66b8ab22014-05-06 15:57:45 -04004724
4725 {
4726 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4727 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4728 context->recover();
4729 }
4730 break;
4731
Alexis Hetu76a343a2015-06-04 17:21:22 -04004732 case 246:
John Bauman66b8ab22014-05-06 15:57:45 -04004733
4734 {
4735 TIntermNode* intermNode;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004736 if (context->structQualifierErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004737 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004738 if (context->boolErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004739 context->recover();
4740
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004741 if (!context->executeInitializer((yylsp[(2) - (4)]), *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
John Bauman66b8ab22014-05-06 15:57:45 -04004742 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4743 else {
4744 context->recover();
4745 (yyval.interm.intermTypedNode) = 0;
4746 }
4747 }
4748 break;
4749
Alexis Hetu76a343a2015-06-04 17:21:22 -04004750 case 247:
John Bauman66b8ab22014-05-06 15:57:45 -04004751
4752 { context->symbolTable.push(); ++context->loopNestingLevel; }
4753 break;
4754
Alexis Hetu76a343a2015-06-04 17:21:22 -04004755 case 248:
John Bauman66b8ab22014-05-06 15:57:45 -04004756
4757 {
4758 context->symbolTable.pop();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004759 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yylsp[(1) - (6)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004760 --context->loopNestingLevel;
4761 }
4762 break;
4763
Alexis Hetu76a343a2015-06-04 17:21:22 -04004764 case 249:
John Bauman66b8ab22014-05-06 15:57:45 -04004765
4766 { ++context->loopNestingLevel; }
4767 break;
4768
Alexis Hetu76a343a2015-06-04 17:21:22 -04004769 case 250:
John Bauman66b8ab22014-05-06 15:57:45 -04004770
4771 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004772 if (context->boolErrorCheck((yylsp[(8) - (8)]), (yyvsp[(6) - (8)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004773 context->recover();
4774
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004775 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yylsp[(4) - (8)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004776 --context->loopNestingLevel;
4777 }
4778 break;
4779
Alexis Hetu76a343a2015-06-04 17:21:22 -04004780 case 251:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004781
Alexis Hetuad6b8752015-06-09 16:15:30 -04004782 { context->symbolTable.push(); ++context->loopNestingLevel; }
Alexis Hetub027aa92015-01-19 15:56:12 -05004783 break;
4784
Alexis Hetu76a343a2015-06-04 17:21:22 -04004785 case 252:
Alexis Hetub027aa92015-01-19 15:56:12 -05004786
4787 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004788 context->symbolTable.pop();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004789 (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), (yylsp[(1) - (7)]));
Alexis Hetuad6b8752015-06-09 16:15:30 -04004790 --context->loopNestingLevel;
Nicolas Capens3c20f802015-02-17 17:17:20 -05004791 }
4792 break;
4793
Alexis Hetu76a343a2015-06-04 17:21:22 -04004794 case 253:
Alexis Hetu17809052015-05-13 11:28:22 -04004795
4796 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004797 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetu17809052015-05-13 11:28:22 -04004798 }
4799 break;
4800
Alexis Hetu76a343a2015-06-04 17:21:22 -04004801 case 254:
Alexis Hetu17809052015-05-13 11:28:22 -04004802
4803 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004804 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetuad6b8752015-06-09 16:15:30 -04004805 }
4806 break;
4807
Alexis Hetu76a343a2015-06-04 17:21:22 -04004808 case 255:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004809
4810 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004811 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4812 }
4813 break;
4814
Alexis Hetu76a343a2015-06-04 17:21:22 -04004815 case 256:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004816
4817 {
4818 (yyval.interm.intermTypedNode) = 0;
4819 }
4820 break;
4821
Alexis Hetu76a343a2015-06-04 17:21:22 -04004822 case 257:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004823
4824 {
Alexis Hetu17809052015-05-13 11:28:22 -04004825 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4826 (yyval.interm.nodePair).node2 = 0;
4827 }
4828 break;
4829
Alexis Hetu76a343a2015-06-04 17:21:22 -04004830 case 258:
Alexis Hetu17809052015-05-13 11:28:22 -04004831
4832 {
4833 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4834 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
4835 }
4836 break;
4837
Alexis Hetu76a343a2015-06-04 17:21:22 -04004838 case 259:
Alexis Hetu17809052015-05-13 11:28:22 -04004839
4840 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004841 (yyval.interm.intermNode) = context->addBranch(EOpContinue, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004842 }
4843 break;
4844
Alexis Hetu76a343a2015-06-04 17:21:22 -04004845 case 260:
Alexis Hetu17809052015-05-13 11:28:22 -04004846
4847 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004848 (yyval.interm.intermNode) = context->addBranch(EOpBreak, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004849 }
4850 break;
4851
Alexis Hetu76a343a2015-06-04 17:21:22 -04004852 case 261:
Alexis Hetu17809052015-05-13 11:28:22 -04004853
4854 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004855 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004856 }
4857 break;
4858
Alexis Hetu76a343a2015-06-04 17:21:22 -04004859 case 262:
Alexis Hetu17809052015-05-13 11:28:22 -04004860
4861 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004862 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004863 }
4864 break;
4865
Alexis Hetu76a343a2015-06-04 17:21:22 -04004866 case 263:
Alexis Hetu17809052015-05-13 11:28:22 -04004867
4868 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004869 FRAG_ONLY("discard", (yylsp[(1) - (2)]));
4870 (yyval.interm.intermNode) = context->addBranch(EOpKill, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004871 }
4872 break;
4873
Alexis Hetu76a343a2015-06-04 17:21:22 -04004874 case 264:
Alexis Hetu17809052015-05-13 11:28:22 -04004875
4876 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004877 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetu17809052015-05-13 11:28:22 -04004878 context->treeRoot = (yyval.interm.intermNode);
4879 }
4880 break;
4881
Alexis Hetu76a343a2015-06-04 17:21:22 -04004882 case 265:
Alexis Hetu17809052015-05-13 11:28:22 -04004883
4884 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004885 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
4886 context->treeRoot = (yyval.interm.intermNode);
Alexis Hetu17809052015-05-13 11:28:22 -04004887 }
4888 break;
4889
Alexis Hetu76a343a2015-06-04 17:21:22 -04004890 case 266:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004891
4892 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004893 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4894 }
4895 break;
4896
Alexis Hetu76a343a2015-06-04 17:21:22 -04004897 case 267:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004898
4899 {
4900 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4901 }
4902 break;
4903
Alexis Hetu76a343a2015-06-04 17:21:22 -04004904 case 268:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004905
4906 {
John Bauman66b8ab22014-05-06 15:57:45 -04004907 TFunction* function = (yyvsp[(1) - (1)].interm).function;
4908
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05004909 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
John Bauman66b8ab22014-05-06 15:57:45 -04004910
4911 if (builtIn)
4912 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004913 context->error((yylsp[(1) - (1)]), "built-in functions cannot be redefined", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004914 context->recover();
4915 }
4916
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05004917 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04004918 //
4919 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4920 // as it would have just been put in the symbol table. Otherwise, we're looking up
4921 // an earlier occurance.
4922 //
4923 if (prevDec->isDefined()) {
4924 //
4925 // Then this function already has a body.
4926 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004927 context->error((yylsp[(1) - (1)]), "function already has a body", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004928 context->recover();
4929 }
4930 prevDec->setDefined();
4931
4932 //
4933 // Raise error message if main function takes any parameters or return anything other than void
4934 //
4935 if (function->getName() == "main") {
4936 if (function->getParamCount() > 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004937 context->error((yylsp[(1) - (1)]), "function cannot take any parameter(s)", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004938 context->recover();
4939 }
4940 if (function->getReturnType().getBasicType() != EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004941 context->error((yylsp[(1) - (1)]), "", function->getReturnType().getBasicString(), "main function cannot return a value");
John Bauman66b8ab22014-05-06 15:57:45 -04004942 context->recover();
4943 }
4944 }
4945
4946 //
4947 // Remember the return type for later checking for RETURN statements.
4948 //
4949 context->currentFunctionType = &(prevDec->getReturnType());
4950 context->functionReturnsValue = false;
4951
4952 //
4953 // Insert parameters into the symbol table.
4954 // If the parameter has no name, it's not an error, just don't insert it
4955 // (could be used for unused args).
4956 //
4957 // Also, accumulate the list of parameters into the HIL, so lower level code
4958 // knows where to find parameters.
4959 //
4960 TIntermAggregate* paramNodes = new TIntermAggregate;
Alexis Hetu76a343a2015-06-04 17:21:22 -04004961 for (size_t i = 0; i < function->getParamCount(); i++) {
John Bauman66b8ab22014-05-06 15:57:45 -04004962 const TParameter& param = function->getParam(i);
4963 if (param.name != 0) {
4964 TVariable *variable = new TVariable(param.name, *param.type);
4965 //
4966 // Insert the parameters with name in the symbol table.
4967 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05004968 if (! context->symbolTable.declare(*variable)) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004969 context->error((yylsp[(1) - (1)]), "redefinition", variable->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004970 context->recover();
4971 delete variable;
4972 }
4973
4974 //
4975 // Add the parameter to the HIL
4976 //
4977 paramNodes = context->intermediate.growAggregate(
4978 paramNodes,
4979 context->intermediate.addSymbol(variable->getUniqueId(),
4980 variable->getName(),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004981 variable->getType(), (yylsp[(1) - (1)])),
4982 (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004983 } else {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004984 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (1)])), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004985 }
4986 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004987 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004988 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4989 context->loopNestingLevel = 0;
4990 }
4991 break;
4992
Alexis Hetu76a343a2015-06-04 17:21:22 -04004993 case 269:
John Bauman66b8ab22014-05-06 15:57:45 -04004994
4995 {
4996 //?? Check that all paths return a value if return type != void ?
4997 // May be best done as post process phase on intermediate code
4998 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004999 context->error((yylsp[(1) - (3)]), "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04005000 context->recover();
5001 }
5002
5003 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005004 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yylsp[(1) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04005005 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
5006 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
5007
5008 // store the pragma information for debug and optimize and other vendor specific
5009 // information. This information can be queried from the parse tree
5010 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
5011 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
5012
5013 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
5014 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
5015
5016 context->symbolTable.pop();
5017 }
5018 break;
5019
5020
5021
5022 default: break;
5023 }
5024 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
5025
5026 YYPOPSTACK (yylen);
5027 yylen = 0;
5028 YY_STACK_PRINT (yyss, yyssp);
5029
5030 *++yyvsp = yyval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005031 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04005032
5033 /* Now `shift' the result of the reduction. Determine what state
5034 that goes to, based on the state we popped back to and the rule
5035 number reduced by. */
5036
5037 yyn = yyr1[yyn];
5038
5039 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
5040 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
5041 yystate = yytable[yystate];
5042 else
5043 yystate = yydefgoto[yyn - YYNTOKENS];
5044
5045 goto yynewstate;
5046
5047
5048/*------------------------------------.
5049| yyerrlab -- here on detecting error |
5050`------------------------------------*/
5051yyerrlab:
5052 /* If not already recovering from an error, report this error. */
5053 if (!yyerrstatus)
5054 {
5055 ++yynerrs;
5056#if ! YYERROR_VERBOSE
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005057 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04005058#else
5059 {
5060 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
5061 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
5062 {
5063 YYSIZE_T yyalloc = 2 * yysize;
5064 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
5065 yyalloc = YYSTACK_ALLOC_MAXIMUM;
5066 if (yymsg != yymsgbuf)
5067 YYSTACK_FREE (yymsg);
5068 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
5069 if (yymsg)
5070 yymsg_alloc = yyalloc;
5071 else
5072 {
5073 yymsg = yymsgbuf;
5074 yymsg_alloc = sizeof yymsgbuf;
5075 }
5076 }
5077
5078 if (0 < yysize && yysize <= yymsg_alloc)
5079 {
5080 (void) yysyntax_error (yymsg, yystate, yychar);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005081 yyerror (&yylloc, context, yymsg);
John Bauman66b8ab22014-05-06 15:57:45 -04005082 }
5083 else
5084 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005085 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04005086 if (yysize != 0)
5087 goto yyexhaustedlab;
5088 }
5089 }
5090#endif
5091 }
5092
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005093 yyerror_range[0] = yylloc;
John Bauman66b8ab22014-05-06 15:57:45 -04005094
5095 if (yyerrstatus == 3)
5096 {
5097 /* If just tried and failed to reuse lookahead token after an
5098 error, discard it. */
5099
5100 if (yychar <= YYEOF)
5101 {
5102 /* Return failure if at end of input. */
5103 if (yychar == YYEOF)
5104 YYABORT;
5105 }
5106 else
5107 {
5108 yydestruct ("Error: discarding",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005109 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005110 yychar = YYEMPTY;
5111 }
5112 }
5113
5114 /* Else will try to reuse lookahead token after shifting the error
5115 token. */
5116 goto yyerrlab1;
5117
5118
5119/*---------------------------------------------------.
5120| yyerrorlab -- error raised explicitly by YYERROR. |
5121`---------------------------------------------------*/
5122yyerrorlab:
5123
5124 /* Pacify compilers like GCC when the user code never invokes
5125 YYERROR and the label yyerrorlab therefore never appears in user
5126 code. */
5127 if (/*CONSTCOND*/ 0)
5128 goto yyerrorlab;
5129
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005130 yyerror_range[0] = yylsp[1-yylen];
John Bauman66b8ab22014-05-06 15:57:45 -04005131 /* Do not reclaim the symbols of the rule which action triggered
5132 this YYERROR. */
5133 YYPOPSTACK (yylen);
5134 yylen = 0;
5135 YY_STACK_PRINT (yyss, yyssp);
5136 yystate = *yyssp;
5137 goto yyerrlab1;
5138
5139
5140/*-------------------------------------------------------------.
5141| yyerrlab1 -- common code for both syntax error and YYERROR. |
5142`-------------------------------------------------------------*/
5143yyerrlab1:
5144 yyerrstatus = 3; /* Each real token shifted decrements this. */
5145
5146 for (;;)
5147 {
5148 yyn = yypact[yystate];
5149 if (yyn != YYPACT_NINF)
5150 {
5151 yyn += YYTERROR;
5152 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5153 {
5154 yyn = yytable[yyn];
5155 if (0 < yyn)
5156 break;
5157 }
5158 }
5159
5160 /* Pop the current state because it cannot handle the error token. */
5161 if (yyssp == yyss)
5162 YYABORT;
5163
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005164 yyerror_range[0] = *yylsp;
John Bauman66b8ab22014-05-06 15:57:45 -04005165 yydestruct ("Error: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005166 yystos[yystate], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005167 YYPOPSTACK (1);
5168 yystate = *yyssp;
5169 YY_STACK_PRINT (yyss, yyssp);
5170 }
5171
5172 *++yyvsp = yylval;
5173
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005174 yyerror_range[1] = yylloc;
5175 /* Using YYLLOC is tempting, but would change the location of
5176 the lookahead. YYLOC is available though. */
5177 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
5178 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04005179
5180 /* Shift the error token. */
5181 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5182
5183 yystate = yyn;
5184 goto yynewstate;
5185
5186
5187/*-------------------------------------.
5188| yyacceptlab -- YYACCEPT comes here. |
5189`-------------------------------------*/
5190yyacceptlab:
5191 yyresult = 0;
5192 goto yyreturn;
5193
5194/*-----------------------------------.
5195| yyabortlab -- YYABORT comes here. |
5196`-----------------------------------*/
5197yyabortlab:
5198 yyresult = 1;
5199 goto yyreturn;
5200
5201#if !defined(yyoverflow) || YYERROR_VERBOSE
5202/*-------------------------------------------------.
5203| yyexhaustedlab -- memory exhaustion comes here. |
5204`-------------------------------------------------*/
5205yyexhaustedlab:
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005206 yyerror (&yylloc, context, YY_("memory exhausted"));
John Bauman66b8ab22014-05-06 15:57:45 -04005207 yyresult = 2;
5208 /* Fall through. */
5209#endif
5210
5211yyreturn:
5212 if (yychar != YYEMPTY)
5213 yydestruct ("Cleanup: discarding lookahead",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005214 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005215 /* Do not reclaim the symbols of the rule which action triggered
5216 this YYABORT or YYACCEPT. */
5217 YYPOPSTACK (yylen);
5218 YY_STACK_PRINT (yyss, yyssp);
5219 while (yyssp != yyss)
5220 {
5221 yydestruct ("Cleanup: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005222 yystos[*yyssp], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005223 YYPOPSTACK (1);
5224 }
5225#ifndef yyoverflow
5226 if (yyss != yyssa)
5227 YYSTACK_FREE (yyss);
5228#endif
5229#if YYERROR_VERBOSE
5230 if (yymsg != yymsgbuf)
5231 YYSTACK_FREE (yymsg);
5232#endif
5233 /* Make sure YYID is used. */
5234 return YYID (yyresult);
5235}
5236
5237
5238
5239
5240
5241int glslang_parse(TParseContext* context) {
5242 return yyparse(context);
5243}
5244