blob: af91eddc9aba533e23bdd5e9e408c9acafed9ae2 [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
361#define ES3_ONLY(S, L) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400362 if (context->getShaderVersion() != 300) { \
Nicolas Capensc6841852015-02-15 14:25:37 -0500363 context->error(L, " supported in GLSL ES 3.00 only ", S); \
364 context->recover(); \
365 } \
366}
367
John Bauman66b8ab22014-05-06 15:57:45 -0400368
369
370#ifdef short
371# undef short
372#endif
373
374#ifdef YYTYPE_UINT8
375typedef YYTYPE_UINT8 yytype_uint8;
376#else
377typedef unsigned char yytype_uint8;
378#endif
379
380#ifdef YYTYPE_INT8
381typedef YYTYPE_INT8 yytype_int8;
382#elif (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384typedef signed char yytype_int8;
385#else
386typedef short int yytype_int8;
387#endif
388
389#ifdef YYTYPE_UINT16
390typedef YYTYPE_UINT16 yytype_uint16;
391#else
392typedef unsigned short int yytype_uint16;
393#endif
394
395#ifdef YYTYPE_INT16
396typedef YYTYPE_INT16 yytype_int16;
397#else
398typedef short int yytype_int16;
399#endif
400
401#ifndef YYSIZE_T
402# ifdef __SIZE_TYPE__
403# define YYSIZE_T __SIZE_TYPE__
404# elif defined size_t
405# define YYSIZE_T size_t
406# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
407 || defined __cplusplus || defined _MSC_VER)
408# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
409# define YYSIZE_T size_t
410# else
411# define YYSIZE_T unsigned int
412# endif
413#endif
414
415#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
416
417#ifndef YY_
Nicolas Capense9c5e4f2014-05-28 22:46:43 -0400418# if YYENABLE_NLS
John Bauman66b8ab22014-05-06 15:57:45 -0400419# if ENABLE_NLS
420# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
421# define YY_(msgid) dgettext ("bison-runtime", msgid)
422# endif
423# endif
424# ifndef YY_
425# define YY_(msgid) msgid
426# endif
427#endif
428
429/* Suppress unused-variable warnings by "using" E. */
430#if ! defined lint || defined __GNUC__
431# define YYUSE(e) ((void) (e))
432#else
433# define YYUSE(e) /* empty */
434#endif
435
436/* Identity function, used to suppress warnings about constant conditions. */
437#ifndef lint
438# define YYID(n) (n)
439#else
440#if (defined __STDC__ || defined __C99__FUNC__ \
441 || defined __cplusplus || defined _MSC_VER)
442static int
443YYID (int yyi)
444#else
445static int
446YYID (yyi)
447 int yyi;
448#endif
449{
450 return yyi;
451}
452#endif
453
454#if ! defined yyoverflow || YYERROR_VERBOSE
455
456/* The parser invokes alloca or malloc; define the necessary symbols. */
457
458# ifdef YYSTACK_USE_ALLOCA
459# if YYSTACK_USE_ALLOCA
460# ifdef __GNUC__
461# define YYSTACK_ALLOC __builtin_alloca
462# elif defined __BUILTIN_VA_ARG_INCR
463# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
464# elif defined _AIX
465# define YYSTACK_ALLOC __alloca
466# elif defined _MSC_VER
467# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
468# define alloca _alloca
469# else
470# define YYSTACK_ALLOC alloca
471# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
473# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
474# ifndef _STDLIB_H
475# define _STDLIB_H 1
476# endif
477# endif
478# endif
479# endif
480# endif
481
482# ifdef YYSTACK_ALLOC
483 /* Pacify GCC's `empty if-body' warning. */
484# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
485# ifndef YYSTACK_ALLOC_MAXIMUM
486 /* The OS might guarantee only one guard page at the bottom of the stack,
487 and a page size can be as small as 4096 bytes. So we cannot safely
488 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
489 to allow for a few compiler-allocated temporary stack slots. */
490# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
491# endif
492# else
493# define YYSTACK_ALLOC YYMALLOC
494# define YYSTACK_FREE YYFREE
495# ifndef YYSTACK_ALLOC_MAXIMUM
496# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
497# endif
498# if (defined __cplusplus && ! defined _STDLIB_H \
499 && ! ((defined YYMALLOC || defined malloc) \
500 && (defined YYFREE || defined free)))
501# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
502# ifndef _STDLIB_H
503# define _STDLIB_H 1
504# endif
505# endif
506# ifndef YYMALLOC
507# define YYMALLOC malloc
508# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
509 || defined __cplusplus || defined _MSC_VER)
510void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
511# endif
512# endif
513# ifndef YYFREE
514# define YYFREE free
515# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
516 || defined __cplusplus || defined _MSC_VER)
517void free (void *); /* INFRINGES ON USER NAME SPACE */
518# endif
519# endif
520# endif
521#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
522
523
524#if (! defined yyoverflow \
525 && (! defined __cplusplus \
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400526 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
527 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
John Bauman66b8ab22014-05-06 15:57:45 -0400528
529/* A type that is properly aligned for any stack member. */
530union yyalloc
531{
532 yytype_int16 yyss_alloc;
533 YYSTYPE yyvs_alloc;
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400534 YYLTYPE yyls_alloc;
John Bauman66b8ab22014-05-06 15:57:45 -0400535};
536
537/* The size of the maximum gap between one aligned stack and the next. */
538# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
539
540/* The size of an array large to enough to hold all stacks, each with
541 N elements. */
542# define YYSTACK_BYTES(N) \
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400543 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
544 + 2 * YYSTACK_GAP_MAXIMUM)
John Bauman66b8ab22014-05-06 15:57:45 -0400545
546/* Copy COUNT objects from FROM to TO. The source and destination do
547 not overlap. */
548# ifndef YYCOPY
549# if defined __GNUC__ && 1 < __GNUC__
550# define YYCOPY(To, From, Count) \
551 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
552# else
553# define YYCOPY(To, From, Count) \
554 do \
555 { \
556 YYSIZE_T yyi; \
557 for (yyi = 0; yyi < (Count); yyi++) \
558 (To)[yyi] = (From)[yyi]; \
559 } \
560 while (YYID (0))
561# endif
562# endif
563
564/* Relocate STACK from its old location to the new one. The
565 local variables YYSIZE and YYSTACKSIZE give the old and new number of
566 elements in the stack, and YYPTR gives the new location of the
567 stack. Advance YYPTR to a properly aligned location for the next
568 stack. */
569# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
570 do \
571 { \
572 YYSIZE_T yynewbytes; \
573 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
574 Stack = &yyptr->Stack_alloc; \
575 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
576 yyptr += yynewbytes / sizeof (*yyptr); \
577 } \
578 while (YYID (0))
579
580#endif
581
582/* YYFINAL -- State number of the termination state. */
Alexis Hetua35d8232015-06-11 17:11:06 -0400583#define YYFINAL 110
John Bauman66b8ab22014-05-06 15:57:45 -0400584/* YYLAST -- Last index in YYTABLE. */
Alexis 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,
769 269, 272, 275, 278, 281, 287, 295, 395, 398, 406,
Alexis Hetue5246692015-06-18 12:34:52 -0400770 410, 417, 421, 428, 434, 443, 451, 457, 464, 474,
771 477, 487, 497, 519, 520, 521, 522, 530, 531, 535,
772 539, 547, 548, 551, 557, 558, 562, 569, 570, 573,
773 576, 579, 585, 586, 589, 595, 596, 603, 604, 611,
774 612, 619, 620, 626, 627, 633, 634, 640, 641, 658,
775 659, 667, 668, 669, 670, 672, 673, 674, 676, 678,
776 680, 682, 687, 690, 701, 709, 717, 744, 750, 757,
777 761, 765, 769, 776, 814, 817, 824, 832, 853, 874,
778 885, 914, 919, 929, 934, 944, 947, 950, 953, 959,
779 966, 969, 973, 977, 982, 987, 994, 998, 1002, 1006,
780 1011, 1016, 1020, 1096, 1106, 1112, 1115, 1121, 1127, 1134,
781 1143, 1152, 1155, 1158, 1165, 1169, 1176, 1180, 1185, 1190,
782 1200, 1210, 1219, 1229, 1236, 1239, 1242, 1248, 1255, 1258,
783 1264, 1267, 1270, 1276, 1279, 1284, 1299, 1303, 1307, 1311,
784 1315, 1319, 1324, 1329, 1334, 1339, 1344, 1349, 1354, 1359,
785 1364, 1369, 1374, 1379, 1385, 1391, 1397, 1403, 1409, 1415,
786 1421, 1427, 1433, 1438, 1443, 1452, 1457, 1462, 1467, 1472,
787 1477, 1482, 1487, 1492, 1497, 1502, 1507, 1512, 1517, 1522,
788 1535, 1535, 1538, 1538, 1544, 1547, 1563, 1566, 1575, 1579,
789 1585, 1592, 1607, 1611, 1615, 1616, 1622, 1623, 1624, 1625,
790 1626, 1627, 1628, 1632, 1633, 1633, 1633, 1643, 1644, 1648,
791 1648, 1649, 1649, 1654, 1657, 1667, 1670, 1676, 1677, 1681,
792 1689, 1693, 1700, 1700, 1707, 1710, 1719, 1724, 1741, 1741,
793 1746, 1746, 1753, 1753, 1761, 1764, 1770, 1773, 1779, 1783,
794 1790, 1793, 1796, 1799, 1802, 1811, 1815, 1822, 1825, 1831,
795 1831
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 {
2628 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2629 TOperator op = fnCall->getBuiltInOp();
2630
2631 if (op != EOpNull)
2632 {
2633 //
2634 // Then this should be a constructor.
2635 // Don't go through the symbol table for constructors.
2636 // Their parameters will be verified algorithmically.
2637 //
2638 TType type(EbtVoid, EbpUndefined); // use this to get the type back
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002639 if (context->constructorErrorCheck((yylsp[(1) - (1)]), (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
John Bauman66b8ab22014-05-06 15:57:45 -04002640 (yyval.interm.intermTypedNode) = 0;
2641 } else {
2642 //
2643 // It's a constructor, of type 'type'.
2644 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002645 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002646 }
2647
2648 if ((yyval.interm.intermTypedNode) == 0) {
2649 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002650 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002651 }
2652 (yyval.interm.intermTypedNode)->setType(type);
2653 } else {
2654 //
2655 // Not a constructor. Find it in the symbol table.
2656 //
2657 const TFunction* fnCandidate;
2658 bool builtIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002659 fnCandidate = context->findFunction((yylsp[(1) - (1)]), fnCall, &builtIn);
John Bauman66b8ab22014-05-06 15:57:45 -04002660 if (fnCandidate) {
2661 //
2662 // A declared function.
2663 //
2664 if (builtIn && !fnCandidate->getExtension().empty() &&
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002665 context->extensionErrorCheck((yylsp[(1) - (1)]), fnCandidate->getExtension())) {
John Bauman66b8ab22014-05-06 15:57:45 -04002666 context->recover();
2667 }
2668 op = fnCandidate->getBuiltInOp();
2669 if (builtIn && op != EOpNull) {
2670 //
2671 // A function call mapped to a built-in operation.
2672 //
2673 if (fnCandidate->getParamCount() == 1) {
2674 //
2675 // Treat it like a built-in unary operator.
2676 //
John Baumand4ae8632014-05-06 16:18:33 -04002677 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0);
John Bauman66b8ab22014-05-06 15:57:45 -04002678 if ((yyval.interm.intermTypedNode) == 0) {
2679 std::stringstream extraInfoStream;
2680 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2681 std::string extraInfo = extraInfoStream.str();
2682 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
2683 YYERROR;
2684 }
2685 } else {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002686 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002687 }
2688 } else {
2689 // This is a real function call
2690
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002691 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002692 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2693
2694 // this is how we know whether the given function is a builtIn function or a user defined function
2695 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2696 // if builtIn == true, it's definitely a builtIn function with EOpNull
2697 if (!builtIn)
2698 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2699 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2700
2701 TQualifier qual;
Alexis Hetu76a343a2015-06-04 17:21:22 -04002702 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04002703 qual = fnCandidate->getParam(i).type->getQualifier();
2704 if (qual == EvqOut || qual == EvqInOut) {
2705 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
2706 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
2707 context->recover();
2708 }
2709 }
2710 }
2711 }
2712 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2713 } else {
2714 // error message was put out by PaFindFunction()
2715 // Put on a dummy node for error recovery
2716 ConstantUnion *unionArray = new ConstantUnion[1];
2717 unionArray->setFConst(0.0f);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002718 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002719 context->recover();
2720 }
2721 }
2722 delete fnCall;
2723 }
2724 break;
2725
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002726 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002727
2728 {
2729 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2730 }
2731 break;
2732
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002733 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002734
2735 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002736 context->error((yylsp[(3) - (3)]), "methods are not supported", "");
John Bauman66b8ab22014-05-06 15:57:45 -04002737 context->recover();
2738 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2739 }
2740 break;
2741
John Bauman66b8ab22014-05-06 15:57:45 -04002742 case 19:
2743
2744 {
2745 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002746 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04002747 }
2748 break;
2749
2750 case 20:
2751
2752 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002753 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002754 (yyval.interm).line = (yylsp[(2) - (2)]);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002755 }
2756 break;
2757
2758 case 21:
2759
2760 {
John Bauman66b8ab22014-05-06 15:57:45 -04002761 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2762 (yyval.interm).intermNode = 0;
2763 }
2764 break;
2765
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002766 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002767
2768 {
2769 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2770 (yyval.interm).intermNode = 0;
2771 }
2772 break;
2773
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002774 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002775
2776 {
2777 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2778 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2779 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2780 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2781 }
2782 break;
2783
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002784 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002785
2786 {
2787 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2788 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2789 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002790 (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 -04002791 }
2792 break;
2793
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002794 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002795
2796 {
2797 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2798 }
2799 break;
2800
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002801 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002802
2803 {
Alexis Hetue5246692015-06-18 12:34:52 -04002804 if ((yyvsp[(1) - (1)].interm.type).array) {
2805 ES3_ONLY("[]", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002806 }
Alexis Hetue5246692015-06-18 12:34:52 -04002807 (yyval.interm.function) = context->addConstructorFunc((yyvsp[(1) - (1)].interm.type));
John Bauman66b8ab22014-05-06 15:57:45 -04002808 }
2809 break;
2810
John Bauman66b8ab22014-05-06 15:57:45 -04002811 case 27:
2812
2813 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002814 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04002815 context->recover();
2816 TType type(EbtVoid, EbpUndefined);
2817 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2818 (yyval.interm.function) = function;
2819 }
2820 break;
2821
2822 case 28:
2823
2824 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002825 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002826 context->recover();
2827 TType type(EbtVoid, EbpUndefined);
2828 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2829 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002830 }
2831 break;
2832
2833 case 29:
2834
2835 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002836 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2837 }
2838 break;
2839
2840 case 30:
2841
2842 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002843 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002844 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002845 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002846 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002847 context->unaryOpError((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002848 context->recover();
2849 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2850 }
2851 }
2852 break;
2853
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002854 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002855
2856 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002857 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002858 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002859 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002860 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002861 context->unaryOpError((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002862 context->recover();
2863 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2864 }
2865 }
2866 break;
2867
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002868 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002869
2870 {
2871 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002872 (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 -04002873 if ((yyval.interm.intermTypedNode) == 0) {
2874 const char* errorOp = "";
2875 switch((yyvsp[(1) - (2)].interm).op) {
2876 case EOpNegative: errorOp = "-"; break;
2877 case EOpLogicalNot: errorOp = "!"; break;
Alexis Hetud061e422015-05-13 16:37:50 -04002878 case EOpBitwiseNot: errorOp = "~"; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002879 default: break;
2880 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002881 context->unaryOpError((yylsp[(1) - (2)]), errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002882 context->recover();
2883 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2884 }
2885 } else
2886 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2887 }
2888 break;
2889
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002890 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002891
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002892 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNull; }
John Bauman66b8ab22014-05-06 15:57:45 -04002893 break;
2894
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002895 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002896
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002897 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNegative; }
John Bauman66b8ab22014-05-06 15:57:45 -04002898 break;
2899
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002900 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002901
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002902 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpLogicalNot; }
John Bauman66b8ab22014-05-06 15:57:45 -04002903 break;
2904
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002905 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002906
Alexis Hetu17809052015-05-13 11:28:22 -04002907 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002908 ES3_ONLY("~", (yylsp[(1) - (1)]));
2909 (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseNot;
Alexis Hetu17809052015-05-13 11:28:22 -04002910 }
John Bauman66b8ab22014-05-06 15:57:45 -04002911 break;
2912
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002913 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002914
Alexis Hetu17809052015-05-13 11:28:22 -04002915 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2916 break;
2917
2918 case 38:
2919
John Bauman66b8ab22014-05-06 15:57:45 -04002920 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002921 FRAG_VERT_ONLY("*", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002922 (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 -04002923 }
2924 break;
2925
Alexis Hetu17809052015-05-13 11:28:22 -04002926 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04002927
2928 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002929 FRAG_VERT_ONLY("/", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002930 (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 -04002931 }
2932 break;
2933
Alexis Hetu17809052015-05-13 11:28:22 -04002934 case 40:
2935
2936 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002937 FRAG_VERT_ONLY("%", (yylsp[(2) - (3)]));
2938 ES3_ONLY("%", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002939 (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 -04002940 }
2941 break;
2942
2943 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04002944
2945 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2946 break;
2947
Alexis Hetu17809052015-05-13 11:28:22 -04002948 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04002949
2950 {
Alexis Hetub4769582015-06-16 12:19:50 -04002951 (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 -04002952 }
2953 break;
2954
Alexis Hetu17809052015-05-13 11:28:22 -04002955 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04002956
2957 {
Alexis Hetub4769582015-06-16 12:19:50 -04002958 (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 -04002959 }
2960 break;
2961
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002962 case 44:
2963
Alexis Hetu17809052015-05-13 11:28:22 -04002964 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2965 break;
2966
2967 case 45:
2968
2969 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002970 ES3_ONLY("<<", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002971 (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 -04002972 }
2973 break;
2974
2975 case 46:
2976
2977 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002978 ES3_ONLY(">>", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002979 (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 -04002980 }
2981 break;
2982
2983 case 47:
2984
2985 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2986 break;
2987
2988 case 48:
2989
John Bauman66b8ab22014-05-06 15:57:45 -04002990 {
Alexis Hetub4769582015-06-16 12:19:50 -04002991 (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 -04002992 }
2993 break;
2994
Alexis Hetu17809052015-05-13 11:28:22 -04002995 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04002996
2997 {
Alexis Hetub4769582015-06-16 12:19:50 -04002998 (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 -04002999 }
3000 break;
3001
Alexis Hetu17809052015-05-13 11:28:22 -04003002 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04003003
3004 {
Alexis Hetub4769582015-06-16 12:19:50 -04003005 (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 -04003006 }
3007 break;
3008
Alexis Hetu17809052015-05-13 11:28:22 -04003009 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04003010
3011 {
Alexis Hetub4769582015-06-16 12:19:50 -04003012 (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 -04003013 }
3014 break;
3015
Alexis Hetu17809052015-05-13 11:28:22 -04003016 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04003017
3018 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3019 break;
3020
Alexis Hetu17809052015-05-13 11:28:22 -04003021 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04003022
3023 {
Alexis Hetub4769582015-06-16 12:19:50 -04003024 (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 -04003025 }
3026 break;
3027
Alexis Hetu17809052015-05-13 11:28:22 -04003028 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04003029
3030 {
Alexis Hetub4769582015-06-16 12:19:50 -04003031 (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 -04003032 }
3033 break;
3034
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003035 case 55:
3036
Alexis Hetu17809052015-05-13 11:28:22 -04003037 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3038 break;
3039
3040 case 56:
3041
3042 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003043 ES3_ONLY("&", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003044 (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 -04003045 }
3046 break;
3047
3048 case 57:
3049
3050 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3051 break;
3052
3053 case 58:
3054
3055 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003056 ES3_ONLY("^", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003057 (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 -04003058 }
3059 break;
3060
3061 case 59:
3062
3063 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3064 break;
3065
3066 case 60:
3067
3068 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003069 ES3_ONLY("|", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04003070 (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 -04003071 }
3072 break;
3073
3074 case 61:
3075
3076 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3077 break;
3078
3079 case 62:
3080
John Bauman66b8ab22014-05-06 15:57:45 -04003081 {
Alexis Hetub4769582015-06-16 12:19:50 -04003082 (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 -04003083 }
3084 break;
3085
Alexis Hetu17809052015-05-13 11:28:22 -04003086 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04003087
3088 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3089 break;
3090
Alexis Hetu17809052015-05-13 11:28:22 -04003091 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003092
3093 {
Alexis Hetub4769582015-06-16 12:19:50 -04003094 (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 -04003095 }
3096 break;
3097
Alexis Hetu17809052015-05-13 11:28:22 -04003098 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003099
3100 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3101 break;
3102
Alexis Hetu17809052015-05-13 11:28:22 -04003103 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003104
3105 {
Alexis Hetub4769582015-06-16 12:19:50 -04003106 (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 -04003107 }
3108 break;
3109
Alexis Hetu17809052015-05-13 11:28:22 -04003110 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003111
3112 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3113 break;
3114
Alexis Hetu17809052015-05-13 11:28:22 -04003115 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003116
3117 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003118 if (context->boolErrorCheck((yylsp[(2) - (5)]), (yyvsp[(1) - (5)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04003119 context->recover();
3120
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003121 (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 -04003122 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3123 (yyval.interm.intermTypedNode) = 0;
3124
3125 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003126 context->binaryOpError((yylsp[(2) - (5)]), ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003127 context->recover();
3128 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3129 }
3130 }
3131 break;
3132
Alexis Hetu17809052015-05-13 11:28:22 -04003133 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003134
3135 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3136 break;
3137
Alexis Hetu17809052015-05-13 11:28:22 -04003138 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003139
3140 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003141 if (context->lValueErrorCheck((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04003142 context->recover();
Alexis Hetue5246692015-06-18 12:34:52 -04003143 (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 -04003144 }
3145 break;
3146
Alexis Hetu17809052015-05-13 11:28:22 -04003147 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003148
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003149 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003150 break;
3151
Alexis Hetu17809052015-05-13 11:28:22 -04003152 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003153
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003154 { FRAG_VERT_ONLY("*=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpMulAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003155 break;
3156
Alexis Hetu17809052015-05-13 11:28:22 -04003157 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003158
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003159 { FRAG_VERT_ONLY("/=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpDivAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003160 break;
3161
Alexis Hetu17809052015-05-13 11:28:22 -04003162 case 74:
3163
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003164 { ES3_ONLY("%=", (yylsp[(1) - (1)]));
3165 FRAG_VERT_ONLY("%=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpIModAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003166 break;
3167
3168 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003169
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003170 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAddAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003171 break;
3172
Alexis Hetu17809052015-05-13 11:28:22 -04003173 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003174
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003175 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpSubAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003176 break;
3177
Alexis Hetu17809052015-05-13 11:28:22 -04003178 case 77:
3179
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003180 { ES3_ONLY("<<=", (yylsp[(1) - (1)]));
3181 FRAG_VERT_ONLY("<<=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftLeftAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003182 break;
3183
3184 case 78:
3185
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003186 { ES3_ONLY(">>=", (yylsp[(1) - (1)]));
3187 FRAG_VERT_ONLY(">>=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftRightAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003188 break;
3189
3190 case 79:
3191
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003192 { ES3_ONLY("&=", (yylsp[(1) - (1)]));
3193 FRAG_VERT_ONLY("&=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseAndAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003194 break;
3195
3196 case 80:
3197
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003198 { ES3_ONLY("^=", (yylsp[(1) - (1)]));
3199 FRAG_VERT_ONLY("^=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseXorAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003200 break;
3201
3202 case 81:
3203
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003204 { ES3_ONLY("|=", (yylsp[(1) - (1)]));
3205 FRAG_VERT_ONLY("|=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseOrAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003206 break;
3207
3208 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003209
3210 {
3211 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3212 }
3213 break;
3214
Alexis Hetu17809052015-05-13 11:28:22 -04003215 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003216
3217 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003218 (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 -04003219 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003220 context->binaryOpError((yylsp[(2) - (3)]), ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003221 context->recover();
3222 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3223 }
3224 }
3225 break;
3226
Alexis Hetu17809052015-05-13 11:28:22 -04003227 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003228
3229 {
3230 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3231 context->recover();
3232 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3233 }
3234 break;
3235
Alexis Hetu17809052015-05-13 11:28:22 -04003236 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003237
3238 {
Alexis Hetue5246692015-06-18 12:34:52 -04003239 if (context->enterStructDeclaration((yylsp[(1) - (2)]), *(yyvsp[(1) - (2)].lex).string))
Alexis Hetua35d8232015-06-11 17:11:06 -04003240 context->recover();
3241 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3242 }
3243 break;
3244
3245 case 86:
3246
3247 {
John Bauman66b8ab22014-05-06 15:57:45 -04003248 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3249
3250 TIntermAggregate *prototype = new TIntermAggregate;
3251 prototype->setType(function.getReturnType());
3252 prototype->setName(function.getName());
3253
Alexis Hetu76a343a2015-06-04 17:21:22 -04003254 for (size_t i = 0; i < function.getParamCount(); i++)
John Bauman66b8ab22014-05-06 15:57:45 -04003255 {
3256 const TParameter &param = function.getParam(i);
3257 if (param.name != 0)
3258 {
John Baumand4ae8632014-05-06 16:18:33 -04003259 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003260
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003261 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 -04003262 }
3263 else
3264 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003265 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003266 }
3267 }
3268
3269 prototype->setOp(EOpPrototype);
3270 (yyval.interm.intermNode) = prototype;
3271
3272 context->symbolTable.pop();
3273 }
3274 break;
3275
Alexis Hetua35d8232015-06-11 17:11:06 -04003276 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003277
3278 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003279 TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
3280 if (aggNode && aggNode->getOp() == EOpNull)
3281 aggNode->setOp(EOpDeclaration);
3282 (yyval.interm.intermNode) = aggNode;
John Bauman66b8ab22014-05-06 15:57:45 -04003283 }
3284 break;
3285
Alexis Hetua35d8232015-06-11 17:11:06 -04003286 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003287
3288 {
John Baumand4ae8632014-05-06 16:18:33 -04003289 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003290 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 -04003291 context->recover();
3292 }
John Bauman66b8ab22014-05-06 15:57:45 -04003293 (yyval.interm.intermNode) = 0;
3294 }
3295 break;
3296
Alexis Hetua35d8232015-06-11 17:11:06 -04003297 case 89:
3298
3299 {
Alexis Hetue5246692015-06-18 12:34:52 -04003300 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yylsp[(1) - (5)]));
3301 (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 -04003302 }
3303 break;
3304
3305 case 90:
3306
3307 {
Alexis Hetue5246692015-06-18 12:34:52 -04003308 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yylsp[(1) - (6)]));
3309 (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 -04003310 }
3311 break;
3312
3313 case 91:
3314
3315 {
Alexis Hetue5246692015-06-18 12:34:52 -04003316 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yylsp[(1) - (9)]));
3317 (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 -04003318 }
3319 break;
3320
3321 case 92:
3322
3323 {
3324 context->parseGlobalLayoutQualifier((yyvsp[(1) - (2)].interm.type));
3325 (yyval.interm.intermNode) = 0;
3326 }
3327 break;
3328
3329 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003330
3331 {
3332 //
3333 // Multiple declarations of the same function are allowed.
3334 //
3335 // If this is a definition, the definition production code will check for redefinitions
3336 // (we don't know at this point if it's a definition or not).
3337 //
3338 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3339 //
Alexis Hetu0a655842015-06-22 16:52:11 -04003340 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->getShaderVersion()));
John Bauman66b8ab22014-05-06 15:57:45 -04003341 if (prevDec) {
3342 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003343 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 -04003344 context->recover();
3345 }
Alexis Hetu76a343a2015-06-04 17:21:22 -04003346 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04003347 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003348 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 -04003349 context->recover();
3350 }
3351 }
3352 }
3353
3354 //
3355 // If this is a redeclaration, it could also be a definition,
3356 // in which case, we want to use the variable names from this one, and not the one that's
3357 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3358 //
3359 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003360 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003361
3362 // We're at the inner scope level of the function's arguments and body statement.
3363 // Add the function prototype to the surrounding scope instead.
3364 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3365 }
3366 break;
3367
Alexis Hetua35d8232015-06-11 17:11:06 -04003368 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003369
3370 {
3371 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3372 }
3373 break;
3374
Alexis Hetua35d8232015-06-11 17:11:06 -04003375 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003376
3377 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003378 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3379 }
3380 break;
3381
Alexis Hetua35d8232015-06-11 17:11:06 -04003382 case 96:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003383
3384 {
John Bauman66b8ab22014-05-06 15:57:45 -04003385 // Add the parameter
3386 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3387 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3388 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3389 else
3390 delete (yyvsp[(2) - (2)].interm).param.type;
3391 }
3392 break;
3393
Alexis Hetua35d8232015-06-11 17:11:06 -04003394 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003395
3396 {
3397 //
3398 // Only first parameter of one-parameter functions can be void
3399 // The check for named parameters not being void is done in parameter_declarator
3400 //
3401 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3402 //
3403 // This parameter > first is void
3404 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003405 context->error((yylsp[(2) - (3)]), "cannot be an argument type except for '(void)'", "void");
John Bauman66b8ab22014-05-06 15:57:45 -04003406 context->recover();
3407 delete (yyvsp[(3) - (3)].interm).param.type;
3408 } else {
3409 // Add the parameter
3410 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3411 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3412 }
3413 }
3414 break;
3415
Alexis Hetua35d8232015-06-11 17:11:06 -04003416 case 98:
John Bauman66b8ab22014-05-06 15:57:45 -04003417
3418 {
3419 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003420 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 -04003421 context->recover();
3422 }
3423 // make sure a sampler is not involved as well...
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003424 if (context->structQualifierErrorCheck((yylsp[(2) - (3)]), (yyvsp[(1) - (3)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003425 context->recover();
3426
3427 // Add the function as a prototype after parsing it (we do not support recursion)
3428 TFunction *function;
3429 TType type((yyvsp[(1) - (3)].interm.type));
3430 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3431 (yyval.interm.function) = function;
3432
3433 context->symbolTable.push();
3434 }
3435 break;
3436
Alexis Hetua35d8232015-06-11 17:11:06 -04003437 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003438
3439 {
3440 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003441 context->error((yylsp[(2) - (2)]), "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04003442 context->recover();
3443 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003444 if (context->reservedErrorCheck((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003445 context->recover();
3446 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003447 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003448 (yyval.interm).param = param;
3449 }
3450 break;
3451
Alexis Hetua35d8232015-06-11 17:11:06 -04003452 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003453
3454 {
3455 // Check that we can make an array out of this type
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003456 if (context->arrayTypeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003457 context->recover();
3458
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003459 if (context->reservedErrorCheck((yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003460 context->recover();
3461
3462 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003463 if (context->arraySizeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003464 context->recover();
3465 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3466
3467 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3468 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003469 (yyval.interm).line = (yylsp[(2) - (5)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003470 (yyval.interm).param = param;
3471 }
3472 break;
3473
Alexis Hetu17809052015-05-13 11:28:22 -04003474 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003475
3476 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003477 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003478 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 -04003479 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003480 }
3481 break;
3482
Alexis Hetu17809052015-05-13 11:28:22 -04003483 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003484
3485 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003486 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003487 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003488 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003489 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003490 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003491 }
3492 break;
3493
Alexis Hetu17809052015-05-13 11:28:22 -04003494 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003495
3496 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003497 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003498 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 -04003499 context->recover();
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003500 }
3501 break;
3502
Alexis Hetu17809052015-05-13 11:28:22 -04003503 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003504
3505 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003506 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003507 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003508 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003509 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003510 context->recover();
3511 }
3512 break;
3513
3514 case 105:
3515
3516 {
3517 (yyval.interm.qualifier) = EvqIn;
3518 }
3519 break;
3520
3521 case 106:
3522
3523 {
3524 (yyval.interm.qualifier) = EvqIn;
3525 }
3526 break;
3527
3528 case 107:
3529
3530 {
3531 (yyval.interm.qualifier) = EvqOut;
3532 }
3533 break;
3534
3535 case 108:
3536
3537 {
3538 (yyval.interm.qualifier) = EvqInOut;
3539 }
3540 break;
3541
3542 case 109:
3543
3544 {
John Bauman66b8ab22014-05-06 15:57:45 -04003545 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3546 (yyval.interm).param = param;
3547 }
3548 break;
3549
Alexis Hetua35d8232015-06-11 17:11:06 -04003550 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003551
3552 {
3553 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3554 }
3555 break;
3556
Alexis Hetua35d8232015-06-11 17:11:06 -04003557 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003558
3559 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003560 (yyval.interm) = (yyvsp[(1) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003561 (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 -04003562 }
3563 break;
3564
Alexis Hetua35d8232015-06-11 17:11:06 -04003565 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003566
3567 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003568 (yyval.interm) = (yyvsp[(1) - (6)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003569 (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 -04003570 }
3571 break;
3572
Alexis Hetua35d8232015-06-11 17:11:06 -04003573 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003574
3575 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003576 ES3_ONLY("[]", (yylsp[(3) - (7)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003577 (yyval.interm) = (yyvsp[(1) - (7)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003578 (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 -04003579 }
3580 break;
3581
Alexis Hetua35d8232015-06-11 17:11:06 -04003582 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003583
3584 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003585 ES3_ONLY("=", (yylsp[(7) - (8)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003586 (yyval.interm) = (yyvsp[(1) - (8)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003587 (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 -04003588 }
3589 break;
3590
Alexis Hetua35d8232015-06-11 17:11:06 -04003591 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003592
3593 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003594 (yyval.interm) = (yyvsp[(1) - (5)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003595 (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 -04003596 }
3597 break;
3598
Alexis Hetua35d8232015-06-11 17:11:06 -04003599 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003600
3601 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003602 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003603 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(1) - (1)]), "");
John Bauman66b8ab22014-05-06 15:57:45 -04003604 }
3605 break;
3606
Alexis Hetua35d8232015-06-11 17:11:06 -04003607 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003608
3609 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003610 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003611 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string);
John Bauman66b8ab22014-05-06 15:57:45 -04003612 }
3613 break;
3614
Alexis Hetua35d8232015-06-11 17:11:06 -04003615 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003616
3617 {
John Bauman66b8ab22014-05-06 15:57:45 -04003618 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003619 (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 -04003620 }
3621 break;
3622
Alexis Hetua35d8232015-06-11 17:11:06 -04003623 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003624
3625 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003626 ES3_ONLY("[]", (yylsp[(3) - (6)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003627 (yyval.interm).type = (yyvsp[(1) - (6)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003628 (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 -04003629 }
3630 break;
3631
Alexis Hetua35d8232015-06-11 17:11:06 -04003632 case 120:
John Bauman66b8ab22014-05-06 15:57:45 -04003633
3634 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003635 ES3_ONLY("=", (yylsp[(6) - (7)]));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003636 (yyval.interm).type = (yyvsp[(1) - (7)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003637 (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 -04003638 }
3639 break;
3640
Alexis Hetua35d8232015-06-11 17:11:06 -04003641 case 121:
John Bauman66b8ab22014-05-06 15:57:45 -04003642
3643 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003644 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003645 (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 -04003646 }
3647 break;
3648
Alexis Hetua35d8232015-06-11 17:11:06 -04003649 case 122:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003650
3651 {
3652 // $$.type is not used in invariant declarations.
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003653 (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 -04003654 }
3655 break;
3656
Alexis Hetua35d8232015-06-11 17:11:06 -04003657 case 123:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003658
3659 {
John Bauman66b8ab22014-05-06 15:57:45 -04003660 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3661
3662 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003663 ES3_ONLY("[]", (yylsp[(1) - (1)]));
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003664 if (context->getShaderVersion() != 300) {
3665 (yyvsp[(1) - (1)].interm.type).clearArrayness();
3666 }
John Bauman66b8ab22014-05-06 15:57:45 -04003667 }
3668 }
3669 break;
3670
Alexis Hetua35d8232015-06-11 17:11:06 -04003671 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04003672
3673 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003674 (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 -04003675 }
3676 break;
3677
Alexis Hetua35d8232015-06-11 17:11:06 -04003678 case 125:
John Bauman66b8ab22014-05-06 15:57:45 -04003679
3680 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003681 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003682 }
3683 break;
3684
Alexis Hetua35d8232015-06-11 17:11:06 -04003685 case 126:
John Bauman66b8ab22014-05-06 15:57:45 -04003686
3687 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003688 (yyval.interm.type).qualifier = EvqFlat;
3689 }
3690 break;
3691
Alexis Hetua35d8232015-06-11 17:11:06 -04003692 case 127:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003693
3694 {
3695 (yyval.interm.qualifier) = EvqConstReadOnly;
3696 }
3697 break;
3698
Alexis Hetua35d8232015-06-11 17:11:06 -04003699 case 128:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003700
3701 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003702 VERTEX_ONLY("attribute", (yylsp[(1) - (1)]));
3703 ES2_ONLY("attribute", (yylsp[(1) - (1)]));
3704 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "attribute"))
John Bauman66b8ab22014-05-06 15:57:45 -04003705 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003706 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003707 }
3708 break;
3709
Alexis Hetua35d8232015-06-11 17:11:06 -04003710 case 129:
John Bauman66b8ab22014-05-06 15:57:45 -04003711
3712 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003713 ES2_ONLY("varying", (yylsp[(1) - (1)]));
3714 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003715 context->recover();
Alexis Hetu0a655842015-06-22 16:52:11 -04003716 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003717 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003718 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003719 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003720 }
3721 break;
3722
Alexis Hetua35d8232015-06-11 17:11:06 -04003723 case 130:
John Bauman66b8ab22014-05-06 15:57:45 -04003724
3725 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003726 ES2_ONLY("varying", (yylsp[(1) - (2)]));
3727 if (context->globalErrorCheck((yylsp[(1) - (2)]), context->symbolTable.atGlobalLevel(), "invariant varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003728 context->recover();
Alexis Hetu0a655842015-06-22 16:52:11 -04003729 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003730 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003731 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003732 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003733 }
3734 break;
3735
Alexis Hetua35d8232015-06-11 17:11:06 -04003736 case 131:
John Bauman66b8ab22014-05-06 15:57:45 -04003737
3738 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003739 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003740 }
3741 break;
3742
Alexis Hetua35d8232015-06-11 17:11:06 -04003743 case 132:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003744
3745 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003746 (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 -04003747 }
3748 break;
3749
Alexis Hetua35d8232015-06-11 17:11:06 -04003750 case 133:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003751
3752 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003753 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 -04003754 context->recover();
3755
3756 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003757 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003758 }
3759 break;
3760
Alexis Hetua35d8232015-06-11 17:11:06 -04003761 case 134:
John Bauman66b8ab22014-05-06 15:57:45 -04003762
3763 {
Nicolas Capens7d626792015-02-17 17:58:31 -05003764 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3765 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
3766 }
3767 break;
3768
Alexis Hetua35d8232015-06-11 17:11:06 -04003769 case 135:
Nicolas Capens7d626792015-02-17 17:58:31 -05003770
3771 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003772 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yylsp[(2) - (2)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003773 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
3774 }
3775 break;
3776
Alexis Hetua35d8232015-06-11 17:11:06 -04003777 case 136:
Nicolas Capens7d626792015-02-17 17:58:31 -05003778
3779 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003780 (yyval.interm.type).qualifier = EvqConstExpr;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003781 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003782 }
3783 break;
3784
Alexis Hetua35d8232015-06-11 17:11:06 -04003785 case 137:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003786
3787 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003788 ES3_ONLY("in", (yylsp[(1) - (1)]));
Alexis Hetu0a655842015-06-22 16:52:11 -04003789 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003790 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003791 }
3792 break;
3793
Alexis Hetua35d8232015-06-11 17:11:06 -04003794 case 138:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003795
3796 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003797 ES3_ONLY("out", (yylsp[(1) - (1)]));
Alexis Hetu0a655842015-06-22 16:52:11 -04003798 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003799 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003800 }
3801 break;
3802
Alexis Hetua35d8232015-06-11 17:11:06 -04003803 case 139:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003804
3805 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003806 ES3_ONLY("centroid in", (yylsp[(1) - (2)]));
Alexis Hetu0a655842015-06-22 16:52:11 -04003807 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003808 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003809 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 -04003810 context->recover();
3811 }
Alexis Hetu0a655842015-06-22 16:52:11 -04003812 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003813 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003814 }
3815 break;
3816
Alexis Hetua35d8232015-06-11 17:11:06 -04003817 case 140:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003818
3819 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003820 ES3_ONLY("centroid out", (yylsp[(1) - (2)]));
Alexis Hetu0a655842015-06-22 16:52:11 -04003821 if (context->getShaderType() == GL_FRAGMENT_SHADER)
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003822 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003823 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 -04003824 context->recover();
3825 }
Alexis Hetu0a655842015-06-22 16:52:11 -04003826 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003827 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003828 }
3829 break;
3830
Alexis Hetua35d8232015-06-11 17:11:06 -04003831 case 141:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003832
3833 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003834 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "uniform"))
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003835 context->recover();
3836 (yyval.interm.type).qualifier = EvqUniform;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003837 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003838 }
3839 break;
3840
Alexis Hetua35d8232015-06-11 17:11:06 -04003841 case 142:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003842
3843 {
John Bauman66b8ab22014-05-06 15:57:45 -04003844 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3845
3846 if ((yyval.interm.type).precision == EbpUndefined) {
3847 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003848 if (context->precisionErrorCheck((yylsp[(1) - (1)]), (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
John Bauman66b8ab22014-05-06 15:57:45 -04003849 context->recover();
3850 }
3851 }
3852 }
3853 break;
3854
Alexis Hetua35d8232015-06-11 17:11:06 -04003855 case 143:
John Bauman66b8ab22014-05-06 15:57:45 -04003856
3857 {
3858 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3859 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
3860 }
3861 break;
3862
Alexis Hetua35d8232015-06-11 17:11:06 -04003863 case 144:
John Bauman66b8ab22014-05-06 15:57:45 -04003864
3865 {
3866 (yyval.interm.precision) = EbpHigh;
3867 }
3868 break;
3869
Alexis Hetua35d8232015-06-11 17:11:06 -04003870 case 145:
John Bauman66b8ab22014-05-06 15:57:45 -04003871
3872 {
3873 (yyval.interm.precision) = EbpMedium;
3874 }
3875 break;
3876
Alexis Hetua35d8232015-06-11 17:11:06 -04003877 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04003878
3879 {
3880 (yyval.interm.precision) = EbpLow;
3881 }
3882 break;
3883
Alexis Hetua35d8232015-06-11 17:11:06 -04003884 case 147:
Nicolas Capens7d626792015-02-17 17:58:31 -05003885
3886 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003887 ES3_ONLY("layout", (yylsp[(1) - (4)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003888 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
3889 }
3890 break;
3891
Alexis Hetua35d8232015-06-11 17:11:06 -04003892 case 148:
Nicolas Capens7d626792015-02-17 17:58:31 -05003893
3894 {
3895 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
3896 }
3897 break;
3898
Alexis Hetua35d8232015-06-11 17:11:06 -04003899 case 149:
Nicolas Capens7d626792015-02-17 17:58:31 -05003900
3901 {
3902 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
3903 }
3904 break;
3905
Alexis Hetua35d8232015-06-11 17:11:06 -04003906 case 150:
Nicolas Capens7d626792015-02-17 17:58:31 -05003907
3908 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003909 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003910 }
3911 break;
3912
Alexis Hetua35d8232015-06-11 17:11:06 -04003913 case 151:
John Bauman66b8ab22014-05-06 15:57:45 -04003914
3915 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003916 (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 -04003917 }
3918 break;
3919
Alexis Hetua35d8232015-06-11 17:11:06 -04003920 case 152:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003921
3922 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003923 (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 -04003924 }
3925 break;
3926
Alexis Hetua35d8232015-06-11 17:11:06 -04003927 case 153:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003928
3929 {
John Bauman66b8ab22014-05-06 15:57:45 -04003930 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3931 }
3932 break;
3933
Alexis Hetua35d8232015-06-11 17:11:06 -04003934 case 154:
John Bauman66b8ab22014-05-06 15:57:45 -04003935
3936 {
Alexis Hetue5246692015-06-18 12:34:52 -04003937 ES3_ONLY("[]", (yylsp[(2) - (3)]));
3938 (yyval.interm.type) = (yyvsp[(1) - (3)].interm.type);
3939 (yyval.interm.type).setArray(true, 0);
3940 }
3941 break;
3942
3943 case 155:
3944
3945 {
John Bauman66b8ab22014-05-06 15:57:45 -04003946 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3947
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003948 if (context->arrayTypeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003949 context->recover();
3950 else {
3951 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003952 if (context->arraySizeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003953 context->recover();
3954 (yyval.interm.type).setArray(true, size);
3955 }
3956 }
3957 break;
3958
Alexis Hetue5246692015-06-18 12:34:52 -04003959 case 156:
Alexis Hetu17809052015-05-13 11:28:22 -04003960
3961 {
3962 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003963 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003964 }
3965 break;
3966
Alexis Hetu17809052015-05-13 11:28:22 -04003967 case 157:
3968
3969 {
3970 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003971 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003972 }
3973 break;
3974
3975 case 158:
3976
3977 {
3978 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003979 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003980 }
3981 break;
3982
3983 case 159:
3984
3985 {
3986 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003987 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003988 }
3989 break;
3990
3991 case 160:
3992
3993 {
3994 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003995 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04003996 }
3997 break;
3998
3999 case 161:
4000
4001 {
4002 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004003 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004004 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04004005 }
4006 break;
4007
4008 case 162:
4009
4010 {
4011 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004012 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004013 (yyval.interm.type).setAggregate(3);
Alexis Hetua35d8232015-06-11 17:11:06 -04004014 }
4015 break;
4016
4017 case 163:
4018
4019 {
4020 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04004021 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4022 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04004023 }
4024 break;
4025
4026 case 164:
4027
4028 {
4029 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004030 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004031 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04004032 }
4033 break;
4034
4035 case 165:
4036
4037 {
4038 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004039 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004040 (yyval.interm.type).setAggregate(3);
Alexis Hetu17809052015-05-13 11:28:22 -04004041 }
4042 break;
4043
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004044 case 166:
4045
4046 {
4047 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04004048 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
4049 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04004050 }
4051 break;
4052
4053 case 167:
4054
4055 {
4056 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004057 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004058 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04004059 }
4060 break;
4061
4062 case 168:
4063
4064 {
4065 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004066 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004067 (yyval.interm.type).setAggregate(3);
Alexis Hetua35d8232015-06-11 17:11:06 -04004068 }
4069 break;
4070
4071 case 169:
4072
4073 {
4074 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04004075 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
4076 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04004077 }
4078 break;
4079
4080 case 170:
4081
4082 {
4083 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004084 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004085 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04004086 }
4087 break;
4088
4089 case 171:
4090
4091 {
4092 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004093 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04004094 (yyval.interm.type).setAggregate(3);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004095 }
4096 break;
4097
Alexis Hetua35d8232015-06-11 17:11:06 -04004098 case 172:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004099
4100 {
Alexis Hetue5246692015-06-18 12:34:52 -04004101 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4102 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
4103 (yyval.interm.type).setAggregate(4);
4104 }
4105 break;
4106
4107 case 173:
4108
4109 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004110 FRAG_VERT_ONLY("mat2", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004111 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004112 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004113 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004114 }
4115 break;
4116
Alexis Hetue5246692015-06-18 12:34:52 -04004117 case 174:
John Bauman66b8ab22014-05-06 15:57:45 -04004118
4119 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004120 FRAG_VERT_ONLY("mat3", (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(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004123 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004124 }
4125 break;
4126
Alexis Hetue5246692015-06-18 12:34:52 -04004127 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004128
4129 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004130 FRAG_VERT_ONLY("mat4", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004131 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004132 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004133 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004134 }
4135 break;
4136
Alexis Hetue5246692015-06-18 12:34:52 -04004137 case 176:
John Bauman66b8ab22014-05-06 15:57:45 -04004138
4139 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004140 FRAG_VERT_ONLY("mat2x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004141 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004142 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004143 (yyval.interm.type).setMatrix(2, 3);
4144 }
4145 break;
4146
Alexis Hetue5246692015-06-18 12:34:52 -04004147 case 177:
Alexis Hetub14178b2015-04-13 13:23:20 -04004148
4149 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004150 FRAG_VERT_ONLY("mat3x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004151 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004152 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004153 (yyval.interm.type).setMatrix(3, 2);
4154 }
4155 break;
4156
Alexis Hetue5246692015-06-18 12:34:52 -04004157 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004158
4159 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004160 FRAG_VERT_ONLY("mat2x4", (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(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004163 (yyval.interm.type).setMatrix(2, 4);
4164 }
4165 break;
4166
Alexis Hetue5246692015-06-18 12:34:52 -04004167 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004168
4169 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004170 FRAG_VERT_ONLY("mat4x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004171 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004172 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004173 (yyval.interm.type).setMatrix(4, 2);
4174 }
4175 break;
4176
Alexis Hetue5246692015-06-18 12:34:52 -04004177 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004178
4179 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004180 FRAG_VERT_ONLY("mat3x4", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004181 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004182 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004183 (yyval.interm.type).setMatrix(3, 4);
4184 }
4185 break;
4186
Alexis Hetue5246692015-06-18 12:34:52 -04004187 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004188
4189 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004190 FRAG_VERT_ONLY("mat4x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004191 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004192 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004193 (yyval.interm.type).setMatrix(4, 3);
4194 }
4195 break;
4196
Alexis Hetue5246692015-06-18 12:34:52 -04004197 case 182:
Alexis Hetub14178b2015-04-13 13:23:20 -04004198
4199 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004200 FRAG_VERT_ONLY("sampler2D", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004201 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004202 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004203 }
4204 break;
4205
Alexis Hetue5246692015-06-18 12:34:52 -04004206 case 183:
John Bauman66b8ab22014-05-06 15:57:45 -04004207
4208 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004209 FRAG_VERT_ONLY("samplerCube", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004210 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004211 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004212 }
4213 break;
4214
Alexis Hetue5246692015-06-18 12:34:52 -04004215 case 184:
John Bauman66b8ab22014-05-06 15:57:45 -04004216
4217 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004218 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004219 context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES", "");
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004220 context->recover();
4221 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004222 FRAG_VERT_ONLY("samplerExternalOES", (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004223 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004224 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004225 }
4226 break;
4227
Alexis Hetue5246692015-06-18 12:34:52 -04004228 case 185:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004229
4230 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004231 FRAG_VERT_ONLY("sampler3D", (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004232 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004233 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004234 }
4235 break;
4236
Alexis Hetue5246692015-06-18 12:34:52 -04004237 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004238
4239 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004240 FRAG_VERT_ONLY("sampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004241 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004242 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004243 }
4244 break;
4245
Alexis Hetue5246692015-06-18 12:34:52 -04004246 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004247
4248 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004249 FRAG_VERT_ONLY("isampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004250 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004251 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004252 }
4253 break;
4254
Alexis Hetue5246692015-06-18 12:34:52 -04004255 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004256
4257 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004258 FRAG_VERT_ONLY("isampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004259 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004260 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004261 }
4262 break;
4263
Alexis Hetue5246692015-06-18 12:34:52 -04004264 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004265
4266 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004267 FRAG_VERT_ONLY("isamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004268 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004269 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004270 }
4271 break;
4272
Alexis Hetue5246692015-06-18 12:34:52 -04004273 case 190:
Alexis Hetub14178b2015-04-13 13:23:20 -04004274
4275 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004276 FRAG_VERT_ONLY("isampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004277 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004278 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004279 }
4280 break;
4281
Alexis Hetue5246692015-06-18 12:34:52 -04004282 case 191:
Alexis Hetub14178b2015-04-13 13:23:20 -04004283
4284 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004285 FRAG_VERT_ONLY("usampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004286 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004287 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004288 }
4289 break;
4290
Alexis Hetue5246692015-06-18 12:34:52 -04004291 case 192:
Alexis Hetub14178b2015-04-13 13:23:20 -04004292
4293 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004294 FRAG_VERT_ONLY("usampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004295 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004296 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004297 }
4298 break;
4299
Alexis Hetue5246692015-06-18 12:34:52 -04004300 case 193:
Alexis Hetub14178b2015-04-13 13:23:20 -04004301
4302 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004303 FRAG_VERT_ONLY("usamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004304 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004305 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004306 }
4307 break;
4308
Alexis Hetue5246692015-06-18 12:34:52 -04004309 case 194:
Alexis Hetub14178b2015-04-13 13:23:20 -04004310
4311 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004312 FRAG_VERT_ONLY("usampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004313 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004314 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004315 }
4316 break;
4317
Alexis Hetue5246692015-06-18 12:34:52 -04004318 case 195:
Alexis Hetub14178b2015-04-13 13:23:20 -04004319
4320 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004321 FRAG_VERT_ONLY("sampler2DShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004322 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004323 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004324 }
4325 break;
4326
Alexis Hetue5246692015-06-18 12:34:52 -04004327 case 196:
Alexis Hetub14178b2015-04-13 13:23:20 -04004328
4329 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004330 FRAG_VERT_ONLY("samplerCubeShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004331 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004332 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004333 }
4334 break;
4335
Alexis Hetue5246692015-06-18 12:34:52 -04004336 case 197:
Alexis Hetub14178b2015-04-13 13:23:20 -04004337
4338 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004339 FRAG_VERT_ONLY("sampler2DArrayShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004340 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004341 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004342 }
4343 break;
4344
Alexis Hetue5246692015-06-18 12:34:52 -04004345 case 198:
Alexis Hetub027aa92015-01-19 15:56:12 -05004346
4347 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004348 FRAG_VERT_ONLY("struct", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004349 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4350 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4351 }
4352 break;
4353
Alexis Hetue5246692015-06-18 12:34:52 -04004354 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004355
4356 {
4357 //
4358 // This is for user defined type names. The lexical phase looked up the
4359 // type.
4360 //
4361 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4362 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004363 (yyval.interm.type).setBasic(EbtStruct, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004364 (yyval.interm.type).userDef = &structure;
4365 }
4366 break;
4367
Alexis Hetue5246692015-06-18 12:34:52 -04004368 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004369
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004370 { if (context->enterStructDeclaration((yylsp[(2) - (3)]), *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004371 break;
4372
Alexis Hetue5246692015-06-18 12:34:52 -04004373 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004374
4375 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004376 (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 -04004377 }
4378 break;
4379
Alexis Hetue5246692015-06-18 12:34:52 -04004380 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004381
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004382 { if (context->enterStructDeclaration((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004383 break;
4384
Alexis Hetue5246692015-06-18 12:34:52 -04004385 case 203:
John Bauman66b8ab22014-05-06 15:57:45 -04004386
4387 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004388 (yyval.interm.type) = context->addStructure((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004389 }
4390 break;
4391
Alexis Hetue5246692015-06-18 12:34:52 -04004392 case 204:
John Bauman66b8ab22014-05-06 15:57:45 -04004393
4394 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004395 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
John Bauman66b8ab22014-05-06 15:57:45 -04004396 }
4397 break;
4398
Alexis Hetue5246692015-06-18 12:34:52 -04004399 case 205:
John Bauman66b8ab22014-05-06 15:57:45 -04004400
4401 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004402 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
4403 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) {
4404 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i];
4405 for (unsigned int j = 0; j < (yyval.interm.fieldList)->size(); ++j) {
4406 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) {
4407 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 -04004408 context->recover();
4409 }
4410 }
Alexis Hetua8b364b2015-06-10 11:48:40 -04004411 (yyval.interm.fieldList)->push_back((*(yyvsp[(2) - (2)].interm.fieldList))[i]);
John Bauman66b8ab22014-05-06 15:57:45 -04004412 }
4413 }
4414 break;
4415
Alexis Hetue5246692015-06-18 12:34:52 -04004416 case 206:
John Bauman66b8ab22014-05-06 15:57:45 -04004417
4418 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004419 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004420 }
4421 break;
4422
Alexis Hetue5246692015-06-18 12:34:52 -04004423 case 207:
John Bauman66b8ab22014-05-06 15:57:45 -04004424
4425 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004426 // ES3 Only, but errors should be handled elsewhere
4427 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4428 (yyvsp[(2) - (4)].interm.type).layoutQualifier = (yyvsp[(1) - (4)].interm.type).layoutQualifier;
4429 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.fieldList));
4430 }
4431 break;
4432
Alexis Hetue5246692015-06-18 12:34:52 -04004433 case 208:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004434
4435 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004436 (yyval.interm.fieldList) = NewPoolTFieldList();
4437 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004438 }
4439 break;
4440
Alexis Hetue5246692015-06-18 12:34:52 -04004441 case 209:
John Bauman66b8ab22014-05-06 15:57:45 -04004442
4443 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004444 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004445 }
4446 break;
4447
Alexis Hetue5246692015-06-18 12:34:52 -04004448 case 210:
John Bauman66b8ab22014-05-06 15:57:45 -04004449
4450 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004451 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004452 context->recover();
4453
Alexis Hetua8b364b2015-06-10 11:48:40 -04004454 TType* type = new TType(EbtVoid, EbpUndefined);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004455 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004456 }
4457 break;
4458
Alexis Hetue5246692015-06-18 12:34:52 -04004459 case 211:
John Bauman66b8ab22014-05-06 15:57:45 -04004460
4461 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004462 if (context->reservedErrorCheck((yylsp[(1) - (4)]), *(yyvsp[(1) - (4)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004463 context->recover();
4464
Alexis Hetua8b364b2015-06-10 11:48:40 -04004465 TType* type = new TType(EbtVoid, EbpUndefined);
John Bauman66b8ab22014-05-06 15:57:45 -04004466 int size;
Alexis Hetua8b364b2015-06-10 11:48:40 -04004467 if (context->arraySizeErrorCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLine(), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04004468 context->recover();
Alexis Hetua8b364b2015-06-10 11:48:40 -04004469 type->setArraySize(size);
4470
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004471 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yylsp[(1) - (4)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004472 }
4473 break;
4474
Alexis Hetue5246692015-06-18 12:34:52 -04004475 case 212:
Nicolas Capens7d626792015-02-17 17:58:31 -05004476
Alexis Hetua35d8232015-06-11 17:11:06 -04004477 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004478 break;
4479
Alexis Hetu17809052015-05-13 11:28:22 -04004480 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004481
Alexis Hetue5246692015-06-18 12:34:52 -04004482 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004483 break;
4484
Alexis Hetu17809052015-05-13 11:28:22 -04004485 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004486
Alexis Hetue5246692015-06-18 12:34:52 -04004487 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004488 break;
4489
Alexis Hetu17809052015-05-13 11:28:22 -04004490 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004491
Alexis Hetua35d8232015-06-11 17:11:06 -04004492 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetuad6b8752015-06-09 16:15:30 -04004493 break;
4494
4495 case 216:
4496
Alexis Hetua35d8232015-06-11 17:11:06 -04004497 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004498 break;
4499
4500 case 217:
4501
Alexis Hetua35d8232015-06-11 17:11:06 -04004502 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004503 break;
4504
4505 case 218:
4506
Alexis Hetue5246692015-06-18 12:34:52 -04004507 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004508 break;
4509
4510 case 219:
4511
Alexis Hetue5246692015-06-18 12:34:52 -04004512 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermSwitch); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004513 break;
4514
4515 case 220:
4516
Alexis Hetue5246692015-06-18 12:34:52 -04004517 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermCase); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004518 break;
4519
4520 case 221:
4521
Alexis Hetu76a343a2015-06-04 17:21:22 -04004522 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004523 break;
4524
4525 case 222:
4526
Alexis Hetue5246692015-06-18 12:34:52 -04004527 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004528 break;
4529
4530 case 223:
4531
Alexis Hetue5246692015-06-18 12:34:52 -04004532 { (yyval.interm.intermAggregate) = 0; }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004533 break;
4534
4535 case 224:
4536
Alexis Hetue5246692015-06-18 12:34:52 -04004537 { context->symbolTable.push(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004538 break;
4539
4540 case 225:
4541
Alexis Hetue5246692015-06-18 12:34:52 -04004542 { context->symbolTable.pop(); }
4543 break;
4544
4545 case 226:
4546
Nicolas Capens7d626792015-02-17 17:58:31 -05004547 {
4548 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4549 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004550 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yylsp[(5) - (5)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05004551 }
4552 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4553 }
4554 break;
4555
Alexis Hetua35d8232015-06-11 17:11:06 -04004556 case 227:
4557
Alexis Hetu76a343a2015-06-04 17:21:22 -04004558 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004559 break;
4560
4561 case 228:
4562
Alexis Hetue5246692015-06-18 12:34:52 -04004563 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004564 break;
4565
4566 case 229:
4567
Alexis Hetue5246692015-06-18 12:34:52 -04004568 { context->symbolTable.push(); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004569 break;
4570
4571 case 230:
4572
Alexis Hetue5246692015-06-18 12:34:52 -04004573 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004574 break;
4575
4576 case 231:
4577
Alexis Hetue5246692015-06-18 12:34:52 -04004578 { context->symbolTable.push(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004579 break;
4580
4581 case 232:
4582
Alexis Hetue5246692015-06-18 12:34:52 -04004583 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4584 break;
4585
4586 case 233:
4587
John Bauman66b8ab22014-05-06 15:57:45 -04004588 {
4589 (yyval.interm.intermNode) = 0;
4590 }
4591 break;
4592
Alexis Hetue5246692015-06-18 12:34:52 -04004593 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004594
4595 {
4596 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4597 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004598 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yylsp[(3) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004599 }
4600 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4601 }
4602 break;
4603
Alexis Hetue5246692015-06-18 12:34:52 -04004604 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004605
4606 {
4607 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4608 }
4609 break;
4610
Alexis Hetue5246692015-06-18 12:34:52 -04004611 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004612
4613 {
4614 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4615 }
4616 break;
4617
Alexis Hetue5246692015-06-18 12:34:52 -04004618 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04004619
4620 { (yyval.interm.intermNode) = 0; }
4621 break;
4622
Alexis Hetue5246692015-06-18 12:34:52 -04004623 case 238:
John Bauman66b8ab22014-05-06 15:57:45 -04004624
4625 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4626 break;
4627
Alexis Hetue5246692015-06-18 12:34:52 -04004628 case 239:
John Bauman66b8ab22014-05-06 15:57:45 -04004629
4630 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004631 if (context->boolErrorCheck((yylsp[(1) - (5)]), (yyvsp[(3) - (5)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004632 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004633 (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 -04004634 }
4635 break;
4636
Alexis Hetue5246692015-06-18 12:34:52 -04004637 case 240:
John Bauman66b8ab22014-05-06 15:57:45 -04004638
4639 {
4640 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4641 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4642 }
4643 break;
4644
Alexis Hetue5246692015-06-18 12:34:52 -04004645 case 241:
John Bauman66b8ab22014-05-06 15:57:45 -04004646
4647 {
4648 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4649 (yyval.interm.nodePair).node2 = 0;
4650 }
4651 break;
4652
Alexis Hetu76a343a2015-06-04 17:21:22 -04004653 case 242:
4654
Alexis Hetue5246692015-06-18 12:34:52 -04004655 { context->incrSwitchNestingLevel(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004656 break;
4657
4658 case 243:
4659
4660 {
Alexis Hetue5246692015-06-18 12:34:52 -04004661 (yyval.interm.intermSwitch) = context->addSwitch((yyvsp[(3) - (6)].interm.intermTypedNode), (yyvsp[(6) - (6)].interm.intermAggregate), (yylsp[(1) - (6)]));
4662 context->decrSwitchNestingLevel();
Alexis Hetu76a343a2015-06-04 17:21:22 -04004663 }
4664 break;
4665
4666 case 244:
4667
4668 {
Alexis Hetue5246692015-06-18 12:34:52 -04004669 (yyval.interm.intermCase) = context->addCase((yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
Alexis Hetu76a343a2015-06-04 17:21:22 -04004670 }
4671 break;
4672
4673 case 245:
John Bauman66b8ab22014-05-06 15:57:45 -04004674
4675 {
Alexis Hetue5246692015-06-18 12:34:52 -04004676 (yyval.interm.intermCase) = context->addDefault((yylsp[(1) - (2)]));
4677 }
4678 break;
4679
4680 case 246:
4681
4682 {
John Bauman66b8ab22014-05-06 15:57:45 -04004683 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4684 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4685 context->recover();
4686 }
4687 break;
4688
Alexis Hetue5246692015-06-18 12:34:52 -04004689 case 247:
John Bauman66b8ab22014-05-06 15:57:45 -04004690
4691 {
4692 TIntermNode* intermNode;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004693 if (context->structQualifierErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004694 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004695 if (context->boolErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004696 context->recover();
4697
Alexis Hetue5246692015-06-18 12:34:52 -04004698 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 -04004699 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4700 else {
4701 context->recover();
4702 (yyval.interm.intermTypedNode) = 0;
4703 }
4704 }
4705 break;
4706
Alexis Hetue5246692015-06-18 12:34:52 -04004707 case 248:
John Bauman66b8ab22014-05-06 15:57:45 -04004708
Alexis Hetu0a655842015-06-22 16:52:11 -04004709 { context->symbolTable.push(); context->incrLoopNestingLevel(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004710 break;
4711
Alexis Hetue5246692015-06-18 12:34:52 -04004712 case 249:
John Bauman66b8ab22014-05-06 15:57:45 -04004713
4714 {
4715 context->symbolTable.pop();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004716 (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 -04004717 context->decrLoopNestingLevel();
John Bauman66b8ab22014-05-06 15:57:45 -04004718 }
4719 break;
4720
Alexis Hetue5246692015-06-18 12:34:52 -04004721 case 250:
John Bauman66b8ab22014-05-06 15:57:45 -04004722
Alexis Hetu0a655842015-06-22 16:52:11 -04004723 { context->incrLoopNestingLevel(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004724 break;
4725
Alexis Hetue5246692015-06-18 12:34:52 -04004726 case 251:
John Bauman66b8ab22014-05-06 15:57:45 -04004727
4728 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004729 if (context->boolErrorCheck((yylsp[(8) - (8)]), (yyvsp[(6) - (8)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004730 context->recover();
4731
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004732 (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 -04004733 context->decrLoopNestingLevel();
John Bauman66b8ab22014-05-06 15:57:45 -04004734 }
4735 break;
4736
Alexis Hetu76a343a2015-06-04 17:21:22 -04004737 case 252:
Alexis Hetub027aa92015-01-19 15:56:12 -05004738
Alexis Hetu0a655842015-06-22 16:52:11 -04004739 { context->symbolTable.push(); context->incrLoopNestingLevel(); }
Nicolas Capens3c20f802015-02-17 17:17:20 -05004740 break;
4741
Alexis Hetu76a343a2015-06-04 17:21:22 -04004742 case 253:
Alexis Hetu17809052015-05-13 11:28:22 -04004743
4744 {
Alexis Hetue5246692015-06-18 12:34:52 -04004745 context->symbolTable.pop();
4746 (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 -04004747 context->decrLoopNestingLevel();
Alexis Hetu17809052015-05-13 11:28:22 -04004748 }
4749 break;
4750
Alexis Hetu76a343a2015-06-04 17:21:22 -04004751 case 254:
Alexis Hetu17809052015-05-13 11:28:22 -04004752
4753 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004754 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetuad6b8752015-06-09 16:15:30 -04004755 }
4756 break;
4757
Alexis Hetu76a343a2015-06-04 17:21:22 -04004758 case 255:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004759
4760 {
Alexis Hetue5246692015-06-18 12:34:52 -04004761 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004762 }
4763 break;
4764
Alexis Hetu76a343a2015-06-04 17:21:22 -04004765 case 256:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004766
4767 {
Alexis Hetue5246692015-06-18 12:34:52 -04004768 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004769 }
4770 break;
4771
Alexis Hetu76a343a2015-06-04 17:21:22 -04004772 case 257:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004773
4774 {
Alexis Hetue5246692015-06-18 12:34:52 -04004775 (yyval.interm.intermTypedNode) = 0;
4776 }
4777 break;
4778
4779 case 258:
4780
4781 {
Alexis Hetu17809052015-05-13 11:28:22 -04004782 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4783 (yyval.interm.nodePair).node2 = 0;
4784 }
4785 break;
4786
Alexis Hetue5246692015-06-18 12:34:52 -04004787 case 259:
Alexis Hetu17809052015-05-13 11:28:22 -04004788
4789 {
4790 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4791 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
4792 }
4793 break;
4794
Alexis Hetue5246692015-06-18 12:34:52 -04004795 case 260:
Alexis Hetu17809052015-05-13 11:28:22 -04004796
4797 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004798 (yyval.interm.intermNode) = context->addBranch(EOpContinue, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004799 }
4800 break;
4801
Alexis Hetue5246692015-06-18 12:34:52 -04004802 case 261:
Alexis Hetu17809052015-05-13 11:28:22 -04004803
4804 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004805 (yyval.interm.intermNode) = context->addBranch(EOpBreak, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004806 }
4807 break;
4808
Alexis Hetue5246692015-06-18 12:34:52 -04004809 case 262:
Alexis Hetu17809052015-05-13 11:28:22 -04004810
4811 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004812 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004813 }
4814 break;
4815
Alexis Hetue5246692015-06-18 12:34:52 -04004816 case 263:
Alexis Hetu17809052015-05-13 11:28:22 -04004817
4818 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004819 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004820 }
4821 break;
4822
Alexis Hetue5246692015-06-18 12:34:52 -04004823 case 264:
Alexis Hetu17809052015-05-13 11:28:22 -04004824
4825 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004826 FRAG_ONLY("discard", (yylsp[(1) - (2)]));
4827 (yyval.interm.intermNode) = context->addBranch(EOpKill, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004828 }
4829 break;
4830
Alexis Hetu76a343a2015-06-04 17:21:22 -04004831 case 265:
Alexis Hetu17809052015-05-13 11:28:22 -04004832
4833 {
Alexis Hetue5246692015-06-18 12:34:52 -04004834 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetu0a655842015-06-22 16:52:11 -04004835 context->setTreeRoot((yyval.interm.intermNode));
Alexis Hetu17809052015-05-13 11:28:22 -04004836 }
4837 break;
4838
Alexis Hetu76a343a2015-06-04 17:21:22 -04004839 case 266:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004840
4841 {
Alexis Hetue5246692015-06-18 12:34:52 -04004842 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
Alexis Hetu0a655842015-06-22 16:52:11 -04004843 context->setTreeRoot((yyval.interm.intermNode));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004844 }
4845 break;
4846
Alexis Hetu76a343a2015-06-04 17:21:22 -04004847 case 267:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004848
4849 {
4850 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4851 }
4852 break;
4853
Alexis Hetu76a343a2015-06-04 17:21:22 -04004854 case 268:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004855
4856 {
Alexis Hetue5246692015-06-18 12:34:52 -04004857 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4858 }
4859 break;
4860
4861 case 269:
4862
4863 {
John Bauman66b8ab22014-05-06 15:57:45 -04004864 TFunction* function = (yyvsp[(1) - (1)].interm).function;
4865
Alexis Hetu0a655842015-06-22 16:52:11 -04004866 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->getShaderVersion());
John Bauman66b8ab22014-05-06 15:57:45 -04004867
4868 if (builtIn)
4869 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004870 context->error((yylsp[(1) - (1)]), "built-in functions cannot be redefined", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004871 context->recover();
4872 }
4873
Alexis Hetu0a655842015-06-22 16:52:11 -04004874 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->getShaderVersion()));
John Bauman66b8ab22014-05-06 15:57:45 -04004875 //
4876 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4877 // as it would have just been put in the symbol table. Otherwise, we're looking up
4878 // an earlier occurance.
4879 //
4880 if (prevDec->isDefined()) {
4881 //
4882 // Then this function already has a body.
4883 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004884 context->error((yylsp[(1) - (1)]), "function already has a body", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004885 context->recover();
4886 }
4887 prevDec->setDefined();
4888
4889 //
4890 // Raise error message if main function takes any parameters or return anything other than void
4891 //
4892 if (function->getName() == "main") {
4893 if (function->getParamCount() > 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004894 context->error((yylsp[(1) - (1)]), "function cannot take any parameter(s)", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004895 context->recover();
4896 }
4897 if (function->getReturnType().getBasicType() != EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004898 context->error((yylsp[(1) - (1)]), "", function->getReturnType().getBasicString(), "main function cannot return a value");
John Bauman66b8ab22014-05-06 15:57:45 -04004899 context->recover();
4900 }
4901 }
4902
4903 //
4904 // Remember the return type for later checking for RETURN statements.
4905 //
Alexis Hetu0a655842015-06-22 16:52:11 -04004906 context->setCurrentFunctionType(&(prevDec->getReturnType()));
4907 context->setFunctionReturnsValue(false);
John Bauman66b8ab22014-05-06 15:57:45 -04004908
4909 //
4910 // Insert parameters into the symbol table.
4911 // If the parameter has no name, it's not an error, just don't insert it
4912 // (could be used for unused args).
4913 //
4914 // Also, accumulate the list of parameters into the HIL, so lower level code
4915 // knows where to find parameters.
4916 //
4917 TIntermAggregate* paramNodes = new TIntermAggregate;
Alexis Hetu76a343a2015-06-04 17:21:22 -04004918 for (size_t i = 0; i < function->getParamCount(); i++) {
John Bauman66b8ab22014-05-06 15:57:45 -04004919 const TParameter& param = function->getParam(i);
4920 if (param.name != 0) {
4921 TVariable *variable = new TVariable(param.name, *param.type);
4922 //
4923 // Insert the parameters with name in the symbol table.
4924 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05004925 if (! context->symbolTable.declare(*variable)) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004926 context->error((yylsp[(1) - (1)]), "redefinition", variable->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004927 context->recover();
4928 delete variable;
4929 }
4930
4931 //
4932 // Add the parameter to the HIL
4933 //
4934 paramNodes = context->intermediate.growAggregate(
4935 paramNodes,
4936 context->intermediate.addSymbol(variable->getUniqueId(),
4937 variable->getName(),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004938 variable->getType(), (yylsp[(1) - (1)])),
4939 (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004940 } else {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004941 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (1)])), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004942 }
4943 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004944 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004945 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
Alexis Hetu0a655842015-06-22 16:52:11 -04004946 context->setLoopNestingLevel(0);
John Bauman66b8ab22014-05-06 15:57:45 -04004947 }
4948 break;
4949
Alexis Hetue5246692015-06-18 12:34:52 -04004950 case 270:
John Bauman66b8ab22014-05-06 15:57:45 -04004951
4952 {
4953 //?? Check that all paths return a value if return type != void ?
4954 // May be best done as post process phase on intermediate code
Alexis Hetu0a655842015-06-22 16:52:11 -04004955 if (context->getCurrentFunctionType()->getBasicType() != EbtVoid && ! context->getFunctionReturnsValue()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004956 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 -04004957 context->recover();
4958 }
4959
4960 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004961 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yylsp[(1) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004962 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4963 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4964
4965 // store the pragma information for debug and optimize and other vendor specific
4966 // information. This information can be queried from the parse tree
4967 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4968 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
4969
4970 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4971 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
4972
4973 context->symbolTable.pop();
4974 }
4975 break;
4976
4977
4978
4979 default: break;
4980 }
4981 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4982
4983 YYPOPSTACK (yylen);
4984 yylen = 0;
4985 YY_STACK_PRINT (yyss, yyssp);
4986
4987 *++yyvsp = yyval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004988 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04004989
4990 /* Now `shift' the result of the reduction. Determine what state
4991 that goes to, based on the state we popped back to and the rule
4992 number reduced by. */
4993
4994 yyn = yyr1[yyn];
4995
4996 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4997 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4998 yystate = yytable[yystate];
4999 else
5000 yystate = yydefgoto[yyn - YYNTOKENS];
5001
5002 goto yynewstate;
5003
5004
5005/*------------------------------------.
5006| yyerrlab -- here on detecting error |
5007`------------------------------------*/
5008yyerrlab:
5009 /* If not already recovering from an error, report this error. */
5010 if (!yyerrstatus)
5011 {
5012 ++yynerrs;
5013#if ! YYERROR_VERBOSE
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005014 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04005015#else
5016 {
5017 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
5018 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
5019 {
5020 YYSIZE_T yyalloc = 2 * yysize;
5021 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
5022 yyalloc = YYSTACK_ALLOC_MAXIMUM;
5023 if (yymsg != yymsgbuf)
5024 YYSTACK_FREE (yymsg);
5025 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
5026 if (yymsg)
5027 yymsg_alloc = yyalloc;
5028 else
5029 {
5030 yymsg = yymsgbuf;
5031 yymsg_alloc = sizeof yymsgbuf;
5032 }
5033 }
5034
5035 if (0 < yysize && yysize <= yymsg_alloc)
5036 {
5037 (void) yysyntax_error (yymsg, yystate, yychar);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005038 yyerror (&yylloc, context, yymsg);
John Bauman66b8ab22014-05-06 15:57:45 -04005039 }
5040 else
5041 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005042 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04005043 if (yysize != 0)
5044 goto yyexhaustedlab;
5045 }
5046 }
5047#endif
5048 }
5049
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005050 yyerror_range[0] = yylloc;
John Bauman66b8ab22014-05-06 15:57:45 -04005051
5052 if (yyerrstatus == 3)
5053 {
5054 /* If just tried and failed to reuse lookahead token after an
5055 error, discard it. */
5056
5057 if (yychar <= YYEOF)
5058 {
5059 /* Return failure if at end of input. */
5060 if (yychar == YYEOF)
5061 YYABORT;
5062 }
5063 else
5064 {
5065 yydestruct ("Error: discarding",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005066 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005067 yychar = YYEMPTY;
5068 }
5069 }
5070
5071 /* Else will try to reuse lookahead token after shifting the error
5072 token. */
5073 goto yyerrlab1;
5074
5075
5076/*---------------------------------------------------.
5077| yyerrorlab -- error raised explicitly by YYERROR. |
5078`---------------------------------------------------*/
5079yyerrorlab:
5080
5081 /* Pacify compilers like GCC when the user code never invokes
5082 YYERROR and the label yyerrorlab therefore never appears in user
5083 code. */
5084 if (/*CONSTCOND*/ 0)
5085 goto yyerrorlab;
5086
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005087 yyerror_range[0] = yylsp[1-yylen];
John Bauman66b8ab22014-05-06 15:57:45 -04005088 /* Do not reclaim the symbols of the rule which action triggered
5089 this YYERROR. */
5090 YYPOPSTACK (yylen);
5091 yylen = 0;
5092 YY_STACK_PRINT (yyss, yyssp);
5093 yystate = *yyssp;
5094 goto yyerrlab1;
5095
5096
5097/*-------------------------------------------------------------.
5098| yyerrlab1 -- common code for both syntax error and YYERROR. |
5099`-------------------------------------------------------------*/
5100yyerrlab1:
5101 yyerrstatus = 3; /* Each real token shifted decrements this. */
5102
5103 for (;;)
5104 {
5105 yyn = yypact[yystate];
5106 if (yyn != YYPACT_NINF)
5107 {
5108 yyn += YYTERROR;
5109 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5110 {
5111 yyn = yytable[yyn];
5112 if (0 < yyn)
5113 break;
5114 }
5115 }
5116
5117 /* Pop the current state because it cannot handle the error token. */
5118 if (yyssp == yyss)
5119 YYABORT;
5120
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005121 yyerror_range[0] = *yylsp;
John Bauman66b8ab22014-05-06 15:57:45 -04005122 yydestruct ("Error: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005123 yystos[yystate], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005124 YYPOPSTACK (1);
5125 yystate = *yyssp;
5126 YY_STACK_PRINT (yyss, yyssp);
5127 }
5128
5129 *++yyvsp = yylval;
5130
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005131 yyerror_range[1] = yylloc;
5132 /* Using YYLLOC is tempting, but would change the location of
5133 the lookahead. YYLOC is available though. */
5134 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
5135 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04005136
5137 /* Shift the error token. */
5138 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5139
5140 yystate = yyn;
5141 goto yynewstate;
5142
5143
5144/*-------------------------------------.
5145| yyacceptlab -- YYACCEPT comes here. |
5146`-------------------------------------*/
5147yyacceptlab:
5148 yyresult = 0;
5149 goto yyreturn;
5150
5151/*-----------------------------------.
5152| yyabortlab -- YYABORT comes here. |
5153`-----------------------------------*/
5154yyabortlab:
5155 yyresult = 1;
5156 goto yyreturn;
5157
5158#if !defined(yyoverflow) || YYERROR_VERBOSE
5159/*-------------------------------------------------.
5160| yyexhaustedlab -- memory exhaustion comes here. |
5161`-------------------------------------------------*/
5162yyexhaustedlab:
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005163 yyerror (&yylloc, context, YY_("memory exhausted"));
John Bauman66b8ab22014-05-06 15:57:45 -04005164 yyresult = 2;
5165 /* Fall through. */
5166#endif
5167
5168yyreturn:
5169 if (yychar != YYEMPTY)
5170 yydestruct ("Cleanup: discarding lookahead",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005171 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005172 /* Do not reclaim the symbols of the rule which action triggered
5173 this YYABORT or YYACCEPT. */
5174 YYPOPSTACK (yylen);
5175 YY_STACK_PRINT (yyss, yyssp);
5176 while (yyssp != yyss)
5177 {
5178 yydestruct ("Cleanup: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005179 yystos[*yyssp], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005180 YYPOPSTACK (1);
5181 }
5182#ifndef yyoverflow
5183 if (yyss != yyssa)
5184 YYSTACK_FREE (yyss);
5185#endif
5186#if YYERROR_VERBOSE
5187 if (yymsg != yymsgbuf)
5188 YYSTACK_FREE (yymsg);
5189#endif
5190 /* Make sure YYID is used. */
5191 return YYID (yyresult);
5192}
5193
5194
5195
5196
5197
5198int glslang_parse(TParseContext* context) {
5199 return yyparse(context);
5200}
5201