blob: 9ecc6aaa301a7f151f580215d2b28064bc3be9fa [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
Alexis Hetu0a655842015-06-22 16:52:11 -040096#define YYLEX_PARAM context->getScanner()
John Bauman66b8ab22014-05-06 15:57:45 -040097
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) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400333 if (context->getShaderType() != GL_FRAGMENT_SHADER && \
334 context->getShaderType() != 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) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400341 if (context->getShaderType() != 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) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400348 if (context->getShaderType() != 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) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400355 if (context->getShaderVersion() != 100) { \
Nicolas Capensc6841852015-02-15 14:25:37 -0500356 context->error(L, " supported in GLSL ES 1.00 only ", S); \
357 context->recover(); \
358 } \
359}
360
Alexis Hetu3e9e2082015-07-03 16:20:11 -0400361#define ES3_ONLY(TOKEN, LINE, REASON) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400362 if (context->getShaderVersion() != 300) { \
Alexis Hetu3e9e2082015-07-03 16:20:11 -0400363 context->error(LINE, REASON " supported in GLSL ES 3.00 only ", TOKEN); \
Nicolas Capensc6841852015-02-15 14:25:37 -0500364 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 Hetue5246692015-06-18 12:34:52 -0400585#define YYLAST 2519
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 Hetue5246692015-06-18 12:34:52 -0400592#define YYNRULES 270
John Bauman66b8ab22014-05-06 15:57:45 -0400593/* YYNRULES -- Number of states. */
Alexis Hetue5246692015-06-18 12:34:52 -0400594#define YYNSTATES 410
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,
Alexis Hetue5246692015-06-18 12:34:52 -0400667 462, 464, 468, 472, 474, 478, 483, 485, 487, 489,
668 491, 493, 495, 497, 499, 501, 503, 505, 507, 509,
669 511, 513, 515, 517, 519, 521, 523, 525, 527, 529,
670 531, 533, 535, 537, 539, 541, 543, 545, 547, 549,
671 551, 553, 555, 557, 559, 561, 563, 565, 567, 569,
672 571, 572, 579, 580, 586, 588, 591, 595, 600, 602,
673 606, 608, 613, 615, 617, 619, 621, 623, 625, 627,
674 629, 631, 633, 635, 638, 639, 640, 646, 648, 650,
675 651, 654, 655, 658, 661, 665, 667, 670, 672, 675,
676 681, 685, 687, 688, 695, 699, 702, 704, 709, 710,
677 717, 718, 727, 728, 736, 738, 740, 742, 743, 746,
678 750, 753, 756, 759, 763, 766, 768, 771, 773, 775,
679 776
John Bauman66b8ab22014-05-06 15:57:45 -0400680};
681
682/* YYRHS -- A `-1'-separated list of the rules' RHS. */
683static const yytype_int16 yyrhs[] =
684{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400685 217, 0, -1, 76, -1, 129, -1, 79, -1, 80,
Alexis Hetub14178b2015-04-13 13:23:20 -0400686 -1, 78, -1, 81, -1, 104, 156, 105, -1, 130,
687 -1, 131, 106, 132, 107, -1, 133, -1, 131, 110,
688 82, -1, 131, 85, -1, 131, 86, -1, 156, -1,
689 134, -1, 135, -1, 131, 110, 135, -1, 137, 105,
690 -1, 136, 105, -1, 138, 55, -1, 138, -1, 138,
Alexis Hetue5246692015-06-18 12:34:52 -0400691 154, -1, 137, 111, 154, -1, 139, 104, -1, 180,
Alexis Hetub14178b2015-04-13 13:23:20 -0400692 -1, 76, -1, 82, -1, 131, -1, 85, 140, -1,
693 86, 140, -1, 141, 140, -1, 118, -1, 116, -1,
Alexis Hetu17809052015-05-13 11:28:22 -0400694 115, -1, 117, -1, 140, -1, 142, 119, 140, -1,
695 142, 120, 140, -1, 142, 121, 140, -1, 142, -1,
696 143, 118, 142, -1, 143, 116, 142, -1, 143, -1,
697 144, 83, 143, -1, 144, 84, 143, -1, 144, -1,
698 145, 122, 144, -1, 145, 123, 144, -1, 145, 87,
699 144, -1, 145, 88, 144, -1, 145, -1, 146, 89,
700 145, -1, 146, 90, 145, -1, 146, -1, 147, 126,
701 146, -1, 147, -1, 148, 125, 147, -1, 148, -1,
702 149, 124, 148, -1, 149, -1, 150, 91, 149, -1,
703 150, -1, 151, 93, 150, -1, 151, -1, 152, 92,
704 151, -1, 152, -1, 152, 127, 156, 112, 154, -1,
705 153, -1, 140, 155, 154, -1, 113, -1, 94, -1,
706 95, -1, 97, -1, 96, -1, 103, -1, 98, -1,
707 99, -1, 100, -1, 101, -1, 102, -1, 154, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400708 156, 111, 154, -1, 153, -1, 76, 108, -1, 160,
709 114, -1, 168, 114, -1, 7, 176, 180, 114, -1,
710 173, 158, 185, 109, 114, -1, 173, 158, 185, 109,
711 76, 114, -1, 173, 158, 185, 109, 76, 106, 157,
712 107, 114, -1, 173, 114, -1, 161, 105, -1, 163,
713 -1, 162, -1, 163, 165, -1, 162, 111, 165, -1,
714 170, 76, 104, -1, 175, 76, -1, 175, 76, 106,
715 157, 107, -1, 172, 166, 164, -1, 166, 164, -1,
716 172, 166, 167, -1, 166, 167, -1, -1, 40, -1,
717 41, -1, 42, -1, 175, -1, 169, -1, 168, 111,
718 76, -1, 168, 111, 76, 106, 157, 107, -1, 168,
719 111, 76, 106, 107, 113, 189, -1, 168, 111, 76,
720 106, 157, 107, 113, 189, -1, 168, 111, 76, 113,
721 189, -1, 170, -1, 170, 76, -1, 170, 76, 106,
722 157, 107, -1, 170, 76, 106, 107, 113, 189, -1,
723 170, 76, 106, 157, 107, 113, 189, -1, 170, 76,
724 113, 189, -1, 3, 76, -1, 175, -1, 173, 175,
725 -1, 53, -1, 52, -1, 9, -1, 8, -1, 44,
726 -1, 3, 44, -1, 174, -1, 171, 174, -1, 171,
727 -1, 177, -1, 177, 174, -1, 9, -1, 40, -1,
728 41, -1, 51, 40, -1, 51, 41, -1, 43, -1,
729 180, -1, 176, 180, -1, 4, -1, 5, -1, 6,
730 -1, 75, 104, 178, 105, -1, 179, -1, 178, 111,
731 179, -1, 76, -1, 76, 113, 79, -1, 76, 113,
Alexis Hetue5246692015-06-18 12:34:52 -0400732 80, -1, 181, -1, 181, 106, 107, -1, 181, 106,
733 157, 107, -1, 55, -1, 11, -1, 12, -1, 13,
734 -1, 10, -1, 31, -1, 32, -1, 33, -1, 25,
735 -1, 26, -1, 27, -1, 28, -1, 29, -1, 30,
736 -1, 34, -1, 35, -1, 36, -1, 37, -1, 38,
737 -1, 39, -1, 45, -1, 46, -1, 47, -1, 48,
738 -1, 49, -1, 50, -1, 57, -1, 58, -1, 59,
739 -1, 70, -1, 61, -1, 62, -1, 63, -1, 64,
740 -1, 65, -1, 66, -1, 67, -1, 68, -1, 69,
741 -1, 72, -1, 73, -1, 74, -1, 182, -1, 77,
742 -1, -1, 54, 76, 108, 183, 185, 109, -1, -1,
743 54, 108, 184, 185, 109, -1, 186, -1, 185, 186,
744 -1, 175, 187, 114, -1, 173, 175, 187, 114, -1,
745 188, -1, 187, 111, 188, -1, 76, -1, 76, 106,
746 157, 107, -1, 154, -1, 159, -1, 193, -1, 192,
747 -1, 190, -1, 202, -1, 203, -1, 205, -1, 207,
748 -1, 209, -1, 216, -1, 108, 109, -1, -1, -1,
749 108, 194, 201, 195, 109, -1, 200, -1, 192, -1,
750 -1, 198, 200, -1, -1, 199, 192, -1, 108, 109,
751 -1, 108, 201, 109, -1, 191, -1, 201, 191, -1,
752 114, -1, 156, 114, -1, 19, 104, 156, 105, 204,
753 -1, 197, 17, 197, -1, 197, -1, -1, 22, 104,
754 156, 105, 206, 193, -1, 23, 157, 112, -1, 24,
755 112, -1, 156, -1, 170, 76, 113, 189, -1, -1,
756 56, 104, 210, 208, 105, 196, -1, -1, 16, 211,
757 197, 56, 104, 156, 105, 114, -1, -1, 18, 104,
758 212, 213, 215, 105, 196, -1, 202, -1, 190, -1,
759 208, -1, -1, 214, 114, -1, 214, 114, 156, -1,
760 15, 114, -1, 14, 114, -1, 21, 114, -1, 21,
761 156, 114, -1, 20, 114, -1, 218, -1, 217, 218,
762 -1, 219, -1, 159, -1, -1, 160, 220, 200, -1
John Bauman66b8ab22014-05-06 15:57:45 -0400763};
764
765/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
766static const yytype_uint16 yyrline[] =
767{
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400768 0, 202, 202, 237, 240, 245, 250, 255, 260, 266,
Alexis Hetub3ff42c2015-07-03 18:19:57 -0400769 269, 272, 275, 278, 281, 287, 295, 306, 309, 317,
770 321, 328, 332, 339, 345, 354, 362, 368, 375, 385,
771 388, 398, 408, 430, 431, 432, 433, 441, 442, 446,
772 450, 458, 459, 462, 468, 469, 473, 480, 481, 484,
773 487, 490, 496, 497, 500, 506, 507, 514, 515, 522,
774 523, 530, 531, 537, 538, 544, 545, 551, 552, 569,
775 570, 578, 579, 580, 581, 583, 584, 585, 587, 589,
776 591, 593, 598, 601, 612, 620, 628, 655, 661, 668,
777 672, 676, 680, 687, 725, 728, 735, 743, 764, 785,
778 796, 825, 830, 840, 845, 855, 858, 861, 864, 870,
779 877, 880, 884, 888, 893, 898, 905, 909, 913, 917,
780 922, 927, 931, 1007, 1017, 1023, 1026, 1032, 1038, 1045,
781 1054, 1063, 1066, 1069, 1076, 1080, 1087, 1091, 1096, 1101,
782 1111, 1121, 1130, 1140, 1147, 1150, 1153, 1159, 1166, 1169,
783 1175, 1178, 1181, 1187, 1190, 1195, 1210, 1214, 1218, 1222,
784 1226, 1230, 1235, 1240, 1245, 1250, 1255, 1260, 1265, 1270,
785 1275, 1280, 1285, 1290, 1296, 1302, 1308, 1314, 1320, 1326,
786 1332, 1338, 1344, 1349, 1354, 1363, 1368, 1373, 1378, 1383,
787 1388, 1393, 1398, 1403, 1408, 1413, 1418, 1423, 1428, 1433,
788 1446, 1446, 1449, 1449, 1455, 1458, 1474, 1477, 1486, 1490,
789 1496, 1503, 1518, 1522, 1526, 1527, 1533, 1534, 1535, 1536,
790 1537, 1538, 1539, 1543, 1544, 1544, 1544, 1554, 1555, 1559,
791 1559, 1560, 1560, 1565, 1568, 1578, 1581, 1587, 1588, 1592,
792 1600, 1604, 1611, 1611, 1618, 1621, 1630, 1635, 1652, 1652,
793 1657, 1657, 1664, 1664, 1672, 1675, 1681, 1684, 1690, 1694,
794 1701, 1704, 1707, 1710, 1713, 1722, 1726, 1733, 1736, 1742,
795 1742
John Bauman66b8ab22014-05-06 15:57:45 -0400796};
797#endif
798
799#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
800/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
801 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
802static const char *const yytname[] =
803{
804 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
805 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
Nicolas Capens3c20f802015-02-17 17:17:20 -0500806 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE",
807 "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN",
808 "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500809 "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2",
810 "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
Alexis Hetub14178b2015-04-13 13:23:20 -0400811 "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2",
812 "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT",
813 "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES",
814 "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D",
815 "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
816 "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT",
817 "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT",
818 "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
819 "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
820 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
821 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
822 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
823 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500824 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
825 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
826 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
827 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
828 "primary_expression", "postfix_expression", "integer_expression",
829 "function_call", "function_call_or_method", "function_call_generic",
John Bauman66b8ab22014-05-06 15:57:45 -0400830 "function_call_header_no_parameters",
831 "function_call_header_with_parameters", "function_call_header",
832 "function_identifier", "unary_expression", "unary_operator",
833 "multiplicative_expression", "additive_expression", "shift_expression",
834 "relational_expression", "equality_expression", "and_expression",
835 "exclusive_or_expression", "inclusive_or_expression",
836 "logical_and_expression", "logical_xor_expression",
837 "logical_or_expression", "conditional_expression",
838 "assignment_expression", "assignment_operator", "expression",
Alexis Hetua35d8232015-06-11 17:11:06 -0400839 "constant_expression", "enter_struct", "declaration",
840 "function_prototype", "function_declarator",
841 "function_header_with_parameters", "function_header",
842 "parameter_declarator", "parameter_declaration", "parameter_qualifier",
843 "parameter_type_specifier", "init_declarator_list", "single_declaration",
844 "fully_specified_type", "interpolation_qualifier",
845 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
846 "type_specifier", "precision_qualifier", "layout_qualifier",
847 "layout_qualifier_id_list", "layout_qualifier_id",
Nicolas Capens7d626792015-02-17 17:58:31 -0500848 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
849 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
John Bauman66b8ab22014-05-06 15:57:45 -0400850 "struct_declarator_list", "struct_declarator", "initializer",
851 "declaration_statement", "statement", "simple_statement",
852 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
853 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
854 "statement_list", "expression_statement", "selection_statement",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400855 "selection_rest_statement", "switch_statement", "$@7", "case_label",
856 "condition", "iteration_statement", "$@8", "$@9", "$@10",
857 "for_init_statement", "conditionopt", "for_rest_statement",
John Bauman66b8ab22014-05-06 15:57:45 -0400858 "jump_statement", "translation_unit", "external_declaration",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400859 "function_definition", "$@11", 0
John Bauman66b8ab22014-05-06 15:57:45 -0400860};
861#endif
862
863# ifdef YYPRINT
864/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
865 token YYLEX-NUM. */
866static const yytype_uint16 yytoknum[] =
867{
868 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
869 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
870 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
871 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
872 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
873 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
874 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
875 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
876 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
Nicolas Capensc6841852015-02-15 14:25:37 -0500877 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Nicolas Capens7d626792015-02-17 17:58:31 -0500878 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Alexis Hetub14178b2015-04-13 13:23:20 -0400879 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
880 375, 376, 377, 378, 379, 380, 381, 382
John Bauman66b8ab22014-05-06 15:57:45 -0400881};
882# endif
883
884/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
885static const yytype_uint8 yyr1[] =
886{
Alexis Hetub14178b2015-04-13 13:23:20 -0400887 0, 128, 129, 130, 130, 130, 130, 130, 130, 131,
888 131, 131, 131, 131, 131, 132, 133, 134, 134, 135,
889 135, 136, 136, 137, 137, 138, 139, 139, 139, 140,
Alexis Hetu17809052015-05-13 11:28:22 -0400890 140, 140, 140, 141, 141, 141, 141, 142, 142, 142,
891 142, 143, 143, 143, 144, 144, 144, 145, 145, 145,
892 145, 145, 146, 146, 146, 147, 147, 148, 148, 149,
893 149, 150, 150, 151, 151, 152, 152, 153, 153, 154,
894 154, 155, 155, 155, 155, 155, 155, 155, 155, 155,
Alexis Hetua35d8232015-06-11 17:11:06 -0400895 155, 155, 156, 156, 157, 158, 159, 159, 159, 159,
896 159, 159, 159, 160, 161, 161, 162, 162, 163, 164,
897 164, 165, 165, 165, 165, 166, 166, 166, 166, 167,
898 168, 168, 168, 168, 168, 168, 169, 169, 169, 169,
899 169, 169, 169, 170, 170, 171, 171, 172, 173, 173,
900 173, 173, 173, 173, 173, 173, 174, 174, 174, 174,
901 174, 174, 175, 175, 176, 176, 176, 177, 178, 178,
Alexis Hetue5246692015-06-18 12:34:52 -0400902 179, 179, 179, 180, 180, 180, 181, 181, 181, 181,
Alexis Hetua35d8232015-06-11 17:11:06 -0400903 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
904 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
905 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
Alexis Hetue5246692015-06-18 12:34:52 -0400906 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
907 183, 182, 184, 182, 185, 185, 186, 186, 187, 187,
908 188, 188, 189, 190, 191, 191, 192, 192, 192, 192,
909 192, 192, 192, 193, 194, 195, 193, 196, 196, 198,
910 197, 199, 197, 200, 200, 201, 201, 202, 202, 203,
911 204, 204, 206, 205, 207, 207, 208, 208, 210, 209,
912 211, 209, 212, 209, 213, 213, 214, 214, 215, 215,
913 216, 216, 216, 216, 216, 217, 217, 218, 218, 220,
914 219
John Bauman66b8ab22014-05-06 15:57:45 -0400915};
916
917/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
918static const yytype_uint8 yyr2[] =
919{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500920 0, 2, 1, 1, 1, 1, 1, 1, 3, 1,
921 4, 1, 3, 2, 2, 1, 1, 1, 3, 2,
922 2, 2, 1, 2, 3, 2, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400923 2, 2, 2, 1, 1, 1, 1, 1, 3, 3,
924 3, 1, 3, 3, 1, 3, 3, 1, 3, 3,
925 3, 3, 1, 3, 3, 1, 3, 1, 3, 1,
926 3, 1, 3, 1, 3, 1, 3, 1, 5, 1,
927 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400928 1, 1, 1, 3, 1, 2, 2, 2, 4, 5,
929 6, 9, 2, 2, 1, 1, 2, 3, 3, 2,
930 5, 3, 2, 3, 2, 0, 1, 1, 1, 1,
931 1, 3, 6, 7, 8, 5, 1, 2, 5, 6,
932 7, 4, 2, 1, 2, 1, 1, 1, 1, 1,
933 2, 1, 2, 1, 1, 2, 1, 1, 1, 2,
934 2, 1, 1, 2, 1, 1, 1, 4, 1, 3,
Alexis Hetue5246692015-06-18 12:34:52 -0400935 1, 3, 3, 1, 3, 4, 1, 1, 1, 1,
John Bauman66b8ab22014-05-06 15:57:45 -0400936 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetub14178b2015-04-13 13:23:20 -0400937 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
938 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetue5246692015-06-18 12:34:52 -0400939 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
940 0, 6, 0, 5, 1, 2, 3, 4, 1, 3,
941 1, 4, 1, 1, 1, 1, 1, 1, 1, 1,
942 1, 1, 1, 2, 0, 0, 5, 1, 1, 0,
943 2, 0, 2, 2, 3, 1, 2, 1, 2, 5,
944 3, 1, 0, 6, 3, 2, 1, 4, 0, 6,
945 0, 8, 0, 7, 1, 1, 1, 0, 2, 3,
946 2, 2, 2, 3, 2, 1, 2, 1, 1, 0,
947 3
John Bauman66b8ab22014-05-06 15:57:45 -0400948};
949
950/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
951 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
952 means the default is an error. */
Alexis Hetuad6b8752015-06-09 16:15:30 -0400953static const yytype_uint16 yydefact[] =
John Bauman66b8ab22014-05-06 15:57:45 -0400954{
Alexis Hetue5246692015-06-18 12:34:52 -0400955 0, 0, 144, 145, 146, 0, 128, 136, 160, 157,
956 158, 159, 164, 165, 166, 167, 168, 169, 161, 162,
957 163, 170, 171, 172, 173, 174, 175, 137, 138, 141,
958 129, 176, 177, 178, 179, 180, 181, 0, 126, 125,
959 0, 156, 182, 183, 184, 186, 187, 188, 189, 190,
960 191, 192, 193, 194, 185, 195, 196, 197, 0, 199,
961 268, 269, 0, 95, 105, 0, 110, 116, 133, 0,
962 131, 123, 0, 134, 142, 153, 198, 0, 265, 267,
963 130, 122, 0, 139, 140, 0, 202, 0, 86, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -0400964 93, 105, 127, 106, 107, 108, 96, 0, 105, 0,
965 87, 117, 132, 0, 92, 0, 124, 143, 135, 0,
Alexis Hetue5246692015-06-18 12:34:52 -0400966 1, 266, 0, 200, 0, 150, 0, 148, 0, 270,
Alexis Hetua35d8232015-06-11 17:11:06 -0400967 97, 102, 104, 109, 0, 111, 98, 0, 0, 85,
Alexis Hetue5246692015-06-18 12:34:52 -0400968 0, 0, 0, 0, 204, 2, 6, 4, 5, 7,
969 28, 0, 0, 0, 154, 35, 34, 36, 33, 3,
970 9, 29, 11, 16, 17, 0, 0, 22, 0, 37,
971 0, 41, 44, 47, 52, 55, 57, 59, 61, 63,
972 65, 67, 84, 0, 26, 88, 0, 0, 0, 147,
973 0, 0, 0, 250, 0, 0, 0, 0, 0, 0,
974 0, 0, 224, 233, 237, 37, 69, 82, 0, 213,
975 0, 142, 216, 235, 215, 214, 0, 217, 218, 219,
976 220, 221, 222, 99, 101, 103, 0, 0, 0, 0,
977 212, 121, 0, 210, 0, 208, 0, 205, 30, 31,
978 0, 13, 14, 0, 0, 20, 19, 0, 156, 23,
979 25, 32, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -0400980 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -0400981 0, 0, 155, 0, 203, 151, 152, 149, 261, 260,
982 231, 252, 0, 264, 262, 0, 0, 0, 245, 248,
983 223, 0, 72, 73, 75, 74, 77, 78, 79, 80,
984 81, 76, 71, 0, 0, 238, 234, 236, 0, 0,
985 0, 115, 0, 118, 0, 0, 0, 206, 0, 89,
986 8, 0, 15, 27, 12, 18, 24, 38, 39, 40,
987 43, 42, 45, 46, 50, 51, 48, 49, 53, 54,
988 56, 58, 60, 62, 64, 66, 0, 201, 0, 0,
989 0, 0, 0, 263, 0, 244, 0, 225, 70, 83,
990 0, 0, 112, 119, 0, 207, 0, 209, 0, 90,
991 10, 0, 0, 230, 232, 255, 254, 257, 231, 242,
992 246, 0, 0, 0, 0, 100, 113, 0, 120, 211,
993 0, 68, 0, 256, 0, 0, 241, 239, 0, 0,
994 0, 226, 114, 0, 0, 258, 0, 231, 243, 0,
995 228, 249, 227, 91, 0, 259, 253, 240, 247, 251
John Bauman66b8ab22014-05-06 15:57:45 -0400996};
997
998/* YYDEFGOTO[NTERM-NUM]. */
999static const yytype_int16 yydefgoto[] =
1000{
Alexis Hetue5246692015-06-18 12:34:52 -04001001 -1, 149, 150, 151, 311, 152, 153, 154, 155, 156,
1002 157, 158, 195, 160, 161, 162, 163, 164, 165, 166,
1003 167, 168, 169, 170, 171, 196, 197, 293, 198, 173,
1004 105, 199, 200, 62, 63, 64, 121, 96, 97, 122,
Alexis Hetua35d8232015-06-11 17:11:06 -04001005 65, 66, 67, 68, 98, 69, 70, 71, 72, 73,
Alexis Hetue5246692015-06-18 12:34:52 -04001006 116, 117, 174, 75, 76, 176, 114, 133, 134, 224,
1007 225, 221, 202, 203, 204, 205, 281, 374, 401, 338,
1008 339, 340, 402, 206, 207, 208, 387, 209, 388, 210,
1009 373, 211, 346, 270, 341, 367, 384, 385, 212, 77,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001010 78, 79, 89
John Bauman66b8ab22014-05-06 15:57:45 -04001011};
1012
1013/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1014 STATE-NUM. */
Alexis Hetue5246692015-06-18 12:34:52 -04001015#define YYPACT_NINF -331
John Bauman66b8ab22014-05-06 15:57:45 -04001016static const yytype_int16 yypact[] =
1017{
Alexis Hetue5246692015-06-18 12:34:52 -04001018 2157, -28, -331, -331, -331, 141, -331, -331, -331, -331,
1019 -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1020 -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1021 -331, -331, -331, -331, -331, -331, -331, 4, -331, -331,
1022 -44, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1023 -331, -331, -331, -331, -331, -331, -331, -331, -78, -331,
1024 -331, -31, -35, -24, 10, -71, -331, 45, 38, 1176,
1025 -331, -331, 2442, 38, -331, 1, -331, 2082, -331, -331,
1026 -331, -331, 2442, -331, -331, 49, -331, 72, -331, 51,
1027 -331, 19, -331, -331, -331, -331, -331, 2306, 110, 92,
1028 -331, -79, -331, 67, -331, 2232, -331, -331, -331, 1246,
1029 -331, -331, 25, -331, 2232, 58, -70, -331, 404, -331,
1030 -331, -331, -331, 103, 2306, -89, -331, 1344, 1635, -331,
1031 136, 2306, 105, 1827, -331, 78, -331, -331, -331, -331,
1032 -331, 1635, 1635, 1635, -331, -331, -331, -331, -331, -331,
1033 -331, 16, -331, -331, -331, 79, -21, 1730, 83, -331,
1034 1635, 34, 40, 28, -65, 47, 57, 61, 64, 100,
1035 101, -72, -331, 86, -331, -331, 2232, 1912, 82, -331,
1036 72, 84, 85, -331, 93, 96, 87, 1442, 98, 1635,
1037 91, 106, 102, -331, -331, 188, -331, -331, -15, -331,
1038 -31, 108, -331, -331, -331, -331, 520, -331, -331, -331,
1039 -331, -331, -331, 90, -331, -331, 1537, 1635, 104, 109,
1040 -331, -331, 105, 107, 5, -331, -61, -331, -331, -331,
1041 -20, -331, -331, 1635, 2374, -331, -331, 1635, 113, -331,
1042 -331, -331, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
1043 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
1044 1635, 1635, -331, 1997, -331, -331, -331, -331, -331, -331,
1045 111, -331, 1635, -331, -331, 6, 1635, 97, -331, -331,
1046 -331, 636, -331, -331, -331, -331, -331, -331, -331, -331,
1047 -331, -331, -331, 1635, 1635, -331, -331, -331, 1635, 112,
1048 114, -331, 1635, 115, 21, 1635, 105, -331, -75, -331,
1049 -331, 117, 120, -331, 116, -331, -331, -331, -331, -331,
1050 34, 34, 40, 40, 28, 28, 28, 28, -65, -65,
1051 47, 57, 61, 64, 100, 101, 31, -331, 159, 51,
1052 868, 984, -17, -331, -5, -331, 1081, 636, -331, -331,
1053 119, 1635, 121, -331, 1635, -331, 125, -331, 1635, -331,
1054 -331, 1635, 118, -331, -331, -331, -331, 1081, 111, -331,
1055 120, 157, 2306, 130, 127, -331, -331, 1635, -331, -331,
1056 131, -331, 1635, -331, 126, 134, 224, -331, 138, 129,
1057 752, -331, -331, 133, -1, 1635, 752, 111, -331, 1635,
1058 -331, -331, -331, -331, 135, 120, -331, -331, -331, -331
John Bauman66b8ab22014-05-06 15:57:45 -04001059};
1060
1061/* YYPGOTO[NTERM-NUM]. */
1062static const yytype_int16 yypgoto[] =
1063{
Alexis Hetue5246692015-06-18 12:34:52 -04001064 -331, -331, -331, -331, -331, -331, -331, 14, -331, -331,
1065 -331, -331, 63, -331, -82, -74, -122, -88, -4, -6,
1066 -3, 2, 7, 8, -331, -91, -124, -331, -138, -113,
1067 -331, 3, 9, -331, -331, -331, 137, 164, 160, 145,
1068 -331, -331, -325, -331, -331, -103, -2, -68, 254, -331,
1069 -331, 94, 0, -331, -331, -331, -331, -101, -123, 43,
1070 -36, -210, -69, -198, -328, -126, -331, -331, -125, -330,
1071 -331, -331, -83, -8, -64, -331, -331, -331, -331, -331,
1072 -87, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1073 199, -331, -331
John Bauman66b8ab22014-05-06 15:57:45 -04001074};
1075
1076/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1077 positive, shift that token. If negative, reduce the rule which
1078 number is the opposite. If zero, do what YYDEFACT says.
1079 If YYTABLE_NINF, syntax error. */
Alexis Hetue5246692015-06-18 12:34:52 -04001080#define YYTABLE_NINF -230
John Bauman66b8ab22014-05-06 15:57:45 -04001081static const yytype_int16 yytable[] =
1082{
Alexis Hetue5246692015-06-18 12:34:52 -04001083 74, 106, 131, 60, 220, 230, 119, 301, 297, 61,
1084 227, 131, 364, 177, 219, 308, 80, 216, 172, 92,
1085 260, 371, 249, 250, 217, 126, 87, 127, 92, 123,
1086 131, 358, 85, 239, 128, 179, 172, 132, 386, 359,
1087 99, 180, 371, 100, 83, 84, 132, 7, 81, 275,
1088 93, 94, 95, 309, 227, 261, 123, 251, 252, 93,
1089 94, 95, 400, 222, 86, 132, 102, 407, 400, 74,
1090 90, 108, 107, 131, 131, 263, 277, 74, 27, 28,
1091 60, 29, 112, 88, 236, 310, 61, 91, 368, 37,
1092 237, 294, 353, 220, 294, 312, 294, 74, 172, 295,
1093 369, 231, 232, 300, 404, 74, 294, 109, 132, 132,
1094 294, 247, 248, 316, 74, -94, 306, 294, 201, 307,
1095 343, 101, 233, 336, 74, 172, 234, 324, 325, 326,
1096 327, 74, 306, 74, 342, 355, 253, 254, 344, 175,
1097 227, 376, 294, 361, 378, 2, 3, 4, 115, 297,
1098 93, 94, 95, 242, 243, 244, 245, 113, 246, 118,
1099 131, 265, 266, 320, 321, 328, 329, 392, 125, 348,
1100 349, 178, 159, 322, 323, 129, 74, 74, 220, 213,
1101 80, 223, -27, 255, 235, 350, 256, 240, 257, 408,
1102 159, 258, 356, 262, 259, 132, 298, 271, 268, 269,
1103 272, 273, 276, 278, 228, 229, 201, 172, 370, 345,
1104 279, 280, -26, 305, 172, 362, 303, 302, -21, -229,
1105 -28, 352, 382, 241, 360, 351, 375, 220, 354, 370,
1106 220, 294, 379, 389, 377, 390, 391, 381, 393, 396,
1107 395, 397, 399, 372, 394, 380, 192, 403, 315, 409,
1108 331, 330, 159, 220, 332, 120, 363, 405, 124, 82,
1109 333, 214, 398, 74, 372, 304, 334, 172, 335, 215,
1110 357, 406, 365, 347, 267, 220, 111, 366, 0, 159,
1111 383, 201, 282, 283, 284, 285, 286, 287, 288, 289,
1112 290, 291, 0, 0, 0, 0, 0, 0, 0, 0,
1113 0, 292, 0, 0, 106, 317, 318, 319, 159, 159,
1114 159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
1115 159, 159, 159, 159, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001117 201, 201, 0, 0, 0, 0, 201, 201, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001119 0, 159, 0, 0, 0, 0, 0, 201, 159, 0,
1120 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001122 201, 0, 0, 0, 0, 0, 201, 0, 0, 0,
1123 0, 0, 0, 0, 0, 0, 0, 1, 2, 3,
1124 4, 5, 6, 7, 8, 9, 10, 11, 181, 182,
1125 183, 159, 184, 185, 186, 187, 188, 189, 190, 12,
1126 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1127 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1128 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1129 191, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1130 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1131 135, 59, 136, 137, 138, 139, 140, 0, 0, 141,
1132 142, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1133 0, 0, 0, 0, 0, 0, 0, 0, 143, 0,
1134 0, 0, 192, 193, 0, 0, 0, 0, 194, 145,
1135 146, 147, 148, 1, 2, 3, 4, 5, 6, 7,
1136 8, 9, 10, 11, 181, 182, 183, 0, 184, 185,
1137 186, 187, 188, 189, 190, 12, 13, 14, 15, 16,
1138 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1139 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1140 36, 37, 38, 39, 40, 41, 191, 42, 43, 44,
1141 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1142 54, 0, 55, 56, 57, 58, 135, 59, 136, 137,
1143 138, 139, 140, 0, 0, 141, 142, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001145 0, 0, 0, 0, 143, 0, 0, 0, 192, 296,
1146 0, 0, 0, 0, 194, 145, 146, 147, 148, 1,
1147 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1148 181, 182, 183, 0, 184, 185, 186, 187, 188, 189,
1149 190, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1150 21, 22, 23, 24, 25, 26, 27, 28, 0, 29,
1151 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1152 40, 41, 191, 42, 43, 44, 0, 45, 46, 47,
1153 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1154 57, 58, 135, 59, 136, 137, 138, 139, 140, 0,
1155 0, 141, 142, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001156 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001157 143, 0, 0, 0, 192, 0, 0, 0, 0, 0,
1158 194, 145, 146, 147, 148, 1, 2, 3, 4, 5,
1159 6, 7, 8, 9, 10, 11, 181, 182, 183, 0,
1160 184, 185, 186, 187, 188, 189, 190, 12, 13, 14,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001161 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001162 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
Alexis Hetue5246692015-06-18 12:34:52 -04001163 34, 35, 36, 37, 38, 39, 40, 41, 191, 42,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001164 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
Alexis Hetua35d8232015-06-11 17:11:06 -04001165 52, 53, 54, 0, 55, 56, 57, 58, 135, 59,
1166 136, 137, 138, 139, 140, 0, 0, 141, 142, 0,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001168 0, 0, 0, 0, 0, 0, 143, 0, 0, 0,
1169 118, 0, 0, 0, 0, 0, 194, 145, 146, 147,
1170 148, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1171 10, 11, 181, 182, 183, 0, 184, 185, 186, 187,
1172 188, 189, 190, 12, 13, 14, 15, 16, 17, 18,
1173 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1174 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1175 38, 39, 40, 41, 191, 42, 43, 44, 0, 45,
1176 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1177 55, 56, 57, 58, 135, 59, 136, 137, 138, 139,
1178 140, 0, 0, 141, 142, 0, 0, 0, 0, 0,
1179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1180 0, 0, 143, 0, 0, 0, 0, 0, 0, 0,
1181 0, 0, 194, 145, 146, 147, 148, 1, 2, 3,
1182 4, 5, 6, 7, 8, 9, 10, 11, 0, 0,
1183 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
1184 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1185 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1186 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1187 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1188 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1189 135, 59, 136, 137, 138, 139, 140, 0, 0, 141,
1190 142, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1191 0, 0, 0, 0, 130, 2, 3, 4, 143, 6,
1192 7, 8, 9, 10, 11, 0, 0, 0, 194, 145,
1193 146, 147, 148, 0, 0, 0, 12, 13, 14, 15,
1194 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1195 26, 27, 28, 0, 29, 30, 31, 32, 33, 34,
1196 35, 36, 37, 38, 39, 40, 41, 0, 42, 43,
1197 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
1198 53, 54, 0, 55, 56, 57, 58, 135, 59, 136,
1199 137, 138, 139, 140, 0, 0, 141, 142, 0, 0,
1200 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1201 2, 3, 4, 0, 0, 143, 8, 9, 10, 11,
1202 0, 0, 0, 0, 0, 0, 145, 146, 147, 148,
1203 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1204 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1205 0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1206 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1207 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1208 57, 0, 103, 59, 0, 0, 8, 9, 10, 11,
1209 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1210 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1211 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1212 104, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1213 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1214 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1215 57, 0, 135, 59, 136, 137, 138, 139, 140, 0,
1216 0, 141, 142, 0, 0, 0, 0, 0, 0, 0,
1217 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1218 143, 0, 0, 144, 8, 9, 10, 11, 0, 0,
1219 0, 145, 146, 147, 148, 0, 0, 0, 0, 12,
1220 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1221 23, 24, 25, 26, 0, 0, 0, 0, 0, 31,
1222 32, 33, 34, 35, 36, 0, 0, 0, 40, 41,
1223 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1224 50, 51, 52, 53, 54, 0, 55, 56, 57, 0,
1225 135, 59, 136, 137, 138, 139, 140, 0, 0, 141,
1226 142, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1227 0, 0, 0, 0, 0, 0, 0, 0, 143, 0,
1228 0, 218, 8, 9, 10, 11, 0, 0, 0, 145,
1229 146, 147, 148, 0, 0, 0, 0, 12, 13, 14,
1230 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1231 25, 26, 0, 0, 0, 0, 0, 31, 32, 33,
1232 34, 35, 36, 0, 0, 0, 40, 41, 0, 42,
1233 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1234 52, 53, 54, 0, 55, 56, 57, 0, 135, 59,
1235 136, 137, 138, 139, 140, 0, 0, 141, 142, 0,
1236 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1237 0, 0, 0, 0, 0, 0, 143, 8, 9, 10,
1238 11, 0, 0, 0, 0, 0, 274, 145, 146, 147,
1239 148, 0, 12, 13, 14, 15, 16, 17, 18, 19,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001240 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1241 0, 0, 31, 32, 33, 34, 35, 36, 0, 0,
1242 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
Alexis Hetua35d8232015-06-11 17:11:06 -04001243 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001244 56, 57, 0, 135, 59, 136, 137, 138, 139, 140,
Alexis Hetua35d8232015-06-11 17:11:06 -04001245 0, 0, 141, 142, 0, 0, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001247 0, 143, 0, 0, 299, 8, 9, 10, 11, 0,
1248 0, 0, 145, 146, 147, 148, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001249 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1250 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
1251 31, 32, 33, 34, 35, 36, 0, 0, 0, 40,
1252 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1253 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1254 0, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1255 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1256 0, 0, 0, 0, 0, 0, 0, 0, 0, 143,
Alexis Hetue5246692015-06-18 12:34:52 -04001257 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
1258 145, 146, 147, 148, 0, 12, 13, 14, 15, 16,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001259 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1260 0, 0, 0, 0, 0, 31, 32, 33, 34, 35,
Alexis Hetue5246692015-06-18 12:34:52 -04001261 36, 0, 0, 0, 40, 238, 0, 42, 43, 44,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001262 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1263 54, 0, 55, 56, 57, 0, 135, 59, 136, 137,
1264 138, 139, 140, 0, 0, 141, 142, 0, 0, 0,
1265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001266 130, 2, 3, 4, 143, 6, 7, 8, 9, 10,
1267 11, 0, 0, 0, 0, 145, 146, 147, 148, 0,
1268 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1269 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1270 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1271 39, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1272 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1273 56, 57, 58, 0, 59, 0, 0, 0, 0, 0,
1274 0, 0, 0, 0, 0, 130, 2, 3, 4, 0,
1275 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
1276 0, 0, 0, 0, 0, 0, 226, 12, 13, 14,
1277 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1278 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1279 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
1280 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1281 52, 53, 54, 0, 55, 56, 57, 58, 0, 59,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001283 130, 2, 3, 4, 0, 6, 7, 8, 9, 10,
1284 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1285 0, 264, 12, 13, 14, 15, 16, 17, 18, 19,
1286 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1287 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1288 39, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1289 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1290 56, 57, 58, 0, 59, 0, 0, 0, 0, 0,
1291 0, 0, 110, 0, 0, 1, 2, 3, 4, 5,
1292 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
1293 0, 0, 0, 0, 0, 0, 337, 12, 13, 14,
1294 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1295 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1296 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
1297 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1298 52, 53, 54, 0, 55, 56, 57, 58, 0, 59,
1299 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001300 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1301 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
Alexis Hetue5246692015-06-18 12:34:52 -04001302 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1303 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1304 39, 40, 41, 0, 42, 43, 44, 0, 45, 46,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001305 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
Alexis Hetue5246692015-06-18 12:34:52 -04001306 56, 57, 58, 0, 59, 130, 2, 3, 4, 0,
1307 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
1308 0, 0, 0, 0, 0, 0, 0, 12, 13, 14,
1309 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1310 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1311 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
1312 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1313 52, 53, 54, 0, 55, 56, 57, 58, 0, 59,
1314 2, 3, 4, 0, 0, 0, 8, 9, 10, 11,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001315 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001316 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1317 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1318 0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1319 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1320 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1321 57, 0, 0, 59, 8, 9, 10, 11, 0, 0,
1322 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
1323 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1324 23, 24, 25, 26, 0, 0, 0, 0, 0, 31,
1325 32, 33, 34, 35, 36, 0, 0, 0, 40, 41,
1326 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1327 50, 51, 52, 53, 54, 0, 55, 56, 57, 0,
1328 313, 59, 8, 9, 10, 11, 314, 0, 0, 0,
1329 0, 0, 0, 0, 0, 0, 0, 12, 13, 14,
1330 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1331 25, 26, 0, 0, 0, 0, 0, 31, 32, 33,
1332 34, 35, 36, 0, 0, 0, 40, 41, 0, 42,
1333 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1334 52, 53, 54, 0, 55, 56, 57, 0, 0, 59
John Bauman66b8ab22014-05-06 15:57:45 -04001335};
1336
1337static const yytype_int16 yycheck[] =
1338{
Alexis Hetue5246692015-06-18 12:34:52 -04001339 0, 69, 105, 0, 128, 143, 89, 217, 206, 0,
1340 133, 114, 340, 114, 127, 76, 44, 106, 109, 9,
1341 92, 346, 87, 88, 113, 104, 104, 106, 9, 97,
1342 133, 106, 76, 157, 113, 105, 127, 105, 368, 114,
1343 111, 111, 367, 114, 40, 41, 114, 9, 76, 187,
1344 40, 41, 42, 114, 177, 127, 124, 122, 123, 40,
1345 41, 42, 390, 131, 108, 133, 68, 397, 396, 69,
1346 105, 73, 72, 176, 177, 176, 189, 77, 40, 41,
1347 77, 43, 82, 114, 105, 105, 77, 111, 105, 51,
1348 111, 111, 302, 217, 111, 233, 111, 97, 189, 114,
1349 105, 85, 86, 216, 105, 105, 111, 106, 176, 177,
1350 111, 83, 84, 237, 114, 105, 111, 111, 118, 114,
1351 114, 76, 106, 261, 124, 216, 110, 249, 250, 251,
1352 252, 131, 111, 133, 272, 114, 89, 90, 276, 114,
1353 263, 351, 111, 112, 354, 4, 5, 6, 76, 347,
1354 40, 41, 42, 119, 120, 121, 116, 108, 118, 108,
1355 263, 79, 80, 245, 246, 253, 254, 377, 76, 293,
1356 294, 113, 109, 247, 248, 108, 176, 177, 302, 76,
1357 44, 76, 104, 126, 105, 298, 125, 104, 124, 399,
1358 127, 91, 305, 107, 93, 263, 106, 104, 114, 114,
1359 104, 114, 104, 112, 141, 142, 206, 298, 346, 112,
1360 104, 109, 104, 106, 305, 56, 107, 113, 105, 108,
1361 104, 107, 104, 160, 107, 113, 107, 351, 113, 367,
1362 354, 111, 107, 76, 113, 105, 109, 361, 107, 105,
1363 114, 17, 113, 346, 382, 358, 108, 114, 234, 114,
1364 256, 255, 189, 377, 257, 91, 339, 395, 98, 5,
1365 258, 124, 388, 263, 367, 222, 259, 358, 260, 124,
1366 306, 396, 341, 281, 180, 399, 77, 341, -1, 216,
1367 367, 281, 94, 95, 96, 97, 98, 99, 100, 101,
1368 102, 103, -1, -1, -1, -1, -1, -1, -1, -1,
1369 -1, 113, -1, -1, 372, 242, 243, 244, 245, 246,
1370 247, 248, 249, 250, 251, 252, 253, 254, 255, 256,
1371 257, 258, 259, 260, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001372 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001373 340, 341, -1, -1, -1, -1, 346, 347, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001374 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001375 -1, 298, -1, -1, -1, -1, -1, 367, 305, -1,
1376 -1, -1, 372, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001377 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001378 390, -1, -1, -1, -1, -1, 396, -1, -1, -1,
1379 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
1380 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1381 16, 358, 18, 19, 20, 21, 22, 23, 24, 25,
1382 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1383 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1384 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1385 56, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1386 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1387 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1388 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1389 -1, -1, -1, -1, -1, -1, -1, -1, 104, -1,
1390 -1, -1, 108, 109, -1, -1, -1, -1, 114, 115,
1391 116, 117, 118, 3, 4, 5, 6, 7, 8, 9,
1392 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
1393 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1394 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1395 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1396 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1397 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1398 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
1399 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001401 -1, -1, -1, -1, 104, -1, -1, -1, 108, 109,
1402 -1, -1, -1, -1, 114, 115, 116, 117, 118, 3,
1403 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1404 14, 15, 16, -1, 18, 19, 20, 21, 22, 23,
1405 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1406 34, 35, 36, 37, 38, 39, 40, 41, -1, 43,
1407 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1408 54, 55, 56, 57, 58, 59, -1, 61, 62, 63,
1409 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1410 74, 75, 76, 77, 78, 79, 80, 81, 82, -1,
1411 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001413 104, -1, -1, -1, 108, -1, -1, -1, -1, -1,
1414 114, 115, 116, 117, 118, 3, 4, 5, 6, 7,
1415 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1416 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001417 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001418 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
Alexis Hetue5246692015-06-18 12:34:52 -04001419 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001420 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001421 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001422 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1423 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001424 -1, -1, -1, -1, -1, -1, 104, -1, -1, -1,
1425 108, -1, -1, -1, -1, -1, 114, 115, 116, 117,
1426 118, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1427 12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
1428 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1429 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1430 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1431 52, 53, 54, 55, 56, 57, 58, 59, -1, 61,
1432 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1433 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1434 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1435 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1436 -1, -1, 104, -1, -1, -1, -1, -1, -1, -1,
1437 -1, -1, 114, 115, 116, 117, 118, 3, 4, 5,
1438 6, 7, 8, 9, 10, 11, 12, 13, -1, -1,
1439 -1, -1, -1, -1, -1, -1, -1, -1, -1, 25,
1440 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1441 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1442 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1443 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1444 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1445 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1446 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1447 -1, -1, -1, -1, 3, 4, 5, 6, 104, 8,
1448 9, 10, 11, 12, 13, -1, -1, -1, 114, 115,
1449 116, 117, 118, -1, -1, -1, 25, 26, 27, 28,
1450 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1451 39, 40, 41, -1, 43, 44, 45, 46, 47, 48,
1452 49, 50, 51, 52, 53, 54, 55, -1, 57, 58,
1453 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
1454 69, 70, -1, 72, 73, 74, 75, 76, 77, 78,
1455 79, 80, 81, 82, -1, -1, 85, 86, -1, -1,
1456 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1457 4, 5, 6, -1, -1, 104, 10, 11, 12, 13,
1458 -1, -1, -1, -1, -1, -1, 115, 116, 117, 118,
1459 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1460 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1461 -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1462 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1463 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1464 74, -1, 76, 77, -1, -1, 10, 11, 12, 13,
1465 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1466 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1467 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1468 114, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1469 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1470 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1471 74, -1, 76, 77, 78, 79, 80, 81, 82, -1,
1472 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1474 104, -1, -1, 107, 10, 11, 12, 13, -1, -1,
1475 -1, 115, 116, 117, 118, -1, -1, -1, -1, 25,
1476 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1477 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
1478 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1479 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1480 66, 67, 68, 69, 70, -1, 72, 73, 74, -1,
1481 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1482 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1483 -1, -1, -1, -1, -1, -1, -1, -1, 104, -1,
1484 -1, 107, 10, 11, 12, 13, -1, -1, -1, 115,
1485 116, 117, 118, -1, -1, -1, -1, 25, 26, 27,
1486 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1487 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
1488 48, 49, 50, -1, -1, -1, 54, 55, -1, 57,
1489 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1490 68, 69, 70, -1, 72, 73, 74, -1, 76, 77,
1491 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1492 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1493 -1, -1, -1, -1, -1, -1, 104, 10, 11, 12,
1494 13, -1, -1, -1, -1, -1, 114, 115, 116, 117,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001495 118, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1496 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1497 -1, -1, 45, 46, 47, 48, 49, 50, -1, -1,
1498 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
Alexis Hetua35d8232015-06-11 17:11:06 -04001499 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001500 73, 74, -1, 76, 77, 78, 79, 80, 81, 82,
Alexis Hetua35d8232015-06-11 17:11:06 -04001501 -1, -1, 85, 86, -1, -1, -1, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001502 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001503 -1, 104, -1, -1, 107, 10, 11, 12, 13, -1,
1504 -1, -1, 115, 116, 117, 118, -1, -1, -1, -1,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001505 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1506 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
1507 45, 46, 47, 48, 49, 50, -1, -1, -1, 54,
1508 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1509 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1510 -1, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1511 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1512 -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
Alexis Hetue5246692015-06-18 12:34:52 -04001513 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001514 115, 116, 117, 118, -1, 25, 26, 27, 28, 29,
1515 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1516 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
1517 50, -1, -1, -1, 54, 55, -1, 57, 58, 59,
1518 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1519 70, -1, 72, 73, 74, -1, 76, 77, 78, 79,
1520 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
1521 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001522 3, 4, 5, 6, 104, 8, 9, 10, 11, 12,
1523 13, -1, -1, -1, -1, 115, 116, 117, 118, -1,
1524 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1525 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1526 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1527 53, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1528 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1529 73, 74, 75, -1, 77, -1, -1, -1, -1, -1,
1530 -1, -1, -1, -1, -1, 3, 4, 5, 6, -1,
1531 8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
1532 -1, -1, -1, -1, -1, -1, 109, 25, 26, 27,
1533 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1534 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1535 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
1536 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1537 68, 69, 70, -1, 72, 73, 74, 75, -1, 77,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001538 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001539 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
1540 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1541 -1, 109, 25, 26, 27, 28, 29, 30, 31, 32,
1542 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1543 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1544 53, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1545 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1546 73, 74, 75, -1, 77, -1, -1, -1, -1, -1,
1547 -1, -1, 0, -1, -1, 3, 4, 5, 6, 7,
1548 8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
1549 -1, -1, -1, -1, -1, -1, 109, 25, 26, 27,
1550 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1551 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1552 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
1553 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1554 68, 69, 70, -1, 72, 73, 74, 75, -1, 77,
1555 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001556 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1557 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
Alexis Hetue5246692015-06-18 12:34:52 -04001558 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1559 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1560 53, 54, 55, -1, 57, 58, 59, -1, 61, 62,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001561 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
Alexis Hetue5246692015-06-18 12:34:52 -04001562 73, 74, 75, -1, 77, 3, 4, 5, 6, -1,
1563 8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
1564 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
1565 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1566 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1567 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
1568 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1569 68, 69, 70, -1, 72, 73, 74, 75, -1, 77,
1570 4, 5, 6, -1, -1, -1, 10, 11, 12, 13,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001571 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001572 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1573 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1574 -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1575 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1576 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1577 74, -1, -1, 77, 10, 11, 12, 13, -1, -1,
1578 -1, -1, -1, -1, -1, -1, -1, -1, -1, 25,
1579 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1580 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
1581 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1582 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1583 66, 67, 68, 69, 70, -1, 72, 73, 74, -1,
1584 76, 77, 10, 11, 12, 13, 82, -1, -1, -1,
1585 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
1586 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1587 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
1588 48, 49, 50, -1, -1, -1, 54, 55, -1, 57,
1589 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1590 68, 69, 70, -1, 72, 73, 74, -1, -1, 77
John Bauman66b8ab22014-05-06 15:57:45 -04001591};
1592
1593/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1594 symbol of state STATE-NUM. */
1595static const yytype_uint8 yystos[] =
1596{
1597 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Nicolas Capens3c20f802015-02-17 17:17:20 -05001598 12, 13, 25, 26, 27, 28, 29, 30, 31, 32,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05001599 33, 34, 35, 36, 37, 38, 39, 40, 41, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001600 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1601 54, 55, 57, 58, 59, 61, 62, 63, 64, 65,
1602 66, 67, 68, 69, 70, 72, 73, 74, 75, 77,
Alexis Hetua35d8232015-06-11 17:11:06 -04001603 159, 160, 161, 162, 163, 168, 169, 170, 171, 173,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001604 174, 175, 176, 177, 180, 181, 182, 217, 218, 219,
1605 44, 76, 176, 40, 41, 76, 108, 104, 114, 220,
Alexis Hetua35d8232015-06-11 17:11:06 -04001606 105, 111, 9, 40, 41, 42, 165, 166, 172, 111,
1607 114, 76, 174, 76, 114, 158, 175, 180, 174, 106,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001608 0, 218, 180, 108, 184, 76, 178, 179, 108, 200,
Alexis Hetua35d8232015-06-11 17:11:06 -04001609 165, 164, 167, 175, 166, 76, 104, 106, 113, 108,
1610 3, 173, 175, 185, 186, 76, 78, 79, 80, 81,
Alexis Hetue5246692015-06-18 12:34:52 -04001611 82, 85, 86, 104, 107, 115, 116, 117, 118, 129,
1612 130, 131, 133, 134, 135, 136, 137, 138, 139, 140,
1613 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
1614 151, 152, 153, 157, 180, 114, 183, 185, 113, 105,
1615 111, 14, 15, 16, 18, 19, 20, 21, 22, 23,
1616 24, 56, 108, 109, 114, 140, 153, 154, 156, 159,
1617 160, 180, 190, 191, 192, 193, 201, 202, 203, 205,
1618 207, 209, 216, 76, 164, 167, 106, 113, 107, 157,
1619 154, 189, 175, 76, 187, 188, 109, 186, 140, 140,
1620 156, 85, 86, 106, 110, 105, 105, 111, 55, 154,
1621 104, 140, 119, 120, 121, 116, 118, 83, 84, 87,
1622 88, 122, 123, 89, 90, 126, 125, 124, 91, 93,
1623 92, 127, 107, 185, 109, 79, 80, 179, 114, 114,
1624 211, 104, 104, 114, 114, 156, 104, 157, 112, 104,
1625 109, 194, 94, 95, 96, 97, 98, 99, 100, 101,
1626 102, 103, 113, 155, 111, 114, 109, 191, 106, 107,
1627 157, 189, 113, 107, 187, 106, 111, 114, 76, 114,
1628 105, 132, 156, 76, 82, 135, 154, 140, 140, 140,
1629 142, 142, 143, 143, 144, 144, 144, 144, 145, 145,
1630 146, 147, 148, 149, 150, 151, 156, 109, 197, 198,
1631 199, 212, 156, 114, 156, 112, 210, 201, 154, 154,
1632 157, 113, 107, 189, 113, 114, 157, 188, 106, 114,
1633 107, 112, 56, 200, 192, 190, 202, 213, 105, 105,
1634 156, 170, 173, 208, 195, 107, 189, 113, 189, 107,
1635 157, 154, 104, 208, 214, 215, 197, 204, 206, 76,
1636 105, 109, 189, 107, 156, 114, 105, 17, 193, 113,
1637 192, 196, 200, 114, 105, 156, 196, 197, 189, 114
John Bauman66b8ab22014-05-06 15:57:45 -04001638};
1639
1640#define yyerrok (yyerrstatus = 0)
1641#define yyclearin (yychar = YYEMPTY)
1642#define YYEMPTY (-2)
1643#define YYEOF 0
1644
1645#define YYACCEPT goto yyacceptlab
1646#define YYABORT goto yyabortlab
1647#define YYERROR goto yyerrorlab
1648
1649
1650/* Like YYERROR except do call yyerror. This remains here temporarily
1651 to ease the transition to the new meaning of YYERROR, for GCC.
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001652 Once GCC version 2 has supplanted version 1, this can go. */
John Bauman66b8ab22014-05-06 15:57:45 -04001653
1654#define YYFAIL goto yyerrlab
John Bauman66b8ab22014-05-06 15:57:45 -04001655
1656#define YYRECOVERING() (!!yyerrstatus)
1657
1658#define YYBACKUP(Token, Value) \
1659do \
1660 if (yychar == YYEMPTY && yylen == 1) \
1661 { \
1662 yychar = (Token); \
1663 yylval = (Value); \
1664 yytoken = YYTRANSLATE (yychar); \
1665 YYPOPSTACK (1); \
1666 goto yybackup; \
1667 } \
1668 else \
1669 { \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001670 yyerror (&yylloc, context, YY_("syntax error: cannot back up")); \
John Bauman66b8ab22014-05-06 15:57:45 -04001671 YYERROR; \
1672 } \
1673while (YYID (0))
1674
1675
1676#define YYTERROR 1
1677#define YYERRCODE 256
1678
1679
1680/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1681 If N is 0, then set CURRENT to the empty location which ends
1682 the previous symbol: RHS[0] (always defined). */
1683
1684#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1685#ifndef YYLLOC_DEFAULT
1686# define YYLLOC_DEFAULT(Current, Rhs, N) \
1687 do \
1688 if (YYID (N)) \
1689 { \
1690 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1691 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1692 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1693 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1694 } \
1695 else \
1696 { \
1697 (Current).first_line = (Current).last_line = \
1698 YYRHSLOC (Rhs, 0).last_line; \
1699 (Current).first_column = (Current).last_column = \
1700 YYRHSLOC (Rhs, 0).last_column; \
1701 } \
1702 while (YYID (0))
1703#endif
1704
1705
1706/* YY_LOCATION_PRINT -- Print the location on the stream.
1707 This macro was not mandated originally: define only if we know
1708 we won't break user code: when these are the locations we know. */
1709
1710#ifndef YY_LOCATION_PRINT
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001711# if YYLTYPE_IS_TRIVIAL
John Bauman66b8ab22014-05-06 15:57:45 -04001712# define YY_LOCATION_PRINT(File, Loc) \
1713 fprintf (File, "%d.%d-%d.%d", \
1714 (Loc).first_line, (Loc).first_column, \
1715 (Loc).last_line, (Loc).last_column)
1716# else
1717# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1718# endif
1719#endif
1720
1721
1722/* YYLEX -- calling `yylex' with the right arguments. */
1723
1724#ifdef YYLEX_PARAM
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001725# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
John Bauman66b8ab22014-05-06 15:57:45 -04001726#else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001727# define YYLEX yylex (&yylval, &yylloc)
John Bauman66b8ab22014-05-06 15:57:45 -04001728#endif
1729
1730/* Enable debugging if requested. */
1731#if YYDEBUG
1732
1733# ifndef YYFPRINTF
1734# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1735# define YYFPRINTF fprintf
1736# endif
1737
1738# define YYDPRINTF(Args) \
1739do { \
1740 if (yydebug) \
1741 YYFPRINTF Args; \
1742} while (YYID (0))
1743
1744# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1745do { \
1746 if (yydebug) \
1747 { \
1748 YYFPRINTF (stderr, "%s ", Title); \
1749 yy_symbol_print (stderr, \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001750 Type, Value, Location, context); \
John Bauman66b8ab22014-05-06 15:57:45 -04001751 YYFPRINTF (stderr, "\n"); \
1752 } \
1753} while (YYID (0))
1754
1755
1756/*--------------------------------.
1757| Print this symbol on YYOUTPUT. |
1758`--------------------------------*/
1759
1760/*ARGSUSED*/
1761#if (defined __STDC__ || defined __C99__FUNC__ \
1762 || defined __cplusplus || defined _MSC_VER)
1763static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001764yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001765#else
1766static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001767yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001768 FILE *yyoutput;
1769 int yytype;
1770 YYSTYPE const * const yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001771 YYLTYPE const * const yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04001772 TParseContext* context;
1773#endif
1774{
1775 if (!yyvaluep)
1776 return;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001777 YYUSE (yylocationp);
John Bauman66b8ab22014-05-06 15:57:45 -04001778 YYUSE (context);
1779# ifdef YYPRINT
1780 if (yytype < YYNTOKENS)
1781 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1782# else
1783 YYUSE (yyoutput);
1784# endif
1785 switch (yytype)
1786 {
1787 default:
1788 break;
1789 }
1790}
1791
1792
1793/*--------------------------------.
1794| Print this symbol on YYOUTPUT. |
1795`--------------------------------*/
1796
1797#if (defined __STDC__ || defined __C99__FUNC__ \
1798 || defined __cplusplus || defined _MSC_VER)
1799static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001800yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001801#else
1802static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001803yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001804 FILE *yyoutput;
1805 int yytype;
1806 YYSTYPE const * const yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001807 YYLTYPE const * const yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04001808 TParseContext* context;
1809#endif
1810{
1811 if (yytype < YYNTOKENS)
1812 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1813 else
1814 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1815
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001816 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1817 YYFPRINTF (yyoutput, ": ");
1818 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04001819 YYFPRINTF (yyoutput, ")");
1820}
1821
1822/*------------------------------------------------------------------.
1823| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1824| TOP (included). |
1825`------------------------------------------------------------------*/
1826
1827#if (defined __STDC__ || defined __C99__FUNC__ \
1828 || defined __cplusplus || defined _MSC_VER)
1829static void
1830yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1831#else
1832static void
1833yy_stack_print (yybottom, yytop)
1834 yytype_int16 *yybottom;
1835 yytype_int16 *yytop;
1836#endif
1837{
1838 YYFPRINTF (stderr, "Stack now");
1839 for (; yybottom <= yytop; yybottom++)
1840 {
1841 int yybot = *yybottom;
1842 YYFPRINTF (stderr, " %d", yybot);
1843 }
1844 YYFPRINTF (stderr, "\n");
1845}
1846
1847# define YY_STACK_PRINT(Bottom, Top) \
1848do { \
1849 if (yydebug) \
1850 yy_stack_print ((Bottom), (Top)); \
1851} while (YYID (0))
1852
1853
1854/*------------------------------------------------.
1855| Report that the YYRULE is going to be reduced. |
1856`------------------------------------------------*/
1857
1858#if (defined __STDC__ || defined __C99__FUNC__ \
1859 || defined __cplusplus || defined _MSC_VER)
1860static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001861yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001862#else
1863static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001864yy_reduce_print (yyvsp, yylsp, yyrule, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001865 YYSTYPE *yyvsp;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001866 YYLTYPE *yylsp;
John Bauman66b8ab22014-05-06 15:57:45 -04001867 int yyrule;
1868 TParseContext* context;
1869#endif
1870{
1871 int yynrhs = yyr2[yyrule];
1872 int yyi;
1873 unsigned long int yylno = yyrline[yyrule];
1874 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1875 yyrule - 1, yylno);
1876 /* The symbols being reduced. */
1877 for (yyi = 0; yyi < yynrhs; yyi++)
1878 {
1879 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1880 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1881 &(yyvsp[(yyi + 1) - (yynrhs)])
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001882 , &(yylsp[(yyi + 1) - (yynrhs)]) , context);
John Bauman66b8ab22014-05-06 15:57:45 -04001883 YYFPRINTF (stderr, "\n");
1884 }
1885}
1886
1887# define YY_REDUCE_PRINT(Rule) \
1888do { \
1889 if (yydebug) \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001890 yy_reduce_print (yyvsp, yylsp, Rule, context); \
John Bauman66b8ab22014-05-06 15:57:45 -04001891} while (YYID (0))
1892
1893/* Nonzero means print parse trace. It is left uninitialized so that
1894 multiple parsers can coexist. */
1895int yydebug;
1896#else /* !YYDEBUG */
1897# define YYDPRINTF(Args)
1898# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1899# define YY_STACK_PRINT(Bottom, Top)
1900# define YY_REDUCE_PRINT(Rule)
1901#endif /* !YYDEBUG */
1902
1903
1904/* YYINITDEPTH -- initial size of the parser's stacks. */
1905#ifndef YYINITDEPTH
1906# define YYINITDEPTH 200
1907#endif
1908
1909/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1910 if the built-in stack extension method is used).
1911
1912 Do not make this value too large; the results are undefined if
1913 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1914 evaluated with infinite-precision integer arithmetic. */
1915
1916#ifndef YYMAXDEPTH
1917# define YYMAXDEPTH 10000
1918#endif
1919
1920
1921
1922#if YYERROR_VERBOSE
1923
1924# ifndef yystrlen
1925# if defined __GLIBC__ && defined _STRING_H
1926# define yystrlen strlen
1927# else
1928/* Return the length of YYSTR. */
1929#if (defined __STDC__ || defined __C99__FUNC__ \
1930 || defined __cplusplus || defined _MSC_VER)
1931static YYSIZE_T
1932yystrlen (const char *yystr)
1933#else
1934static YYSIZE_T
1935yystrlen (yystr)
1936 const char *yystr;
1937#endif
1938{
1939 YYSIZE_T yylen;
1940 for (yylen = 0; yystr[yylen]; yylen++)
1941 continue;
1942 return yylen;
1943}
1944# endif
1945# endif
1946
1947# ifndef yystpcpy
1948# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1949# define yystpcpy stpcpy
1950# else
1951/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1952 YYDEST. */
1953#if (defined __STDC__ || defined __C99__FUNC__ \
1954 || defined __cplusplus || defined _MSC_VER)
1955static char *
1956yystpcpy (char *yydest, const char *yysrc)
1957#else
1958static char *
1959yystpcpy (yydest, yysrc)
1960 char *yydest;
1961 const char *yysrc;
1962#endif
1963{
1964 char *yyd = yydest;
1965 const char *yys = yysrc;
1966
1967 while ((*yyd++ = *yys++) != '\0')
1968 continue;
1969
1970 return yyd - 1;
1971}
1972# endif
1973# endif
1974
1975# ifndef yytnamerr
1976/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1977 quotes and backslashes, so that it's suitable for yyerror. The
1978 heuristic is that double-quoting is unnecessary unless the string
1979 contains an apostrophe, a comma, or backslash (other than
1980 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1981 null, do not copy; instead, return the length of what the result
1982 would have been. */
1983static YYSIZE_T
1984yytnamerr (char *yyres, const char *yystr)
1985{
1986 if (*yystr == '"')
1987 {
1988 YYSIZE_T yyn = 0;
1989 char const *yyp = yystr;
1990
1991 for (;;)
1992 switch (*++yyp)
1993 {
1994 case '\'':
1995 case ',':
1996 goto do_not_strip_quotes;
1997
1998 case '\\':
1999 if (*++yyp != '\\')
2000 goto do_not_strip_quotes;
2001 /* Fall through. */
2002 default:
2003 if (yyres)
2004 yyres[yyn] = *yyp;
2005 yyn++;
2006 break;
2007
2008 case '"':
2009 if (yyres)
2010 yyres[yyn] = '\0';
2011 return yyn;
2012 }
2013 do_not_strip_quotes: ;
2014 }
2015
2016 if (! yyres)
2017 return yystrlen (yystr);
2018
2019 return yystpcpy (yyres, yystr) - yyres;
2020}
2021# endif
2022
2023/* Copy into YYRESULT an error message about the unexpected token
2024 YYCHAR while in state YYSTATE. Return the number of bytes copied,
2025 including the terminating null byte. If YYRESULT is null, do not
2026 copy anything; just return the number of bytes that would be
2027 copied. As a special case, return 0 if an ordinary "syntax error"
2028 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
2029 size calculation. */
2030static YYSIZE_T
2031yysyntax_error (char *yyresult, int yystate, int yychar)
2032{
2033 int yyn = yypact[yystate];
2034
2035 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
2036 return 0;
2037 else
2038 {
2039 int yytype = YYTRANSLATE (yychar);
2040 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2041 YYSIZE_T yysize = yysize0;
2042 YYSIZE_T yysize1;
2043 int yysize_overflow = 0;
2044 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2045 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2046 int yyx;
2047
2048# if 0
2049 /* This is so xgettext sees the translatable formats that are
2050 constructed on the fly. */
2051 YY_("syntax error, unexpected %s");
2052 YY_("syntax error, unexpected %s, expecting %s");
2053 YY_("syntax error, unexpected %s, expecting %s or %s");
2054 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2055 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2056# endif
2057 char *yyfmt;
2058 char const *yyf;
2059 static char const yyunexpected[] = "syntax error, unexpected %s";
2060 static char const yyexpecting[] = ", expecting %s";
2061 static char const yyor[] = " or %s";
2062 char yyformat[sizeof yyunexpected
2063 + sizeof yyexpecting - 1
2064 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2065 * (sizeof yyor - 1))];
2066 char const *yyprefix = yyexpecting;
2067
2068 /* Start YYX at -YYN if negative to avoid negative indexes in
2069 YYCHECK. */
2070 int yyxbegin = yyn < 0 ? -yyn : 0;
2071
2072 /* Stay within bounds of both yycheck and yytname. */
2073 int yychecklim = YYLAST - yyn + 1;
2074 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2075 int yycount = 1;
2076
2077 yyarg[0] = yytname[yytype];
2078 yyfmt = yystpcpy (yyformat, yyunexpected);
2079
2080 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2081 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2082 {
2083 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2084 {
2085 yycount = 1;
2086 yysize = yysize0;
2087 yyformat[sizeof yyunexpected - 1] = '\0';
2088 break;
2089 }
2090 yyarg[yycount++] = yytname[yyx];
2091 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2092 yysize_overflow |= (yysize1 < yysize);
2093 yysize = yysize1;
2094 yyfmt = yystpcpy (yyfmt, yyprefix);
2095 yyprefix = yyor;
2096 }
2097
2098 yyf = YY_(yyformat);
2099 yysize1 = yysize + yystrlen (yyf);
2100 yysize_overflow |= (yysize1 < yysize);
2101 yysize = yysize1;
2102
2103 if (yysize_overflow)
2104 return YYSIZE_MAXIMUM;
2105
2106 if (yyresult)
2107 {
2108 /* Avoid sprintf, as that infringes on the user's name space.
2109 Don't have undefined behavior even if the translation
2110 produced a string with the wrong number of "%s"s. */
2111 char *yyp = yyresult;
2112 int yyi = 0;
2113 while ((*yyp = *yyf) != '\0')
2114 {
2115 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2116 {
2117 yyp += yytnamerr (yyp, yyarg[yyi++]);
2118 yyf += 2;
2119 }
2120 else
2121 {
2122 yyp++;
2123 yyf++;
2124 }
2125 }
2126 }
2127 return yysize;
2128 }
2129}
2130#endif /* YYERROR_VERBOSE */
2131
2132
2133/*-----------------------------------------------.
2134| Release the memory associated to this symbol. |
2135`-----------------------------------------------*/
2136
2137/*ARGSUSED*/
2138#if (defined __STDC__ || defined __C99__FUNC__ \
2139 || defined __cplusplus || defined _MSC_VER)
2140static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002141yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04002142#else
2143static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002144yydestruct (yymsg, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04002145 const char *yymsg;
2146 int yytype;
2147 YYSTYPE *yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002148 YYLTYPE *yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04002149 TParseContext* context;
2150#endif
2151{
2152 YYUSE (yyvaluep);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002153 YYUSE (yylocationp);
John Bauman66b8ab22014-05-06 15:57:45 -04002154 YYUSE (context);
2155
2156 if (!yymsg)
2157 yymsg = "Deleting";
2158 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2159
2160 switch (yytype)
2161 {
2162
2163 default:
2164 break;
2165 }
2166}
2167
2168/* Prevent warnings from -Wmissing-prototypes. */
2169#ifdef YYPARSE_PARAM
2170#if defined __STDC__ || defined __cplusplus
2171int yyparse (void *YYPARSE_PARAM);
2172#else
2173int yyparse ();
2174#endif
2175#else /* ! YYPARSE_PARAM */
2176#if defined __STDC__ || defined __cplusplus
2177int yyparse (TParseContext* context);
2178#else
2179int yyparse ();
2180#endif
2181#endif /* ! YYPARSE_PARAM */
2182
2183
2184
2185
2186
2187/*-------------------------.
2188| yyparse or yypush_parse. |
2189`-------------------------*/
2190
2191#ifdef YYPARSE_PARAM
2192#if (defined __STDC__ || defined __C99__FUNC__ \
2193 || defined __cplusplus || defined _MSC_VER)
2194int
2195yyparse (void *YYPARSE_PARAM)
2196#else
2197int
2198yyparse (YYPARSE_PARAM)
2199 void *YYPARSE_PARAM;
2200#endif
2201#else /* ! YYPARSE_PARAM */
2202#if (defined __STDC__ || defined __C99__FUNC__ \
2203 || defined __cplusplus || defined _MSC_VER)
2204int
2205yyparse (TParseContext* context)
2206#else
2207int
2208yyparse (context)
2209 TParseContext* context;
2210#endif
2211#endif
2212{
2213/* The lookahead symbol. */
2214int yychar;
2215
2216/* The semantic value of the lookahead symbol. */
2217YYSTYPE yylval;
2218
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002219/* Location data for the lookahead symbol. */
2220YYLTYPE yylloc;
2221
John Bauman66b8ab22014-05-06 15:57:45 -04002222 /* Number of syntax errors so far. */
2223 int yynerrs;
2224
2225 int yystate;
2226 /* Number of tokens to shift before error messages enabled. */
2227 int yyerrstatus;
2228
2229 /* The stacks and their tools:
2230 `yyss': related to states.
2231 `yyvs': related to semantic values.
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002232 `yyls': related to locations.
John Bauman66b8ab22014-05-06 15:57:45 -04002233
2234 Refer to the stacks thru separate pointers, to allow yyoverflow
2235 to reallocate them elsewhere. */
2236
2237 /* The state stack. */
2238 yytype_int16 yyssa[YYINITDEPTH];
2239 yytype_int16 *yyss;
2240 yytype_int16 *yyssp;
2241
2242 /* The semantic value stack. */
2243 YYSTYPE yyvsa[YYINITDEPTH];
2244 YYSTYPE *yyvs;
2245 YYSTYPE *yyvsp;
2246
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002247 /* The location stack. */
2248 YYLTYPE yylsa[YYINITDEPTH];
2249 YYLTYPE *yyls;
2250 YYLTYPE *yylsp;
2251
2252 /* The locations where the error started and ended. */
2253 YYLTYPE yyerror_range[2];
2254
John Bauman66b8ab22014-05-06 15:57:45 -04002255 YYSIZE_T yystacksize;
2256
2257 int yyn;
2258 int yyresult;
2259 /* Lookahead token as an internal (translated) token number. */
2260 int yytoken;
2261 /* The variables used to return semantic value and location from the
2262 action routines. */
2263 YYSTYPE yyval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002264 YYLTYPE yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04002265
2266#if YYERROR_VERBOSE
2267 /* Buffer for error messages, and its allocated size. */
2268 char yymsgbuf[128];
2269 char *yymsg = yymsgbuf;
2270 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2271#endif
2272
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002273#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
John Bauman66b8ab22014-05-06 15:57:45 -04002274
2275 /* The number of symbols on the RHS of the reduced rule.
2276 Keep to zero when no symbol should be popped. */
2277 int yylen = 0;
2278
2279 yytoken = 0;
2280 yyss = yyssa;
2281 yyvs = yyvsa;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002282 yyls = yylsa;
John Bauman66b8ab22014-05-06 15:57:45 -04002283 yystacksize = YYINITDEPTH;
2284
2285 YYDPRINTF ((stderr, "Starting parse\n"));
2286
2287 yystate = 0;
2288 yyerrstatus = 0;
2289 yynerrs = 0;
2290 yychar = YYEMPTY; /* Cause a token to be read. */
2291
2292 /* Initialize stack pointers.
2293 Waste one element of value and location stack
2294 so that they stay on the same level as the state stack.
2295 The wasted elements are never initialized. */
2296 yyssp = yyss;
2297 yyvsp = yyvs;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002298 yylsp = yyls;
2299
2300#if YYLTYPE_IS_TRIVIAL
2301 /* Initialize the default location before parsing starts. */
2302 yylloc.first_line = yylloc.last_line = 1;
2303 yylloc.first_column = yylloc.last_column = 1;
2304#endif
John Bauman66b8ab22014-05-06 15:57:45 -04002305
2306 goto yysetstate;
2307
2308/*------------------------------------------------------------.
2309| yynewstate -- Push a new state, which is found in yystate. |
2310`------------------------------------------------------------*/
2311 yynewstate:
2312 /* In all cases, when you get here, the value and location stacks
2313 have just been pushed. So pushing a state here evens the stacks. */
2314 yyssp++;
2315
2316 yysetstate:
2317 *yyssp = yystate;
2318
2319 if (yyss + yystacksize - 1 <= yyssp)
2320 {
2321 /* Get the current used size of the three stacks, in elements. */
2322 YYSIZE_T yysize = yyssp - yyss + 1;
2323
2324#ifdef yyoverflow
2325 {
2326 /* Give user a chance to reallocate the stack. Use copies of
2327 these so that the &'s don't force the real ones into
2328 memory. */
2329 YYSTYPE *yyvs1 = yyvs;
2330 yytype_int16 *yyss1 = yyss;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002331 YYLTYPE *yyls1 = yyls;
John Bauman66b8ab22014-05-06 15:57:45 -04002332
2333 /* Each stack pointer address is followed by the size of the
2334 data in use in that stack, in bytes. This used to be a
2335 conditional around just the two extra args, but that might
2336 be undefined if yyoverflow is a macro. */
2337 yyoverflow (YY_("memory exhausted"),
2338 &yyss1, yysize * sizeof (*yyssp),
2339 &yyvs1, yysize * sizeof (*yyvsp),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002340 &yyls1, yysize * sizeof (*yylsp),
John Bauman66b8ab22014-05-06 15:57:45 -04002341 &yystacksize);
2342
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002343 yyls = yyls1;
John Bauman66b8ab22014-05-06 15:57:45 -04002344 yyss = yyss1;
2345 yyvs = yyvs1;
2346 }
2347#else /* no yyoverflow */
2348# ifndef YYSTACK_RELOCATE
2349 goto yyexhaustedlab;
2350# else
2351 /* Extend the stack our own way. */
2352 if (YYMAXDEPTH <= yystacksize)
2353 goto yyexhaustedlab;
2354 yystacksize *= 2;
2355 if (YYMAXDEPTH < yystacksize)
2356 yystacksize = YYMAXDEPTH;
2357
2358 {
2359 yytype_int16 *yyss1 = yyss;
2360 union yyalloc *yyptr =
2361 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2362 if (! yyptr)
2363 goto yyexhaustedlab;
2364 YYSTACK_RELOCATE (yyss_alloc, yyss);
2365 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002366 YYSTACK_RELOCATE (yyls_alloc, yyls);
John Bauman66b8ab22014-05-06 15:57:45 -04002367# undef YYSTACK_RELOCATE
2368 if (yyss1 != yyssa)
2369 YYSTACK_FREE (yyss1);
2370 }
2371# endif
2372#endif /* no yyoverflow */
2373
2374 yyssp = yyss + yysize - 1;
2375 yyvsp = yyvs + yysize - 1;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002376 yylsp = yyls + yysize - 1;
John Bauman66b8ab22014-05-06 15:57:45 -04002377
2378 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2379 (unsigned long int) yystacksize));
2380
2381 if (yyss + yystacksize - 1 <= yyssp)
2382 YYABORT;
2383 }
2384
2385 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2386
2387 if (yystate == YYFINAL)
2388 YYACCEPT;
2389
2390 goto yybackup;
2391
2392/*-----------.
2393| yybackup. |
2394`-----------*/
2395yybackup:
2396
2397 /* Do appropriate processing given the current state. Read a
2398 lookahead token if we need one and don't already have one. */
2399
2400 /* First try to decide what to do without reference to lookahead token. */
2401 yyn = yypact[yystate];
2402 if (yyn == YYPACT_NINF)
2403 goto yydefault;
2404
2405 /* Not known => get a lookahead token if don't already have one. */
2406
2407 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2408 if (yychar == YYEMPTY)
2409 {
2410 YYDPRINTF ((stderr, "Reading a token: "));
2411 yychar = YYLEX;
2412 }
2413
2414 if (yychar <= YYEOF)
2415 {
2416 yychar = yytoken = YYEOF;
2417 YYDPRINTF ((stderr, "Now at end of input.\n"));
2418 }
2419 else
2420 {
2421 yytoken = YYTRANSLATE (yychar);
2422 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2423 }
2424
2425 /* If the proper action on seeing token YYTOKEN is to reduce or to
2426 detect an error, take that action. */
2427 yyn += yytoken;
2428 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2429 goto yydefault;
2430 yyn = yytable[yyn];
2431 if (yyn <= 0)
2432 {
2433 if (yyn == 0 || yyn == YYTABLE_NINF)
2434 goto yyerrlab;
2435 yyn = -yyn;
2436 goto yyreduce;
2437 }
2438
2439 /* Count tokens shifted since error; after three, turn off error
2440 status. */
2441 if (yyerrstatus)
2442 yyerrstatus--;
2443
2444 /* Shift the lookahead token. */
2445 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2446
2447 /* Discard the shifted token. */
2448 yychar = YYEMPTY;
2449
2450 yystate = yyn;
2451 *++yyvsp = yylval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002452 *++yylsp = yylloc;
John Bauman66b8ab22014-05-06 15:57:45 -04002453 goto yynewstate;
2454
2455
2456/*-----------------------------------------------------------.
2457| yydefault -- do the default action for the current state. |
2458`-----------------------------------------------------------*/
2459yydefault:
2460 yyn = yydefact[yystate];
2461 if (yyn == 0)
2462 goto yyerrlab;
2463 goto yyreduce;
2464
2465
2466/*-----------------------------.
2467| yyreduce -- Do a reduction. |
2468`-----------------------------*/
2469yyreduce:
2470 /* yyn is the number of a rule to reduce with. */
2471 yylen = yyr2[yyn];
2472
2473 /* If YYLEN is nonzero, implement the default value of the action:
2474 `$$ = $1'.
2475
2476 Otherwise, the following line sets YYVAL to garbage.
2477 This behavior is undocumented and Bison
2478 users should not rely upon it. Assigning to YYVAL
2479 unconditionally makes the parser a bit smaller, and it avoids a
2480 GCC warning that YYVAL may be used uninitialized. */
2481 yyval = yyvsp[1-yylen];
2482
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002483 /* Default location. */
2484 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
John Bauman66b8ab22014-05-06 15:57:45 -04002485 YY_REDUCE_PRINT (yyn);
2486 switch (yyn)
2487 {
2488 case 2:
2489
2490 {
2491 // The symbol table search was done in the lexical phase
2492 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2493 const TVariable* variable;
2494 if (symbol == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002495 context->error((yylsp[(1) - (1)]), "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04002496 context->recover();
2497 TType type(EbtFloat, EbpUndefined);
2498 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05002499 context->symbolTable.declare(*fakeVariable);
John Bauman66b8ab22014-05-06 15:57:45 -04002500 variable = fakeVariable;
2501 } else {
2502 // This identifier can only be a variable type symbol
2503 if (! symbol->isVariable()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002504 context->error((yylsp[(1) - (1)]), "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04002505 context->recover();
2506 }
2507 variable = static_cast<const TVariable*>(symbol);
2508 }
2509
2510 // don't delete $1.string, it's used by error recovery, and the pool
2511 // pop will reclaim the memory
2512
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002513 if (variable->getType().getQualifier() == EvqConstExpr ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002514 ConstantUnion* constArray = variable->getConstPointer();
2515 TType t(variable->getType());
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002516 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002517 } else
2518 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2519 variable->getName(),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002520 variable->getType(), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002521 }
2522 break;
2523
2524 case 3:
2525
2526 {
2527 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2528 }
2529 break;
2530
2531 case 4:
2532
2533 {
John Bauman66b8ab22014-05-06 15:57:45 -04002534 ConstantUnion *unionArray = new ConstantUnion[1];
2535 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002536 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002537 }
2538 break;
2539
2540 case 5:
2541
2542 {
2543 ConstantUnion *unionArray = new ConstantUnion[1];
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002544 unionArray->setUConst((yyvsp[(1) - (1)].lex).u);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002545 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002546 }
2547 break;
2548
2549 case 6:
2550
2551 {
2552 ConstantUnion *unionArray = new ConstantUnion[1];
John Bauman66b8ab22014-05-06 15:57:45 -04002553 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002554 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002555 }
2556 break;
2557
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002558 case 7:
John Bauman66b8ab22014-05-06 15:57:45 -04002559
2560 {
2561 ConstantUnion *unionArray = new ConstantUnion[1];
2562 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002563 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002564 }
2565 break;
2566
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002567 case 8:
John Bauman66b8ab22014-05-06 15:57:45 -04002568
2569 {
2570 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
2571 }
2572 break;
2573
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002574 case 9:
John Bauman66b8ab22014-05-06 15:57:45 -04002575
2576 {
2577 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2578 }
2579 break;
2580
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002581 case 10:
John Bauman66b8ab22014-05-06 15:57:45 -04002582
2583 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002584 (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 -04002585 }
2586 break;
2587
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002588 case 11:
John Bauman66b8ab22014-05-06 15:57:45 -04002589
2590 {
2591 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2592 }
2593 break;
2594
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002595 case 12:
John Bauman66b8ab22014-05-06 15:57:45 -04002596
2597 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002598 (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 -04002599 }
2600 break;
2601
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002602 case 13:
John Bauman66b8ab22014-05-06 15:57:45 -04002603
2604 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002605 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002606 }
2607 break;
2608
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002609 case 14:
John Bauman66b8ab22014-05-06 15:57:45 -04002610
2611 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002612 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002613 }
2614 break;
2615
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002616 case 15:
John Bauman66b8ab22014-05-06 15:57:45 -04002617
2618 {
2619 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2620 context->recover();
2621 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2622 }
2623 break;
2624
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002625 case 16:
John Bauman66b8ab22014-05-06 15:57:45 -04002626
2627 {
Alexis Hetub3ff42c2015-07-03 18:19:57 -04002628 bool fatalError = false;
2629 (yyval.interm.intermTypedNode) = context->addFunctionCallOrMethod((yyvsp[(1) - (1)].interm).function, (yyvsp[(1) - (1)].interm).intermNode, nullptr, (yylsp[(1) - (1)]), &fatalError);
2630 if (fatalError)
John Bauman66b8ab22014-05-06 15:57:45 -04002631 {
Alexis Hetub3ff42c2015-07-03 18:19:57 -04002632 YYERROR;
John Bauman66b8ab22014-05-06 15:57:45 -04002633 }
John Bauman66b8ab22014-05-06 15:57:45 -04002634 }
2635 break;
2636
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002637 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002638
2639 {
2640 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2641 }
2642 break;
2643
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002644 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002645
2646 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002647 context->error((yylsp[(3) - (3)]), "methods are not supported", "");
John Bauman66b8ab22014-05-06 15:57:45 -04002648 context->recover();
2649 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2650 }
2651 break;
2652
John Bauman66b8ab22014-05-06 15:57:45 -04002653 case 19:
2654
2655 {
2656 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002657 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04002658 }
2659 break;
2660
2661 case 20:
2662
2663 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002664 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002665 (yyval.interm).line = (yylsp[(2) - (2)]);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002666 }
2667 break;
2668
2669 case 21:
2670
2671 {
John Bauman66b8ab22014-05-06 15:57:45 -04002672 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2673 (yyval.interm).intermNode = 0;
2674 }
2675 break;
2676
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002677 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002678
2679 {
2680 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2681 (yyval.interm).intermNode = 0;
2682 }
2683 break;
2684
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002685 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002686
2687 {
2688 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2689 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2690 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2691 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2692 }
2693 break;
2694
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002695 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002696
2697 {
2698 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2699 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2700 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002701 (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 -04002702 }
2703 break;
2704
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002705 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002706
2707 {
2708 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2709 }
2710 break;
2711
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002712 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002713
2714 {
Alexis Hetue5246692015-06-18 12:34:52 -04002715 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002716 ES3_ONLY("[]", (yylsp[(1) - (1)]), "array constructor");
John Bauman66b8ab22014-05-06 15:57:45 -04002717 }
Alexis Hetue5246692015-06-18 12:34:52 -04002718 (yyval.interm.function) = context->addConstructorFunc((yyvsp[(1) - (1)].interm.type));
John Bauman66b8ab22014-05-06 15:57:45 -04002719 }
2720 break;
2721
John Bauman66b8ab22014-05-06 15:57:45 -04002722 case 27:
2723
2724 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002725 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04002726 context->recover();
2727 TType type(EbtVoid, EbpUndefined);
2728 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2729 (yyval.interm.function) = function;
2730 }
2731 break;
2732
2733 case 28:
2734
2735 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002736 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002737 context->recover();
2738 TType type(EbtVoid, EbpUndefined);
2739 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2740 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002741 }
2742 break;
2743
2744 case 29:
2745
2746 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002747 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2748 }
2749 break;
2750
2751 case 30:
2752
2753 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002754 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002755 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002756 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002757 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002758 context->unaryOpError((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002759 context->recover();
2760 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2761 }
2762 }
2763 break;
2764
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002765 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002766
2767 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002768 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002769 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002770 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002771 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002772 context->unaryOpError((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002773 context->recover();
2774 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2775 }
2776 }
2777 break;
2778
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002779 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002780
2781 {
2782 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002783 (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 -04002784 if ((yyval.interm.intermTypedNode) == 0) {
2785 const char* errorOp = "";
2786 switch((yyvsp[(1) - (2)].interm).op) {
2787 case EOpNegative: errorOp = "-"; break;
2788 case EOpLogicalNot: errorOp = "!"; break;
Alexis Hetud061e422015-05-13 16:37:50 -04002789 case EOpBitwiseNot: errorOp = "~"; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002790 default: break;
2791 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002792 context->unaryOpError((yylsp[(1) - (2)]), errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002793 context->recover();
2794 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2795 }
2796 } else
2797 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2798 }
2799 break;
2800
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002801 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002802
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002803 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNull; }
John Bauman66b8ab22014-05-06 15:57:45 -04002804 break;
2805
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002806 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002807
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002808 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNegative; }
John Bauman66b8ab22014-05-06 15:57:45 -04002809 break;
2810
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002811 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002812
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002813 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpLogicalNot; }
John Bauman66b8ab22014-05-06 15:57:45 -04002814 break;
2815
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002816 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002817
Alexis Hetu17809052015-05-13 11:28:22 -04002818 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002819 ES3_ONLY("~", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002820 (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseNot;
Alexis Hetu17809052015-05-13 11:28:22 -04002821 }
John Bauman66b8ab22014-05-06 15:57:45 -04002822 break;
2823
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002824 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002825
Alexis Hetu17809052015-05-13 11:28:22 -04002826 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2827 break;
2828
2829 case 38:
2830
John Bauman66b8ab22014-05-06 15:57:45 -04002831 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002832 FRAG_VERT_ONLY("*", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002833 (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 -04002834 }
2835 break;
2836
Alexis Hetu17809052015-05-13 11:28:22 -04002837 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04002838
2839 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002840 FRAG_VERT_ONLY("/", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002841 (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 -04002842 }
2843 break;
2844
Alexis Hetu17809052015-05-13 11:28:22 -04002845 case 40:
2846
2847 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002848 FRAG_VERT_ONLY("%", (yylsp[(2) - (3)]));
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002849 ES3_ONLY("%", (yylsp[(2) - (3)]), "integer modulus operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002850 (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 -04002851 }
2852 break;
2853
2854 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04002855
2856 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2857 break;
2858
Alexis Hetu17809052015-05-13 11:28:22 -04002859 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04002860
2861 {
Alexis Hetub4769582015-06-16 12:19:50 -04002862 (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 -04002863 }
2864 break;
2865
Alexis Hetu17809052015-05-13 11:28:22 -04002866 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04002867
2868 {
Alexis Hetub4769582015-06-16 12:19:50 -04002869 (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 -04002870 }
2871 break;
2872
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002873 case 44:
2874
Alexis Hetu17809052015-05-13 11:28:22 -04002875 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2876 break;
2877
2878 case 45:
2879
2880 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002881 ES3_ONLY("<<", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002882 (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 -04002883 }
2884 break;
2885
2886 case 46:
2887
2888 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002889 ES3_ONLY(">>", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002890 (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 -04002891 }
2892 break;
2893
2894 case 47:
2895
2896 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2897 break;
2898
2899 case 48:
2900
John Bauman66b8ab22014-05-06 15:57:45 -04002901 {
Alexis Hetub4769582015-06-16 12:19:50 -04002902 (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 -04002903 }
2904 break;
2905
Alexis Hetu17809052015-05-13 11:28:22 -04002906 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04002907
2908 {
Alexis Hetub4769582015-06-16 12:19:50 -04002909 (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 -04002910 }
2911 break;
2912
Alexis Hetu17809052015-05-13 11:28:22 -04002913 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04002914
2915 {
Alexis Hetub4769582015-06-16 12:19:50 -04002916 (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 -04002917 }
2918 break;
2919
Alexis Hetu17809052015-05-13 11:28:22 -04002920 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04002921
2922 {
Alexis Hetub4769582015-06-16 12:19:50 -04002923 (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 -04002924 }
2925 break;
2926
Alexis Hetu17809052015-05-13 11:28:22 -04002927 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04002928
2929 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2930 break;
2931
Alexis Hetu17809052015-05-13 11:28:22 -04002932 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04002933
2934 {
Alexis Hetub4769582015-06-16 12:19:50 -04002935 (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 -04002936 }
2937 break;
2938
Alexis Hetu17809052015-05-13 11:28:22 -04002939 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04002940
2941 {
Alexis Hetub4769582015-06-16 12:19:50 -04002942 (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 -04002943 }
2944 break;
2945
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002946 case 55:
2947
Alexis Hetu17809052015-05-13 11:28:22 -04002948 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2949 break;
2950
2951 case 56:
2952
2953 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002954 ES3_ONLY("&", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002955 (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 -04002956 }
2957 break;
2958
2959 case 57:
2960
2961 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2962 break;
2963
2964 case 58:
2965
2966 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002967 ES3_ONLY("^", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002968 (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 -04002969 }
2970 break;
2971
2972 case 59:
2973
2974 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2975 break;
2976
2977 case 60:
2978
2979 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002980 ES3_ONLY("|", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002981 (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 -04002982 }
2983 break;
2984
2985 case 61:
2986
2987 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2988 break;
2989
2990 case 62:
2991
John Bauman66b8ab22014-05-06 15:57:45 -04002992 {
Alexis Hetub4769582015-06-16 12:19:50 -04002993 (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 -04002994 }
2995 break;
2996
Alexis Hetu17809052015-05-13 11:28:22 -04002997 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04002998
2999 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3000 break;
3001
Alexis Hetu17809052015-05-13 11:28:22 -04003002 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003003
3004 {
Alexis Hetub4769582015-06-16 12:19:50 -04003005 (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 -04003006 }
3007 break;
3008
Alexis Hetu17809052015-05-13 11:28:22 -04003009 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003010
3011 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3012 break;
3013
Alexis Hetu17809052015-05-13 11:28:22 -04003014 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003015
3016 {
Alexis Hetub4769582015-06-16 12:19:50 -04003017 (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 -04003018 }
3019 break;
3020
Alexis Hetu17809052015-05-13 11:28:22 -04003021 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003022
3023 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3024 break;
3025
Alexis Hetu17809052015-05-13 11:28:22 -04003026 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003027
3028 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003029 if (context->boolErrorCheck((yylsp[(2) - (5)]), (yyvsp[(1) - (5)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04003030 context->recover();
3031
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003032 (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 -04003033 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3034 (yyval.interm.intermTypedNode) = 0;
3035
3036 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003037 context->binaryOpError((yylsp[(2) - (5)]), ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003038 context->recover();
3039 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3040 }
3041 }
3042 break;
3043
Alexis Hetu17809052015-05-13 11:28:22 -04003044 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003045
3046 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3047 break;
3048
Alexis Hetu17809052015-05-13 11:28:22 -04003049 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003050
3051 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003052 if (context->lValueErrorCheck((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04003053 context->recover();
Alexis Hetue5246692015-06-18 12:34:52 -04003054 (yyval.interm.intermTypedNode) = context->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 -04003055 }
3056 break;
3057
Alexis Hetu17809052015-05-13 11:28:22 -04003058 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003059
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003060 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003061 break;
3062
Alexis Hetu17809052015-05-13 11:28:22 -04003063 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003064
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003065 { FRAG_VERT_ONLY("*=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpMulAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003066 break;
3067
Alexis Hetu17809052015-05-13 11:28:22 -04003068 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003069
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003070 { FRAG_VERT_ONLY("/=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpDivAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003071 break;
3072
Alexis Hetu17809052015-05-13 11:28:22 -04003073 case 74:
3074
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003075 { ES3_ONLY("%=", (yylsp[(1) - (1)]), "integer modulus operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003076 FRAG_VERT_ONLY("%=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpIModAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003077 break;
3078
3079 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003080
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003081 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAddAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003082 break;
3083
Alexis Hetu17809052015-05-13 11:28:22 -04003084 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003085
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003086 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpSubAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003087 break;
3088
Alexis Hetu17809052015-05-13 11:28:22 -04003089 case 77:
3090
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003091 { ES3_ONLY("<<=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003092 FRAG_VERT_ONLY("<<=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftLeftAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003093 break;
3094
3095 case 78:
3096
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003097 { ES3_ONLY(">>=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003098 FRAG_VERT_ONLY(">>=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftRightAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003099 break;
3100
3101 case 79:
3102
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003103 { ES3_ONLY("&=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003104 FRAG_VERT_ONLY("&=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseAndAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003105 break;
3106
3107 case 80:
3108
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003109 { ES3_ONLY("^=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003110 FRAG_VERT_ONLY("^=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseXorAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003111 break;
3112
3113 case 81:
3114
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003115 { ES3_ONLY("|=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003116 FRAG_VERT_ONLY("|=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseOrAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003117 break;
3118
3119 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003120
3121 {
3122 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3123 }
3124 break;
3125
Alexis Hetu17809052015-05-13 11:28:22 -04003126 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003127
3128 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003129 (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 -04003130 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003131 context->binaryOpError((yylsp[(2) - (3)]), ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003132 context->recover();
3133 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3134 }
3135 }
3136 break;
3137
Alexis Hetu17809052015-05-13 11:28:22 -04003138 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003139
3140 {
3141 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3142 context->recover();
3143 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3144 }
3145 break;
3146
Alexis Hetu17809052015-05-13 11:28:22 -04003147 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003148
3149 {
Alexis Hetue5246692015-06-18 12:34:52 -04003150 if (context->enterStructDeclaration((yylsp[(1) - (2)]), *(yyvsp[(1) - (2)].lex).string))
Alexis Hetua35d8232015-06-11 17:11:06 -04003151 context->recover();
3152 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3153 }
3154 break;
3155
3156 case 86:
3157
3158 {
John Bauman66b8ab22014-05-06 15:57:45 -04003159 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3160
3161 TIntermAggregate *prototype = new TIntermAggregate;
3162 prototype->setType(function.getReturnType());
3163 prototype->setName(function.getName());
3164
Alexis Hetu76a343a2015-06-04 17:21:22 -04003165 for (size_t i = 0; i < function.getParamCount(); i++)
John Bauman66b8ab22014-05-06 15:57:45 -04003166 {
3167 const TParameter &param = function.getParam(i);
3168 if (param.name != 0)
3169 {
John Baumand4ae8632014-05-06 16:18:33 -04003170 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003171
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003172 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 -04003173 }
3174 else
3175 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003176 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003177 }
3178 }
3179
3180 prototype->setOp(EOpPrototype);
3181 (yyval.interm.intermNode) = prototype;
3182
3183 context->symbolTable.pop();
3184 }
3185 break;
3186
Alexis Hetua35d8232015-06-11 17:11:06 -04003187 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003188
3189 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003190 TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
3191 if (aggNode && aggNode->getOp() == EOpNull)
3192 aggNode->setOp(EOpDeclaration);
3193 (yyval.interm.intermNode) = aggNode;
John Bauman66b8ab22014-05-06 15:57:45 -04003194 }
3195 break;
3196
Alexis Hetua35d8232015-06-11 17:11:06 -04003197 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003198
3199 {
John Baumand4ae8632014-05-06 16:18:33 -04003200 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003201 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 -04003202 context->recover();
3203 }
John Bauman66b8ab22014-05-06 15:57:45 -04003204 (yyval.interm.intermNode) = 0;
3205 }
3206 break;
3207
Alexis Hetua35d8232015-06-11 17:11:06 -04003208 case 89:
3209
3210 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003211 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yylsp[(1) - (5)]), "interface blocks");
Alexis Hetue5246692015-06-18 12:34:52 -04003212 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (5)].interm.type), (yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].interm.fieldList), NULL, (yylsp[(1) - (5)]), NULL, (yylsp[(1) - (5)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04003213 }
3214 break;
3215
3216 case 90:
3217
3218 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003219 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yylsp[(1) - (6)]), "interface blocks");
Alexis Hetue5246692015-06-18 12:34:52 -04003220 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (6)].interm.type), (yylsp[(2) - (6)]), *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].interm.fieldList), (yyvsp[(5) - (6)].lex).string, (yylsp[(5) - (6)]), NULL, (yylsp[(1) - (6)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04003221 }
3222 break;
3223
3224 case 91:
3225
3226 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003227 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yylsp[(1) - (9)]), "interface blocks");
Alexis Hetue5246692015-06-18 12:34:52 -04003228 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (9)].interm.type), (yylsp[(2) - (9)]), *(yyvsp[(2) - (9)].lex).string, (yyvsp[(3) - (9)].interm.fieldList), (yyvsp[(5) - (9)].lex).string, (yylsp[(5) - (9)]), (yyvsp[(7) - (9)].interm.intermTypedNode), (yylsp[(6) - (9)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04003229 }
3230 break;
3231
3232 case 92:
3233
3234 {
3235 context->parseGlobalLayoutQualifier((yyvsp[(1) - (2)].interm.type));
3236 (yyval.interm.intermNode) = 0;
3237 }
3238 break;
3239
3240 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003241
3242 {
3243 //
3244 // Multiple declarations of the same function are allowed.
3245 //
3246 // If this is a definition, the definition production code will check for redefinitions
3247 // (we don't know at this point if it's a definition or not).
3248 //
3249 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3250 //
Alexis Hetu0a655842015-06-22 16:52:11 -04003251 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->getShaderVersion()));
John Bauman66b8ab22014-05-06 15:57:45 -04003252 if (prevDec) {
3253 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003254 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 -04003255 context->recover();
3256 }
Alexis Hetu76a343a2015-06-04 17:21:22 -04003257 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04003258 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003259 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 -04003260 context->recover();
3261 }
3262 }
3263 }
3264
3265 //
3266 // If this is a redeclaration, it could also be a definition,
3267 // in which case, we want to use the variable names from this one, and not the one that's
3268 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3269 //
3270 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003271 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003272
3273 // We're at the inner scope level of the function's arguments and body statement.
3274 // Add the function prototype to the surrounding scope instead.
3275 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3276 }
3277 break;
3278
Alexis Hetua35d8232015-06-11 17:11:06 -04003279 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003280
3281 {
3282 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3283 }
3284 break;
3285
Alexis Hetua35d8232015-06-11 17:11:06 -04003286 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003287
3288 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003289 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3290 }
3291 break;
3292
Alexis Hetua35d8232015-06-11 17:11:06 -04003293 case 96:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003294
3295 {
John Bauman66b8ab22014-05-06 15:57:45 -04003296 // Add the parameter
3297 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3298 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3299 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3300 else
3301 delete (yyvsp[(2) - (2)].interm).param.type;
3302 }
3303 break;
3304
Alexis Hetua35d8232015-06-11 17:11:06 -04003305 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003306
3307 {
3308 //
3309 // Only first parameter of one-parameter functions can be void
3310 // The check for named parameters not being void is done in parameter_declarator
3311 //
3312 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3313 //
3314 // This parameter > first is void
3315 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003316 context->error((yylsp[(2) - (3)]), "cannot be an argument type except for '(void)'", "void");
John Bauman66b8ab22014-05-06 15:57:45 -04003317 context->recover();
3318 delete (yyvsp[(3) - (3)].interm).param.type;
3319 } else {
3320 // Add the parameter
3321 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3322 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3323 }
3324 }
3325 break;
3326
Alexis Hetua35d8232015-06-11 17:11:06 -04003327 case 98:
John Bauman66b8ab22014-05-06 15:57:45 -04003328
3329 {
3330 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003331 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 -04003332 context->recover();
3333 }
3334 // make sure a sampler is not involved as well...
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003335 if (context->structQualifierErrorCheck((yylsp[(2) - (3)]), (yyvsp[(1) - (3)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003336 context->recover();
3337
3338 // Add the function as a prototype after parsing it (we do not support recursion)
3339 TFunction *function;
3340 TType type((yyvsp[(1) - (3)].interm.type));
3341 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3342 (yyval.interm.function) = function;
3343
3344 context->symbolTable.push();
3345 }
3346 break;
3347
Alexis Hetua35d8232015-06-11 17:11:06 -04003348 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003349
3350 {
3351 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003352 context->error((yylsp[(2) - (2)]), "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04003353 context->recover();
3354 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003355 if (context->reservedErrorCheck((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003356 context->recover();
3357 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003358 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003359 (yyval.interm).param = param;
3360 }
3361 break;
3362
Alexis Hetua35d8232015-06-11 17:11:06 -04003363 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003364
3365 {
3366 // Check that we can make an array out of this type
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003367 if (context->arrayTypeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003368 context->recover();
3369
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003370 if (context->reservedErrorCheck((yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003371 context->recover();
3372
3373 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003374 if (context->arraySizeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003375 context->recover();
3376 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3377
3378 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3379 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003380 (yyval.interm).line = (yylsp[(2) - (5)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003381 (yyval.interm).param = param;
3382 }
3383 break;
3384
Alexis Hetu17809052015-05-13 11:28:22 -04003385 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003386
3387 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003388 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003389 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 -04003390 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003391 }
3392 break;
3393
Alexis Hetu17809052015-05-13 11:28:22 -04003394 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003395
3396 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003397 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003398 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003399 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003400 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003401 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003402 }
3403 break;
3404
Alexis Hetu17809052015-05-13 11:28:22 -04003405 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003406
3407 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003408 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003409 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 -04003410 context->recover();
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003411 }
3412 break;
3413
Alexis Hetu17809052015-05-13 11:28:22 -04003414 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003415
3416 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003417 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003418 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003419 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003420 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003421 context->recover();
3422 }
3423 break;
3424
3425 case 105:
3426
3427 {
3428 (yyval.interm.qualifier) = EvqIn;
3429 }
3430 break;
3431
3432 case 106:
3433
3434 {
3435 (yyval.interm.qualifier) = EvqIn;
3436 }
3437 break;
3438
3439 case 107:
3440
3441 {
3442 (yyval.interm.qualifier) = EvqOut;
3443 }
3444 break;
3445
3446 case 108:
3447
3448 {
3449 (yyval.interm.qualifier) = EvqInOut;
3450 }
3451 break;
3452
3453 case 109:
3454
3455 {
John Bauman66b8ab22014-05-06 15:57:45 -04003456 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3457 (yyval.interm).param = param;
3458 }
3459 break;
3460
Alexis Hetua35d8232015-06-11 17:11:06 -04003461 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003462
3463 {
3464 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3465 }
3466 break;
3467
Alexis Hetua35d8232015-06-11 17:11:06 -04003468 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003469
3470 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003471 (yyval.interm) = (yyvsp[(1) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003472 (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 -04003473 }
3474 break;
3475
Alexis Hetua35d8232015-06-11 17:11:06 -04003476 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003477
3478 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003479 (yyval.interm) = (yyvsp[(1) - (6)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003480 (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 -04003481 }
3482 break;
3483
Alexis Hetua35d8232015-06-11 17:11:06 -04003484 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003485
3486 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003487 ES3_ONLY("[]", (yylsp[(3) - (7)]), "implicitly sized array");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003488 (yyval.interm) = (yyvsp[(1) - (7)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003489 (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 -04003490 }
3491 break;
3492
Alexis Hetua35d8232015-06-11 17:11:06 -04003493 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003494
3495 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003496 ES3_ONLY("=", (yylsp[(7) - (8)]), "first-class arrays (array initializer)");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003497 (yyval.interm) = (yyvsp[(1) - (8)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003498 (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 -04003499 }
3500 break;
3501
Alexis Hetua35d8232015-06-11 17:11:06 -04003502 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003503
3504 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003505 (yyval.interm) = (yyvsp[(1) - (5)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003506 (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 -04003507 }
3508 break;
3509
Alexis Hetua35d8232015-06-11 17:11:06 -04003510 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003511
3512 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003513 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003514 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(1) - (1)]), "");
John Bauman66b8ab22014-05-06 15:57:45 -04003515 }
3516 break;
3517
Alexis Hetua35d8232015-06-11 17:11:06 -04003518 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003519
3520 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003521 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003522 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string);
John Bauman66b8ab22014-05-06 15:57:45 -04003523 }
3524 break;
3525
Alexis Hetua35d8232015-06-11 17:11:06 -04003526 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003527
3528 {
John Bauman66b8ab22014-05-06 15:57:45 -04003529 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003530 (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 -04003531 }
3532 break;
3533
Alexis Hetua35d8232015-06-11 17:11:06 -04003534 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003535
3536 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003537 ES3_ONLY("[]", (yylsp[(3) - (6)]), "implicitly sized array");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003538 (yyval.interm).type = (yyvsp[(1) - (6)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003539 (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 -04003540 }
3541 break;
3542
Alexis Hetua35d8232015-06-11 17:11:06 -04003543 case 120:
John Bauman66b8ab22014-05-06 15:57:45 -04003544
3545 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003546 ES3_ONLY("=", (yylsp[(6) - (7)]), "first-class arrays (array initializer)");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003547 (yyval.interm).type = (yyvsp[(1) - (7)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003548 (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 -04003549 }
3550 break;
3551
Alexis Hetua35d8232015-06-11 17:11:06 -04003552 case 121:
John Bauman66b8ab22014-05-06 15:57:45 -04003553
3554 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003555 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003556 (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 -04003557 }
3558 break;
3559
Alexis Hetua35d8232015-06-11 17:11:06 -04003560 case 122:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003561
3562 {
3563 // $$.type is not used in invariant declarations.
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003564 (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 -04003565 }
3566 break;
3567
Alexis Hetua35d8232015-06-11 17:11:06 -04003568 case 123:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003569
3570 {
John Bauman66b8ab22014-05-06 15:57:45 -04003571 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3572
3573 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003574 ES3_ONLY("[]", (yylsp[(1) - (1)]), "first-class-array");
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003575 if (context->getShaderVersion() != 300) {
3576 (yyvsp[(1) - (1)].interm.type).clearArrayness();
3577 }
John Bauman66b8ab22014-05-06 15:57:45 -04003578 }
3579 }
3580 break;
3581
Alexis Hetua35d8232015-06-11 17:11:06 -04003582 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04003583
3584 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003585 (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 -04003586 }
3587 break;
3588
Alexis Hetua35d8232015-06-11 17:11:06 -04003589 case 125:
John Bauman66b8ab22014-05-06 15:57:45 -04003590
3591 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003592 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003593 }
3594 break;
3595
Alexis Hetua35d8232015-06-11 17:11:06 -04003596 case 126:
John Bauman66b8ab22014-05-06 15:57:45 -04003597
3598 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003599 (yyval.interm.type).qualifier = EvqFlat;
3600 }
3601 break;
3602
Alexis Hetua35d8232015-06-11 17:11:06 -04003603 case 127:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003604
3605 {
3606 (yyval.interm.qualifier) = EvqConstReadOnly;
3607 }
3608 break;
3609
Alexis Hetua35d8232015-06-11 17:11:06 -04003610 case 128:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003611
3612 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003613 VERTEX_ONLY("attribute", (yylsp[(1) - (1)]));
3614 ES2_ONLY("attribute", (yylsp[(1) - (1)]));
3615 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "attribute"))
John Bauman66b8ab22014-05-06 15:57:45 -04003616 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003617 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003618 }
3619 break;
3620
Alexis Hetua35d8232015-06-11 17:11:06 -04003621 case 129:
John Bauman66b8ab22014-05-06 15:57:45 -04003622
3623 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003624 ES2_ONLY("varying", (yylsp[(1) - (1)]));
3625 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003626 context->recover();
Alexis Hetu0a655842015-06-22 16:52:11 -04003627 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003628 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003629 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003630 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003631 }
3632 break;
3633
Alexis Hetua35d8232015-06-11 17:11:06 -04003634 case 130:
John Bauman66b8ab22014-05-06 15:57:45 -04003635
3636 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003637 ES2_ONLY("varying", (yylsp[(1) - (2)]));
3638 if (context->globalErrorCheck((yylsp[(1) - (2)]), context->symbolTable.atGlobalLevel(), "invariant varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003639 context->recover();
Alexis Hetu0a655842015-06-22 16:52:11 -04003640 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003641 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003642 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003643 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003644 }
3645 break;
3646
Alexis Hetua35d8232015-06-11 17:11:06 -04003647 case 131:
John Bauman66b8ab22014-05-06 15:57:45 -04003648
3649 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003650 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003651 }
3652 break;
3653
Alexis Hetua35d8232015-06-11 17:11:06 -04003654 case 132:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003655
3656 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003657 (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 -04003658 }
3659 break;
3660
Alexis Hetua35d8232015-06-11 17:11:06 -04003661 case 133:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003662
3663 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003664 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 -04003665 context->recover();
3666
3667 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003668 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003669 }
3670 break;
3671
Alexis Hetua35d8232015-06-11 17:11:06 -04003672 case 134:
John Bauman66b8ab22014-05-06 15:57:45 -04003673
3674 {
Nicolas Capens7d626792015-02-17 17:58:31 -05003675 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3676 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
3677 }
3678 break;
3679
Alexis Hetua35d8232015-06-11 17:11:06 -04003680 case 135:
Nicolas Capens7d626792015-02-17 17:58:31 -05003681
3682 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003683 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yylsp[(2) - (2)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003684 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
3685 }
3686 break;
3687
Alexis Hetua35d8232015-06-11 17:11:06 -04003688 case 136:
Nicolas Capens7d626792015-02-17 17:58:31 -05003689
3690 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003691 (yyval.interm.type).qualifier = EvqConstExpr;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003692 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003693 }
3694 break;
3695
Alexis Hetua35d8232015-06-11 17:11:06 -04003696 case 137:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003697
3698 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003699 ES3_ONLY("in", (yylsp[(1) - (1)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003700 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003701 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003702 }
3703 break;
3704
Alexis Hetua35d8232015-06-11 17:11:06 -04003705 case 138:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003706
3707 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003708 ES3_ONLY("out", (yylsp[(1) - (1)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003709 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003710 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003711 }
3712 break;
3713
Alexis Hetua35d8232015-06-11 17:11:06 -04003714 case 139:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003715
3716 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003717 ES3_ONLY("centroid in", (yylsp[(1) - (2)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003718 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003719 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003720 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 -04003721 context->recover();
3722 }
Alexis Hetu0a655842015-06-22 16:52:11 -04003723 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003724 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003725 }
3726 break;
3727
Alexis Hetua35d8232015-06-11 17:11:06 -04003728 case 140:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003729
3730 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003731 ES3_ONLY("centroid out", (yylsp[(1) - (2)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003732 if (context->getShaderType() == GL_FRAGMENT_SHADER)
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003733 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003734 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 -04003735 context->recover();
3736 }
Alexis Hetu0a655842015-06-22 16:52:11 -04003737 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003738 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003739 }
3740 break;
3741
Alexis Hetua35d8232015-06-11 17:11:06 -04003742 case 141:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003743
3744 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003745 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "uniform"))
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003746 context->recover();
3747 (yyval.interm.type).qualifier = EvqUniform;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003748 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003749 }
3750 break;
3751
Alexis Hetua35d8232015-06-11 17:11:06 -04003752 case 142:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003753
3754 {
John Bauman66b8ab22014-05-06 15:57:45 -04003755 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3756
3757 if ((yyval.interm.type).precision == EbpUndefined) {
3758 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003759 if (context->precisionErrorCheck((yylsp[(1) - (1)]), (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
John Bauman66b8ab22014-05-06 15:57:45 -04003760 context->recover();
3761 }
3762 }
3763 }
3764 break;
3765
Alexis Hetua35d8232015-06-11 17:11:06 -04003766 case 143:
John Bauman66b8ab22014-05-06 15:57:45 -04003767
3768 {
3769 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3770 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
3771 }
3772 break;
3773
Alexis Hetua35d8232015-06-11 17:11:06 -04003774 case 144:
John Bauman66b8ab22014-05-06 15:57:45 -04003775
3776 {
3777 (yyval.interm.precision) = EbpHigh;
3778 }
3779 break;
3780
Alexis Hetua35d8232015-06-11 17:11:06 -04003781 case 145:
John Bauman66b8ab22014-05-06 15:57:45 -04003782
3783 {
3784 (yyval.interm.precision) = EbpMedium;
3785 }
3786 break;
3787
Alexis Hetua35d8232015-06-11 17:11:06 -04003788 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04003789
3790 {
3791 (yyval.interm.precision) = EbpLow;
3792 }
3793 break;
3794
Alexis Hetua35d8232015-06-11 17:11:06 -04003795 case 147:
Nicolas Capens7d626792015-02-17 17:58:31 -05003796
3797 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003798 ES3_ONLY("layout", (yylsp[(1) - (4)]), "qualifier");
Nicolas Capens7d626792015-02-17 17:58:31 -05003799 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
3800 }
3801 break;
3802
Alexis Hetua35d8232015-06-11 17:11:06 -04003803 case 148:
Nicolas Capens7d626792015-02-17 17:58:31 -05003804
3805 {
3806 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
3807 }
3808 break;
3809
Alexis Hetua35d8232015-06-11 17:11:06 -04003810 case 149:
Nicolas Capens7d626792015-02-17 17:58:31 -05003811
3812 {
3813 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
3814 }
3815 break;
3816
Alexis Hetua35d8232015-06-11 17:11:06 -04003817 case 150:
Nicolas Capens7d626792015-02-17 17:58:31 -05003818
3819 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003820 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003821 }
3822 break;
3823
Alexis Hetua35d8232015-06-11 17:11:06 -04003824 case 151:
John Bauman66b8ab22014-05-06 15:57:45 -04003825
3826 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003827 (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 -04003828 }
3829 break;
3830
Alexis Hetua35d8232015-06-11 17:11:06 -04003831 case 152:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003832
3833 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003834 (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 -04003835 }
3836 break;
3837
Alexis Hetua35d8232015-06-11 17:11:06 -04003838 case 153:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003839
3840 {
John Bauman66b8ab22014-05-06 15:57:45 -04003841 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3842 }
3843 break;
3844
Alexis Hetua35d8232015-06-11 17:11:06 -04003845 case 154:
John Bauman66b8ab22014-05-06 15:57:45 -04003846
3847 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003848 ES3_ONLY("[]", (yylsp[(2) - (3)]), "implicitly sized array");
Alexis Hetue5246692015-06-18 12:34:52 -04003849 (yyval.interm.type) = (yyvsp[(1) - (3)].interm.type);
3850 (yyval.interm.type).setArray(true, 0);
3851 }
3852 break;
3853
3854 case 155:
3855
3856 {
John Bauman66b8ab22014-05-06 15:57:45 -04003857 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3858
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003859 if (context->arrayTypeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003860 context->recover();
3861 else {
3862 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003863 if (context->arraySizeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003864 context->recover();
3865 (yyval.interm.type).setArray(true, size);
3866 }
3867 }
3868 break;
3869
Alexis Hetue5246692015-06-18 12:34:52 -04003870 case 156:
Alexis Hetu17809052015-05-13 11:28:22 -04003871
3872 {
3873 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003874 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003875 }
3876 break;
3877
Alexis Hetu17809052015-05-13 11:28:22 -04003878 case 157:
3879
3880 {
3881 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003882 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003883 }
3884 break;
3885
3886 case 158:
3887
3888 {
3889 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003890 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003891 }
3892 break;
3893
3894 case 159:
3895
3896 {
3897 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003898 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003899 }
3900 break;
3901
3902 case 160:
3903
3904 {
3905 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003906 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04003907 }
3908 break;
3909
3910 case 161:
3911
3912 {
3913 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003914 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003915 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003916 }
3917 break;
3918
3919 case 162:
3920
3921 {
3922 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003923 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003924 (yyval.interm.type).setAggregate(3);
Alexis Hetua35d8232015-06-11 17:11:06 -04003925 }
3926 break;
3927
3928 case 163:
3929
3930 {
3931 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003932 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
3933 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04003934 }
3935 break;
3936
3937 case 164:
3938
3939 {
3940 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003941 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003942 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003943 }
3944 break;
3945
3946 case 165:
3947
3948 {
3949 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003950 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003951 (yyval.interm.type).setAggregate(3);
Alexis Hetu17809052015-05-13 11:28:22 -04003952 }
3953 break;
3954
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003955 case 166:
3956
3957 {
3958 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003959 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
3960 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04003961 }
3962 break;
3963
3964 case 167:
3965
3966 {
3967 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003968 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003969 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003970 }
3971 break;
3972
3973 case 168:
3974
3975 {
3976 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003977 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003978 (yyval.interm.type).setAggregate(3);
Alexis Hetua35d8232015-06-11 17:11:06 -04003979 }
3980 break;
3981
3982 case 169:
3983
3984 {
3985 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003986 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
3987 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04003988 }
3989 break;
3990
3991 case 170:
3992
3993 {
3994 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003995 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003996 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003997 }
3998 break;
3999
4000 case 171:
4001
4002 {
4003 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004004 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004005 (yyval.interm.type).setAggregate(3);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004006 }
4007 break;
4008
Alexis Hetua35d8232015-06-11 17:11:06 -04004009 case 172:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004010
4011 {
Alexis Hetue5246692015-06-18 12:34:52 -04004012 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4013 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
4014 (yyval.interm.type).setAggregate(4);
4015 }
4016 break;
4017
4018 case 173:
4019
4020 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004021 FRAG_VERT_ONLY("mat2", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004022 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004023 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004024 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004025 }
4026 break;
4027
Alexis Hetue5246692015-06-18 12:34:52 -04004028 case 174:
John Bauman66b8ab22014-05-06 15:57:45 -04004029
4030 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004031 FRAG_VERT_ONLY("mat3", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004032 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004033 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004034 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004035 }
4036 break;
4037
Alexis Hetue5246692015-06-18 12:34:52 -04004038 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004039
4040 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004041 FRAG_VERT_ONLY("mat4", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004042 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004043 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004044 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004045 }
4046 break;
4047
Alexis Hetue5246692015-06-18 12:34:52 -04004048 case 176:
John Bauman66b8ab22014-05-06 15:57:45 -04004049
4050 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004051 FRAG_VERT_ONLY("mat2x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004052 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004053 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004054 (yyval.interm.type).setMatrix(2, 3);
4055 }
4056 break;
4057
Alexis Hetue5246692015-06-18 12:34:52 -04004058 case 177:
Alexis Hetub14178b2015-04-13 13:23:20 -04004059
4060 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004061 FRAG_VERT_ONLY("mat3x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004062 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004063 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004064 (yyval.interm.type).setMatrix(3, 2);
4065 }
4066 break;
4067
Alexis Hetue5246692015-06-18 12:34:52 -04004068 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004069
4070 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004071 FRAG_VERT_ONLY("mat2x4", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004072 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004073 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004074 (yyval.interm.type).setMatrix(2, 4);
4075 }
4076 break;
4077
Alexis Hetue5246692015-06-18 12:34:52 -04004078 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004079
4080 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004081 FRAG_VERT_ONLY("mat4x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004082 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004083 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004084 (yyval.interm.type).setMatrix(4, 2);
4085 }
4086 break;
4087
Alexis Hetue5246692015-06-18 12:34:52 -04004088 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004089
4090 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004091 FRAG_VERT_ONLY("mat3x4", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004092 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004093 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004094 (yyval.interm.type).setMatrix(3, 4);
4095 }
4096 break;
4097
Alexis Hetue5246692015-06-18 12:34:52 -04004098 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004099
4100 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004101 FRAG_VERT_ONLY("mat4x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004102 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004103 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004104 (yyval.interm.type).setMatrix(4, 3);
4105 }
4106 break;
4107
Alexis Hetue5246692015-06-18 12:34:52 -04004108 case 182:
Alexis Hetub14178b2015-04-13 13:23:20 -04004109
4110 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004111 FRAG_VERT_ONLY("sampler2D", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004112 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004113 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004114 }
4115 break;
4116
Alexis Hetue5246692015-06-18 12:34:52 -04004117 case 183:
John Bauman66b8ab22014-05-06 15:57:45 -04004118
4119 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004120 FRAG_VERT_ONLY("samplerCube", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004121 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004122 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004123 }
4124 break;
4125
Alexis Hetue5246692015-06-18 12:34:52 -04004126 case 184:
John Bauman66b8ab22014-05-06 15:57:45 -04004127
4128 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004129 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004130 context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES", "");
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004131 context->recover();
4132 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004133 FRAG_VERT_ONLY("samplerExternalOES", (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004134 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004135 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004136 }
4137 break;
4138
Alexis Hetue5246692015-06-18 12:34:52 -04004139 case 185:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004140
4141 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004142 FRAG_VERT_ONLY("sampler3D", (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004143 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004144 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004145 }
4146 break;
4147
Alexis Hetue5246692015-06-18 12:34:52 -04004148 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004149
4150 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004151 FRAG_VERT_ONLY("sampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004152 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004153 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004154 }
4155 break;
4156
Alexis Hetue5246692015-06-18 12:34:52 -04004157 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004158
4159 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004160 FRAG_VERT_ONLY("isampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004161 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004162 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004163 }
4164 break;
4165
Alexis Hetue5246692015-06-18 12:34:52 -04004166 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004167
4168 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004169 FRAG_VERT_ONLY("isampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004170 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004171 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004172 }
4173 break;
4174
Alexis Hetue5246692015-06-18 12:34:52 -04004175 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004176
4177 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004178 FRAG_VERT_ONLY("isamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004179 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004180 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004181 }
4182 break;
4183
Alexis Hetue5246692015-06-18 12:34:52 -04004184 case 190:
Alexis Hetub14178b2015-04-13 13:23:20 -04004185
4186 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004187 FRAG_VERT_ONLY("isampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004188 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004189 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004190 }
4191 break;
4192
Alexis Hetue5246692015-06-18 12:34:52 -04004193 case 191:
Alexis Hetub14178b2015-04-13 13:23:20 -04004194
4195 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004196 FRAG_VERT_ONLY("usampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004197 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004198 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004199 }
4200 break;
4201
Alexis Hetue5246692015-06-18 12:34:52 -04004202 case 192:
Alexis Hetub14178b2015-04-13 13:23:20 -04004203
4204 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004205 FRAG_VERT_ONLY("usampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004206 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004207 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004208 }
4209 break;
4210
Alexis Hetue5246692015-06-18 12:34:52 -04004211 case 193:
Alexis Hetub14178b2015-04-13 13:23:20 -04004212
4213 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004214 FRAG_VERT_ONLY("usamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004215 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004216 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004217 }
4218 break;
4219
Alexis Hetue5246692015-06-18 12:34:52 -04004220 case 194:
Alexis Hetub14178b2015-04-13 13:23:20 -04004221
4222 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004223 FRAG_VERT_ONLY("usampler2DArray", (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(EbtUSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004226 }
4227 break;
4228
Alexis Hetue5246692015-06-18 12:34:52 -04004229 case 195:
Alexis Hetub14178b2015-04-13 13:23:20 -04004230
4231 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004232 FRAG_VERT_ONLY("sampler2DShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004233 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004234 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004235 }
4236 break;
4237
Alexis Hetue5246692015-06-18 12:34:52 -04004238 case 196:
Alexis Hetub14178b2015-04-13 13:23:20 -04004239
4240 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004241 FRAG_VERT_ONLY("samplerCubeShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004242 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004243 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004244 }
4245 break;
4246
Alexis Hetue5246692015-06-18 12:34:52 -04004247 case 197:
Alexis Hetub14178b2015-04-13 13:23:20 -04004248
4249 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004250 FRAG_VERT_ONLY("sampler2DArrayShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004251 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004252 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004253 }
4254 break;
4255
Alexis Hetue5246692015-06-18 12:34:52 -04004256 case 198:
Alexis Hetub027aa92015-01-19 15:56:12 -05004257
4258 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004259 FRAG_VERT_ONLY("struct", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004260 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4261 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4262 }
4263 break;
4264
Alexis Hetue5246692015-06-18 12:34:52 -04004265 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004266
4267 {
4268 //
4269 // This is for user defined type names. The lexical phase looked up the
4270 // type.
4271 //
4272 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4273 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004274 (yyval.interm.type).setBasic(EbtStruct, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004275 (yyval.interm.type).userDef = &structure;
4276 }
4277 break;
4278
Alexis Hetue5246692015-06-18 12:34:52 -04004279 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004280
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004281 { if (context->enterStructDeclaration((yylsp[(2) - (3)]), *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004282 break;
4283
Alexis Hetue5246692015-06-18 12:34:52 -04004284 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004285
4286 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004287 (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 -04004288 }
4289 break;
4290
Alexis Hetue5246692015-06-18 12:34:52 -04004291 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004292
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004293 { if (context->enterStructDeclaration((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004294 break;
4295
Alexis Hetue5246692015-06-18 12:34:52 -04004296 case 203:
John Bauman66b8ab22014-05-06 15:57:45 -04004297
4298 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004299 (yyval.interm.type) = context->addStructure((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004300 }
4301 break;
4302
Alexis Hetue5246692015-06-18 12:34:52 -04004303 case 204:
John Bauman66b8ab22014-05-06 15:57:45 -04004304
4305 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004306 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
John Bauman66b8ab22014-05-06 15:57:45 -04004307 }
4308 break;
4309
Alexis Hetue5246692015-06-18 12:34:52 -04004310 case 205:
John Bauman66b8ab22014-05-06 15:57:45 -04004311
4312 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004313 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
4314 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) {
4315 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i];
4316 for (unsigned int j = 0; j < (yyval.interm.fieldList)->size(); ++j) {
4317 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) {
4318 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 -04004319 context->recover();
4320 }
4321 }
Alexis Hetua8b364b2015-06-10 11:48:40 -04004322 (yyval.interm.fieldList)->push_back((*(yyvsp[(2) - (2)].interm.fieldList))[i]);
John Bauman66b8ab22014-05-06 15:57:45 -04004323 }
4324 }
4325 break;
4326
Alexis Hetue5246692015-06-18 12:34:52 -04004327 case 206:
John Bauman66b8ab22014-05-06 15:57:45 -04004328
4329 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004330 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004331 }
4332 break;
4333
Alexis Hetue5246692015-06-18 12:34:52 -04004334 case 207:
John Bauman66b8ab22014-05-06 15:57:45 -04004335
4336 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004337 // ES3 Only, but errors should be handled elsewhere
4338 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4339 (yyvsp[(2) - (4)].interm.type).layoutQualifier = (yyvsp[(1) - (4)].interm.type).layoutQualifier;
4340 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.fieldList));
4341 }
4342 break;
4343
Alexis Hetue5246692015-06-18 12:34:52 -04004344 case 208:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004345
4346 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004347 (yyval.interm.fieldList) = NewPoolTFieldList();
4348 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004349 }
4350 break;
4351
Alexis Hetue5246692015-06-18 12:34:52 -04004352 case 209:
John Bauman66b8ab22014-05-06 15:57:45 -04004353
4354 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004355 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004356 }
4357 break;
4358
Alexis Hetue5246692015-06-18 12:34:52 -04004359 case 210:
John Bauman66b8ab22014-05-06 15:57:45 -04004360
4361 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004362 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004363 context->recover();
4364
Alexis Hetua8b364b2015-06-10 11:48:40 -04004365 TType* type = new TType(EbtVoid, EbpUndefined);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004366 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004367 }
4368 break;
4369
Alexis Hetue5246692015-06-18 12:34:52 -04004370 case 211:
John Bauman66b8ab22014-05-06 15:57:45 -04004371
4372 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004373 if (context->reservedErrorCheck((yylsp[(1) - (4)]), *(yyvsp[(1) - (4)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004374 context->recover();
4375
Alexis Hetua8b364b2015-06-10 11:48:40 -04004376 TType* type = new TType(EbtVoid, EbpUndefined);
John Bauman66b8ab22014-05-06 15:57:45 -04004377 int size;
Alexis Hetua8b364b2015-06-10 11:48:40 -04004378 if (context->arraySizeErrorCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLine(), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04004379 context->recover();
Alexis Hetua8b364b2015-06-10 11:48:40 -04004380 type->setArraySize(size);
4381
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004382 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yylsp[(1) - (4)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004383 }
4384 break;
4385
Alexis Hetue5246692015-06-18 12:34:52 -04004386 case 212:
Nicolas Capens7d626792015-02-17 17:58:31 -05004387
Alexis Hetua35d8232015-06-11 17:11:06 -04004388 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004389 break;
4390
Alexis Hetu17809052015-05-13 11:28:22 -04004391 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004392
Alexis Hetue5246692015-06-18 12:34:52 -04004393 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004394 break;
4395
Alexis Hetu17809052015-05-13 11:28:22 -04004396 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004397
Alexis Hetue5246692015-06-18 12:34:52 -04004398 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004399 break;
4400
Alexis Hetu17809052015-05-13 11:28:22 -04004401 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004402
Alexis Hetua35d8232015-06-11 17:11:06 -04004403 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetuad6b8752015-06-09 16:15:30 -04004404 break;
4405
4406 case 216:
4407
Alexis Hetua35d8232015-06-11 17:11:06 -04004408 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004409 break;
4410
4411 case 217:
4412
Alexis Hetua35d8232015-06-11 17:11:06 -04004413 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004414 break;
4415
4416 case 218:
4417
Alexis Hetue5246692015-06-18 12:34:52 -04004418 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004419 break;
4420
4421 case 219:
4422
Alexis Hetue5246692015-06-18 12:34:52 -04004423 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermSwitch); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004424 break;
4425
4426 case 220:
4427
Alexis Hetue5246692015-06-18 12:34:52 -04004428 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermCase); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004429 break;
4430
4431 case 221:
4432
Alexis Hetu76a343a2015-06-04 17:21:22 -04004433 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004434 break;
4435
4436 case 222:
4437
Alexis Hetue5246692015-06-18 12:34:52 -04004438 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004439 break;
4440
4441 case 223:
4442
Alexis Hetue5246692015-06-18 12:34:52 -04004443 { (yyval.interm.intermAggregate) = 0; }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004444 break;
4445
4446 case 224:
4447
Alexis Hetue5246692015-06-18 12:34:52 -04004448 { context->symbolTable.push(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004449 break;
4450
4451 case 225:
4452
Alexis Hetue5246692015-06-18 12:34:52 -04004453 { context->symbolTable.pop(); }
4454 break;
4455
4456 case 226:
4457
Nicolas Capens7d626792015-02-17 17:58:31 -05004458 {
4459 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4460 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004461 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yylsp[(5) - (5)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05004462 }
4463 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4464 }
4465 break;
4466
Alexis Hetua35d8232015-06-11 17:11:06 -04004467 case 227:
4468
Alexis Hetu76a343a2015-06-04 17:21:22 -04004469 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004470 break;
4471
4472 case 228:
4473
Alexis Hetue5246692015-06-18 12:34:52 -04004474 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004475 break;
4476
4477 case 229:
4478
Alexis Hetue5246692015-06-18 12:34:52 -04004479 { context->symbolTable.push(); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004480 break;
4481
4482 case 230:
4483
Alexis Hetue5246692015-06-18 12:34:52 -04004484 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004485 break;
4486
4487 case 231:
4488
Alexis Hetue5246692015-06-18 12:34:52 -04004489 { context->symbolTable.push(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004490 break;
4491
4492 case 232:
4493
Alexis Hetue5246692015-06-18 12:34:52 -04004494 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4495 break;
4496
4497 case 233:
4498
John Bauman66b8ab22014-05-06 15:57:45 -04004499 {
4500 (yyval.interm.intermNode) = 0;
4501 }
4502 break;
4503
Alexis Hetue5246692015-06-18 12:34:52 -04004504 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004505
4506 {
4507 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4508 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004509 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yylsp[(3) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004510 }
4511 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4512 }
4513 break;
4514
Alexis Hetue5246692015-06-18 12:34:52 -04004515 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004516
4517 {
4518 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4519 }
4520 break;
4521
Alexis Hetue5246692015-06-18 12:34:52 -04004522 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004523
4524 {
4525 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4526 }
4527 break;
4528
Alexis Hetue5246692015-06-18 12:34:52 -04004529 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04004530
4531 { (yyval.interm.intermNode) = 0; }
4532 break;
4533
Alexis Hetue5246692015-06-18 12:34:52 -04004534 case 238:
John Bauman66b8ab22014-05-06 15:57:45 -04004535
4536 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4537 break;
4538
Alexis Hetue5246692015-06-18 12:34:52 -04004539 case 239:
John Bauman66b8ab22014-05-06 15:57:45 -04004540
4541 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004542 if (context->boolErrorCheck((yylsp[(1) - (5)]), (yyvsp[(3) - (5)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004543 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004544 (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 -04004545 }
4546 break;
4547
Alexis Hetue5246692015-06-18 12:34:52 -04004548 case 240:
John Bauman66b8ab22014-05-06 15:57:45 -04004549
4550 {
4551 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4552 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4553 }
4554 break;
4555
Alexis Hetue5246692015-06-18 12:34:52 -04004556 case 241:
John Bauman66b8ab22014-05-06 15:57:45 -04004557
4558 {
4559 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4560 (yyval.interm.nodePair).node2 = 0;
4561 }
4562 break;
4563
Alexis Hetu76a343a2015-06-04 17:21:22 -04004564 case 242:
4565
Alexis Hetue5246692015-06-18 12:34:52 -04004566 { context->incrSwitchNestingLevel(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004567 break;
4568
4569 case 243:
4570
4571 {
Alexis Hetue5246692015-06-18 12:34:52 -04004572 (yyval.interm.intermSwitch) = context->addSwitch((yyvsp[(3) - (6)].interm.intermTypedNode), (yyvsp[(6) - (6)].interm.intermAggregate), (yylsp[(1) - (6)]));
4573 context->decrSwitchNestingLevel();
Alexis Hetu76a343a2015-06-04 17:21:22 -04004574 }
4575 break;
4576
4577 case 244:
4578
4579 {
Alexis Hetue5246692015-06-18 12:34:52 -04004580 (yyval.interm.intermCase) = context->addCase((yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
Alexis Hetu76a343a2015-06-04 17:21:22 -04004581 }
4582 break;
4583
4584 case 245:
John Bauman66b8ab22014-05-06 15:57:45 -04004585
4586 {
Alexis Hetue5246692015-06-18 12:34:52 -04004587 (yyval.interm.intermCase) = context->addDefault((yylsp[(1) - (2)]));
4588 }
4589 break;
4590
4591 case 246:
4592
4593 {
John Bauman66b8ab22014-05-06 15:57:45 -04004594 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4595 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4596 context->recover();
4597 }
4598 break;
4599
Alexis Hetue5246692015-06-18 12:34:52 -04004600 case 247:
John Bauman66b8ab22014-05-06 15:57:45 -04004601
4602 {
4603 TIntermNode* intermNode;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004604 if (context->structQualifierErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004605 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004606 if (context->boolErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004607 context->recover();
4608
Alexis Hetue5246692015-06-18 12:34:52 -04004609 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 -04004610 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4611 else {
4612 context->recover();
4613 (yyval.interm.intermTypedNode) = 0;
4614 }
4615 }
4616 break;
4617
Alexis Hetue5246692015-06-18 12:34:52 -04004618 case 248:
John Bauman66b8ab22014-05-06 15:57:45 -04004619
Alexis Hetu0a655842015-06-22 16:52:11 -04004620 { context->symbolTable.push(); context->incrLoopNestingLevel(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004621 break;
4622
Alexis Hetue5246692015-06-18 12:34:52 -04004623 case 249:
John Bauman66b8ab22014-05-06 15:57:45 -04004624
4625 {
4626 context->symbolTable.pop();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004627 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yylsp[(1) - (6)]));
Alexis Hetu0a655842015-06-22 16:52:11 -04004628 context->decrLoopNestingLevel();
John Bauman66b8ab22014-05-06 15:57:45 -04004629 }
4630 break;
4631
Alexis Hetue5246692015-06-18 12:34:52 -04004632 case 250:
John Bauman66b8ab22014-05-06 15:57:45 -04004633
Alexis Hetu0a655842015-06-22 16:52:11 -04004634 { context->incrLoopNestingLevel(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004635 break;
4636
Alexis Hetue5246692015-06-18 12:34:52 -04004637 case 251:
John Bauman66b8ab22014-05-06 15:57:45 -04004638
4639 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004640 if (context->boolErrorCheck((yylsp[(8) - (8)]), (yyvsp[(6) - (8)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004641 context->recover();
4642
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004643 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yylsp[(4) - (8)]));
Alexis Hetu0a655842015-06-22 16:52:11 -04004644 context->decrLoopNestingLevel();
John Bauman66b8ab22014-05-06 15:57:45 -04004645 }
4646 break;
4647
Alexis Hetu76a343a2015-06-04 17:21:22 -04004648 case 252:
Alexis Hetub027aa92015-01-19 15:56:12 -05004649
Alexis Hetu0a655842015-06-22 16:52:11 -04004650 { context->symbolTable.push(); context->incrLoopNestingLevel(); }
Nicolas Capens3c20f802015-02-17 17:17:20 -05004651 break;
4652
Alexis Hetu76a343a2015-06-04 17:21:22 -04004653 case 253:
Alexis Hetu17809052015-05-13 11:28:22 -04004654
4655 {
Alexis Hetue5246692015-06-18 12:34:52 -04004656 context->symbolTable.pop();
4657 (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 Hetu0a655842015-06-22 16:52:11 -04004658 context->decrLoopNestingLevel();
Alexis Hetu17809052015-05-13 11:28:22 -04004659 }
4660 break;
4661
Alexis Hetu76a343a2015-06-04 17:21:22 -04004662 case 254:
Alexis Hetu17809052015-05-13 11:28:22 -04004663
4664 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004665 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetuad6b8752015-06-09 16:15:30 -04004666 }
4667 break;
4668
Alexis Hetu76a343a2015-06-04 17:21:22 -04004669 case 255:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004670
4671 {
Alexis Hetue5246692015-06-18 12:34:52 -04004672 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004673 }
4674 break;
4675
Alexis Hetu76a343a2015-06-04 17:21:22 -04004676 case 256:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004677
4678 {
Alexis Hetue5246692015-06-18 12:34:52 -04004679 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004680 }
4681 break;
4682
Alexis Hetu76a343a2015-06-04 17:21:22 -04004683 case 257:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004684
4685 {
Alexis Hetue5246692015-06-18 12:34:52 -04004686 (yyval.interm.intermTypedNode) = 0;
4687 }
4688 break;
4689
4690 case 258:
4691
4692 {
Alexis Hetu17809052015-05-13 11:28:22 -04004693 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4694 (yyval.interm.nodePair).node2 = 0;
4695 }
4696 break;
4697
Alexis Hetue5246692015-06-18 12:34:52 -04004698 case 259:
Alexis Hetu17809052015-05-13 11:28:22 -04004699
4700 {
4701 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4702 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
4703 }
4704 break;
4705
Alexis Hetue5246692015-06-18 12:34:52 -04004706 case 260:
Alexis Hetu17809052015-05-13 11:28:22 -04004707
4708 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004709 (yyval.interm.intermNode) = context->addBranch(EOpContinue, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004710 }
4711 break;
4712
Alexis Hetue5246692015-06-18 12:34:52 -04004713 case 261:
Alexis Hetu17809052015-05-13 11:28:22 -04004714
4715 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004716 (yyval.interm.intermNode) = context->addBranch(EOpBreak, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004717 }
4718 break;
4719
Alexis Hetue5246692015-06-18 12:34:52 -04004720 case 262:
Alexis Hetu17809052015-05-13 11:28:22 -04004721
4722 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004723 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004724 }
4725 break;
4726
Alexis Hetue5246692015-06-18 12:34:52 -04004727 case 263:
Alexis Hetu17809052015-05-13 11:28:22 -04004728
4729 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004730 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004731 }
4732 break;
4733
Alexis Hetue5246692015-06-18 12:34:52 -04004734 case 264:
Alexis Hetu17809052015-05-13 11:28:22 -04004735
4736 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004737 FRAG_ONLY("discard", (yylsp[(1) - (2)]));
4738 (yyval.interm.intermNode) = context->addBranch(EOpKill, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004739 }
4740 break;
4741
Alexis Hetu76a343a2015-06-04 17:21:22 -04004742 case 265:
Alexis Hetu17809052015-05-13 11:28:22 -04004743
4744 {
Alexis Hetue5246692015-06-18 12:34:52 -04004745 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetu0a655842015-06-22 16:52:11 -04004746 context->setTreeRoot((yyval.interm.intermNode));
Alexis Hetu17809052015-05-13 11:28:22 -04004747 }
4748 break;
4749
Alexis Hetu76a343a2015-06-04 17:21:22 -04004750 case 266:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004751
4752 {
Alexis Hetue5246692015-06-18 12:34:52 -04004753 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
Alexis Hetu0a655842015-06-22 16:52:11 -04004754 context->setTreeRoot((yyval.interm.intermNode));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004755 }
4756 break;
4757
Alexis Hetu76a343a2015-06-04 17:21:22 -04004758 case 267:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004759
4760 {
4761 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4762 }
4763 break;
4764
Alexis Hetu76a343a2015-06-04 17:21:22 -04004765 case 268:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004766
4767 {
Alexis Hetue5246692015-06-18 12:34:52 -04004768 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4769 }
4770 break;
4771
4772 case 269:
4773
4774 {
John Bauman66b8ab22014-05-06 15:57:45 -04004775 TFunction* function = (yyvsp[(1) - (1)].interm).function;
4776
Alexis Hetu0a655842015-06-22 16:52:11 -04004777 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->getShaderVersion());
John Bauman66b8ab22014-05-06 15:57:45 -04004778
4779 if (builtIn)
4780 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004781 context->error((yylsp[(1) - (1)]), "built-in functions cannot be redefined", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004782 context->recover();
4783 }
4784
Alexis Hetu0a655842015-06-22 16:52:11 -04004785 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->getShaderVersion()));
John Bauman66b8ab22014-05-06 15:57:45 -04004786 //
4787 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4788 // as it would have just been put in the symbol table. Otherwise, we're looking up
4789 // an earlier occurance.
4790 //
4791 if (prevDec->isDefined()) {
4792 //
4793 // Then this function already has a body.
4794 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004795 context->error((yylsp[(1) - (1)]), "function already has a body", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004796 context->recover();
4797 }
4798 prevDec->setDefined();
4799
4800 //
4801 // Raise error message if main function takes any parameters or return anything other than void
4802 //
4803 if (function->getName() == "main") {
4804 if (function->getParamCount() > 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004805 context->error((yylsp[(1) - (1)]), "function cannot take any parameter(s)", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004806 context->recover();
4807 }
4808 if (function->getReturnType().getBasicType() != EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004809 context->error((yylsp[(1) - (1)]), "", function->getReturnType().getBasicString(), "main function cannot return a value");
John Bauman66b8ab22014-05-06 15:57:45 -04004810 context->recover();
4811 }
4812 }
4813
4814 //
4815 // Remember the return type for later checking for RETURN statements.
4816 //
Alexis Hetu0a655842015-06-22 16:52:11 -04004817 context->setCurrentFunctionType(&(prevDec->getReturnType()));
4818 context->setFunctionReturnsValue(false);
John Bauman66b8ab22014-05-06 15:57:45 -04004819
4820 //
4821 // Insert parameters into the symbol table.
4822 // If the parameter has no name, it's not an error, just don't insert it
4823 // (could be used for unused args).
4824 //
4825 // Also, accumulate the list of parameters into the HIL, so lower level code
4826 // knows where to find parameters.
4827 //
4828 TIntermAggregate* paramNodes = new TIntermAggregate;
Alexis Hetu76a343a2015-06-04 17:21:22 -04004829 for (size_t i = 0; i < function->getParamCount(); i++) {
John Bauman66b8ab22014-05-06 15:57:45 -04004830 const TParameter& param = function->getParam(i);
4831 if (param.name != 0) {
4832 TVariable *variable = new TVariable(param.name, *param.type);
4833 //
4834 // Insert the parameters with name in the symbol table.
4835 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05004836 if (! context->symbolTable.declare(*variable)) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004837 context->error((yylsp[(1) - (1)]), "redefinition", variable->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004838 context->recover();
4839 delete variable;
4840 }
4841
4842 //
4843 // Add the parameter to the HIL
4844 //
4845 paramNodes = context->intermediate.growAggregate(
4846 paramNodes,
4847 context->intermediate.addSymbol(variable->getUniqueId(),
4848 variable->getName(),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004849 variable->getType(), (yylsp[(1) - (1)])),
4850 (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004851 } else {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004852 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (1)])), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004853 }
4854 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004855 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004856 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
Alexis Hetu0a655842015-06-22 16:52:11 -04004857 context->setLoopNestingLevel(0);
John Bauman66b8ab22014-05-06 15:57:45 -04004858 }
4859 break;
4860
Alexis Hetue5246692015-06-18 12:34:52 -04004861 case 270:
John Bauman66b8ab22014-05-06 15:57:45 -04004862
4863 {
4864 //?? Check that all paths return a value if return type != void ?
4865 // May be best done as post process phase on intermediate code
Alexis Hetu0a655842015-06-22 16:52:11 -04004866 if (context->getCurrentFunctionType()->getBasicType() != EbtVoid && ! context->getFunctionReturnsValue()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004867 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 -04004868 context->recover();
4869 }
4870
4871 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004872 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yylsp[(1) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004873 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4874 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4875
4876 // store the pragma information for debug and optimize and other vendor specific
4877 // information. This information can be queried from the parse tree
4878 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4879 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
4880
4881 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4882 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
4883
4884 context->symbolTable.pop();
4885 }
4886 break;
4887
4888
4889
4890 default: break;
4891 }
4892 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4893
4894 YYPOPSTACK (yylen);
4895 yylen = 0;
4896 YY_STACK_PRINT (yyss, yyssp);
4897
4898 *++yyvsp = yyval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004899 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04004900
4901 /* Now `shift' the result of the reduction. Determine what state
4902 that goes to, based on the state we popped back to and the rule
4903 number reduced by. */
4904
4905 yyn = yyr1[yyn];
4906
4907 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4908 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4909 yystate = yytable[yystate];
4910 else
4911 yystate = yydefgoto[yyn - YYNTOKENS];
4912
4913 goto yynewstate;
4914
4915
4916/*------------------------------------.
4917| yyerrlab -- here on detecting error |
4918`------------------------------------*/
4919yyerrlab:
4920 /* If not already recovering from an error, report this error. */
4921 if (!yyerrstatus)
4922 {
4923 ++yynerrs;
4924#if ! YYERROR_VERBOSE
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004925 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04004926#else
4927 {
4928 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4929 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4930 {
4931 YYSIZE_T yyalloc = 2 * yysize;
4932 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4933 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4934 if (yymsg != yymsgbuf)
4935 YYSTACK_FREE (yymsg);
4936 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4937 if (yymsg)
4938 yymsg_alloc = yyalloc;
4939 else
4940 {
4941 yymsg = yymsgbuf;
4942 yymsg_alloc = sizeof yymsgbuf;
4943 }
4944 }
4945
4946 if (0 < yysize && yysize <= yymsg_alloc)
4947 {
4948 (void) yysyntax_error (yymsg, yystate, yychar);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004949 yyerror (&yylloc, context, yymsg);
John Bauman66b8ab22014-05-06 15:57:45 -04004950 }
4951 else
4952 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004953 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04004954 if (yysize != 0)
4955 goto yyexhaustedlab;
4956 }
4957 }
4958#endif
4959 }
4960
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004961 yyerror_range[0] = yylloc;
John Bauman66b8ab22014-05-06 15:57:45 -04004962
4963 if (yyerrstatus == 3)
4964 {
4965 /* If just tried and failed to reuse lookahead token after an
4966 error, discard it. */
4967
4968 if (yychar <= YYEOF)
4969 {
4970 /* Return failure if at end of input. */
4971 if (yychar == YYEOF)
4972 YYABORT;
4973 }
4974 else
4975 {
4976 yydestruct ("Error: discarding",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004977 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04004978 yychar = YYEMPTY;
4979 }
4980 }
4981
4982 /* Else will try to reuse lookahead token after shifting the error
4983 token. */
4984 goto yyerrlab1;
4985
4986
4987/*---------------------------------------------------.
4988| yyerrorlab -- error raised explicitly by YYERROR. |
4989`---------------------------------------------------*/
4990yyerrorlab:
4991
4992 /* Pacify compilers like GCC when the user code never invokes
4993 YYERROR and the label yyerrorlab therefore never appears in user
4994 code. */
4995 if (/*CONSTCOND*/ 0)
4996 goto yyerrorlab;
4997
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004998 yyerror_range[0] = yylsp[1-yylen];
John Bauman66b8ab22014-05-06 15:57:45 -04004999 /* Do not reclaim the symbols of the rule which action triggered
5000 this YYERROR. */
5001 YYPOPSTACK (yylen);
5002 yylen = 0;
5003 YY_STACK_PRINT (yyss, yyssp);
5004 yystate = *yyssp;
5005 goto yyerrlab1;
5006
5007
5008/*-------------------------------------------------------------.
5009| yyerrlab1 -- common code for both syntax error and YYERROR. |
5010`-------------------------------------------------------------*/
5011yyerrlab1:
5012 yyerrstatus = 3; /* Each real token shifted decrements this. */
5013
5014 for (;;)
5015 {
5016 yyn = yypact[yystate];
5017 if (yyn != YYPACT_NINF)
5018 {
5019 yyn += YYTERROR;
5020 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5021 {
5022 yyn = yytable[yyn];
5023 if (0 < yyn)
5024 break;
5025 }
5026 }
5027
5028 /* Pop the current state because it cannot handle the error token. */
5029 if (yyssp == yyss)
5030 YYABORT;
5031
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005032 yyerror_range[0] = *yylsp;
John Bauman66b8ab22014-05-06 15:57:45 -04005033 yydestruct ("Error: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005034 yystos[yystate], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005035 YYPOPSTACK (1);
5036 yystate = *yyssp;
5037 YY_STACK_PRINT (yyss, yyssp);
5038 }
5039
5040 *++yyvsp = yylval;
5041
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005042 yyerror_range[1] = yylloc;
5043 /* Using YYLLOC is tempting, but would change the location of
5044 the lookahead. YYLOC is available though. */
5045 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
5046 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04005047
5048 /* Shift the error token. */
5049 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5050
5051 yystate = yyn;
5052 goto yynewstate;
5053
5054
5055/*-------------------------------------.
5056| yyacceptlab -- YYACCEPT comes here. |
5057`-------------------------------------*/
5058yyacceptlab:
5059 yyresult = 0;
5060 goto yyreturn;
5061
5062/*-----------------------------------.
5063| yyabortlab -- YYABORT comes here. |
5064`-----------------------------------*/
5065yyabortlab:
5066 yyresult = 1;
5067 goto yyreturn;
5068
5069#if !defined(yyoverflow) || YYERROR_VERBOSE
5070/*-------------------------------------------------.
5071| yyexhaustedlab -- memory exhaustion comes here. |
5072`-------------------------------------------------*/
5073yyexhaustedlab:
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005074 yyerror (&yylloc, context, YY_("memory exhausted"));
John Bauman66b8ab22014-05-06 15:57:45 -04005075 yyresult = 2;
5076 /* Fall through. */
5077#endif
5078
5079yyreturn:
5080 if (yychar != YYEMPTY)
5081 yydestruct ("Cleanup: discarding lookahead",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005082 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005083 /* Do not reclaim the symbols of the rule which action triggered
5084 this YYABORT or YYACCEPT. */
5085 YYPOPSTACK (yylen);
5086 YY_STACK_PRINT (yyss, yyssp);
5087 while (yyssp != yyss)
5088 {
5089 yydestruct ("Cleanup: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005090 yystos[*yyssp], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005091 YYPOPSTACK (1);
5092 }
5093#ifndef yyoverflow
5094 if (yyss != yyssa)
5095 YYSTACK_FREE (yyss);
5096#endif
5097#if YYERROR_VERBOSE
5098 if (yymsg != yymsgbuf)
5099 YYSTACK_FREE (yymsg);
5100#endif
5101 /* Make sure YYID is used. */
5102 return YYID (yyresult);
5103}
5104
5105
5106
5107
5108
5109int glslang_parse(TParseContext* context) {
5110 return yyparse(context);
5111}
5112