blob: 01272ff5ab71033b0e2bbb2c91dbe9bed562187e [file] [log] [blame]
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001
2/* A Bison parser, made by GNU Bison 2.4.1. */
John Bauman66b8ab22014-05-06 15:57:45 -04003
4/* Skeleton implementation for Bison's Yacc-like parsers in C
5
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
John Bauman66b8ab22014-05-06 15:57:45 -04008
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22/* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35/* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
37
38/* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
44
45/* Identify Bison output. */
46#define YYBISON 1
47
48/* Bison version. */
Nicolas Capense9c5e4f2014-05-28 22:46:43 -040049#define YYBISON_VERSION "2.4.1"
John Bauman66b8ab22014-05-06 15:57:45 -040050
51/* Skeleton name. */
52#define YYSKELETON_NAME "yacc.c"
53
54/* Pure parsers. */
55#define YYPURE 1
56
57/* Push parsers. */
58#define YYPUSH 0
59
60/* Pull parsers. */
61#define YYPULL 1
62
63/* Using locations. */
Alexis Hetu15ae36c2015-06-18 21:10:09 -040064#define YYLSP_NEEDED 1
John Bauman66b8ab22014-05-06 15:57:45 -040065
66
67
68/* Copy the first part of user declarations. */
69
70
71//
Alexis Hetub14178b2015-04-13 13:23:20 -040072// Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved.
John Bauman66b8ab22014-05-06 15:57:45 -040073// Use of this source code is governed by a BSD-style license that can be
74// found in the LICENSE file.
75//
76
77// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
78
79// Ignore errors in auto-generated code.
80#if defined(__GNUC__)
81#pragma GCC diagnostic ignored "-Wunused-function"
82#pragma GCC diagnostic ignored "-Wunused-variable"
83#pragma GCC diagnostic ignored "-Wswitch-enum"
84#elif defined(_MSC_VER)
85#pragma warning(disable: 4065)
86#pragma warning(disable: 4189)
87#pragma warning(disable: 4505)
88#pragma warning(disable: 4701)
89#endif
90
Nicolas Capenscc863da2015-01-21 15:50:55 -050091#include "SymbolTable.h"
92#include "ParseHelper.h"
John Bauman66b8ab22014-05-06 15:57:45 -040093
John Baumand4ae8632014-05-06 16:18:33 -040094#define YYENABLE_NLS 0
John Baumand4ae8632014-05-06 16:18:33 -040095
Alexis Hetu0a655842015-06-22 16:52:11 -040096#define YYLEX_PARAM context->getScanner()
John Bauman66b8ab22014-05-06 15:57:45 -040097
98
99
100/* Enabling traces. */
101#ifndef YYDEBUG
102# define YYDEBUG 0
103#endif
104
105/* Enabling verbose error messages. */
106#ifdef YYERROR_VERBOSE
107# undef YYERROR_VERBOSE
108# define YYERROR_VERBOSE 1
109#else
110# define YYERROR_VERBOSE 0
111#endif
112
113/* Enabling the token table. */
114#ifndef YYTOKEN_TABLE
115# define YYTOKEN_TABLE 0
116#endif
117
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400118/* "%code requires" blocks. */
119
120
121#define YYLTYPE TSourceLoc
122#define YYLTYPE_IS_DECLARED 1
123
124
125
John Bauman66b8ab22014-05-06 15:57:45 -0400126
127/* Tokens. */
128#ifndef YYTOKENTYPE
129# define YYTOKENTYPE
130 /* Put the tokens into the symbol table, so that GDB and other debuggers
131 know about them. */
132 enum yytokentype {
133 INVARIANT = 258,
134 HIGH_PRECISION = 259,
135 MEDIUM_PRECISION = 260,
136 LOW_PRECISION = 261,
137 PRECISION = 262,
138 ATTRIBUTE = 263,
139 CONST_QUAL = 264,
140 BOOL_TYPE = 265,
141 FLOAT_TYPE = 266,
142 INT_TYPE = 267,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500143 UINT_TYPE = 268,
144 BREAK = 269,
145 CONTINUE = 270,
146 DO = 271,
147 ELSE = 272,
148 FOR = 273,
149 IF = 274,
150 DISCARD = 275,
151 RETURN = 276,
152 SWITCH = 277,
153 CASE = 278,
154 DEFAULT = 279,
155 BVEC2 = 280,
156 BVEC3 = 281,
157 BVEC4 = 282,
158 IVEC2 = 283,
159 IVEC3 = 284,
160 IVEC4 = 285,
161 VEC2 = 286,
162 VEC3 = 287,
163 VEC4 = 288,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500164 UVEC2 = 289,
165 UVEC3 = 290,
166 UVEC4 = 291,
167 MATRIX2 = 292,
168 MATRIX3 = 293,
169 MATRIX4 = 294,
170 IN_QUAL = 295,
171 OUT_QUAL = 296,
172 INOUT_QUAL = 297,
173 UNIFORM = 298,
174 VARYING = 299,
Alexis Hetub14178b2015-04-13 13:23:20 -0400175 MATRIX2x3 = 300,
176 MATRIX3x2 = 301,
177 MATRIX2x4 = 302,
178 MATRIX4x2 = 303,
179 MATRIX3x4 = 304,
180 MATRIX4x3 = 305,
181 CENTROID = 306,
182 FLAT = 307,
183 SMOOTH = 308,
184 STRUCT = 309,
185 VOID_TYPE = 310,
186 WHILE = 311,
187 SAMPLER2D = 312,
188 SAMPLERCUBE = 313,
189 SAMPLER_EXTERNAL_OES = 314,
190 SAMPLER2DRECT = 315,
191 SAMPLER2DARRAY = 316,
192 ISAMPLER2D = 317,
193 ISAMPLER3D = 318,
194 ISAMPLERCUBE = 319,
195 ISAMPLER2DARRAY = 320,
196 USAMPLER2D = 321,
197 USAMPLER3D = 322,
198 USAMPLERCUBE = 323,
199 USAMPLER2DARRAY = 324,
200 SAMPLER3D = 325,
201 SAMPLER3DRECT = 326,
202 SAMPLER2DSHADOW = 327,
203 SAMPLERCUBESHADOW = 328,
204 SAMPLER2DARRAYSHADOW = 329,
205 LAYOUT = 330,
206 IDENTIFIER = 331,
207 TYPE_NAME = 332,
208 FLOATCONSTANT = 333,
209 INTCONSTANT = 334,
210 UINTCONSTANT = 335,
211 BOOLCONSTANT = 336,
212 FIELD_SELECTION = 337,
213 LEFT_OP = 338,
214 RIGHT_OP = 339,
215 INC_OP = 340,
216 DEC_OP = 341,
217 LE_OP = 342,
218 GE_OP = 343,
219 EQ_OP = 344,
220 NE_OP = 345,
221 AND_OP = 346,
222 OR_OP = 347,
223 XOR_OP = 348,
224 MUL_ASSIGN = 349,
225 DIV_ASSIGN = 350,
226 ADD_ASSIGN = 351,
227 MOD_ASSIGN = 352,
228 LEFT_ASSIGN = 353,
229 RIGHT_ASSIGN = 354,
230 AND_ASSIGN = 355,
231 XOR_ASSIGN = 356,
232 OR_ASSIGN = 357,
233 SUB_ASSIGN = 358,
234 LEFT_PAREN = 359,
235 RIGHT_PAREN = 360,
236 LEFT_BRACKET = 361,
237 RIGHT_BRACKET = 362,
238 LEFT_BRACE = 363,
239 RIGHT_BRACE = 364,
240 DOT = 365,
241 COMMA = 366,
242 COLON = 367,
243 EQUAL = 368,
244 SEMICOLON = 369,
245 BANG = 370,
246 DASH = 371,
247 TILDE = 372,
248 PLUS = 373,
249 STAR = 374,
250 SLASH = 375,
251 PERCENT = 376,
252 LEFT_ANGLE = 377,
253 RIGHT_ANGLE = 378,
254 VERTICAL_BAR = 379,
255 CARET = 380,
256 AMPERSAND = 381,
257 QUESTION = 382
John Bauman66b8ab22014-05-06 15:57:45 -0400258 };
259#endif
260
261
262
263#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
264typedef union YYSTYPE
265{
266
267
268 struct {
269 TSourceLoc line;
270 union {
271 TString *string;
272 float f;
273 int i;
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500274 unsigned int u;
John Bauman66b8ab22014-05-06 15:57:45 -0400275 bool b;
276 };
277 TSymbol* symbol;
278 } lex;
279 struct {
280 TSourceLoc line;
281 TOperator op;
282 union {
283 TIntermNode* intermNode;
284 TIntermNodePair nodePair;
285 TIntermTyped* intermTypedNode;
286 TIntermAggregate* intermAggregate;
Alexis Hetu76a343a2015-06-04 17:21:22 -0400287 TIntermSwitch* intermSwitch;
288 TIntermCase* intermCase;
John Bauman66b8ab22014-05-06 15:57:45 -0400289 };
290 union {
291 TPublicType type;
292 TPrecision precision;
Nicolas Capens7d626792015-02-17 17:58:31 -0500293 TLayoutQualifier layoutQualifier;
John Bauman66b8ab22014-05-06 15:57:45 -0400294 TQualifier qualifier;
295 TFunction* function;
296 TParameter param;
Alexis Hetua8b364b2015-06-10 11:48:40 -0400297 TField* field;
298 TFieldList* fieldList;
John Bauman66b8ab22014-05-06 15:57:45 -0400299 };
300 } interm;
301
302
303
304} YYSTYPE;
305# define YYSTYPE_IS_TRIVIAL 1
306# define yystype YYSTYPE /* obsolescent; will be withdrawn */
307# define YYSTYPE_IS_DECLARED 1
308#endif
309
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400310#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
311typedef struct YYLTYPE
312{
313 int first_line;
314 int first_column;
315 int last_line;
316 int last_column;
317} YYLTYPE;
318# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
319# define YYLTYPE_IS_DECLARED 1
320# define YYLTYPE_IS_TRIVIAL 1
321#endif
322
John Bauman66b8ab22014-05-06 15:57:45 -0400323
324/* Copy the second part of user declarations. */
325
326
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400327extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner);
328extern void yyerror(YYLTYPE* lloc, TParseContext* context, const char* reason);
329
330#define YYLLOC_DEFAULT(Current, Rhs, N) do { (Current) = YYRHSLOC(Rhs, N ? 1 : 0); } while (0)
John Bauman66b8ab22014-05-06 15:57:45 -0400331
332#define FRAG_VERT_ONLY(S, L) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400333 if (context->getShaderType() != GL_FRAGMENT_SHADER && \
334 context->getShaderType() != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400335 context->error(L, " supported in vertex/fragment shaders only ", S); \
336 context->recover(); \
337 } \
338}
339
340#define VERTEX_ONLY(S, L) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400341 if (context->getShaderType() != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400342 context->error(L, " supported in vertex shaders only ", S); \
343 context->recover(); \
344 } \
345}
346
347#define FRAG_ONLY(S, L) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400348 if (context->getShaderType() != GL_FRAGMENT_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400349 context->error(L, " supported in fragment shaders only ", S); \
350 context->recover(); \
351 } \
352}
353
Nicolas Capensc6841852015-02-15 14:25:37 -0500354#define ES2_ONLY(S, L) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400355 if (context->getShaderVersion() != 100) { \
Nicolas Capensc6841852015-02-15 14:25:37 -0500356 context->error(L, " supported in GLSL ES 1.00 only ", S); \
357 context->recover(); \
358 } \
359}
360
Alexis Hetu3e9e2082015-07-03 16:20:11 -0400361#define ES3_ONLY(TOKEN, LINE, REASON) { \
Alexis Hetu0a655842015-06-22 16:52:11 -0400362 if (context->getShaderVersion() != 300) { \
Alexis Hetu3e9e2082015-07-03 16:20:11 -0400363 context->error(LINE, REASON " supported in GLSL ES 3.00 only ", TOKEN); \
Nicolas Capensc6841852015-02-15 14:25:37 -0500364 context->recover(); \
365 } \
366}
367
John Bauman66b8ab22014-05-06 15:57:45 -0400368
369
370#ifdef short
371# undef short
372#endif
373
374#ifdef YYTYPE_UINT8
375typedef YYTYPE_UINT8 yytype_uint8;
376#else
377typedef unsigned char yytype_uint8;
378#endif
379
380#ifdef YYTYPE_INT8
381typedef YYTYPE_INT8 yytype_int8;
382#elif (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384typedef signed char yytype_int8;
385#else
386typedef short int yytype_int8;
387#endif
388
389#ifdef YYTYPE_UINT16
390typedef YYTYPE_UINT16 yytype_uint16;
391#else
392typedef unsigned short int yytype_uint16;
393#endif
394
395#ifdef YYTYPE_INT16
396typedef YYTYPE_INT16 yytype_int16;
397#else
398typedef short int yytype_int16;
399#endif
400
401#ifndef YYSIZE_T
402# ifdef __SIZE_TYPE__
403# define YYSIZE_T __SIZE_TYPE__
404# elif defined size_t
405# define YYSIZE_T size_t
406# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
407 || defined __cplusplus || defined _MSC_VER)
408# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
409# define YYSIZE_T size_t
410# else
411# define YYSIZE_T unsigned int
412# endif
413#endif
414
415#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
416
417#ifndef YY_
Nicolas Capense9c5e4f2014-05-28 22:46:43 -0400418# if YYENABLE_NLS
John Bauman66b8ab22014-05-06 15:57:45 -0400419# if ENABLE_NLS
420# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
421# define YY_(msgid) dgettext ("bison-runtime", msgid)
422# endif
423# endif
424# ifndef YY_
425# define YY_(msgid) msgid
426# endif
427#endif
428
429/* Suppress unused-variable warnings by "using" E. */
430#if ! defined lint || defined __GNUC__
431# define YYUSE(e) ((void) (e))
432#else
433# define YYUSE(e) /* empty */
434#endif
435
436/* Identity function, used to suppress warnings about constant conditions. */
437#ifndef lint
438# define YYID(n) (n)
439#else
440#if (defined __STDC__ || defined __C99__FUNC__ \
441 || defined __cplusplus || defined _MSC_VER)
442static int
443YYID (int yyi)
444#else
445static int
446YYID (yyi)
447 int yyi;
448#endif
449{
450 return yyi;
451}
452#endif
453
454#if ! defined yyoverflow || YYERROR_VERBOSE
455
456/* The parser invokes alloca or malloc; define the necessary symbols. */
457
458# ifdef YYSTACK_USE_ALLOCA
459# if YYSTACK_USE_ALLOCA
460# ifdef __GNUC__
461# define YYSTACK_ALLOC __builtin_alloca
462# elif defined __BUILTIN_VA_ARG_INCR
463# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
464# elif defined _AIX
465# define YYSTACK_ALLOC __alloca
466# elif defined _MSC_VER
467# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
468# define alloca _alloca
469# else
470# define YYSTACK_ALLOC alloca
471# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
472 || defined __cplusplus || defined _MSC_VER)
473# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
474# ifndef _STDLIB_H
475# define _STDLIB_H 1
476# endif
477# endif
478# endif
479# endif
480# endif
481
482# ifdef YYSTACK_ALLOC
483 /* Pacify GCC's `empty if-body' warning. */
484# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
485# ifndef YYSTACK_ALLOC_MAXIMUM
486 /* The OS might guarantee only one guard page at the bottom of the stack,
487 and a page size can be as small as 4096 bytes. So we cannot safely
488 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
489 to allow for a few compiler-allocated temporary stack slots. */
490# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
491# endif
492# else
493# define YYSTACK_ALLOC YYMALLOC
494# define YYSTACK_FREE YYFREE
495# ifndef YYSTACK_ALLOC_MAXIMUM
496# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
497# endif
498# if (defined __cplusplus && ! defined _STDLIB_H \
499 && ! ((defined YYMALLOC || defined malloc) \
500 && (defined YYFREE || defined free)))
501# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
502# ifndef _STDLIB_H
503# define _STDLIB_H 1
504# endif
505# endif
506# ifndef YYMALLOC
507# define YYMALLOC malloc
508# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
509 || defined __cplusplus || defined _MSC_VER)
510void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
511# endif
512# endif
513# ifndef YYFREE
514# define YYFREE free
515# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
516 || defined __cplusplus || defined _MSC_VER)
517void free (void *); /* INFRINGES ON USER NAME SPACE */
518# endif
519# endif
520# endif
521#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
522
523
524#if (! defined yyoverflow \
525 && (! defined __cplusplus \
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400526 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
527 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
John Bauman66b8ab22014-05-06 15:57:45 -0400528
529/* A type that is properly aligned for any stack member. */
530union yyalloc
531{
532 yytype_int16 yyss_alloc;
533 YYSTYPE yyvs_alloc;
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400534 YYLTYPE yyls_alloc;
John Bauman66b8ab22014-05-06 15:57:45 -0400535};
536
537/* The size of the maximum gap between one aligned stack and the next. */
538# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
539
540/* The size of an array large to enough to hold all stacks, each with
541 N elements. */
542# define YYSTACK_BYTES(N) \
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400543 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
544 + 2 * YYSTACK_GAP_MAXIMUM)
John Bauman66b8ab22014-05-06 15:57:45 -0400545
546/* Copy COUNT objects from FROM to TO. The source and destination do
547 not overlap. */
548# ifndef YYCOPY
549# if defined __GNUC__ && 1 < __GNUC__
550# define YYCOPY(To, From, Count) \
551 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
552# else
553# define YYCOPY(To, From, Count) \
554 do \
555 { \
556 YYSIZE_T yyi; \
557 for (yyi = 0; yyi < (Count); yyi++) \
558 (To)[yyi] = (From)[yyi]; \
559 } \
560 while (YYID (0))
561# endif
562# endif
563
564/* Relocate STACK from its old location to the new one. The
565 local variables YYSIZE and YYSTACKSIZE give the old and new number of
566 elements in the stack, and YYPTR gives the new location of the
567 stack. Advance YYPTR to a properly aligned location for the next
568 stack. */
569# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
570 do \
571 { \
572 YYSIZE_T yynewbytes; \
573 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
574 Stack = &yyptr->Stack_alloc; \
575 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
576 yyptr += yynewbytes / sizeof (*yyptr); \
577 } \
578 while (YYID (0))
579
580#endif
581
582/* YYFINAL -- State number of the termination state. */
Alexis Hetua35d8232015-06-11 17:11:06 -0400583#define YYFINAL 110
John Bauman66b8ab22014-05-06 15:57:45 -0400584/* YYLAST -- Last index in YYTABLE. */
Alexis Hetue5246692015-06-18 12:34:52 -0400585#define YYLAST 2519
John Bauman66b8ab22014-05-06 15:57:45 -0400586
587/* YYNTOKENS -- Number of terminals. */
Alexis Hetub14178b2015-04-13 13:23:20 -0400588#define YYNTOKENS 128
John Bauman66b8ab22014-05-06 15:57:45 -0400589/* YYNNTS -- Number of nonterminals. */
Alexis Hetu76a343a2015-06-04 17:21:22 -0400590#define YYNNTS 93
John Bauman66b8ab22014-05-06 15:57:45 -0400591/* YYNRULES -- Number of rules. */
Alexis Hetue5246692015-06-18 12:34:52 -0400592#define YYNRULES 270
John Bauman66b8ab22014-05-06 15:57:45 -0400593/* YYNRULES -- Number of states. */
Alexis Hetue5246692015-06-18 12:34:52 -0400594#define YYNSTATES 410
John Bauman66b8ab22014-05-06 15:57:45 -0400595
596/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
597#define YYUNDEFTOK 2
Alexis Hetub14178b2015-04-13 13:23:20 -0400598#define YYMAXUTOK 382
John Bauman66b8ab22014-05-06 15:57:45 -0400599
600#define YYTRANSLATE(YYX) \
601 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
602
603/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
604static const yytype_uint8 yytranslate[] =
605{
606 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
610 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
611 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
612 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
613 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
614 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
615 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
616 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
617 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
618 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
619 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
620 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
621 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
622 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
623 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
624 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
625 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
626 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
627 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
628 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
629 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
630 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
631 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
632 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
633 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
634 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
635 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
636 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
637 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
638 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
639 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
Alexis Hetub027aa92015-01-19 15:56:12 -0500640 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500641 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Alexis Hetub14178b2015-04-13 13:23:20 -0400642 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
643 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
644 125, 126, 127
John Bauman66b8ab22014-05-06 15:57:45 -0400645};
646
647#if YYDEBUG
648/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
649 YYRHS. */
650static const yytype_uint16 yyprhs[] =
651{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500652 0, 0, 3, 5, 7, 9, 11, 13, 15, 19,
653 21, 26, 28, 32, 35, 38, 40, 42, 44, 48,
654 51, 54, 57, 59, 62, 66, 69, 71, 73, 75,
Alexis Hetu17809052015-05-13 11:28:22 -0400655 77, 80, 83, 86, 88, 90, 92, 94, 96, 100,
656 104, 108, 110, 114, 118, 120, 124, 128, 130, 134,
657 138, 142, 146, 148, 152, 156, 158, 162, 164, 168,
658 170, 174, 176, 180, 182, 186, 188, 192, 194, 200,
659 202, 206, 208, 210, 212, 214, 216, 218, 220, 222,
Alexis Hetua35d8232015-06-11 17:11:06 -0400660 224, 226, 228, 230, 234, 236, 239, 242, 245, 250,
661 256, 263, 273, 276, 279, 281, 283, 286, 290, 294,
662 297, 303, 307, 310, 314, 317, 318, 320, 322, 324,
663 326, 328, 332, 339, 347, 356, 362, 364, 367, 373,
664 380, 388, 393, 396, 398, 401, 403, 405, 407, 409,
665 411, 414, 416, 419, 421, 423, 426, 428, 430, 432,
666 435, 438, 440, 442, 445, 447, 449, 451, 456, 458,
Alexis Hetue5246692015-06-18 12:34:52 -0400667 462, 464, 468, 472, 474, 478, 483, 485, 487, 489,
668 491, 493, 495, 497, 499, 501, 503, 505, 507, 509,
669 511, 513, 515, 517, 519, 521, 523, 525, 527, 529,
670 531, 533, 535, 537, 539, 541, 543, 545, 547, 549,
671 551, 553, 555, 557, 559, 561, 563, 565, 567, 569,
672 571, 572, 579, 580, 586, 588, 591, 595, 600, 602,
673 606, 608, 613, 615, 617, 619, 621, 623, 625, 627,
674 629, 631, 633, 635, 638, 639, 640, 646, 648, 650,
675 651, 654, 655, 658, 661, 665, 667, 670, 672, 675,
676 681, 685, 687, 688, 695, 699, 702, 704, 709, 710,
677 717, 718, 727, 728, 736, 738, 740, 742, 743, 746,
678 750, 753, 756, 759, 763, 766, 768, 771, 773, 775,
679 776
John Bauman66b8ab22014-05-06 15:57:45 -0400680};
681
682/* YYRHS -- A `-1'-separated list of the rules' RHS. */
683static const yytype_int16 yyrhs[] =
684{
Alexis Hetu76a343a2015-06-04 17:21:22 -0400685 217, 0, -1, 76, -1, 129, -1, 79, -1, 80,
Alexis Hetub14178b2015-04-13 13:23:20 -0400686 -1, 78, -1, 81, -1, 104, 156, 105, -1, 130,
687 -1, 131, 106, 132, 107, -1, 133, -1, 131, 110,
688 82, -1, 131, 85, -1, 131, 86, -1, 156, -1,
689 134, -1, 135, -1, 131, 110, 135, -1, 137, 105,
690 -1, 136, 105, -1, 138, 55, -1, 138, -1, 138,
Alexis Hetue5246692015-06-18 12:34:52 -0400691 154, -1, 137, 111, 154, -1, 139, 104, -1, 180,
Alexis Hetub14178b2015-04-13 13:23:20 -0400692 -1, 76, -1, 82, -1, 131, -1, 85, 140, -1,
693 86, 140, -1, 141, 140, -1, 118, -1, 116, -1,
Alexis Hetu17809052015-05-13 11:28:22 -0400694 115, -1, 117, -1, 140, -1, 142, 119, 140, -1,
695 142, 120, 140, -1, 142, 121, 140, -1, 142, -1,
696 143, 118, 142, -1, 143, 116, 142, -1, 143, -1,
697 144, 83, 143, -1, 144, 84, 143, -1, 144, -1,
698 145, 122, 144, -1, 145, 123, 144, -1, 145, 87,
699 144, -1, 145, 88, 144, -1, 145, -1, 146, 89,
700 145, -1, 146, 90, 145, -1, 146, -1, 147, 126,
701 146, -1, 147, -1, 148, 125, 147, -1, 148, -1,
702 149, 124, 148, -1, 149, -1, 150, 91, 149, -1,
703 150, -1, 151, 93, 150, -1, 151, -1, 152, 92,
704 151, -1, 152, -1, 152, 127, 156, 112, 154, -1,
705 153, -1, 140, 155, 154, -1, 113, -1, 94, -1,
706 95, -1, 97, -1, 96, -1, 103, -1, 98, -1,
707 99, -1, 100, -1, 101, -1, 102, -1, 154, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400708 156, 111, 154, -1, 153, -1, 76, 108, -1, 160,
709 114, -1, 168, 114, -1, 7, 176, 180, 114, -1,
710 173, 158, 185, 109, 114, -1, 173, 158, 185, 109,
711 76, 114, -1, 173, 158, 185, 109, 76, 106, 157,
712 107, 114, -1, 173, 114, -1, 161, 105, -1, 163,
713 -1, 162, -1, 163, 165, -1, 162, 111, 165, -1,
714 170, 76, 104, -1, 175, 76, -1, 175, 76, 106,
715 157, 107, -1, 172, 166, 164, -1, 166, 164, -1,
716 172, 166, 167, -1, 166, 167, -1, -1, 40, -1,
717 41, -1, 42, -1, 175, -1, 169, -1, 168, 111,
718 76, -1, 168, 111, 76, 106, 157, 107, -1, 168,
719 111, 76, 106, 107, 113, 189, -1, 168, 111, 76,
720 106, 157, 107, 113, 189, -1, 168, 111, 76, 113,
721 189, -1, 170, -1, 170, 76, -1, 170, 76, 106,
722 157, 107, -1, 170, 76, 106, 107, 113, 189, -1,
723 170, 76, 106, 157, 107, 113, 189, -1, 170, 76,
724 113, 189, -1, 3, 76, -1, 175, -1, 173, 175,
725 -1, 53, -1, 52, -1, 9, -1, 8, -1, 44,
726 -1, 3, 44, -1, 174, -1, 171, 174, -1, 171,
727 -1, 177, -1, 177, 174, -1, 9, -1, 40, -1,
728 41, -1, 51, 40, -1, 51, 41, -1, 43, -1,
729 180, -1, 176, 180, -1, 4, -1, 5, -1, 6,
730 -1, 75, 104, 178, 105, -1, 179, -1, 178, 111,
731 179, -1, 76, -1, 76, 113, 79, -1, 76, 113,
Alexis Hetue5246692015-06-18 12:34:52 -0400732 80, -1, 181, -1, 181, 106, 107, -1, 181, 106,
733 157, 107, -1, 55, -1, 11, -1, 12, -1, 13,
734 -1, 10, -1, 31, -1, 32, -1, 33, -1, 25,
735 -1, 26, -1, 27, -1, 28, -1, 29, -1, 30,
736 -1, 34, -1, 35, -1, 36, -1, 37, -1, 38,
737 -1, 39, -1, 45, -1, 46, -1, 47, -1, 48,
738 -1, 49, -1, 50, -1, 57, -1, 58, -1, 59,
739 -1, 70, -1, 61, -1, 62, -1, 63, -1, 64,
740 -1, 65, -1, 66, -1, 67, -1, 68, -1, 69,
741 -1, 72, -1, 73, -1, 74, -1, 182, -1, 77,
742 -1, -1, 54, 76, 108, 183, 185, 109, -1, -1,
743 54, 108, 184, 185, 109, -1, 186, -1, 185, 186,
744 -1, 175, 187, 114, -1, 173, 175, 187, 114, -1,
745 188, -1, 187, 111, 188, -1, 76, -1, 76, 106,
746 157, 107, -1, 154, -1, 159, -1, 193, -1, 192,
747 -1, 190, -1, 202, -1, 203, -1, 205, -1, 207,
748 -1, 209, -1, 216, -1, 108, 109, -1, -1, -1,
749 108, 194, 201, 195, 109, -1, 200, -1, 192, -1,
750 -1, 198, 200, -1, -1, 199, 192, -1, 108, 109,
751 -1, 108, 201, 109, -1, 191, -1, 201, 191, -1,
752 114, -1, 156, 114, -1, 19, 104, 156, 105, 204,
753 -1, 197, 17, 197, -1, 197, -1, -1, 22, 104,
754 156, 105, 206, 193, -1, 23, 157, 112, -1, 24,
755 112, -1, 156, -1, 170, 76, 113, 189, -1, -1,
756 56, 104, 210, 208, 105, 196, -1, -1, 16, 211,
757 197, 56, 104, 156, 105, 114, -1, -1, 18, 104,
758 212, 213, 215, 105, 196, -1, 202, -1, 190, -1,
759 208, -1, -1, 214, 114, -1, 214, 114, 156, -1,
760 15, 114, -1, 14, 114, -1, 21, 114, -1, 21,
761 156, 114, -1, 20, 114, -1, 218, -1, 217, 218,
762 -1, 219, -1, 159, -1, -1, 160, 220, 200, -1
John Bauman66b8ab22014-05-06 15:57:45 -0400763};
764
765/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
766static const yytype_uint16 yyrline[] =
767{
Alexis Hetu15ae36c2015-06-18 21:10:09 -0400768 0, 202, 202, 237, 240, 245, 250, 255, 260, 266,
Alexis Hetub3ff42c2015-07-03 18:19:57 -0400769 269, 272, 275, 278, 281, 287, 295, 306, 309, 317,
770 321, 328, 332, 339, 345, 354, 362, 368, 375, 385,
771 388, 398, 408, 430, 431, 432, 433, 441, 442, 446,
772 450, 458, 459, 462, 468, 469, 473, 480, 481, 484,
773 487, 490, 496, 497, 500, 506, 507, 514, 515, 522,
Alexis Hetueee212e2015-07-07 17:13:30 -0400774 523, 530, 531, 537, 538, 544, 545, 551, 552, 558,
775 559, 567, 568, 569, 570, 572, 573, 574, 576, 578,
776 580, 582, 587, 590, 601, 609, 617, 644, 650, 657,
777 661, 665, 669, 676, 714, 717, 724, 732, 753, 774,
778 785, 814, 819, 829, 834, 844, 847, 850, 853, 859,
779 866, 869, 873, 877, 882, 887, 894, 898, 902, 906,
780 911, 916, 920, 996, 1006, 1012, 1015, 1021, 1027, 1034,
781 1043, 1052, 1055, 1058, 1065, 1069, 1076, 1080, 1085, 1090,
782 1100, 1110, 1119, 1129, 1136, 1139, 1142, 1148, 1155, 1158,
783 1164, 1167, 1170, 1176, 1179, 1184, 1199, 1203, 1207, 1211,
784 1215, 1219, 1224, 1229, 1234, 1239, 1244, 1249, 1254, 1259,
785 1264, 1269, 1274, 1279, 1285, 1291, 1297, 1303, 1309, 1315,
786 1321, 1327, 1333, 1338, 1343, 1352, 1357, 1362, 1367, 1372,
787 1377, 1382, 1387, 1392, 1397, 1402, 1407, 1412, 1417, 1422,
788 1435, 1435, 1438, 1438, 1444, 1447, 1463, 1466, 1475, 1479,
789 1485, 1492, 1507, 1511, 1515, 1516, 1522, 1523, 1524, 1525,
790 1526, 1527, 1528, 1532, 1533, 1533, 1533, 1543, 1544, 1548,
791 1548, 1549, 1549, 1554, 1557, 1567, 1570, 1576, 1577, 1581,
792 1589, 1593, 1600, 1600, 1607, 1610, 1619, 1624, 1641, 1641,
793 1646, 1646, 1653, 1653, 1661, 1664, 1670, 1673, 1679, 1683,
794 1690, 1693, 1696, 1699, 1702, 1711, 1715, 1722, 1725, 1731,
795 1731
John Bauman66b8ab22014-05-06 15:57:45 -0400796};
797#endif
798
799#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
800/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
801 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
802static const char *const yytname[] =
803{
804 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
805 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
Nicolas Capens3c20f802015-02-17 17:17:20 -0500806 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE",
807 "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN",
808 "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500809 "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2",
810 "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
Alexis Hetub14178b2015-04-13 13:23:20 -0400811 "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2",
812 "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT",
813 "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES",
814 "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D",
815 "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
816 "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT",
817 "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT",
818 "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
819 "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
820 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
821 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
822 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
823 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500824 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
825 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
826 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
827 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
828 "primary_expression", "postfix_expression", "integer_expression",
829 "function_call", "function_call_or_method", "function_call_generic",
John Bauman66b8ab22014-05-06 15:57:45 -0400830 "function_call_header_no_parameters",
831 "function_call_header_with_parameters", "function_call_header",
832 "function_identifier", "unary_expression", "unary_operator",
833 "multiplicative_expression", "additive_expression", "shift_expression",
834 "relational_expression", "equality_expression", "and_expression",
835 "exclusive_or_expression", "inclusive_or_expression",
836 "logical_and_expression", "logical_xor_expression",
837 "logical_or_expression", "conditional_expression",
838 "assignment_expression", "assignment_operator", "expression",
Alexis Hetua35d8232015-06-11 17:11:06 -0400839 "constant_expression", "enter_struct", "declaration",
840 "function_prototype", "function_declarator",
841 "function_header_with_parameters", "function_header",
842 "parameter_declarator", "parameter_declaration", "parameter_qualifier",
843 "parameter_type_specifier", "init_declarator_list", "single_declaration",
844 "fully_specified_type", "interpolation_qualifier",
845 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
846 "type_specifier", "precision_qualifier", "layout_qualifier",
847 "layout_qualifier_id_list", "layout_qualifier_id",
Nicolas Capens7d626792015-02-17 17:58:31 -0500848 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
849 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
John Bauman66b8ab22014-05-06 15:57:45 -0400850 "struct_declarator_list", "struct_declarator", "initializer",
851 "declaration_statement", "statement", "simple_statement",
852 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
853 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
854 "statement_list", "expression_statement", "selection_statement",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400855 "selection_rest_statement", "switch_statement", "$@7", "case_label",
856 "condition", "iteration_statement", "$@8", "$@9", "$@10",
857 "for_init_statement", "conditionopt", "for_rest_statement",
John Bauman66b8ab22014-05-06 15:57:45 -0400858 "jump_statement", "translation_unit", "external_declaration",
Alexis Hetu76a343a2015-06-04 17:21:22 -0400859 "function_definition", "$@11", 0
John Bauman66b8ab22014-05-06 15:57:45 -0400860};
861#endif
862
863# ifdef YYPRINT
864/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
865 token YYLEX-NUM. */
866static const yytype_uint16 yytoknum[] =
867{
868 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
869 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
870 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
871 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
872 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
873 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
874 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
875 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
876 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
Nicolas Capensc6841852015-02-15 14:25:37 -0500877 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Nicolas Capens7d626792015-02-17 17:58:31 -0500878 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Alexis Hetub14178b2015-04-13 13:23:20 -0400879 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
880 375, 376, 377, 378, 379, 380, 381, 382
John Bauman66b8ab22014-05-06 15:57:45 -0400881};
882# endif
883
884/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
885static const yytype_uint8 yyr1[] =
886{
Alexis Hetub14178b2015-04-13 13:23:20 -0400887 0, 128, 129, 130, 130, 130, 130, 130, 130, 131,
888 131, 131, 131, 131, 131, 132, 133, 134, 134, 135,
889 135, 136, 136, 137, 137, 138, 139, 139, 139, 140,
Alexis Hetu17809052015-05-13 11:28:22 -0400890 140, 140, 140, 141, 141, 141, 141, 142, 142, 142,
891 142, 143, 143, 143, 144, 144, 144, 145, 145, 145,
892 145, 145, 146, 146, 146, 147, 147, 148, 148, 149,
893 149, 150, 150, 151, 151, 152, 152, 153, 153, 154,
894 154, 155, 155, 155, 155, 155, 155, 155, 155, 155,
Alexis Hetua35d8232015-06-11 17:11:06 -0400895 155, 155, 156, 156, 157, 158, 159, 159, 159, 159,
896 159, 159, 159, 160, 161, 161, 162, 162, 163, 164,
897 164, 165, 165, 165, 165, 166, 166, 166, 166, 167,
898 168, 168, 168, 168, 168, 168, 169, 169, 169, 169,
899 169, 169, 169, 170, 170, 171, 171, 172, 173, 173,
900 173, 173, 173, 173, 173, 173, 174, 174, 174, 174,
901 174, 174, 175, 175, 176, 176, 176, 177, 178, 178,
Alexis Hetue5246692015-06-18 12:34:52 -0400902 179, 179, 179, 180, 180, 180, 181, 181, 181, 181,
Alexis Hetua35d8232015-06-11 17:11:06 -0400903 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
904 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
905 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
Alexis Hetue5246692015-06-18 12:34:52 -0400906 181, 181, 181, 181, 181, 181, 181, 181, 181, 181,
907 183, 182, 184, 182, 185, 185, 186, 186, 187, 187,
908 188, 188, 189, 190, 191, 191, 192, 192, 192, 192,
909 192, 192, 192, 193, 194, 195, 193, 196, 196, 198,
910 197, 199, 197, 200, 200, 201, 201, 202, 202, 203,
911 204, 204, 206, 205, 207, 207, 208, 208, 210, 209,
912 211, 209, 212, 209, 213, 213, 214, 214, 215, 215,
913 216, 216, 216, 216, 216, 217, 217, 218, 218, 220,
914 219
John Bauman66b8ab22014-05-06 15:57:45 -0400915};
916
917/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
918static const yytype_uint8 yyr2[] =
919{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500920 0, 2, 1, 1, 1, 1, 1, 1, 3, 1,
921 4, 1, 3, 2, 2, 1, 1, 1, 3, 2,
922 2, 2, 1, 2, 3, 2, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400923 2, 2, 2, 1, 1, 1, 1, 1, 3, 3,
924 3, 1, 3, 3, 1, 3, 3, 1, 3, 3,
925 3, 3, 1, 3, 3, 1, 3, 1, 3, 1,
926 3, 1, 3, 1, 3, 1, 3, 1, 5, 1,
927 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetua35d8232015-06-11 17:11:06 -0400928 1, 1, 1, 3, 1, 2, 2, 2, 4, 5,
929 6, 9, 2, 2, 1, 1, 2, 3, 3, 2,
930 5, 3, 2, 3, 2, 0, 1, 1, 1, 1,
931 1, 3, 6, 7, 8, 5, 1, 2, 5, 6,
932 7, 4, 2, 1, 2, 1, 1, 1, 1, 1,
933 2, 1, 2, 1, 1, 2, 1, 1, 1, 2,
934 2, 1, 1, 2, 1, 1, 1, 4, 1, 3,
Alexis Hetue5246692015-06-18 12:34:52 -0400935 1, 3, 3, 1, 3, 4, 1, 1, 1, 1,
John Bauman66b8ab22014-05-06 15:57:45 -0400936 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetub14178b2015-04-13 13:23:20 -0400937 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
938 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetue5246692015-06-18 12:34:52 -0400939 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
940 0, 6, 0, 5, 1, 2, 3, 4, 1, 3,
941 1, 4, 1, 1, 1, 1, 1, 1, 1, 1,
942 1, 1, 1, 2, 0, 0, 5, 1, 1, 0,
943 2, 0, 2, 2, 3, 1, 2, 1, 2, 5,
944 3, 1, 0, 6, 3, 2, 1, 4, 0, 6,
945 0, 8, 0, 7, 1, 1, 1, 0, 2, 3,
946 2, 2, 2, 3, 2, 1, 2, 1, 1, 0,
947 3
John Bauman66b8ab22014-05-06 15:57:45 -0400948};
949
950/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
951 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
952 means the default is an error. */
Alexis Hetuad6b8752015-06-09 16:15:30 -0400953static const yytype_uint16 yydefact[] =
John Bauman66b8ab22014-05-06 15:57:45 -0400954{
Alexis Hetue5246692015-06-18 12:34:52 -0400955 0, 0, 144, 145, 146, 0, 128, 136, 160, 157,
956 158, 159, 164, 165, 166, 167, 168, 169, 161, 162,
957 163, 170, 171, 172, 173, 174, 175, 137, 138, 141,
958 129, 176, 177, 178, 179, 180, 181, 0, 126, 125,
959 0, 156, 182, 183, 184, 186, 187, 188, 189, 190,
960 191, 192, 193, 194, 185, 195, 196, 197, 0, 199,
961 268, 269, 0, 95, 105, 0, 110, 116, 133, 0,
962 131, 123, 0, 134, 142, 153, 198, 0, 265, 267,
963 130, 122, 0, 139, 140, 0, 202, 0, 86, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -0400964 93, 105, 127, 106, 107, 108, 96, 0, 105, 0,
965 87, 117, 132, 0, 92, 0, 124, 143, 135, 0,
Alexis Hetue5246692015-06-18 12:34:52 -0400966 1, 266, 0, 200, 0, 150, 0, 148, 0, 270,
Alexis Hetua35d8232015-06-11 17:11:06 -0400967 97, 102, 104, 109, 0, 111, 98, 0, 0, 85,
Alexis Hetue5246692015-06-18 12:34:52 -0400968 0, 0, 0, 0, 204, 2, 6, 4, 5, 7,
969 28, 0, 0, 0, 154, 35, 34, 36, 33, 3,
970 9, 29, 11, 16, 17, 0, 0, 22, 0, 37,
971 0, 41, 44, 47, 52, 55, 57, 59, 61, 63,
972 65, 67, 84, 0, 26, 88, 0, 0, 0, 147,
973 0, 0, 0, 250, 0, 0, 0, 0, 0, 0,
974 0, 0, 224, 233, 237, 37, 69, 82, 0, 213,
975 0, 142, 216, 235, 215, 214, 0, 217, 218, 219,
976 220, 221, 222, 99, 101, 103, 0, 0, 0, 0,
977 212, 121, 0, 210, 0, 208, 0, 205, 30, 31,
978 0, 13, 14, 0, 0, 20, 19, 0, 156, 23,
979 25, 32, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -0400980 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -0400981 0, 0, 155, 0, 203, 151, 152, 149, 261, 260,
982 231, 252, 0, 264, 262, 0, 0, 0, 245, 248,
983 223, 0, 72, 73, 75, 74, 77, 78, 79, 80,
984 81, 76, 71, 0, 0, 238, 234, 236, 0, 0,
985 0, 115, 0, 118, 0, 0, 0, 206, 0, 89,
986 8, 0, 15, 27, 12, 18, 24, 38, 39, 40,
987 43, 42, 45, 46, 50, 51, 48, 49, 53, 54,
988 56, 58, 60, 62, 64, 66, 0, 201, 0, 0,
989 0, 0, 0, 263, 0, 244, 0, 225, 70, 83,
990 0, 0, 112, 119, 0, 207, 0, 209, 0, 90,
991 10, 0, 0, 230, 232, 255, 254, 257, 231, 242,
992 246, 0, 0, 0, 0, 100, 113, 0, 120, 211,
993 0, 68, 0, 256, 0, 0, 241, 239, 0, 0,
994 0, 226, 114, 0, 0, 258, 0, 231, 243, 0,
995 228, 249, 227, 91, 0, 259, 253, 240, 247, 251
John Bauman66b8ab22014-05-06 15:57:45 -0400996};
997
998/* YYDEFGOTO[NTERM-NUM]. */
999static const yytype_int16 yydefgoto[] =
1000{
Alexis Hetue5246692015-06-18 12:34:52 -04001001 -1, 149, 150, 151, 311, 152, 153, 154, 155, 156,
1002 157, 158, 195, 160, 161, 162, 163, 164, 165, 166,
1003 167, 168, 169, 170, 171, 196, 197, 293, 198, 173,
1004 105, 199, 200, 62, 63, 64, 121, 96, 97, 122,
Alexis Hetua35d8232015-06-11 17:11:06 -04001005 65, 66, 67, 68, 98, 69, 70, 71, 72, 73,
Alexis Hetue5246692015-06-18 12:34:52 -04001006 116, 117, 174, 75, 76, 176, 114, 133, 134, 224,
1007 225, 221, 202, 203, 204, 205, 281, 374, 401, 338,
1008 339, 340, 402, 206, 207, 208, 387, 209, 388, 210,
1009 373, 211, 346, 270, 341, 367, 384, 385, 212, 77,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001010 78, 79, 89
John Bauman66b8ab22014-05-06 15:57:45 -04001011};
1012
1013/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1014 STATE-NUM. */
Alexis Hetue5246692015-06-18 12:34:52 -04001015#define YYPACT_NINF -331
John Bauman66b8ab22014-05-06 15:57:45 -04001016static const yytype_int16 yypact[] =
1017{
Alexis Hetue5246692015-06-18 12:34:52 -04001018 2157, -28, -331, -331, -331, 141, -331, -331, -331, -331,
1019 -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1020 -331, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1021 -331, -331, -331, -331, -331, -331, -331, 4, -331, -331,
1022 -44, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1023 -331, -331, -331, -331, -331, -331, -331, -331, -78, -331,
1024 -331, -31, -35, -24, 10, -71, -331, 45, 38, 1176,
1025 -331, -331, 2442, 38, -331, 1, -331, 2082, -331, -331,
1026 -331, -331, 2442, -331, -331, 49, -331, 72, -331, 51,
1027 -331, 19, -331, -331, -331, -331, -331, 2306, 110, 92,
1028 -331, -79, -331, 67, -331, 2232, -331, -331, -331, 1246,
1029 -331, -331, 25, -331, 2232, 58, -70, -331, 404, -331,
1030 -331, -331, -331, 103, 2306, -89, -331, 1344, 1635, -331,
1031 136, 2306, 105, 1827, -331, 78, -331, -331, -331, -331,
1032 -331, 1635, 1635, 1635, -331, -331, -331, -331, -331, -331,
1033 -331, 16, -331, -331, -331, 79, -21, 1730, 83, -331,
1034 1635, 34, 40, 28, -65, 47, 57, 61, 64, 100,
1035 101, -72, -331, 86, -331, -331, 2232, 1912, 82, -331,
1036 72, 84, 85, -331, 93, 96, 87, 1442, 98, 1635,
1037 91, 106, 102, -331, -331, 188, -331, -331, -15, -331,
1038 -31, 108, -331, -331, -331, -331, 520, -331, -331, -331,
1039 -331, -331, -331, 90, -331, -331, 1537, 1635, 104, 109,
1040 -331, -331, 105, 107, 5, -331, -61, -331, -331, -331,
1041 -20, -331, -331, 1635, 2374, -331, -331, 1635, 113, -331,
1042 -331, -331, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
1043 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635, 1635,
1044 1635, 1635, -331, 1997, -331, -331, -331, -331, -331, -331,
1045 111, -331, 1635, -331, -331, 6, 1635, 97, -331, -331,
1046 -331, 636, -331, -331, -331, -331, -331, -331, -331, -331,
1047 -331, -331, -331, 1635, 1635, -331, -331, -331, 1635, 112,
1048 114, -331, 1635, 115, 21, 1635, 105, -331, -75, -331,
1049 -331, 117, 120, -331, 116, -331, -331, -331, -331, -331,
1050 34, 34, 40, 40, 28, 28, 28, 28, -65, -65,
1051 47, 57, 61, 64, 100, 101, 31, -331, 159, 51,
1052 868, 984, -17, -331, -5, -331, 1081, 636, -331, -331,
1053 119, 1635, 121, -331, 1635, -331, 125, -331, 1635, -331,
1054 -331, 1635, 118, -331, -331, -331, -331, 1081, 111, -331,
1055 120, 157, 2306, 130, 127, -331, -331, 1635, -331, -331,
1056 131, -331, 1635, -331, 126, 134, 224, -331, 138, 129,
1057 752, -331, -331, 133, -1, 1635, 752, 111, -331, 1635,
1058 -331, -331, -331, -331, 135, 120, -331, -331, -331, -331
John Bauman66b8ab22014-05-06 15:57:45 -04001059};
1060
1061/* YYPGOTO[NTERM-NUM]. */
1062static const yytype_int16 yypgoto[] =
1063{
Alexis Hetue5246692015-06-18 12:34:52 -04001064 -331, -331, -331, -331, -331, -331, -331, 14, -331, -331,
1065 -331, -331, 63, -331, -82, -74, -122, -88, -4, -6,
1066 -3, 2, 7, 8, -331, -91, -124, -331, -138, -113,
1067 -331, 3, 9, -331, -331, -331, 137, 164, 160, 145,
1068 -331, -331, -325, -331, -331, -103, -2, -68, 254, -331,
1069 -331, 94, 0, -331, -331, -331, -331, -101, -123, 43,
1070 -36, -210, -69, -198, -328, -126, -331, -331, -125, -330,
1071 -331, -331, -83, -8, -64, -331, -331, -331, -331, -331,
1072 -87, -331, -331, -331, -331, -331, -331, -331, -331, -331,
1073 199, -331, -331
John Bauman66b8ab22014-05-06 15:57:45 -04001074};
1075
1076/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1077 positive, shift that token. If negative, reduce the rule which
1078 number is the opposite. If zero, do what YYDEFACT says.
1079 If YYTABLE_NINF, syntax error. */
Alexis Hetue5246692015-06-18 12:34:52 -04001080#define YYTABLE_NINF -230
John Bauman66b8ab22014-05-06 15:57:45 -04001081static const yytype_int16 yytable[] =
1082{
Alexis Hetue5246692015-06-18 12:34:52 -04001083 74, 106, 131, 60, 220, 230, 119, 301, 297, 61,
1084 227, 131, 364, 177, 219, 308, 80, 216, 172, 92,
1085 260, 371, 249, 250, 217, 126, 87, 127, 92, 123,
1086 131, 358, 85, 239, 128, 179, 172, 132, 386, 359,
1087 99, 180, 371, 100, 83, 84, 132, 7, 81, 275,
1088 93, 94, 95, 309, 227, 261, 123, 251, 252, 93,
1089 94, 95, 400, 222, 86, 132, 102, 407, 400, 74,
1090 90, 108, 107, 131, 131, 263, 277, 74, 27, 28,
1091 60, 29, 112, 88, 236, 310, 61, 91, 368, 37,
1092 237, 294, 353, 220, 294, 312, 294, 74, 172, 295,
1093 369, 231, 232, 300, 404, 74, 294, 109, 132, 132,
1094 294, 247, 248, 316, 74, -94, 306, 294, 201, 307,
1095 343, 101, 233, 336, 74, 172, 234, 324, 325, 326,
1096 327, 74, 306, 74, 342, 355, 253, 254, 344, 175,
1097 227, 376, 294, 361, 378, 2, 3, 4, 115, 297,
1098 93, 94, 95, 242, 243, 244, 245, 113, 246, 118,
1099 131, 265, 266, 320, 321, 328, 329, 392, 125, 348,
1100 349, 178, 159, 322, 323, 129, 74, 74, 220, 213,
1101 80, 223, -27, 255, 235, 350, 256, 240, 257, 408,
1102 159, 258, 356, 262, 259, 132, 298, 271, 268, 269,
1103 272, 273, 276, 278, 228, 229, 201, 172, 370, 345,
1104 279, 280, -26, 305, 172, 362, 303, 302, -21, -229,
1105 -28, 352, 382, 241, 360, 351, 375, 220, 354, 370,
1106 220, 294, 379, 389, 377, 390, 391, 381, 393, 396,
1107 395, 397, 399, 372, 394, 380, 192, 403, 315, 409,
1108 331, 330, 159, 220, 332, 120, 363, 405, 124, 82,
1109 333, 214, 398, 74, 372, 304, 334, 172, 335, 215,
1110 357, 406, 365, 347, 267, 220, 111, 366, 0, 159,
1111 383, 201, 282, 283, 284, 285, 286, 287, 288, 289,
1112 290, 291, 0, 0, 0, 0, 0, 0, 0, 0,
1113 0, 292, 0, 0, 106, 317, 318, 319, 159, 159,
1114 159, 159, 159, 159, 159, 159, 159, 159, 159, 159,
1115 159, 159, 159, 159, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001116 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001117 201, 201, 0, 0, 0, 0, 201, 201, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001118 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001119 0, 159, 0, 0, 0, 0, 0, 201, 159, 0,
1120 0, 0, 74, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001122 201, 0, 0, 0, 0, 0, 201, 0, 0, 0,
1123 0, 0, 0, 0, 0, 0, 0, 1, 2, 3,
1124 4, 5, 6, 7, 8, 9, 10, 11, 181, 182,
1125 183, 159, 184, 185, 186, 187, 188, 189, 190, 12,
1126 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1127 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1128 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1129 191, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1130 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1131 135, 59, 136, 137, 138, 139, 140, 0, 0, 141,
1132 142, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1133 0, 0, 0, 0, 0, 0, 0, 0, 143, 0,
1134 0, 0, 192, 193, 0, 0, 0, 0, 194, 145,
1135 146, 147, 148, 1, 2, 3, 4, 5, 6, 7,
1136 8, 9, 10, 11, 181, 182, 183, 0, 184, 185,
1137 186, 187, 188, 189, 190, 12, 13, 14, 15, 16,
1138 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1139 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1140 36, 37, 38, 39, 40, 41, 191, 42, 43, 44,
1141 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1142 54, 0, 55, 56, 57, 58, 135, 59, 136, 137,
1143 138, 139, 140, 0, 0, 141, 142, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001145 0, 0, 0, 0, 143, 0, 0, 0, 192, 296,
1146 0, 0, 0, 0, 194, 145, 146, 147, 148, 1,
1147 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1148 181, 182, 183, 0, 184, 185, 186, 187, 188, 189,
1149 190, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1150 21, 22, 23, 24, 25, 26, 27, 28, 0, 29,
1151 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1152 40, 41, 191, 42, 43, 44, 0, 45, 46, 47,
1153 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1154 57, 58, 135, 59, 136, 137, 138, 139, 140, 0,
1155 0, 141, 142, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001156 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001157 143, 0, 0, 0, 192, 0, 0, 0, 0, 0,
1158 194, 145, 146, 147, 148, 1, 2, 3, 4, 5,
1159 6, 7, 8, 9, 10, 11, 181, 182, 183, 0,
1160 184, 185, 186, 187, 188, 189, 190, 12, 13, 14,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001161 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001162 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
Alexis Hetue5246692015-06-18 12:34:52 -04001163 34, 35, 36, 37, 38, 39, 40, 41, 191, 42,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001164 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
Alexis Hetua35d8232015-06-11 17:11:06 -04001165 52, 53, 54, 0, 55, 56, 57, 58, 135, 59,
1166 136, 137, 138, 139, 140, 0, 0, 141, 142, 0,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001168 0, 0, 0, 0, 0, 0, 143, 0, 0, 0,
1169 118, 0, 0, 0, 0, 0, 194, 145, 146, 147,
1170 148, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1171 10, 11, 181, 182, 183, 0, 184, 185, 186, 187,
1172 188, 189, 190, 12, 13, 14, 15, 16, 17, 18,
1173 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1174 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1175 38, 39, 40, 41, 191, 42, 43, 44, 0, 45,
1176 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1177 55, 56, 57, 58, 135, 59, 136, 137, 138, 139,
1178 140, 0, 0, 141, 142, 0, 0, 0, 0, 0,
1179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1180 0, 0, 143, 0, 0, 0, 0, 0, 0, 0,
1181 0, 0, 194, 145, 146, 147, 148, 1, 2, 3,
1182 4, 5, 6, 7, 8, 9, 10, 11, 0, 0,
1183 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
1184 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1185 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1186 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1187 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1188 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1189 135, 59, 136, 137, 138, 139, 140, 0, 0, 141,
1190 142, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1191 0, 0, 0, 0, 130, 2, 3, 4, 143, 6,
1192 7, 8, 9, 10, 11, 0, 0, 0, 194, 145,
1193 146, 147, 148, 0, 0, 0, 12, 13, 14, 15,
1194 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1195 26, 27, 28, 0, 29, 30, 31, 32, 33, 34,
1196 35, 36, 37, 38, 39, 40, 41, 0, 42, 43,
1197 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
1198 53, 54, 0, 55, 56, 57, 58, 135, 59, 136,
1199 137, 138, 139, 140, 0, 0, 141, 142, 0, 0,
1200 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1201 2, 3, 4, 0, 0, 143, 8, 9, 10, 11,
1202 0, 0, 0, 0, 0, 0, 145, 146, 147, 148,
1203 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1204 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1205 0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1206 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1207 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1208 57, 0, 103, 59, 0, 0, 8, 9, 10, 11,
1209 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1210 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1211 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1212 104, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1213 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1214 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1215 57, 0, 135, 59, 136, 137, 138, 139, 140, 0,
1216 0, 141, 142, 0, 0, 0, 0, 0, 0, 0,
1217 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1218 143, 0, 0, 144, 8, 9, 10, 11, 0, 0,
1219 0, 145, 146, 147, 148, 0, 0, 0, 0, 12,
1220 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1221 23, 24, 25, 26, 0, 0, 0, 0, 0, 31,
1222 32, 33, 34, 35, 36, 0, 0, 0, 40, 41,
1223 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1224 50, 51, 52, 53, 54, 0, 55, 56, 57, 0,
1225 135, 59, 136, 137, 138, 139, 140, 0, 0, 141,
1226 142, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1227 0, 0, 0, 0, 0, 0, 0, 0, 143, 0,
1228 0, 218, 8, 9, 10, 11, 0, 0, 0, 145,
1229 146, 147, 148, 0, 0, 0, 0, 12, 13, 14,
1230 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1231 25, 26, 0, 0, 0, 0, 0, 31, 32, 33,
1232 34, 35, 36, 0, 0, 0, 40, 41, 0, 42,
1233 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1234 52, 53, 54, 0, 55, 56, 57, 0, 135, 59,
1235 136, 137, 138, 139, 140, 0, 0, 141, 142, 0,
1236 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1237 0, 0, 0, 0, 0, 0, 143, 8, 9, 10,
1238 11, 0, 0, 0, 0, 0, 274, 145, 146, 147,
1239 148, 0, 12, 13, 14, 15, 16, 17, 18, 19,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001240 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
1241 0, 0, 31, 32, 33, 34, 35, 36, 0, 0,
1242 0, 40, 41, 0, 42, 43, 44, 0, 45, 46,
Alexis Hetua35d8232015-06-11 17:11:06 -04001243 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001244 56, 57, 0, 135, 59, 136, 137, 138, 139, 140,
Alexis Hetua35d8232015-06-11 17:11:06 -04001245 0, 0, 141, 142, 0, 0, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001247 0, 143, 0, 0, 299, 8, 9, 10, 11, 0,
1248 0, 0, 145, 146, 147, 148, 0, 0, 0, 0,
Alexis Hetua35d8232015-06-11 17:11:06 -04001249 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1250 22, 23, 24, 25, 26, 0, 0, 0, 0, 0,
1251 31, 32, 33, 34, 35, 36, 0, 0, 0, 40,
1252 41, 0, 42, 43, 44, 0, 45, 46, 47, 48,
1253 49, 50, 51, 52, 53, 54, 0, 55, 56, 57,
1254 0, 135, 59, 136, 137, 138, 139, 140, 0, 0,
1255 141, 142, 0, 0, 0, 0, 0, 0, 0, 0,
1256 0, 0, 0, 0, 0, 0, 0, 0, 0, 143,
Alexis Hetue5246692015-06-18 12:34:52 -04001257 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
1258 145, 146, 147, 148, 0, 12, 13, 14, 15, 16,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001259 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1260 0, 0, 0, 0, 0, 31, 32, 33, 34, 35,
Alexis Hetue5246692015-06-18 12:34:52 -04001261 36, 0, 0, 0, 40, 238, 0, 42, 43, 44,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001262 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1263 54, 0, 55, 56, 57, 0, 135, 59, 136, 137,
1264 138, 139, 140, 0, 0, 141, 142, 0, 0, 0,
1265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001266 130, 2, 3, 4, 143, 6, 7, 8, 9, 10,
1267 11, 0, 0, 0, 0, 145, 146, 147, 148, 0,
1268 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
1269 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1270 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1271 39, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1272 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1273 56, 57, 58, 0, 59, 0, 0, 0, 0, 0,
1274 0, 0, 0, 0, 0, 130, 2, 3, 4, 0,
1275 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
1276 0, 0, 0, 0, 0, 0, 226, 12, 13, 14,
1277 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1278 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1279 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
1280 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1281 52, 53, 54, 0, 55, 56, 57, 58, 0, 59,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001282 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001283 130, 2, 3, 4, 0, 6, 7, 8, 9, 10,
1284 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1285 0, 264, 12, 13, 14, 15, 16, 17, 18, 19,
1286 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1287 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1288 39, 40, 41, 0, 42, 43, 44, 0, 45, 46,
1289 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
1290 56, 57, 58, 0, 59, 0, 0, 0, 0, 0,
1291 0, 0, 110, 0, 0, 1, 2, 3, 4, 5,
1292 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
1293 0, 0, 0, 0, 0, 0, 337, 12, 13, 14,
1294 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1295 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1296 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
1297 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1298 52, 53, 54, 0, 55, 56, 57, 58, 0, 59,
1299 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001300 11, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1301 0, 0, 12, 13, 14, 15, 16, 17, 18, 19,
Alexis Hetue5246692015-06-18 12:34:52 -04001302 20, 21, 22, 23, 24, 25, 26, 27, 28, 0,
1303 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1304 39, 40, 41, 0, 42, 43, 44, 0, 45, 46,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001305 47, 48, 49, 50, 51, 52, 53, 54, 0, 55,
Alexis Hetue5246692015-06-18 12:34:52 -04001306 56, 57, 58, 0, 59, 130, 2, 3, 4, 0,
1307 6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
1308 0, 0, 0, 0, 0, 0, 0, 12, 13, 14,
1309 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1310 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1311 34, 35, 36, 37, 38, 39, 40, 41, 0, 42,
1312 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1313 52, 53, 54, 0, 55, 56, 57, 58, 0, 59,
1314 2, 3, 4, 0, 0, 0, 8, 9, 10, 11,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001315 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetue5246692015-06-18 12:34:52 -04001316 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1317 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1318 0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1319 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1320 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1321 57, 0, 0, 59, 8, 9, 10, 11, 0, 0,
1322 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
1323 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1324 23, 24, 25, 26, 0, 0, 0, 0, 0, 31,
1325 32, 33, 34, 35, 36, 0, 0, 0, 40, 41,
1326 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1327 50, 51, 52, 53, 54, 0, 55, 56, 57, 0,
1328 313, 59, 8, 9, 10, 11, 314, 0, 0, 0,
1329 0, 0, 0, 0, 0, 0, 0, 12, 13, 14,
1330 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1331 25, 26, 0, 0, 0, 0, 0, 31, 32, 33,
1332 34, 35, 36, 0, 0, 0, 40, 41, 0, 42,
1333 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1334 52, 53, 54, 0, 55, 56, 57, 0, 0, 59
John Bauman66b8ab22014-05-06 15:57:45 -04001335};
1336
1337static const yytype_int16 yycheck[] =
1338{
Alexis Hetue5246692015-06-18 12:34:52 -04001339 0, 69, 105, 0, 128, 143, 89, 217, 206, 0,
1340 133, 114, 340, 114, 127, 76, 44, 106, 109, 9,
1341 92, 346, 87, 88, 113, 104, 104, 106, 9, 97,
1342 133, 106, 76, 157, 113, 105, 127, 105, 368, 114,
1343 111, 111, 367, 114, 40, 41, 114, 9, 76, 187,
1344 40, 41, 42, 114, 177, 127, 124, 122, 123, 40,
1345 41, 42, 390, 131, 108, 133, 68, 397, 396, 69,
1346 105, 73, 72, 176, 177, 176, 189, 77, 40, 41,
1347 77, 43, 82, 114, 105, 105, 77, 111, 105, 51,
1348 111, 111, 302, 217, 111, 233, 111, 97, 189, 114,
1349 105, 85, 86, 216, 105, 105, 111, 106, 176, 177,
1350 111, 83, 84, 237, 114, 105, 111, 111, 118, 114,
1351 114, 76, 106, 261, 124, 216, 110, 249, 250, 251,
1352 252, 131, 111, 133, 272, 114, 89, 90, 276, 114,
1353 263, 351, 111, 112, 354, 4, 5, 6, 76, 347,
1354 40, 41, 42, 119, 120, 121, 116, 108, 118, 108,
1355 263, 79, 80, 245, 246, 253, 254, 377, 76, 293,
1356 294, 113, 109, 247, 248, 108, 176, 177, 302, 76,
1357 44, 76, 104, 126, 105, 298, 125, 104, 124, 399,
1358 127, 91, 305, 107, 93, 263, 106, 104, 114, 114,
1359 104, 114, 104, 112, 141, 142, 206, 298, 346, 112,
1360 104, 109, 104, 106, 305, 56, 107, 113, 105, 108,
1361 104, 107, 104, 160, 107, 113, 107, 351, 113, 367,
1362 354, 111, 107, 76, 113, 105, 109, 361, 107, 105,
1363 114, 17, 113, 346, 382, 358, 108, 114, 234, 114,
1364 256, 255, 189, 377, 257, 91, 339, 395, 98, 5,
1365 258, 124, 388, 263, 367, 222, 259, 358, 260, 124,
1366 306, 396, 341, 281, 180, 399, 77, 341, -1, 216,
1367 367, 281, 94, 95, 96, 97, 98, 99, 100, 101,
1368 102, 103, -1, -1, -1, -1, -1, -1, -1, -1,
1369 -1, 113, -1, -1, 372, 242, 243, 244, 245, 246,
1370 247, 248, 249, 250, 251, 252, 253, 254, 255, 256,
1371 257, 258, 259, 260, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001372 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001373 340, 341, -1, -1, -1, -1, 346, 347, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001374 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001375 -1, 298, -1, -1, -1, -1, -1, 367, 305, -1,
1376 -1, -1, 372, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001377 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001378 390, -1, -1, -1, -1, -1, 396, -1, -1, -1,
1379 -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
1380 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1381 16, 358, 18, 19, 20, 21, 22, 23, 24, 25,
1382 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1383 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1384 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1385 56, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1386 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1387 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1388 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1389 -1, -1, -1, -1, -1, -1, -1, -1, 104, -1,
1390 -1, -1, 108, 109, -1, -1, -1, -1, 114, 115,
1391 116, 117, 118, 3, 4, 5, 6, 7, 8, 9,
1392 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
1393 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
1394 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1395 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1396 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1397 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1398 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
1399 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001400 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001401 -1, -1, -1, -1, 104, -1, -1, -1, 108, 109,
1402 -1, -1, -1, -1, 114, 115, 116, 117, 118, 3,
1403 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1404 14, 15, 16, -1, 18, 19, 20, 21, 22, 23,
1405 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1406 34, 35, 36, 37, 38, 39, 40, 41, -1, 43,
1407 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1408 54, 55, 56, 57, 58, 59, -1, 61, 62, 63,
1409 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1410 74, 75, 76, 77, 78, 79, 80, 81, 82, -1,
1411 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001412 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001413 104, -1, -1, -1, 108, -1, -1, -1, -1, -1,
1414 114, 115, 116, 117, 118, 3, 4, 5, 6, 7,
1415 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1416 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001417 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001418 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
Alexis Hetue5246692015-06-18 12:34:52 -04001419 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001420 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04001421 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001422 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1423 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001424 -1, -1, -1, -1, -1, -1, 104, -1, -1, -1,
1425 108, -1, -1, -1, -1, -1, 114, 115, 116, 117,
1426 118, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1427 12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
1428 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
1429 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1430 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1431 52, 53, 54, 55, 56, 57, 58, 59, -1, 61,
1432 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1433 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1434 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1435 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1436 -1, -1, 104, -1, -1, -1, -1, -1, -1, -1,
1437 -1, -1, 114, 115, 116, 117, 118, 3, 4, 5,
1438 6, 7, 8, 9, 10, 11, 12, 13, -1, -1,
1439 -1, -1, -1, -1, -1, -1, -1, -1, -1, 25,
1440 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1441 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1442 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1443 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1444 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1445 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1446 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1447 -1, -1, -1, -1, 3, 4, 5, 6, 104, 8,
1448 9, 10, 11, 12, 13, -1, -1, -1, 114, 115,
1449 116, 117, 118, -1, -1, -1, 25, 26, 27, 28,
1450 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1451 39, 40, 41, -1, 43, 44, 45, 46, 47, 48,
1452 49, 50, 51, 52, 53, 54, 55, -1, 57, 58,
1453 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
1454 69, 70, -1, 72, 73, 74, 75, 76, 77, 78,
1455 79, 80, 81, 82, -1, -1, 85, 86, -1, -1,
1456 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1457 4, 5, 6, -1, -1, 104, 10, 11, 12, 13,
1458 -1, -1, -1, -1, -1, -1, 115, 116, 117, 118,
1459 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1460 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1461 -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1462 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1463 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1464 74, -1, 76, 77, -1, -1, 10, 11, 12, 13,
1465 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1466 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1467 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1468 114, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1469 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1470 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1471 74, -1, 76, 77, 78, 79, 80, 81, 82, -1,
1472 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1473 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1474 104, -1, -1, 107, 10, 11, 12, 13, -1, -1,
1475 -1, 115, 116, 117, 118, -1, -1, -1, -1, 25,
1476 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1477 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
1478 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1479 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1480 66, 67, 68, 69, 70, -1, 72, 73, 74, -1,
1481 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1482 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1483 -1, -1, -1, -1, -1, -1, -1, -1, 104, -1,
1484 -1, 107, 10, 11, 12, 13, -1, -1, -1, 115,
1485 116, 117, 118, -1, -1, -1, -1, 25, 26, 27,
1486 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1487 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
1488 48, 49, 50, -1, -1, -1, 54, 55, -1, 57,
1489 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1490 68, 69, 70, -1, 72, 73, 74, -1, 76, 77,
1491 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1492 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1493 -1, -1, -1, -1, -1, -1, 104, 10, 11, 12,
1494 13, -1, -1, -1, -1, -1, 114, 115, 116, 117,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001495 118, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1496 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
1497 -1, -1, 45, 46, 47, 48, 49, 50, -1, -1,
1498 -1, 54, 55, -1, 57, 58, 59, -1, 61, 62,
Alexis Hetua35d8232015-06-11 17:11:06 -04001499 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001500 73, 74, -1, 76, 77, 78, 79, 80, 81, 82,
Alexis Hetua35d8232015-06-11 17:11:06 -04001501 -1, -1, 85, 86, -1, -1, -1, -1, -1, -1,
Alexis Hetua35d8232015-06-11 17:11:06 -04001502 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001503 -1, 104, -1, -1, 107, 10, 11, 12, 13, -1,
1504 -1, -1, 115, 116, 117, 118, -1, -1, -1, -1,
Alexis Hetuad6b8752015-06-09 16:15:30 -04001505 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1506 35, 36, 37, 38, 39, -1, -1, -1, -1, -1,
1507 45, 46, 47, 48, 49, 50, -1, -1, -1, 54,
1508 55, -1, 57, 58, 59, -1, 61, 62, 63, 64,
1509 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1510 -1, 76, 77, 78, 79, 80, 81, 82, -1, -1,
1511 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1512 -1, -1, -1, -1, -1, -1, -1, -1, -1, 104,
Alexis Hetue5246692015-06-18 12:34:52 -04001513 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001514 115, 116, 117, 118, -1, 25, 26, 27, 28, 29,
1515 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1516 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
1517 50, -1, -1, -1, 54, 55, -1, 57, 58, 59,
1518 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1519 70, -1, 72, 73, 74, -1, 76, 77, 78, 79,
1520 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
1521 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001522 3, 4, 5, 6, 104, 8, 9, 10, 11, 12,
1523 13, -1, -1, -1, -1, 115, 116, 117, 118, -1,
1524 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
1525 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1526 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1527 53, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1528 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1529 73, 74, 75, -1, 77, -1, -1, -1, -1, -1,
1530 -1, -1, -1, -1, -1, 3, 4, 5, 6, -1,
1531 8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
1532 -1, -1, -1, -1, -1, -1, 109, 25, 26, 27,
1533 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1534 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1535 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
1536 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1537 68, 69, 70, -1, 72, 73, 74, 75, -1, 77,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001538 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001539 3, 4, 5, 6, -1, 8, 9, 10, 11, 12,
1540 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1541 -1, 109, 25, 26, 27, 28, 29, 30, 31, 32,
1542 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1543 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1544 53, 54, 55, -1, 57, 58, 59, -1, 61, 62,
1545 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
1546 73, 74, 75, -1, 77, -1, -1, -1, -1, -1,
1547 -1, -1, 0, -1, -1, 3, 4, 5, 6, 7,
1548 8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
1549 -1, -1, -1, -1, -1, -1, 109, 25, 26, 27,
1550 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1551 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1552 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
1553 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1554 68, 69, 70, -1, 72, 73, 74, 75, -1, 77,
1555 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001556 13, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1557 -1, -1, 25, 26, 27, 28, 29, 30, 31, 32,
Alexis Hetue5246692015-06-18 12:34:52 -04001558 33, 34, 35, 36, 37, 38, 39, 40, 41, -1,
1559 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1560 53, 54, 55, -1, 57, 58, 59, -1, 61, 62,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001561 63, 64, 65, 66, 67, 68, 69, 70, -1, 72,
Alexis Hetue5246692015-06-18 12:34:52 -04001562 73, 74, 75, -1, 77, 3, 4, 5, 6, -1,
1563 8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
1564 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
1565 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1566 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1567 48, 49, 50, 51, 52, 53, 54, 55, -1, 57,
1568 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1569 68, 69, 70, -1, 72, 73, 74, 75, -1, 77,
1570 4, 5, 6, -1, -1, -1, 10, 11, 12, 13,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001571 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetue5246692015-06-18 12:34:52 -04001572 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1573 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1574 -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1575 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1576 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1577 74, -1, -1, 77, 10, 11, 12, 13, -1, -1,
1578 -1, -1, -1, -1, -1, -1, -1, -1, -1, 25,
1579 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1580 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
1581 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1582 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1583 66, 67, 68, 69, 70, -1, 72, 73, 74, -1,
1584 76, 77, 10, 11, 12, 13, 82, -1, -1, -1,
1585 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
1586 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1587 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
1588 48, 49, 50, -1, -1, -1, 54, 55, -1, 57,
1589 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1590 68, 69, 70, -1, 72, 73, 74, -1, -1, 77
John Bauman66b8ab22014-05-06 15:57:45 -04001591};
1592
1593/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1594 symbol of state STATE-NUM. */
1595static const yytype_uint8 yystos[] =
1596{
1597 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Nicolas Capens3c20f802015-02-17 17:17:20 -05001598 12, 13, 25, 26, 27, 28, 29, 30, 31, 32,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05001599 33, 34, 35, 36, 37, 38, 39, 40, 41, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001600 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1601 54, 55, 57, 58, 59, 61, 62, 63, 64, 65,
1602 66, 67, 68, 69, 70, 72, 73, 74, 75, 77,
Alexis Hetua35d8232015-06-11 17:11:06 -04001603 159, 160, 161, 162, 163, 168, 169, 170, 171, 173,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001604 174, 175, 176, 177, 180, 181, 182, 217, 218, 219,
1605 44, 76, 176, 40, 41, 76, 108, 104, 114, 220,
Alexis Hetua35d8232015-06-11 17:11:06 -04001606 105, 111, 9, 40, 41, 42, 165, 166, 172, 111,
1607 114, 76, 174, 76, 114, 158, 175, 180, 174, 106,
Alexis Hetu76a343a2015-06-04 17:21:22 -04001608 0, 218, 180, 108, 184, 76, 178, 179, 108, 200,
Alexis Hetua35d8232015-06-11 17:11:06 -04001609 165, 164, 167, 175, 166, 76, 104, 106, 113, 108,
1610 3, 173, 175, 185, 186, 76, 78, 79, 80, 81,
Alexis Hetue5246692015-06-18 12:34:52 -04001611 82, 85, 86, 104, 107, 115, 116, 117, 118, 129,
1612 130, 131, 133, 134, 135, 136, 137, 138, 139, 140,
1613 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
1614 151, 152, 153, 157, 180, 114, 183, 185, 113, 105,
1615 111, 14, 15, 16, 18, 19, 20, 21, 22, 23,
1616 24, 56, 108, 109, 114, 140, 153, 154, 156, 159,
1617 160, 180, 190, 191, 192, 193, 201, 202, 203, 205,
1618 207, 209, 216, 76, 164, 167, 106, 113, 107, 157,
1619 154, 189, 175, 76, 187, 188, 109, 186, 140, 140,
1620 156, 85, 86, 106, 110, 105, 105, 111, 55, 154,
1621 104, 140, 119, 120, 121, 116, 118, 83, 84, 87,
1622 88, 122, 123, 89, 90, 126, 125, 124, 91, 93,
1623 92, 127, 107, 185, 109, 79, 80, 179, 114, 114,
1624 211, 104, 104, 114, 114, 156, 104, 157, 112, 104,
1625 109, 194, 94, 95, 96, 97, 98, 99, 100, 101,
1626 102, 103, 113, 155, 111, 114, 109, 191, 106, 107,
1627 157, 189, 113, 107, 187, 106, 111, 114, 76, 114,
1628 105, 132, 156, 76, 82, 135, 154, 140, 140, 140,
1629 142, 142, 143, 143, 144, 144, 144, 144, 145, 145,
1630 146, 147, 148, 149, 150, 151, 156, 109, 197, 198,
1631 199, 212, 156, 114, 156, 112, 210, 201, 154, 154,
1632 157, 113, 107, 189, 113, 114, 157, 188, 106, 114,
1633 107, 112, 56, 200, 192, 190, 202, 213, 105, 105,
1634 156, 170, 173, 208, 195, 107, 189, 113, 189, 107,
1635 157, 154, 104, 208, 214, 215, 197, 204, 206, 76,
1636 105, 109, 189, 107, 156, 114, 105, 17, 193, 113,
1637 192, 196, 200, 114, 105, 156, 196, 197, 189, 114
John Bauman66b8ab22014-05-06 15:57:45 -04001638};
1639
1640#define yyerrok (yyerrstatus = 0)
1641#define yyclearin (yychar = YYEMPTY)
1642#define YYEMPTY (-2)
1643#define YYEOF 0
1644
1645#define YYACCEPT goto yyacceptlab
1646#define YYABORT goto yyabortlab
1647#define YYERROR goto yyerrorlab
1648
1649
1650/* Like YYERROR except do call yyerror. This remains here temporarily
1651 to ease the transition to the new meaning of YYERROR, for GCC.
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001652 Once GCC version 2 has supplanted version 1, this can go. */
John Bauman66b8ab22014-05-06 15:57:45 -04001653
1654#define YYFAIL goto yyerrlab
John Bauman66b8ab22014-05-06 15:57:45 -04001655
1656#define YYRECOVERING() (!!yyerrstatus)
1657
1658#define YYBACKUP(Token, Value) \
1659do \
1660 if (yychar == YYEMPTY && yylen == 1) \
1661 { \
1662 yychar = (Token); \
1663 yylval = (Value); \
1664 yytoken = YYTRANSLATE (yychar); \
1665 YYPOPSTACK (1); \
1666 goto yybackup; \
1667 } \
1668 else \
1669 { \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001670 yyerror (&yylloc, context, YY_("syntax error: cannot back up")); \
John Bauman66b8ab22014-05-06 15:57:45 -04001671 YYERROR; \
1672 } \
1673while (YYID (0))
1674
1675
1676#define YYTERROR 1
1677#define YYERRCODE 256
1678
1679
1680/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1681 If N is 0, then set CURRENT to the empty location which ends
1682 the previous symbol: RHS[0] (always defined). */
1683
1684#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1685#ifndef YYLLOC_DEFAULT
1686# define YYLLOC_DEFAULT(Current, Rhs, N) \
1687 do \
1688 if (YYID (N)) \
1689 { \
1690 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1691 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1692 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1693 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1694 } \
1695 else \
1696 { \
1697 (Current).first_line = (Current).last_line = \
1698 YYRHSLOC (Rhs, 0).last_line; \
1699 (Current).first_column = (Current).last_column = \
1700 YYRHSLOC (Rhs, 0).last_column; \
1701 } \
1702 while (YYID (0))
1703#endif
1704
1705
1706/* YY_LOCATION_PRINT -- Print the location on the stream.
1707 This macro was not mandated originally: define only if we know
1708 we won't break user code: when these are the locations we know. */
1709
1710#ifndef YY_LOCATION_PRINT
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001711# if YYLTYPE_IS_TRIVIAL
John Bauman66b8ab22014-05-06 15:57:45 -04001712# define YY_LOCATION_PRINT(File, Loc) \
1713 fprintf (File, "%d.%d-%d.%d", \
1714 (Loc).first_line, (Loc).first_column, \
1715 (Loc).last_line, (Loc).last_column)
1716# else
1717# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1718# endif
1719#endif
1720
1721
1722/* YYLEX -- calling `yylex' with the right arguments. */
1723
1724#ifdef YYLEX_PARAM
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001725# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
John Bauman66b8ab22014-05-06 15:57:45 -04001726#else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001727# define YYLEX yylex (&yylval, &yylloc)
John Bauman66b8ab22014-05-06 15:57:45 -04001728#endif
1729
1730/* Enable debugging if requested. */
1731#if YYDEBUG
1732
1733# ifndef YYFPRINTF
1734# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1735# define YYFPRINTF fprintf
1736# endif
1737
1738# define YYDPRINTF(Args) \
1739do { \
1740 if (yydebug) \
1741 YYFPRINTF Args; \
1742} while (YYID (0))
1743
1744# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1745do { \
1746 if (yydebug) \
1747 { \
1748 YYFPRINTF (stderr, "%s ", Title); \
1749 yy_symbol_print (stderr, \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001750 Type, Value, Location, context); \
John Bauman66b8ab22014-05-06 15:57:45 -04001751 YYFPRINTF (stderr, "\n"); \
1752 } \
1753} while (YYID (0))
1754
1755
1756/*--------------------------------.
1757| Print this symbol on YYOUTPUT. |
1758`--------------------------------*/
1759
1760/*ARGSUSED*/
1761#if (defined __STDC__ || defined __C99__FUNC__ \
1762 || defined __cplusplus || defined _MSC_VER)
1763static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001764yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001765#else
1766static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001767yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001768 FILE *yyoutput;
1769 int yytype;
1770 YYSTYPE const * const yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001771 YYLTYPE const * const yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04001772 TParseContext* context;
1773#endif
1774{
1775 if (!yyvaluep)
1776 return;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001777 YYUSE (yylocationp);
John Bauman66b8ab22014-05-06 15:57:45 -04001778 YYUSE (context);
1779# ifdef YYPRINT
1780 if (yytype < YYNTOKENS)
1781 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1782# else
1783 YYUSE (yyoutput);
1784# endif
1785 switch (yytype)
1786 {
1787 default:
1788 break;
1789 }
1790}
1791
1792
1793/*--------------------------------.
1794| Print this symbol on YYOUTPUT. |
1795`--------------------------------*/
1796
1797#if (defined __STDC__ || defined __C99__FUNC__ \
1798 || defined __cplusplus || defined _MSC_VER)
1799static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001800yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001801#else
1802static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001803yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001804 FILE *yyoutput;
1805 int yytype;
1806 YYSTYPE const * const yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001807 YYLTYPE const * const yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04001808 TParseContext* context;
1809#endif
1810{
1811 if (yytype < YYNTOKENS)
1812 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1813 else
1814 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1815
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001816 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1817 YYFPRINTF (yyoutput, ": ");
1818 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04001819 YYFPRINTF (yyoutput, ")");
1820}
1821
1822/*------------------------------------------------------------------.
1823| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1824| TOP (included). |
1825`------------------------------------------------------------------*/
1826
1827#if (defined __STDC__ || defined __C99__FUNC__ \
1828 || defined __cplusplus || defined _MSC_VER)
1829static void
1830yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1831#else
1832static void
1833yy_stack_print (yybottom, yytop)
1834 yytype_int16 *yybottom;
1835 yytype_int16 *yytop;
1836#endif
1837{
1838 YYFPRINTF (stderr, "Stack now");
1839 for (; yybottom <= yytop; yybottom++)
1840 {
1841 int yybot = *yybottom;
1842 YYFPRINTF (stderr, " %d", yybot);
1843 }
1844 YYFPRINTF (stderr, "\n");
1845}
1846
1847# define YY_STACK_PRINT(Bottom, Top) \
1848do { \
1849 if (yydebug) \
1850 yy_stack_print ((Bottom), (Top)); \
1851} while (YYID (0))
1852
1853
1854/*------------------------------------------------.
1855| Report that the YYRULE is going to be reduced. |
1856`------------------------------------------------*/
1857
1858#if (defined __STDC__ || defined __C99__FUNC__ \
1859 || defined __cplusplus || defined _MSC_VER)
1860static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001861yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04001862#else
1863static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001864yy_reduce_print (yyvsp, yylsp, yyrule, context)
John Bauman66b8ab22014-05-06 15:57:45 -04001865 YYSTYPE *yyvsp;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001866 YYLTYPE *yylsp;
John Bauman66b8ab22014-05-06 15:57:45 -04001867 int yyrule;
1868 TParseContext* context;
1869#endif
1870{
1871 int yynrhs = yyr2[yyrule];
1872 int yyi;
1873 unsigned long int yylno = yyrline[yyrule];
1874 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1875 yyrule - 1, yylno);
1876 /* The symbols being reduced. */
1877 for (yyi = 0; yyi < yynrhs; yyi++)
1878 {
1879 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1880 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1881 &(yyvsp[(yyi + 1) - (yynrhs)])
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001882 , &(yylsp[(yyi + 1) - (yynrhs)]) , context);
John Bauman66b8ab22014-05-06 15:57:45 -04001883 YYFPRINTF (stderr, "\n");
1884 }
1885}
1886
1887# define YY_REDUCE_PRINT(Rule) \
1888do { \
1889 if (yydebug) \
Alexis Hetu15ae36c2015-06-18 21:10:09 -04001890 yy_reduce_print (yyvsp, yylsp, Rule, context); \
John Bauman66b8ab22014-05-06 15:57:45 -04001891} while (YYID (0))
1892
1893/* Nonzero means print parse trace. It is left uninitialized so that
1894 multiple parsers can coexist. */
1895int yydebug;
1896#else /* !YYDEBUG */
1897# define YYDPRINTF(Args)
1898# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1899# define YY_STACK_PRINT(Bottom, Top)
1900# define YY_REDUCE_PRINT(Rule)
1901#endif /* !YYDEBUG */
1902
1903
1904/* YYINITDEPTH -- initial size of the parser's stacks. */
1905#ifndef YYINITDEPTH
1906# define YYINITDEPTH 200
1907#endif
1908
1909/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1910 if the built-in stack extension method is used).
1911
1912 Do not make this value too large; the results are undefined if
1913 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1914 evaluated with infinite-precision integer arithmetic. */
1915
1916#ifndef YYMAXDEPTH
1917# define YYMAXDEPTH 10000
1918#endif
1919
1920
1921
1922#if YYERROR_VERBOSE
1923
1924# ifndef yystrlen
1925# if defined __GLIBC__ && defined _STRING_H
1926# define yystrlen strlen
1927# else
1928/* Return the length of YYSTR. */
1929#if (defined __STDC__ || defined __C99__FUNC__ \
1930 || defined __cplusplus || defined _MSC_VER)
1931static YYSIZE_T
1932yystrlen (const char *yystr)
1933#else
1934static YYSIZE_T
1935yystrlen (yystr)
1936 const char *yystr;
1937#endif
1938{
1939 YYSIZE_T yylen;
1940 for (yylen = 0; yystr[yylen]; yylen++)
1941 continue;
1942 return yylen;
1943}
1944# endif
1945# endif
1946
1947# ifndef yystpcpy
1948# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1949# define yystpcpy stpcpy
1950# else
1951/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1952 YYDEST. */
1953#if (defined __STDC__ || defined __C99__FUNC__ \
1954 || defined __cplusplus || defined _MSC_VER)
1955static char *
1956yystpcpy (char *yydest, const char *yysrc)
1957#else
1958static char *
1959yystpcpy (yydest, yysrc)
1960 char *yydest;
1961 const char *yysrc;
1962#endif
1963{
1964 char *yyd = yydest;
1965 const char *yys = yysrc;
1966
1967 while ((*yyd++ = *yys++) != '\0')
1968 continue;
1969
1970 return yyd - 1;
1971}
1972# endif
1973# endif
1974
1975# ifndef yytnamerr
1976/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1977 quotes and backslashes, so that it's suitable for yyerror. The
1978 heuristic is that double-quoting is unnecessary unless the string
1979 contains an apostrophe, a comma, or backslash (other than
1980 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1981 null, do not copy; instead, return the length of what the result
1982 would have been. */
1983static YYSIZE_T
1984yytnamerr (char *yyres, const char *yystr)
1985{
1986 if (*yystr == '"')
1987 {
1988 YYSIZE_T yyn = 0;
1989 char const *yyp = yystr;
1990
1991 for (;;)
1992 switch (*++yyp)
1993 {
1994 case '\'':
1995 case ',':
1996 goto do_not_strip_quotes;
1997
1998 case '\\':
1999 if (*++yyp != '\\')
2000 goto do_not_strip_quotes;
2001 /* Fall through. */
2002 default:
2003 if (yyres)
2004 yyres[yyn] = *yyp;
2005 yyn++;
2006 break;
2007
2008 case '"':
2009 if (yyres)
2010 yyres[yyn] = '\0';
2011 return yyn;
2012 }
2013 do_not_strip_quotes: ;
2014 }
2015
2016 if (! yyres)
2017 return yystrlen (yystr);
2018
2019 return yystpcpy (yyres, yystr) - yyres;
2020}
2021# endif
2022
2023/* Copy into YYRESULT an error message about the unexpected token
2024 YYCHAR while in state YYSTATE. Return the number of bytes copied,
2025 including the terminating null byte. If YYRESULT is null, do not
2026 copy anything; just return the number of bytes that would be
2027 copied. As a special case, return 0 if an ordinary "syntax error"
2028 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
2029 size calculation. */
2030static YYSIZE_T
2031yysyntax_error (char *yyresult, int yystate, int yychar)
2032{
2033 int yyn = yypact[yystate];
2034
2035 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
2036 return 0;
2037 else
2038 {
2039 int yytype = YYTRANSLATE (yychar);
2040 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
2041 YYSIZE_T yysize = yysize0;
2042 YYSIZE_T yysize1;
2043 int yysize_overflow = 0;
2044 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2045 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2046 int yyx;
2047
2048# if 0
2049 /* This is so xgettext sees the translatable formats that are
2050 constructed on the fly. */
2051 YY_("syntax error, unexpected %s");
2052 YY_("syntax error, unexpected %s, expecting %s");
2053 YY_("syntax error, unexpected %s, expecting %s or %s");
2054 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
2055 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
2056# endif
2057 char *yyfmt;
2058 char const *yyf;
2059 static char const yyunexpected[] = "syntax error, unexpected %s";
2060 static char const yyexpecting[] = ", expecting %s";
2061 static char const yyor[] = " or %s";
2062 char yyformat[sizeof yyunexpected
2063 + sizeof yyexpecting - 1
2064 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
2065 * (sizeof yyor - 1))];
2066 char const *yyprefix = yyexpecting;
2067
2068 /* Start YYX at -YYN if negative to avoid negative indexes in
2069 YYCHECK. */
2070 int yyxbegin = yyn < 0 ? -yyn : 0;
2071
2072 /* Stay within bounds of both yycheck and yytname. */
2073 int yychecklim = YYLAST - yyn + 1;
2074 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2075 int yycount = 1;
2076
2077 yyarg[0] = yytname[yytype];
2078 yyfmt = yystpcpy (yyformat, yyunexpected);
2079
2080 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2081 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
2082 {
2083 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2084 {
2085 yycount = 1;
2086 yysize = yysize0;
2087 yyformat[sizeof yyunexpected - 1] = '\0';
2088 break;
2089 }
2090 yyarg[yycount++] = yytname[yyx];
2091 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
2092 yysize_overflow |= (yysize1 < yysize);
2093 yysize = yysize1;
2094 yyfmt = yystpcpy (yyfmt, yyprefix);
2095 yyprefix = yyor;
2096 }
2097
2098 yyf = YY_(yyformat);
2099 yysize1 = yysize + yystrlen (yyf);
2100 yysize_overflow |= (yysize1 < yysize);
2101 yysize = yysize1;
2102
2103 if (yysize_overflow)
2104 return YYSIZE_MAXIMUM;
2105
2106 if (yyresult)
2107 {
2108 /* Avoid sprintf, as that infringes on the user's name space.
2109 Don't have undefined behavior even if the translation
2110 produced a string with the wrong number of "%s"s. */
2111 char *yyp = yyresult;
2112 int yyi = 0;
2113 while ((*yyp = *yyf) != '\0')
2114 {
2115 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
2116 {
2117 yyp += yytnamerr (yyp, yyarg[yyi++]);
2118 yyf += 2;
2119 }
2120 else
2121 {
2122 yyp++;
2123 yyf++;
2124 }
2125 }
2126 }
2127 return yysize;
2128 }
2129}
2130#endif /* YYERROR_VERBOSE */
2131
2132
2133/*-----------------------------------------------.
2134| Release the memory associated to this symbol. |
2135`-----------------------------------------------*/
2136
2137/*ARGSUSED*/
2138#if (defined __STDC__ || defined __C99__FUNC__ \
2139 || defined __cplusplus || defined _MSC_VER)
2140static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002141yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, TParseContext* context)
John Bauman66b8ab22014-05-06 15:57:45 -04002142#else
2143static void
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002144yydestruct (yymsg, yytype, yyvaluep, yylocationp, context)
John Bauman66b8ab22014-05-06 15:57:45 -04002145 const char *yymsg;
2146 int yytype;
2147 YYSTYPE *yyvaluep;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002148 YYLTYPE *yylocationp;
John Bauman66b8ab22014-05-06 15:57:45 -04002149 TParseContext* context;
2150#endif
2151{
2152 YYUSE (yyvaluep);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002153 YYUSE (yylocationp);
John Bauman66b8ab22014-05-06 15:57:45 -04002154 YYUSE (context);
2155
2156 if (!yymsg)
2157 yymsg = "Deleting";
2158 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2159
2160 switch (yytype)
2161 {
2162
2163 default:
2164 break;
2165 }
2166}
2167
2168/* Prevent warnings from -Wmissing-prototypes. */
2169#ifdef YYPARSE_PARAM
2170#if defined __STDC__ || defined __cplusplus
2171int yyparse (void *YYPARSE_PARAM);
2172#else
2173int yyparse ();
2174#endif
2175#else /* ! YYPARSE_PARAM */
2176#if defined __STDC__ || defined __cplusplus
2177int yyparse (TParseContext* context);
2178#else
2179int yyparse ();
2180#endif
2181#endif /* ! YYPARSE_PARAM */
2182
2183
2184
2185
2186
2187/*-------------------------.
2188| yyparse or yypush_parse. |
2189`-------------------------*/
2190
2191#ifdef YYPARSE_PARAM
2192#if (defined __STDC__ || defined __C99__FUNC__ \
2193 || defined __cplusplus || defined _MSC_VER)
2194int
2195yyparse (void *YYPARSE_PARAM)
2196#else
2197int
2198yyparse (YYPARSE_PARAM)
2199 void *YYPARSE_PARAM;
2200#endif
2201#else /* ! YYPARSE_PARAM */
2202#if (defined __STDC__ || defined __C99__FUNC__ \
2203 || defined __cplusplus || defined _MSC_VER)
2204int
2205yyparse (TParseContext* context)
2206#else
2207int
2208yyparse (context)
2209 TParseContext* context;
2210#endif
2211#endif
2212{
2213/* The lookahead symbol. */
2214int yychar;
2215
2216/* The semantic value of the lookahead symbol. */
2217YYSTYPE yylval;
2218
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002219/* Location data for the lookahead symbol. */
2220YYLTYPE yylloc;
2221
John Bauman66b8ab22014-05-06 15:57:45 -04002222 /* Number of syntax errors so far. */
2223 int yynerrs;
2224
2225 int yystate;
2226 /* Number of tokens to shift before error messages enabled. */
2227 int yyerrstatus;
2228
2229 /* The stacks and their tools:
2230 `yyss': related to states.
2231 `yyvs': related to semantic values.
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002232 `yyls': related to locations.
John Bauman66b8ab22014-05-06 15:57:45 -04002233
2234 Refer to the stacks thru separate pointers, to allow yyoverflow
2235 to reallocate them elsewhere. */
2236
2237 /* The state stack. */
2238 yytype_int16 yyssa[YYINITDEPTH];
2239 yytype_int16 *yyss;
2240 yytype_int16 *yyssp;
2241
2242 /* The semantic value stack. */
2243 YYSTYPE yyvsa[YYINITDEPTH];
2244 YYSTYPE *yyvs;
2245 YYSTYPE *yyvsp;
2246
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002247 /* The location stack. */
2248 YYLTYPE yylsa[YYINITDEPTH];
2249 YYLTYPE *yyls;
2250 YYLTYPE *yylsp;
2251
2252 /* The locations where the error started and ended. */
2253 YYLTYPE yyerror_range[2];
2254
John Bauman66b8ab22014-05-06 15:57:45 -04002255 YYSIZE_T yystacksize;
2256
2257 int yyn;
2258 int yyresult;
2259 /* Lookahead token as an internal (translated) token number. */
2260 int yytoken;
2261 /* The variables used to return semantic value and location from the
2262 action routines. */
2263 YYSTYPE yyval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002264 YYLTYPE yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04002265
2266#if YYERROR_VERBOSE
2267 /* Buffer for error messages, and its allocated size. */
2268 char yymsgbuf[128];
2269 char *yymsg = yymsgbuf;
2270 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2271#endif
2272
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002273#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
John Bauman66b8ab22014-05-06 15:57:45 -04002274
2275 /* The number of symbols on the RHS of the reduced rule.
2276 Keep to zero when no symbol should be popped. */
2277 int yylen = 0;
2278
2279 yytoken = 0;
2280 yyss = yyssa;
2281 yyvs = yyvsa;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002282 yyls = yylsa;
John Bauman66b8ab22014-05-06 15:57:45 -04002283 yystacksize = YYINITDEPTH;
2284
2285 YYDPRINTF ((stderr, "Starting parse\n"));
2286
2287 yystate = 0;
2288 yyerrstatus = 0;
2289 yynerrs = 0;
2290 yychar = YYEMPTY; /* Cause a token to be read. */
2291
2292 /* Initialize stack pointers.
2293 Waste one element of value and location stack
2294 so that they stay on the same level as the state stack.
2295 The wasted elements are never initialized. */
2296 yyssp = yyss;
2297 yyvsp = yyvs;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002298 yylsp = yyls;
2299
2300#if YYLTYPE_IS_TRIVIAL
2301 /* Initialize the default location before parsing starts. */
2302 yylloc.first_line = yylloc.last_line = 1;
2303 yylloc.first_column = yylloc.last_column = 1;
2304#endif
John Bauman66b8ab22014-05-06 15:57:45 -04002305
2306 goto yysetstate;
2307
2308/*------------------------------------------------------------.
2309| yynewstate -- Push a new state, which is found in yystate. |
2310`------------------------------------------------------------*/
2311 yynewstate:
2312 /* In all cases, when you get here, the value and location stacks
2313 have just been pushed. So pushing a state here evens the stacks. */
2314 yyssp++;
2315
2316 yysetstate:
2317 *yyssp = yystate;
2318
2319 if (yyss + yystacksize - 1 <= yyssp)
2320 {
2321 /* Get the current used size of the three stacks, in elements. */
2322 YYSIZE_T yysize = yyssp - yyss + 1;
2323
2324#ifdef yyoverflow
2325 {
2326 /* Give user a chance to reallocate the stack. Use copies of
2327 these so that the &'s don't force the real ones into
2328 memory. */
2329 YYSTYPE *yyvs1 = yyvs;
2330 yytype_int16 *yyss1 = yyss;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002331 YYLTYPE *yyls1 = yyls;
John Bauman66b8ab22014-05-06 15:57:45 -04002332
2333 /* Each stack pointer address is followed by the size of the
2334 data in use in that stack, in bytes. This used to be a
2335 conditional around just the two extra args, but that might
2336 be undefined if yyoverflow is a macro. */
2337 yyoverflow (YY_("memory exhausted"),
2338 &yyss1, yysize * sizeof (*yyssp),
2339 &yyvs1, yysize * sizeof (*yyvsp),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002340 &yyls1, yysize * sizeof (*yylsp),
John Bauman66b8ab22014-05-06 15:57:45 -04002341 &yystacksize);
2342
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002343 yyls = yyls1;
John Bauman66b8ab22014-05-06 15:57:45 -04002344 yyss = yyss1;
2345 yyvs = yyvs1;
2346 }
2347#else /* no yyoverflow */
2348# ifndef YYSTACK_RELOCATE
2349 goto yyexhaustedlab;
2350# else
2351 /* Extend the stack our own way. */
2352 if (YYMAXDEPTH <= yystacksize)
2353 goto yyexhaustedlab;
2354 yystacksize *= 2;
2355 if (YYMAXDEPTH < yystacksize)
2356 yystacksize = YYMAXDEPTH;
2357
2358 {
2359 yytype_int16 *yyss1 = yyss;
2360 union yyalloc *yyptr =
2361 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2362 if (! yyptr)
2363 goto yyexhaustedlab;
2364 YYSTACK_RELOCATE (yyss_alloc, yyss);
2365 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002366 YYSTACK_RELOCATE (yyls_alloc, yyls);
John Bauman66b8ab22014-05-06 15:57:45 -04002367# undef YYSTACK_RELOCATE
2368 if (yyss1 != yyssa)
2369 YYSTACK_FREE (yyss1);
2370 }
2371# endif
2372#endif /* no yyoverflow */
2373
2374 yyssp = yyss + yysize - 1;
2375 yyvsp = yyvs + yysize - 1;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002376 yylsp = yyls + yysize - 1;
John Bauman66b8ab22014-05-06 15:57:45 -04002377
2378 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2379 (unsigned long int) yystacksize));
2380
2381 if (yyss + yystacksize - 1 <= yyssp)
2382 YYABORT;
2383 }
2384
2385 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2386
2387 if (yystate == YYFINAL)
2388 YYACCEPT;
2389
2390 goto yybackup;
2391
2392/*-----------.
2393| yybackup. |
2394`-----------*/
2395yybackup:
2396
2397 /* Do appropriate processing given the current state. Read a
2398 lookahead token if we need one and don't already have one. */
2399
2400 /* First try to decide what to do without reference to lookahead token. */
2401 yyn = yypact[yystate];
2402 if (yyn == YYPACT_NINF)
2403 goto yydefault;
2404
2405 /* Not known => get a lookahead token if don't already have one. */
2406
2407 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2408 if (yychar == YYEMPTY)
2409 {
2410 YYDPRINTF ((stderr, "Reading a token: "));
2411 yychar = YYLEX;
2412 }
2413
2414 if (yychar <= YYEOF)
2415 {
2416 yychar = yytoken = YYEOF;
2417 YYDPRINTF ((stderr, "Now at end of input.\n"));
2418 }
2419 else
2420 {
2421 yytoken = YYTRANSLATE (yychar);
2422 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2423 }
2424
2425 /* If the proper action on seeing token YYTOKEN is to reduce or to
2426 detect an error, take that action. */
2427 yyn += yytoken;
2428 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2429 goto yydefault;
2430 yyn = yytable[yyn];
2431 if (yyn <= 0)
2432 {
2433 if (yyn == 0 || yyn == YYTABLE_NINF)
2434 goto yyerrlab;
2435 yyn = -yyn;
2436 goto yyreduce;
2437 }
2438
2439 /* Count tokens shifted since error; after three, turn off error
2440 status. */
2441 if (yyerrstatus)
2442 yyerrstatus--;
2443
2444 /* Shift the lookahead token. */
2445 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2446
2447 /* Discard the shifted token. */
2448 yychar = YYEMPTY;
2449
2450 yystate = yyn;
2451 *++yyvsp = yylval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002452 *++yylsp = yylloc;
John Bauman66b8ab22014-05-06 15:57:45 -04002453 goto yynewstate;
2454
2455
2456/*-----------------------------------------------------------.
2457| yydefault -- do the default action for the current state. |
2458`-----------------------------------------------------------*/
2459yydefault:
2460 yyn = yydefact[yystate];
2461 if (yyn == 0)
2462 goto yyerrlab;
2463 goto yyreduce;
2464
2465
2466/*-----------------------------.
2467| yyreduce -- Do a reduction. |
2468`-----------------------------*/
2469yyreduce:
2470 /* yyn is the number of a rule to reduce with. */
2471 yylen = yyr2[yyn];
2472
2473 /* If YYLEN is nonzero, implement the default value of the action:
2474 `$$ = $1'.
2475
2476 Otherwise, the following line sets YYVAL to garbage.
2477 This behavior is undocumented and Bison
2478 users should not rely upon it. Assigning to YYVAL
2479 unconditionally makes the parser a bit smaller, and it avoids a
2480 GCC warning that YYVAL may be used uninitialized. */
2481 yyval = yyvsp[1-yylen];
2482
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002483 /* Default location. */
2484 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
John Bauman66b8ab22014-05-06 15:57:45 -04002485 YY_REDUCE_PRINT (yyn);
2486 switch (yyn)
2487 {
2488 case 2:
2489
2490 {
2491 // The symbol table search was done in the lexical phase
2492 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2493 const TVariable* variable;
2494 if (symbol == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002495 context->error((yylsp[(1) - (1)]), "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04002496 context->recover();
2497 TType type(EbtFloat, EbpUndefined);
2498 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05002499 context->symbolTable.declare(*fakeVariable);
John Bauman66b8ab22014-05-06 15:57:45 -04002500 variable = fakeVariable;
2501 } else {
2502 // This identifier can only be a variable type symbol
2503 if (! symbol->isVariable()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002504 context->error((yylsp[(1) - (1)]), "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04002505 context->recover();
2506 }
2507 variable = static_cast<const TVariable*>(symbol);
2508 }
2509
2510 // don't delete $1.string, it's used by error recovery, and the pool
2511 // pop will reclaim the memory
2512
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002513 if (variable->getType().getQualifier() == EvqConstExpr ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002514 ConstantUnion* constArray = variable->getConstPointer();
2515 TType t(variable->getType());
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002516 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002517 } else
2518 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2519 variable->getName(),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002520 variable->getType(), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002521 }
2522 break;
2523
2524 case 3:
2525
2526 {
2527 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2528 }
2529 break;
2530
2531 case 4:
2532
2533 {
John Bauman66b8ab22014-05-06 15:57:45 -04002534 ConstantUnion *unionArray = new ConstantUnion[1];
2535 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002536 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002537 }
2538 break;
2539
2540 case 5:
2541
2542 {
2543 ConstantUnion *unionArray = new ConstantUnion[1];
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002544 unionArray->setUConst((yyvsp[(1) - (1)].lex).u);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002545 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002546 }
2547 break;
2548
2549 case 6:
2550
2551 {
2552 ConstantUnion *unionArray = new ConstantUnion[1];
John Bauman66b8ab22014-05-06 15:57:45 -04002553 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002554 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002555 }
2556 break;
2557
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002558 case 7:
John Bauman66b8ab22014-05-06 15:57:45 -04002559
2560 {
2561 ConstantUnion *unionArray = new ConstantUnion[1];
2562 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002563 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002564 }
2565 break;
2566
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002567 case 8:
John Bauman66b8ab22014-05-06 15:57:45 -04002568
2569 {
2570 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
2571 }
2572 break;
2573
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002574 case 9:
John Bauman66b8ab22014-05-06 15:57:45 -04002575
2576 {
2577 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2578 }
2579 break;
2580
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002581 case 10:
John Bauman66b8ab22014-05-06 15:57:45 -04002582
2583 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002584 (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[(1) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode));
John Bauman66b8ab22014-05-06 15:57:45 -04002585 }
2586 break;
2587
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002588 case 11:
John Bauman66b8ab22014-05-06 15:57:45 -04002589
2590 {
2591 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2592 }
2593 break;
2594
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002595 case 12:
John Bauman66b8ab22014-05-06 15:57:45 -04002596
2597 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002598 (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[(1) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yylsp[(3) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002599 }
2600 break;
2601
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002602 case 13:
John Bauman66b8ab22014-05-06 15:57:45 -04002603
2604 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002605 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002606 }
2607 break;
2608
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002609 case 14:
John Bauman66b8ab22014-05-06 15:57:45 -04002610
2611 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002612 (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002613 }
2614 break;
2615
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002616 case 15:
John Bauman66b8ab22014-05-06 15:57:45 -04002617
2618 {
2619 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2620 context->recover();
2621 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2622 }
2623 break;
2624
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002625 case 16:
John Bauman66b8ab22014-05-06 15:57:45 -04002626
2627 {
Alexis Hetub3ff42c2015-07-03 18:19:57 -04002628 bool fatalError = false;
2629 (yyval.interm.intermTypedNode) = context->addFunctionCallOrMethod((yyvsp[(1) - (1)].interm).function, (yyvsp[(1) - (1)].interm).intermNode, nullptr, (yylsp[(1) - (1)]), &fatalError);
2630 if (fatalError)
John Bauman66b8ab22014-05-06 15:57:45 -04002631 {
Alexis Hetub3ff42c2015-07-03 18:19:57 -04002632 YYERROR;
John Bauman66b8ab22014-05-06 15:57:45 -04002633 }
John Bauman66b8ab22014-05-06 15:57:45 -04002634 }
2635 break;
2636
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002637 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002638
2639 {
2640 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2641 }
2642 break;
2643
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002644 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002645
2646 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002647 context->error((yylsp[(3) - (3)]), "methods are not supported", "");
John Bauman66b8ab22014-05-06 15:57:45 -04002648 context->recover();
2649 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2650 }
2651 break;
2652
John Bauman66b8ab22014-05-06 15:57:45 -04002653 case 19:
2654
2655 {
2656 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002657 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04002658 }
2659 break;
2660
2661 case 20:
2662
2663 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002664 (yyval.interm) = (yyvsp[(1) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002665 (yyval.interm).line = (yylsp[(2) - (2)]);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002666 }
2667 break;
2668
2669 case 21:
2670
2671 {
John Bauman66b8ab22014-05-06 15:57:45 -04002672 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2673 (yyval.interm).intermNode = 0;
2674 }
2675 break;
2676
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002677 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002678
2679 {
2680 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2681 (yyval.interm).intermNode = 0;
2682 }
2683 break;
2684
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002685 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002686
2687 {
2688 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2689 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2690 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2691 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2692 }
2693 break;
2694
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002695 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002696
2697 {
2698 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2699 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2700 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002701 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002702 }
2703 break;
2704
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002705 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002706
2707 {
2708 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2709 }
2710 break;
2711
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002712 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002713
2714 {
Alexis Hetue5246692015-06-18 12:34:52 -04002715 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002716 ES3_ONLY("[]", (yylsp[(1) - (1)]), "array constructor");
John Bauman66b8ab22014-05-06 15:57:45 -04002717 }
Alexis Hetue5246692015-06-18 12:34:52 -04002718 (yyval.interm.function) = context->addConstructorFunc((yyvsp[(1) - (1)].interm.type));
John Bauman66b8ab22014-05-06 15:57:45 -04002719 }
2720 break;
2721
John Bauman66b8ab22014-05-06 15:57:45 -04002722 case 27:
2723
2724 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002725 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04002726 context->recover();
2727 TType type(EbtVoid, EbpUndefined);
2728 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2729 (yyval.interm.function) = function;
2730 }
2731 break;
2732
2733 case 28:
2734
2735 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002736 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002737 context->recover();
2738 TType type(EbtVoid, EbpUndefined);
2739 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2740 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002741 }
2742 break;
2743
2744 case 29:
2745
2746 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002747 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2748 }
2749 break;
2750
2751 case 30:
2752
2753 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002754 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002755 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002756 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002757 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002758 context->unaryOpError((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002759 context->recover();
2760 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2761 }
2762 }
2763 break;
2764
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002765 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002766
2767 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002768 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04002769 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002770 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002771 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002772 context->unaryOpError((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002773 context->recover();
2774 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2775 }
2776 }
2777 break;
2778
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002779 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002780
2781 {
2782 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002783 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002784 if ((yyval.interm.intermTypedNode) == 0) {
2785 const char* errorOp = "";
2786 switch((yyvsp[(1) - (2)].interm).op) {
2787 case EOpNegative: errorOp = "-"; break;
2788 case EOpLogicalNot: errorOp = "!"; break;
Alexis Hetud061e422015-05-13 16:37:50 -04002789 case EOpBitwiseNot: errorOp = "~"; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002790 default: break;
2791 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002792 context->unaryOpError((yylsp[(1) - (2)]), errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04002793 context->recover();
2794 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2795 }
2796 } else
2797 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2798 }
2799 break;
2800
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002801 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002802
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002803 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNull; }
John Bauman66b8ab22014-05-06 15:57:45 -04002804 break;
2805
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002806 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002807
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002808 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpNegative; }
John Bauman66b8ab22014-05-06 15:57:45 -04002809 break;
2810
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002811 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002812
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002813 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpLogicalNot; }
John Bauman66b8ab22014-05-06 15:57:45 -04002814 break;
2815
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002816 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002817
Alexis Hetu17809052015-05-13 11:28:22 -04002818 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002819 ES3_ONLY("~", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002820 (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseNot;
Alexis Hetu17809052015-05-13 11:28:22 -04002821 }
John Bauman66b8ab22014-05-06 15:57:45 -04002822 break;
2823
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002824 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002825
Alexis Hetu17809052015-05-13 11:28:22 -04002826 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2827 break;
2828
2829 case 38:
2830
John Bauman66b8ab22014-05-06 15:57:45 -04002831 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002832 FRAG_VERT_ONLY("*", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002833 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002834 }
2835 break;
2836
Alexis Hetu17809052015-05-13 11:28:22 -04002837 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04002838
2839 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002840 FRAG_VERT_ONLY("/", (yylsp[(2) - (3)]));
Alexis Hetub4769582015-06-16 12:19:50 -04002841 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002842 }
2843 break;
2844
Alexis Hetu17809052015-05-13 11:28:22 -04002845 case 40:
2846
2847 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04002848 FRAG_VERT_ONLY("%", (yylsp[(2) - (3)]));
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002849 ES3_ONLY("%", (yylsp[(2) - (3)]), "integer modulus operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002850 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpIMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04002851 }
2852 break;
2853
2854 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04002855
2856 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2857 break;
2858
Alexis Hetu17809052015-05-13 11:28:22 -04002859 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04002860
2861 {
Alexis Hetub4769582015-06-16 12:19:50 -04002862 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002863 }
2864 break;
2865
Alexis Hetu17809052015-05-13 11:28:22 -04002866 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04002867
2868 {
Alexis Hetub4769582015-06-16 12:19:50 -04002869 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002870 }
2871 break;
2872
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002873 case 44:
2874
Alexis Hetu17809052015-05-13 11:28:22 -04002875 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2876 break;
2877
2878 case 45:
2879
2880 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002881 ES3_ONLY("<<", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002882 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitShiftLeft, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04002883 }
2884 break;
2885
2886 case 46:
2887
2888 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002889 ES3_ONLY(">>", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002890 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitShiftRight, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04002891 }
2892 break;
2893
2894 case 47:
2895
2896 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2897 break;
2898
2899 case 48:
2900
John Bauman66b8ab22014-05-06 15:57:45 -04002901 {
Alexis Hetub4769582015-06-16 12:19:50 -04002902 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002903 }
2904 break;
2905
Alexis Hetu17809052015-05-13 11:28:22 -04002906 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04002907
2908 {
Alexis Hetub4769582015-06-16 12:19:50 -04002909 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002910 }
2911 break;
2912
Alexis Hetu17809052015-05-13 11:28:22 -04002913 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04002914
2915 {
Alexis Hetub4769582015-06-16 12:19:50 -04002916 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002917 }
2918 break;
2919
Alexis Hetu17809052015-05-13 11:28:22 -04002920 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04002921
2922 {
Alexis Hetub4769582015-06-16 12:19:50 -04002923 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002924 }
2925 break;
2926
Alexis Hetu17809052015-05-13 11:28:22 -04002927 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04002928
2929 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2930 break;
2931
Alexis Hetu17809052015-05-13 11:28:22 -04002932 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04002933
2934 {
Alexis Hetub4769582015-06-16 12:19:50 -04002935 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002936 }
2937 break;
2938
Alexis Hetu17809052015-05-13 11:28:22 -04002939 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04002940
2941 {
Alexis Hetub4769582015-06-16 12:19:50 -04002942 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002943 }
2944 break;
2945
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002946 case 55:
2947
Alexis Hetu17809052015-05-13 11:28:22 -04002948 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2949 break;
2950
2951 case 56:
2952
2953 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002954 ES3_ONLY("&", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002955 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitwiseAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04002956 }
2957 break;
2958
2959 case 57:
2960
2961 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2962 break;
2963
2964 case 58:
2965
2966 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002967 ES3_ONLY("^", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002968 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitwiseXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04002969 }
2970 break;
2971
2972 case 59:
2973
2974 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2975 break;
2976
2977 case 60:
2978
2979 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04002980 ES3_ONLY("|", (yylsp[(2) - (3)]), "bit-wise operator");
Alexis Hetub4769582015-06-16 12:19:50 -04002981 (yyval.interm.intermTypedNode) = context->addBinaryMath(EOpBitwiseOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04002982 }
2983 break;
2984
2985 case 61:
2986
2987 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2988 break;
2989
2990 case 62:
2991
John Bauman66b8ab22014-05-06 15:57:45 -04002992 {
Alexis Hetub4769582015-06-16 12:19:50 -04002993 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04002994 }
2995 break;
2996
Alexis Hetu17809052015-05-13 11:28:22 -04002997 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04002998
2999 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3000 break;
3001
Alexis Hetu17809052015-05-13 11:28:22 -04003002 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003003
3004 {
Alexis Hetub4769582015-06-16 12:19:50 -04003005 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003006 }
3007 break;
3008
Alexis Hetu17809052015-05-13 11:28:22 -04003009 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003010
3011 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3012 break;
3013
Alexis Hetu17809052015-05-13 11:28:22 -04003014 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003015
3016 {
Alexis Hetub4769582015-06-16 12:19:50 -04003017 (yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003018 }
3019 break;
3020
Alexis Hetu17809052015-05-13 11:28:22 -04003021 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003022
3023 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3024 break;
3025
Alexis Hetu17809052015-05-13 11:28:22 -04003026 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003027
3028 {
Alexis Hetueee212e2015-07-07 17:13:30 -04003029 (yyval.interm.intermTypedNode) = context->addTernarySelection((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 -04003030 }
3031 break;
3032
Alexis Hetu17809052015-05-13 11:28:22 -04003033 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003034
3035 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3036 break;
3037
Alexis Hetu17809052015-05-13 11:28:22 -04003038 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003039
3040 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003041 if (context->lValueErrorCheck((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04003042 context->recover();
Alexis Hetue5246692015-06-18 12:34:52 -04003043 (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 -04003044 }
3045 break;
3046
Alexis Hetu17809052015-05-13 11:28:22 -04003047 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003048
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003049 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003050 break;
3051
Alexis Hetu17809052015-05-13 11:28:22 -04003052 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003053
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003054 { FRAG_VERT_ONLY("*=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpMulAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003055 break;
3056
Alexis Hetu17809052015-05-13 11:28:22 -04003057 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003058
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003059 { FRAG_VERT_ONLY("/=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpDivAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003060 break;
3061
Alexis Hetu17809052015-05-13 11:28:22 -04003062 case 74:
3063
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003064 { ES3_ONLY("%=", (yylsp[(1) - (1)]), "integer modulus operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003065 FRAG_VERT_ONLY("%=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpIModAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003066 break;
3067
3068 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003069
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003070 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpAddAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003071 break;
3072
Alexis Hetu17809052015-05-13 11:28:22 -04003073 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003074
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003075 { (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpSubAssign; }
John Bauman66b8ab22014-05-06 15:57:45 -04003076 break;
3077
Alexis Hetu17809052015-05-13 11:28:22 -04003078 case 77:
3079
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003080 { ES3_ONLY("<<=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003081 FRAG_VERT_ONLY("<<=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftLeftAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003082 break;
3083
3084 case 78:
3085
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003086 { ES3_ONLY(">>=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003087 FRAG_VERT_ONLY(">>=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitShiftRightAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003088 break;
3089
3090 case 79:
3091
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003092 { ES3_ONLY("&=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003093 FRAG_VERT_ONLY("&=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseAndAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003094 break;
3095
3096 case 80:
3097
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003098 { ES3_ONLY("^=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003099 FRAG_VERT_ONLY("^=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseXorAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003100 break;
3101
3102 case 81:
3103
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003104 { ES3_ONLY("|=", (yylsp[(1) - (1)]), "bit-wise operator");
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003105 FRAG_VERT_ONLY("|=", (yylsp[(1) - (1)])); (yyval.interm).line = (yylsp[(1) - (1)]); (yyval.interm).op = EOpBitwiseOrAssign; }
Alexis Hetu17809052015-05-13 11:28:22 -04003106 break;
3107
3108 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003109
3110 {
3111 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3112 }
3113 break;
3114
Alexis Hetu17809052015-05-13 11:28:22 -04003115 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003116
3117 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003118 (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 -04003119 if ((yyval.interm.intermTypedNode) == 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003120 context->binaryOpError((yylsp[(2) - (3)]), ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
John Bauman66b8ab22014-05-06 15:57:45 -04003121 context->recover();
3122 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3123 }
3124 }
3125 break;
3126
Alexis Hetu17809052015-05-13 11:28:22 -04003127 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003128
3129 {
3130 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3131 context->recover();
3132 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3133 }
3134 break;
3135
Alexis Hetu17809052015-05-13 11:28:22 -04003136 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003137
3138 {
Alexis Hetue5246692015-06-18 12:34:52 -04003139 if (context->enterStructDeclaration((yylsp[(1) - (2)]), *(yyvsp[(1) - (2)].lex).string))
Alexis Hetua35d8232015-06-11 17:11:06 -04003140 context->recover();
3141 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3142 }
3143 break;
3144
3145 case 86:
3146
3147 {
John Bauman66b8ab22014-05-06 15:57:45 -04003148 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3149
3150 TIntermAggregate *prototype = new TIntermAggregate;
3151 prototype->setType(function.getReturnType());
3152 prototype->setName(function.getName());
3153
Alexis Hetu76a343a2015-06-04 17:21:22 -04003154 for (size_t i = 0; i < function.getParamCount(); i++)
John Bauman66b8ab22014-05-06 15:57:45 -04003155 {
3156 const TParameter &param = function.getParam(i);
3157 if (param.name != 0)
3158 {
John Baumand4ae8632014-05-06 16:18:33 -04003159 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003160
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003161 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 -04003162 }
3163 else
3164 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003165 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003166 }
3167 }
3168
3169 prototype->setOp(EOpPrototype);
3170 (yyval.interm.intermNode) = prototype;
3171
3172 context->symbolTable.pop();
3173 }
3174 break;
3175
Alexis Hetua35d8232015-06-11 17:11:06 -04003176 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003177
3178 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003179 TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
3180 if (aggNode && aggNode->getOp() == EOpNull)
3181 aggNode->setOp(EOpDeclaration);
3182 (yyval.interm.intermNode) = aggNode;
John Bauman66b8ab22014-05-06 15:57:45 -04003183 }
3184 break;
3185
Alexis Hetua35d8232015-06-11 17:11:06 -04003186 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003187
3188 {
John Baumand4ae8632014-05-06 16:18:33 -04003189 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003190 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 -04003191 context->recover();
3192 }
John Bauman66b8ab22014-05-06 15:57:45 -04003193 (yyval.interm.intermNode) = 0;
3194 }
3195 break;
3196
Alexis Hetua35d8232015-06-11 17:11:06 -04003197 case 89:
3198
3199 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003200 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yylsp[(1) - (5)]), "interface blocks");
Alexis Hetue5246692015-06-18 12:34:52 -04003201 (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 -04003202 }
3203 break;
3204
3205 case 90:
3206
3207 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003208 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yylsp[(1) - (6)]), "interface blocks");
Alexis Hetue5246692015-06-18 12:34:52 -04003209 (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 -04003210 }
3211 break;
3212
3213 case 91:
3214
3215 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003216 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yylsp[(1) - (9)]), "interface blocks");
Alexis Hetue5246692015-06-18 12:34:52 -04003217 (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 -04003218 }
3219 break;
3220
3221 case 92:
3222
3223 {
3224 context->parseGlobalLayoutQualifier((yyvsp[(1) - (2)].interm.type));
3225 (yyval.interm.intermNode) = 0;
3226 }
3227 break;
3228
3229 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003230
3231 {
3232 //
3233 // Multiple declarations of the same function are allowed.
3234 //
3235 // If this is a definition, the definition production code will check for redefinitions
3236 // (we don't know at this point if it's a definition or not).
3237 //
3238 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3239 //
Alexis Hetu0a655842015-06-22 16:52:11 -04003240 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->getShaderVersion()));
John Bauman66b8ab22014-05-06 15:57:45 -04003241 if (prevDec) {
3242 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003243 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 -04003244 context->recover();
3245 }
Alexis Hetu76a343a2015-06-04 17:21:22 -04003246 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04003247 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003248 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 -04003249 context->recover();
3250 }
3251 }
3252 }
3253
3254 //
3255 // If this is a redeclaration, it could also be a definition,
3256 // in which case, we want to use the variable names from this one, and not the one that's
3257 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3258 //
3259 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003260 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003261
3262 // We're at the inner scope level of the function's arguments and body statement.
3263 // Add the function prototype to the surrounding scope instead.
3264 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3265 }
3266 break;
3267
Alexis Hetua35d8232015-06-11 17:11:06 -04003268 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003269
3270 {
3271 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3272 }
3273 break;
3274
Alexis Hetua35d8232015-06-11 17:11:06 -04003275 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003276
3277 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003278 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3279 }
3280 break;
3281
Alexis Hetua35d8232015-06-11 17:11:06 -04003282 case 96:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003283
3284 {
John Bauman66b8ab22014-05-06 15:57:45 -04003285 // Add the parameter
3286 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3287 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3288 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3289 else
3290 delete (yyvsp[(2) - (2)].interm).param.type;
3291 }
3292 break;
3293
Alexis Hetua35d8232015-06-11 17:11:06 -04003294 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003295
3296 {
3297 //
3298 // Only first parameter of one-parameter functions can be void
3299 // The check for named parameters not being void is done in parameter_declarator
3300 //
3301 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3302 //
3303 // This parameter > first is void
3304 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003305 context->error((yylsp[(2) - (3)]), "cannot be an argument type except for '(void)'", "void");
John Bauman66b8ab22014-05-06 15:57:45 -04003306 context->recover();
3307 delete (yyvsp[(3) - (3)].interm).param.type;
3308 } else {
3309 // Add the parameter
3310 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3311 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3312 }
3313 }
3314 break;
3315
Alexis Hetua35d8232015-06-11 17:11:06 -04003316 case 98:
John Bauman66b8ab22014-05-06 15:57:45 -04003317
3318 {
3319 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003320 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 -04003321 context->recover();
3322 }
3323 // make sure a sampler is not involved as well...
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003324 if (context->structQualifierErrorCheck((yylsp[(2) - (3)]), (yyvsp[(1) - (3)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003325 context->recover();
3326
3327 // Add the function as a prototype after parsing it (we do not support recursion)
3328 TFunction *function;
3329 TType type((yyvsp[(1) - (3)].interm.type));
3330 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3331 (yyval.interm.function) = function;
3332
3333 context->symbolTable.push();
3334 }
3335 break;
3336
Alexis Hetua35d8232015-06-11 17:11:06 -04003337 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003338
3339 {
3340 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003341 context->error((yylsp[(2) - (2)]), "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04003342 context->recover();
3343 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003344 if (context->reservedErrorCheck((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003345 context->recover();
3346 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003347 (yyval.interm).line = (yylsp[(2) - (2)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003348 (yyval.interm).param = param;
3349 }
3350 break;
3351
Alexis Hetua35d8232015-06-11 17:11:06 -04003352 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003353
3354 {
3355 // Check that we can make an array out of this type
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003356 if (context->arrayTypeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003357 context->recover();
3358
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003359 if (context->reservedErrorCheck((yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04003360 context->recover();
3361
3362 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003363 if (context->arraySizeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003364 context->recover();
3365 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3366
3367 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3368 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003369 (yyval.interm).line = (yylsp[(2) - (5)]);
John Bauman66b8ab22014-05-06 15:57:45 -04003370 (yyval.interm).param = param;
3371 }
3372 break;
3373
Alexis Hetu17809052015-05-13 11:28:22 -04003374 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003375
3376 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003377 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003378 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 -04003379 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003380 }
3381 break;
3382
Alexis Hetu17809052015-05-13 11:28:22 -04003383 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003384
3385 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003386 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003387 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003388 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003389 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003390 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003391 }
3392 break;
3393
Alexis Hetu17809052015-05-13 11:28:22 -04003394 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003395
3396 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003397 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003398 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 -04003399 context->recover();
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003400 }
3401 break;
3402
Alexis Hetu17809052015-05-13 11:28:22 -04003403 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003404
3405 {
Alexis Hetua35d8232015-06-11 17:11:06 -04003406 (yyval.interm) = (yyvsp[(2) - (2)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003407 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003408 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003409 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
Alexis Hetua35d8232015-06-11 17:11:06 -04003410 context->recover();
3411 }
3412 break;
3413
3414 case 105:
3415
3416 {
3417 (yyval.interm.qualifier) = EvqIn;
3418 }
3419 break;
3420
3421 case 106:
3422
3423 {
3424 (yyval.interm.qualifier) = EvqIn;
3425 }
3426 break;
3427
3428 case 107:
3429
3430 {
3431 (yyval.interm.qualifier) = EvqOut;
3432 }
3433 break;
3434
3435 case 108:
3436
3437 {
3438 (yyval.interm.qualifier) = EvqInOut;
3439 }
3440 break;
3441
3442 case 109:
3443
3444 {
John Bauman66b8ab22014-05-06 15:57:45 -04003445 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3446 (yyval.interm).param = param;
3447 }
3448 break;
3449
Alexis Hetua35d8232015-06-11 17:11:06 -04003450 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003451
3452 {
3453 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3454 }
3455 break;
3456
Alexis Hetua35d8232015-06-11 17:11:06 -04003457 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003458
3459 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003460 (yyval.interm) = (yyvsp[(1) - (3)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003461 (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 -04003462 }
3463 break;
3464
Alexis Hetua35d8232015-06-11 17:11:06 -04003465 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003466
3467 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003468 (yyval.interm) = (yyvsp[(1) - (6)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003469 (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 -04003470 }
3471 break;
3472
Alexis Hetua35d8232015-06-11 17:11:06 -04003473 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003474
3475 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003476 ES3_ONLY("[]", (yylsp[(3) - (7)]), "implicitly sized array");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003477 (yyval.interm) = (yyvsp[(1) - (7)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003478 (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 -04003479 }
3480 break;
3481
Alexis Hetua35d8232015-06-11 17:11:06 -04003482 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003483
3484 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003485 ES3_ONLY("=", (yylsp[(7) - (8)]), "first-class arrays (array initializer)");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003486 (yyval.interm) = (yyvsp[(1) - (8)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003487 (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 -04003488 }
3489 break;
3490
Alexis Hetua35d8232015-06-11 17:11:06 -04003491 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003492
3493 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003494 (yyval.interm) = (yyvsp[(1) - (5)].interm);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003495 (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 -04003496 }
3497 break;
3498
Alexis Hetua35d8232015-06-11 17:11:06 -04003499 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003500
3501 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003502 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003503 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(1) - (1)]), "");
John Bauman66b8ab22014-05-06 15:57:45 -04003504 }
3505 break;
3506
Alexis Hetua35d8232015-06-11 17:11:06 -04003507 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003508
3509 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003510 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003511 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string);
John Bauman66b8ab22014-05-06 15:57:45 -04003512 }
3513 break;
3514
Alexis Hetua35d8232015-06-11 17:11:06 -04003515 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003516
3517 {
John Bauman66b8ab22014-05-06 15:57:45 -04003518 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003519 (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 -04003520 }
3521 break;
3522
Alexis Hetua35d8232015-06-11 17:11:06 -04003523 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003524
3525 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003526 ES3_ONLY("[]", (yylsp[(3) - (6)]), "implicitly sized array");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003527 (yyval.interm).type = (yyvsp[(1) - (6)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003528 (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 -04003529 }
3530 break;
3531
Alexis Hetua35d8232015-06-11 17:11:06 -04003532 case 120:
John Bauman66b8ab22014-05-06 15:57:45 -04003533
3534 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003535 ES3_ONLY("=", (yylsp[(6) - (7)]), "first-class arrays (array initializer)");
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003536 (yyval.interm).type = (yyvsp[(1) - (7)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003537 (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 -04003538 }
3539 break;
3540
Alexis Hetua35d8232015-06-11 17:11:06 -04003541 case 121:
John Bauman66b8ab22014-05-06 15:57:45 -04003542
3543 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003544 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003545 (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 -04003546 }
3547 break;
3548
Alexis Hetua35d8232015-06-11 17:11:06 -04003549 case 122:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003550
3551 {
3552 // $$.type is not used in invariant declarations.
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003553 (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 -04003554 }
3555 break;
3556
Alexis Hetua35d8232015-06-11 17:11:06 -04003557 case 123:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003558
3559 {
John Bauman66b8ab22014-05-06 15:57:45 -04003560 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3561
3562 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003563 ES3_ONLY("[]", (yylsp[(1) - (1)]), "first-class-array");
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003564 if (context->getShaderVersion() != 300) {
3565 (yyvsp[(1) - (1)].interm.type).clearArrayness();
3566 }
John Bauman66b8ab22014-05-06 15:57:45 -04003567 }
3568 }
3569 break;
3570
Alexis Hetua35d8232015-06-11 17:11:06 -04003571 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04003572
3573 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003574 (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 -04003575 }
3576 break;
3577
Alexis Hetua35d8232015-06-11 17:11:06 -04003578 case 125:
John Bauman66b8ab22014-05-06 15:57:45 -04003579
3580 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003581 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003582 }
3583 break;
3584
Alexis Hetua35d8232015-06-11 17:11:06 -04003585 case 126:
John Bauman66b8ab22014-05-06 15:57:45 -04003586
3587 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003588 (yyval.interm.type).qualifier = EvqFlat;
3589 }
3590 break;
3591
Alexis Hetua35d8232015-06-11 17:11:06 -04003592 case 127:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003593
3594 {
3595 (yyval.interm.qualifier) = EvqConstReadOnly;
3596 }
3597 break;
3598
Alexis Hetua35d8232015-06-11 17:11:06 -04003599 case 128:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003600
3601 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003602 VERTEX_ONLY("attribute", (yylsp[(1) - (1)]));
3603 ES2_ONLY("attribute", (yylsp[(1) - (1)]));
3604 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "attribute"))
John Bauman66b8ab22014-05-06 15:57:45 -04003605 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003606 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003607 }
3608 break;
3609
Alexis Hetua35d8232015-06-11 17:11:06 -04003610 case 129:
John Bauman66b8ab22014-05-06 15:57:45 -04003611
3612 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003613 ES2_ONLY("varying", (yylsp[(1) - (1)]));
3614 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003615 context->recover();
Alexis Hetu0a655842015-06-22 16:52:11 -04003616 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003617 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003618 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003619 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003620 }
3621 break;
3622
Alexis Hetua35d8232015-06-11 17:11:06 -04003623 case 130:
John Bauman66b8ab22014-05-06 15:57:45 -04003624
3625 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003626 ES2_ONLY("varying", (yylsp[(1) - (2)]));
3627 if (context->globalErrorCheck((yylsp[(1) - (2)]), context->symbolTable.atGlobalLevel(), "invariant varying"))
John Bauman66b8ab22014-05-06 15:57:45 -04003628 context->recover();
Alexis Hetu0a655842015-06-22 16:52:11 -04003629 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003630 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003631 else
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003632 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yylsp[(1) - (2)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003633 }
3634 break;
3635
Alexis Hetua35d8232015-06-11 17:11:06 -04003636 case 131:
John Bauman66b8ab22014-05-06 15:57:45 -04003637
3638 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003639 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04003640 }
3641 break;
3642
Alexis Hetua35d8232015-06-11 17:11:06 -04003643 case 132:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003644
3645 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003646 (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 -04003647 }
3648 break;
3649
Alexis Hetua35d8232015-06-11 17:11:06 -04003650 case 133:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003651
3652 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003653 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 -04003654 context->recover();
3655
3656 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003657 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003658 }
3659 break;
3660
Alexis Hetua35d8232015-06-11 17:11:06 -04003661 case 134:
John Bauman66b8ab22014-05-06 15:57:45 -04003662
3663 {
Nicolas Capens7d626792015-02-17 17:58:31 -05003664 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3665 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
3666 }
3667 break;
3668
Alexis Hetua35d8232015-06-11 17:11:06 -04003669 case 135:
Nicolas Capens7d626792015-02-17 17:58:31 -05003670
3671 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003672 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yylsp[(2) - (2)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003673 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
3674 }
3675 break;
3676
Alexis Hetua35d8232015-06-11 17:11:06 -04003677 case 136:
Nicolas Capens7d626792015-02-17 17:58:31 -05003678
3679 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003680 (yyval.interm.type).qualifier = EvqConstExpr;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003681 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003682 }
3683 break;
3684
Alexis Hetua35d8232015-06-11 17:11:06 -04003685 case 137:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003686
3687 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003688 ES3_ONLY("in", (yylsp[(1) - (1)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003689 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003690 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003691 }
3692 break;
3693
Alexis Hetua35d8232015-06-11 17:11:06 -04003694 case 138:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003695
3696 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003697 ES3_ONLY("out", (yylsp[(1) - (1)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003698 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003699 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003700 }
3701 break;
3702
Alexis Hetua35d8232015-06-11 17:11:06 -04003703 case 139:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003704
3705 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003706 ES3_ONLY("centroid in", (yylsp[(1) - (2)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003707 if (context->getShaderType() == GL_VERTEX_SHADER)
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003708 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003709 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 -04003710 context->recover();
3711 }
Alexis Hetu0a655842015-06-22 16:52:11 -04003712 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003713 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003714 }
3715 break;
3716
Alexis Hetua35d8232015-06-11 17:11:06 -04003717 case 140:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003718
3719 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003720 ES3_ONLY("centroid out", (yylsp[(1) - (2)]), "storage qualifier");
Alexis Hetu0a655842015-06-22 16:52:11 -04003721 if (context->getShaderType() == GL_FRAGMENT_SHADER)
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003722 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003723 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 -04003724 context->recover();
3725 }
Alexis Hetu0a655842015-06-22 16:52:11 -04003726 (yyval.interm.type).qualifier = (context->getShaderType() == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003727 (yyval.interm.type).line = (yylsp[(2) - (2)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003728 }
3729 break;
3730
Alexis Hetua35d8232015-06-11 17:11:06 -04003731 case 141:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003732
3733 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003734 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "uniform"))
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003735 context->recover();
3736 (yyval.interm.type).qualifier = EvqUniform;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003737 (yyval.interm.type).line = (yylsp[(1) - (1)]);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003738 }
3739 break;
3740
Alexis Hetua35d8232015-06-11 17:11:06 -04003741 case 142:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003742
3743 {
John Bauman66b8ab22014-05-06 15:57:45 -04003744 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3745
3746 if ((yyval.interm.type).precision == EbpUndefined) {
3747 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003748 if (context->precisionErrorCheck((yylsp[(1) - (1)]), (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
John Bauman66b8ab22014-05-06 15:57:45 -04003749 context->recover();
3750 }
3751 }
3752 }
3753 break;
3754
Alexis Hetua35d8232015-06-11 17:11:06 -04003755 case 143:
John Bauman66b8ab22014-05-06 15:57:45 -04003756
3757 {
3758 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3759 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
3760 }
3761 break;
3762
Alexis Hetua35d8232015-06-11 17:11:06 -04003763 case 144:
John Bauman66b8ab22014-05-06 15:57:45 -04003764
3765 {
3766 (yyval.interm.precision) = EbpHigh;
3767 }
3768 break;
3769
Alexis Hetua35d8232015-06-11 17:11:06 -04003770 case 145:
John Bauman66b8ab22014-05-06 15:57:45 -04003771
3772 {
3773 (yyval.interm.precision) = EbpMedium;
3774 }
3775 break;
3776
Alexis Hetua35d8232015-06-11 17:11:06 -04003777 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04003778
3779 {
3780 (yyval.interm.precision) = EbpLow;
3781 }
3782 break;
3783
Alexis Hetua35d8232015-06-11 17:11:06 -04003784 case 147:
Nicolas Capens7d626792015-02-17 17:58:31 -05003785
3786 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003787 ES3_ONLY("layout", (yylsp[(1) - (4)]), "qualifier");
Nicolas Capens7d626792015-02-17 17:58:31 -05003788 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
3789 }
3790 break;
3791
Alexis Hetua35d8232015-06-11 17:11:06 -04003792 case 148:
Nicolas Capens7d626792015-02-17 17:58:31 -05003793
3794 {
3795 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
3796 }
3797 break;
3798
Alexis Hetua35d8232015-06-11 17:11:06 -04003799 case 149:
Nicolas Capens7d626792015-02-17 17:58:31 -05003800
3801 {
3802 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
3803 }
3804 break;
3805
Alexis Hetua35d8232015-06-11 17:11:06 -04003806 case 150:
Nicolas Capens7d626792015-02-17 17:58:31 -05003807
3808 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003809 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05003810 }
3811 break;
3812
Alexis Hetua35d8232015-06-11 17:11:06 -04003813 case 151:
John Bauman66b8ab22014-05-06 15:57:45 -04003814
3815 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003816 (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 -04003817 }
3818 break;
3819
Alexis Hetua35d8232015-06-11 17:11:06 -04003820 case 152:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003821
3822 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003823 (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 -04003824 }
3825 break;
3826
Alexis Hetua35d8232015-06-11 17:11:06 -04003827 case 153:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003828
3829 {
John Bauman66b8ab22014-05-06 15:57:45 -04003830 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3831 }
3832 break;
3833
Alexis Hetua35d8232015-06-11 17:11:06 -04003834 case 154:
John Bauman66b8ab22014-05-06 15:57:45 -04003835
3836 {
Alexis Hetu3e9e2082015-07-03 16:20:11 -04003837 ES3_ONLY("[]", (yylsp[(2) - (3)]), "implicitly sized array");
Alexis Hetue5246692015-06-18 12:34:52 -04003838 (yyval.interm.type) = (yyvsp[(1) - (3)].interm.type);
3839 (yyval.interm.type).setArray(true, 0);
3840 }
3841 break;
3842
3843 case 155:
3844
3845 {
John Bauman66b8ab22014-05-06 15:57:45 -04003846 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3847
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003848 if (context->arrayTypeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04003849 context->recover();
3850 else {
3851 int size;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003852 if (context->arraySizeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04003853 context->recover();
3854 (yyval.interm.type).setArray(true, size);
3855 }
3856 }
3857 break;
3858
Alexis Hetue5246692015-06-18 12:34:52 -04003859 case 156:
Alexis Hetu17809052015-05-13 11:28:22 -04003860
3861 {
3862 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003863 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003864 }
3865 break;
3866
Alexis Hetu17809052015-05-13 11:28:22 -04003867 case 157:
3868
3869 {
3870 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003871 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003872 }
3873 break;
3874
3875 case 158:
3876
3877 {
3878 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003879 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003880 }
3881 break;
3882
3883 case 159:
3884
3885 {
3886 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003887 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetu17809052015-05-13 11:28:22 -04003888 }
3889 break;
3890
3891 case 160:
3892
3893 {
3894 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003895 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetua35d8232015-06-11 17:11:06 -04003896 }
3897 break;
3898
3899 case 161:
3900
3901 {
3902 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003903 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003904 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003905 }
3906 break;
3907
3908 case 162:
3909
3910 {
3911 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003912 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003913 (yyval.interm.type).setAggregate(3);
Alexis Hetua35d8232015-06-11 17:11:06 -04003914 }
3915 break;
3916
3917 case 163:
3918
3919 {
3920 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003921 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
3922 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04003923 }
3924 break;
3925
3926 case 164:
3927
3928 {
3929 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003930 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003931 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003932 }
3933 break;
3934
3935 case 165:
3936
3937 {
3938 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003939 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003940 (yyval.interm.type).setAggregate(3);
Alexis Hetu17809052015-05-13 11:28:22 -04003941 }
3942 break;
3943
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003944 case 166:
3945
3946 {
3947 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003948 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
3949 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04003950 }
3951 break;
3952
3953 case 167:
3954
3955 {
3956 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003957 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003958 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003959 }
3960 break;
3961
3962 case 168:
3963
3964 {
3965 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003966 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003967 (yyval.interm.type).setAggregate(3);
Alexis Hetua35d8232015-06-11 17:11:06 -04003968 }
3969 break;
3970
3971 case 169:
3972
3973 {
3974 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetue5246692015-06-18 12:34:52 -04003975 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
3976 (yyval.interm.type).setAggregate(4);
Alexis Hetua35d8232015-06-11 17:11:06 -04003977 }
3978 break;
3979
3980 case 170:
3981
3982 {
3983 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003984 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003985 (yyval.interm.type).setAggregate(2);
Alexis Hetua35d8232015-06-11 17:11:06 -04003986 }
3987 break;
3988
3989 case 171:
3990
3991 {
3992 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04003993 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
Alexis Hetue5246692015-06-18 12:34:52 -04003994 (yyval.interm.type).setAggregate(3);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003995 }
3996 break;
3997
Alexis Hetua35d8232015-06-11 17:11:06 -04003998 case 172:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04003999
4000 {
Alexis Hetue5246692015-06-18 12:34:52 -04004001 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4002 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
4003 (yyval.interm.type).setAggregate(4);
4004 }
4005 break;
4006
4007 case 173:
4008
4009 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004010 FRAG_VERT_ONLY("mat2", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004011 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 Hetub14178b2015-04-13 13:23:20 -04004013 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004014 }
4015 break;
4016
Alexis Hetue5246692015-06-18 12:34:52 -04004017 case 174:
John Bauman66b8ab22014-05-06 15:57:45 -04004018
4019 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004020 FRAG_VERT_ONLY("mat3", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004021 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004022 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004023 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004024 }
4025 break;
4026
Alexis Hetue5246692015-06-18 12:34:52 -04004027 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004028
4029 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004030 FRAG_VERT_ONLY("mat4", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004031 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004032 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004033 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004034 }
4035 break;
4036
Alexis Hetue5246692015-06-18 12:34:52 -04004037 case 176:
John Bauman66b8ab22014-05-06 15:57:45 -04004038
4039 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004040 FRAG_VERT_ONLY("mat2x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004041 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004042 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004043 (yyval.interm.type).setMatrix(2, 3);
4044 }
4045 break;
4046
Alexis Hetue5246692015-06-18 12:34:52 -04004047 case 177:
Alexis Hetub14178b2015-04-13 13:23:20 -04004048
4049 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004050 FRAG_VERT_ONLY("mat3x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004051 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004052 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004053 (yyval.interm.type).setMatrix(3, 2);
4054 }
4055 break;
4056
Alexis Hetue5246692015-06-18 12:34:52 -04004057 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004058
4059 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004060 FRAG_VERT_ONLY("mat2x4", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004061 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004062 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004063 (yyval.interm.type).setMatrix(2, 4);
4064 }
4065 break;
4066
Alexis Hetue5246692015-06-18 12:34:52 -04004067 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004068
4069 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004070 FRAG_VERT_ONLY("mat4x2", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004071 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004072 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004073 (yyval.interm.type).setMatrix(4, 2);
4074 }
4075 break;
4076
Alexis Hetue5246692015-06-18 12:34:52 -04004077 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004078
4079 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004080 FRAG_VERT_ONLY("mat3x4", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004081 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004082 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004083 (yyval.interm.type).setMatrix(3, 4);
4084 }
4085 break;
4086
Alexis Hetue5246692015-06-18 12:34:52 -04004087 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004088
4089 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004090 FRAG_VERT_ONLY("mat4x3", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004091 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004092 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004093 (yyval.interm.type).setMatrix(4, 3);
4094 }
4095 break;
4096
Alexis Hetue5246692015-06-18 12:34:52 -04004097 case 182:
Alexis Hetub14178b2015-04-13 13:23:20 -04004098
4099 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004100 FRAG_VERT_ONLY("sampler2D", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004101 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004102 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004103 }
4104 break;
4105
Alexis Hetue5246692015-06-18 12:34:52 -04004106 case 183:
John Bauman66b8ab22014-05-06 15:57:45 -04004107
4108 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004109 FRAG_VERT_ONLY("samplerCube", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004110 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004111 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004112 }
4113 break;
4114
Alexis Hetue5246692015-06-18 12:34:52 -04004115 case 184:
John Bauman66b8ab22014-05-06 15:57:45 -04004116
4117 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004118 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004119 context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES", "");
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004120 context->recover();
4121 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004122 FRAG_VERT_ONLY("samplerExternalOES", (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004123 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004124 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)]));
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004125 }
4126 break;
4127
Alexis Hetue5246692015-06-18 12:34:52 -04004128 case 185:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004129
4130 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004131 FRAG_VERT_ONLY("sampler3D", (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004132 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004133 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub027aa92015-01-19 15:56:12 -05004134 }
4135 break;
4136
Alexis Hetue5246692015-06-18 12:34:52 -04004137 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004138
4139 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004140 FRAG_VERT_ONLY("sampler2DArray", (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(EbtSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004143 }
4144 break;
4145
Alexis Hetue5246692015-06-18 12:34:52 -04004146 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004147
4148 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004149 FRAG_VERT_ONLY("isampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004150 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004151 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004152 }
4153 break;
4154
Alexis Hetue5246692015-06-18 12:34:52 -04004155 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004156
4157 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004158 FRAG_VERT_ONLY("isampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004159 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004160 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004161 }
4162 break;
4163
Alexis Hetue5246692015-06-18 12:34:52 -04004164 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004165
4166 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004167 FRAG_VERT_ONLY("isamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004168 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004169 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004170 }
4171 break;
4172
Alexis Hetue5246692015-06-18 12:34:52 -04004173 case 190:
Alexis Hetub14178b2015-04-13 13:23:20 -04004174
4175 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004176 FRAG_VERT_ONLY("isampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004177 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004178 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004179 }
4180 break;
4181
Alexis Hetue5246692015-06-18 12:34:52 -04004182 case 191:
Alexis Hetub14178b2015-04-13 13:23:20 -04004183
4184 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004185 FRAG_VERT_ONLY("usampler2D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004186 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004187 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004188 }
4189 break;
4190
Alexis Hetue5246692015-06-18 12:34:52 -04004191 case 192:
Alexis Hetub14178b2015-04-13 13:23:20 -04004192
4193 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004194 FRAG_VERT_ONLY("usampler3D", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004195 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004196 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004197 }
4198 break;
4199
Alexis Hetue5246692015-06-18 12:34:52 -04004200 case 193:
Alexis Hetub14178b2015-04-13 13:23:20 -04004201
4202 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004203 FRAG_VERT_ONLY("usamplerCube", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004204 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004205 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004206 }
4207 break;
4208
Alexis Hetue5246692015-06-18 12:34:52 -04004209 case 194:
Alexis Hetub14178b2015-04-13 13:23:20 -04004210
4211 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004212 FRAG_VERT_ONLY("usampler2DArray", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004213 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004214 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004215 }
4216 break;
4217
Alexis Hetue5246692015-06-18 12:34:52 -04004218 case 195:
Alexis Hetub14178b2015-04-13 13:23:20 -04004219
4220 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004221 FRAG_VERT_ONLY("sampler2DShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004222 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004223 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004224 }
4225 break;
4226
Alexis Hetue5246692015-06-18 12:34:52 -04004227 case 196:
Alexis Hetub14178b2015-04-13 13:23:20 -04004228
4229 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004230 FRAG_VERT_ONLY("samplerCubeShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004231 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004232 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004233 }
4234 break;
4235
Alexis Hetue5246692015-06-18 12:34:52 -04004236 case 197:
Alexis Hetub14178b2015-04-13 13:23:20 -04004237
4238 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004239 FRAG_VERT_ONLY("sampler2DArrayShadow", (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004240 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004241 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yylsp[(1) - (1)]));
Alexis Hetub14178b2015-04-13 13:23:20 -04004242 }
4243 break;
4244
Alexis Hetue5246692015-06-18 12:34:52 -04004245 case 198:
Alexis Hetub027aa92015-01-19 15:56:12 -05004246
4247 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004248 FRAG_VERT_ONLY("struct", (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004249 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4250 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4251 }
4252 break;
4253
Alexis Hetue5246692015-06-18 12:34:52 -04004254 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004255
4256 {
4257 //
4258 // This is for user defined type names. The lexical phase looked up the
4259 // type.
4260 //
4261 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4262 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004263 (yyval.interm.type).setBasic(EbtStruct, qual, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004264 (yyval.interm.type).userDef = &structure;
4265 }
4266 break;
4267
Alexis Hetue5246692015-06-18 12:34:52 -04004268 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004269
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004270 { if (context->enterStructDeclaration((yylsp[(2) - (3)]), *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004271 break;
4272
Alexis Hetue5246692015-06-18 12:34:52 -04004273 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004274
4275 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004276 (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 -04004277 }
4278 break;
4279
Alexis Hetue5246692015-06-18 12:34:52 -04004280 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004281
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004282 { if (context->enterStructDeclaration((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004283 break;
4284
Alexis Hetue5246692015-06-18 12:34:52 -04004285 case 203:
John Bauman66b8ab22014-05-06 15:57:45 -04004286
4287 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004288 (yyval.interm.type) = context->addStructure((yylsp[(1) - (5)]), (yylsp[(1) - (5)]), NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004289 }
4290 break;
4291
Alexis Hetue5246692015-06-18 12:34:52 -04004292 case 204:
John Bauman66b8ab22014-05-06 15:57:45 -04004293
4294 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004295 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
John Bauman66b8ab22014-05-06 15:57:45 -04004296 }
4297 break;
4298
Alexis Hetue5246692015-06-18 12:34:52 -04004299 case 205:
John Bauman66b8ab22014-05-06 15:57:45 -04004300
4301 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004302 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
4303 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) {
4304 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i];
4305 for (unsigned int j = 0; j < (yyval.interm.fieldList)->size(); ++j) {
4306 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) {
4307 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 -04004308 context->recover();
4309 }
4310 }
Alexis Hetua8b364b2015-06-10 11:48:40 -04004311 (yyval.interm.fieldList)->push_back((*(yyvsp[(2) - (2)].interm.fieldList))[i]);
John Bauman66b8ab22014-05-06 15:57:45 -04004312 }
4313 }
4314 break;
4315
Alexis Hetue5246692015-06-18 12:34:52 -04004316 case 206:
John Bauman66b8ab22014-05-06 15:57:45 -04004317
4318 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004319 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList));
John Bauman66b8ab22014-05-06 15:57:45 -04004320 }
4321 break;
4322
Alexis Hetue5246692015-06-18 12:34:52 -04004323 case 207:
John Bauman66b8ab22014-05-06 15:57:45 -04004324
4325 {
Alexis Hetuad6b8752015-06-09 16:15:30 -04004326 // ES3 Only, but errors should be handled elsewhere
4327 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4328 (yyvsp[(2) - (4)].interm.type).layoutQualifier = (yyvsp[(1) - (4)].interm.type).layoutQualifier;
4329 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.fieldList));
4330 }
4331 break;
4332
Alexis Hetue5246692015-06-18 12:34:52 -04004333 case 208:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004334
4335 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004336 (yyval.interm.fieldList) = NewPoolTFieldList();
4337 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004338 }
4339 break;
4340
Alexis Hetue5246692015-06-18 12:34:52 -04004341 case 209:
John Bauman66b8ab22014-05-06 15:57:45 -04004342
4343 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004344 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004345 }
4346 break;
4347
Alexis Hetue5246692015-06-18 12:34:52 -04004348 case 210:
John Bauman66b8ab22014-05-06 15:57:45 -04004349
4350 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004351 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004352 context->recover();
4353
Alexis Hetua8b364b2015-06-10 11:48:40 -04004354 TType* type = new TType(EbtVoid, EbpUndefined);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004355 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004356 }
4357 break;
4358
Alexis Hetue5246692015-06-18 12:34:52 -04004359 case 211:
John Bauman66b8ab22014-05-06 15:57:45 -04004360
4361 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004362 if (context->reservedErrorCheck((yylsp[(1) - (4)]), *(yyvsp[(1) - (4)].lex).string))
John Bauman66b8ab22014-05-06 15:57:45 -04004363 context->recover();
4364
Alexis Hetua8b364b2015-06-10 11:48:40 -04004365 TType* type = new TType(EbtVoid, EbpUndefined);
John Bauman66b8ab22014-05-06 15:57:45 -04004366 int size;
Alexis Hetua8b364b2015-06-10 11:48:40 -04004367 if (context->arraySizeErrorCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLine(), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04004368 context->recover();
Alexis Hetua8b364b2015-06-10 11:48:40 -04004369 type->setArraySize(size);
4370
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004371 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yylsp[(1) - (4)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004372 }
4373 break;
4374
Alexis Hetue5246692015-06-18 12:34:52 -04004375 case 212:
Nicolas Capens7d626792015-02-17 17:58:31 -05004376
Alexis Hetua35d8232015-06-11 17:11:06 -04004377 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004378 break;
4379
Alexis Hetu17809052015-05-13 11:28:22 -04004380 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004381
Alexis Hetue5246692015-06-18 12:34:52 -04004382 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004383 break;
4384
Alexis Hetu17809052015-05-13 11:28:22 -04004385 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004386
Alexis Hetue5246692015-06-18 12:34:52 -04004387 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004388 break;
4389
Alexis Hetu17809052015-05-13 11:28:22 -04004390 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004391
Alexis Hetua35d8232015-06-11 17:11:06 -04004392 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetuad6b8752015-06-09 16:15:30 -04004393 break;
4394
4395 case 216:
4396
Alexis Hetua35d8232015-06-11 17:11:06 -04004397 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004398 break;
4399
4400 case 217:
4401
Alexis Hetua35d8232015-06-11 17:11:06 -04004402 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004403 break;
4404
4405 case 218:
4406
Alexis Hetue5246692015-06-18 12:34:52 -04004407 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004408 break;
4409
4410 case 219:
4411
Alexis Hetue5246692015-06-18 12:34:52 -04004412 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermSwitch); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004413 break;
4414
4415 case 220:
4416
Alexis Hetue5246692015-06-18 12:34:52 -04004417 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermCase); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004418 break;
4419
4420 case 221:
4421
Alexis Hetu76a343a2015-06-04 17:21:22 -04004422 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004423 break;
4424
4425 case 222:
4426
Alexis Hetue5246692015-06-18 12:34:52 -04004427 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004428 break;
4429
4430 case 223:
4431
Alexis Hetue5246692015-06-18 12:34:52 -04004432 { (yyval.interm.intermAggregate) = 0; }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004433 break;
4434
4435 case 224:
4436
Alexis Hetue5246692015-06-18 12:34:52 -04004437 { context->symbolTable.push(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004438 break;
4439
4440 case 225:
4441
Alexis Hetue5246692015-06-18 12:34:52 -04004442 { context->symbolTable.pop(); }
4443 break;
4444
4445 case 226:
4446
Nicolas Capens7d626792015-02-17 17:58:31 -05004447 {
4448 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4449 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004450 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yylsp[(5) - (5)]));
Nicolas Capens7d626792015-02-17 17:58:31 -05004451 }
4452 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4453 }
4454 break;
4455
Alexis Hetua35d8232015-06-11 17:11:06 -04004456 case 227:
4457
Alexis Hetu76a343a2015-06-04 17:21:22 -04004458 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004459 break;
4460
4461 case 228:
4462
Alexis Hetue5246692015-06-18 12:34:52 -04004463 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004464 break;
4465
4466 case 229:
4467
Alexis Hetue5246692015-06-18 12:34:52 -04004468 { context->symbolTable.push(); }
Alexis Hetua35d8232015-06-11 17:11:06 -04004469 break;
4470
4471 case 230:
4472
Alexis Hetue5246692015-06-18 12:34:52 -04004473 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004474 break;
4475
4476 case 231:
4477
Alexis Hetue5246692015-06-18 12:34:52 -04004478 { context->symbolTable.push(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004479 break;
4480
4481 case 232:
4482
Alexis Hetue5246692015-06-18 12:34:52 -04004483 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4484 break;
4485
4486 case 233:
4487
John Bauman66b8ab22014-05-06 15:57:45 -04004488 {
4489 (yyval.interm.intermNode) = 0;
4490 }
4491 break;
4492
Alexis Hetue5246692015-06-18 12:34:52 -04004493 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004494
4495 {
4496 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4497 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004498 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yylsp[(3) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004499 }
4500 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4501 }
4502 break;
4503
Alexis Hetue5246692015-06-18 12:34:52 -04004504 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004505
4506 {
4507 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4508 }
4509 break;
4510
Alexis Hetue5246692015-06-18 12:34:52 -04004511 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004512
4513 {
4514 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4515 }
4516 break;
4517
Alexis Hetue5246692015-06-18 12:34:52 -04004518 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04004519
4520 { (yyval.interm.intermNode) = 0; }
4521 break;
4522
Alexis Hetue5246692015-06-18 12:34:52 -04004523 case 238:
John Bauman66b8ab22014-05-06 15:57:45 -04004524
4525 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4526 break;
4527
Alexis Hetue5246692015-06-18 12:34:52 -04004528 case 239:
John Bauman66b8ab22014-05-06 15:57:45 -04004529
4530 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004531 if (context->boolErrorCheck((yylsp[(1) - (5)]), (yyvsp[(3) - (5)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004532 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004533 (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 -04004534 }
4535 break;
4536
Alexis Hetue5246692015-06-18 12:34:52 -04004537 case 240:
John Bauman66b8ab22014-05-06 15:57:45 -04004538
4539 {
4540 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4541 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4542 }
4543 break;
4544
Alexis Hetue5246692015-06-18 12:34:52 -04004545 case 241:
John Bauman66b8ab22014-05-06 15:57:45 -04004546
4547 {
4548 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4549 (yyval.interm.nodePair).node2 = 0;
4550 }
4551 break;
4552
Alexis Hetu76a343a2015-06-04 17:21:22 -04004553 case 242:
4554
Alexis Hetue5246692015-06-18 12:34:52 -04004555 { context->incrSwitchNestingLevel(); }
Alexis Hetu76a343a2015-06-04 17:21:22 -04004556 break;
4557
4558 case 243:
4559
4560 {
Alexis Hetue5246692015-06-18 12:34:52 -04004561 (yyval.interm.intermSwitch) = context->addSwitch((yyvsp[(3) - (6)].interm.intermTypedNode), (yyvsp[(6) - (6)].interm.intermAggregate), (yylsp[(1) - (6)]));
4562 context->decrSwitchNestingLevel();
Alexis Hetu76a343a2015-06-04 17:21:22 -04004563 }
4564 break;
4565
4566 case 244:
4567
4568 {
Alexis Hetue5246692015-06-18 12:34:52 -04004569 (yyval.interm.intermCase) = context->addCase((yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
Alexis Hetu76a343a2015-06-04 17:21:22 -04004570 }
4571 break;
4572
4573 case 245:
John Bauman66b8ab22014-05-06 15:57:45 -04004574
4575 {
Alexis Hetue5246692015-06-18 12:34:52 -04004576 (yyval.interm.intermCase) = context->addDefault((yylsp[(1) - (2)]));
4577 }
4578 break;
4579
4580 case 246:
4581
4582 {
John Bauman66b8ab22014-05-06 15:57:45 -04004583 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4584 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4585 context->recover();
4586 }
4587 break;
4588
Alexis Hetue5246692015-06-18 12:34:52 -04004589 case 247:
John Bauman66b8ab22014-05-06 15:57:45 -04004590
4591 {
4592 TIntermNode* intermNode;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004593 if (context->structQualifierErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004594 context->recover();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004595 if (context->boolErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
John Bauman66b8ab22014-05-06 15:57:45 -04004596 context->recover();
4597
Alexis Hetue5246692015-06-18 12:34:52 -04004598 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 -04004599 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4600 else {
4601 context->recover();
4602 (yyval.interm.intermTypedNode) = 0;
4603 }
4604 }
4605 break;
4606
Alexis Hetue5246692015-06-18 12:34:52 -04004607 case 248:
John Bauman66b8ab22014-05-06 15:57:45 -04004608
Alexis Hetu0a655842015-06-22 16:52:11 -04004609 { context->symbolTable.push(); context->incrLoopNestingLevel(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004610 break;
4611
Alexis Hetue5246692015-06-18 12:34:52 -04004612 case 249:
John Bauman66b8ab22014-05-06 15:57:45 -04004613
4614 {
4615 context->symbolTable.pop();
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004616 (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 -04004617 context->decrLoopNestingLevel();
John Bauman66b8ab22014-05-06 15:57:45 -04004618 }
4619 break;
4620
Alexis Hetue5246692015-06-18 12:34:52 -04004621 case 250:
John Bauman66b8ab22014-05-06 15:57:45 -04004622
Alexis Hetu0a655842015-06-22 16:52:11 -04004623 { context->incrLoopNestingLevel(); }
John Bauman66b8ab22014-05-06 15:57:45 -04004624 break;
4625
Alexis Hetue5246692015-06-18 12:34:52 -04004626 case 251:
John Bauman66b8ab22014-05-06 15:57:45 -04004627
4628 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004629 if (context->boolErrorCheck((yylsp[(8) - (8)]), (yyvsp[(6) - (8)].interm.intermTypedNode)))
John Bauman66b8ab22014-05-06 15:57:45 -04004630 context->recover();
4631
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004632 (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 -04004633 context->decrLoopNestingLevel();
John Bauman66b8ab22014-05-06 15:57:45 -04004634 }
4635 break;
4636
Alexis Hetu76a343a2015-06-04 17:21:22 -04004637 case 252:
Alexis Hetub027aa92015-01-19 15:56:12 -05004638
Alexis Hetu0a655842015-06-22 16:52:11 -04004639 { context->symbolTable.push(); context->incrLoopNestingLevel(); }
Nicolas Capens3c20f802015-02-17 17:17:20 -05004640 break;
4641
Alexis Hetu76a343a2015-06-04 17:21:22 -04004642 case 253:
Alexis Hetu17809052015-05-13 11:28:22 -04004643
4644 {
Alexis Hetue5246692015-06-18 12:34:52 -04004645 context->symbolTable.pop();
4646 (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 -04004647 context->decrLoopNestingLevel();
Alexis Hetu17809052015-05-13 11:28:22 -04004648 }
4649 break;
4650
Alexis Hetu76a343a2015-06-04 17:21:22 -04004651 case 254:
Alexis Hetu17809052015-05-13 11:28:22 -04004652
4653 {
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004654 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetuad6b8752015-06-09 16:15:30 -04004655 }
4656 break;
4657
Alexis Hetu76a343a2015-06-04 17:21:22 -04004658 case 255:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004659
4660 {
Alexis Hetue5246692015-06-18 12:34:52 -04004661 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004662 }
4663 break;
4664
Alexis Hetu76a343a2015-06-04 17:21:22 -04004665 case 256:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004666
4667 {
Alexis Hetue5246692015-06-18 12:34:52 -04004668 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004669 }
4670 break;
4671
Alexis Hetu76a343a2015-06-04 17:21:22 -04004672 case 257:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004673
4674 {
Alexis Hetue5246692015-06-18 12:34:52 -04004675 (yyval.interm.intermTypedNode) = 0;
4676 }
4677 break;
4678
4679 case 258:
4680
4681 {
Alexis Hetu17809052015-05-13 11:28:22 -04004682 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4683 (yyval.interm.nodePair).node2 = 0;
4684 }
4685 break;
4686
Alexis Hetue5246692015-06-18 12:34:52 -04004687 case 259:
Alexis Hetu17809052015-05-13 11:28:22 -04004688
4689 {
4690 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4691 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
4692 }
4693 break;
4694
Alexis Hetue5246692015-06-18 12:34:52 -04004695 case 260:
Alexis Hetu17809052015-05-13 11:28:22 -04004696
4697 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004698 (yyval.interm.intermNode) = context->addBranch(EOpContinue, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004699 }
4700 break;
4701
Alexis Hetue5246692015-06-18 12:34:52 -04004702 case 261:
Alexis Hetu17809052015-05-13 11:28:22 -04004703
4704 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004705 (yyval.interm.intermNode) = context->addBranch(EOpBreak, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004706 }
4707 break;
4708
Alexis Hetue5246692015-06-18 12:34:52 -04004709 case 262:
Alexis Hetu17809052015-05-13 11:28:22 -04004710
4711 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004712 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004713 }
4714 break;
4715
Alexis Hetue5246692015-06-18 12:34:52 -04004716 case 263:
Alexis Hetu17809052015-05-13 11:28:22 -04004717
4718 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004719 (yyval.interm.intermNode) = context->addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004720 }
4721 break;
4722
Alexis Hetue5246692015-06-18 12:34:52 -04004723 case 264:
Alexis Hetu17809052015-05-13 11:28:22 -04004724
4725 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004726 FRAG_ONLY("discard", (yylsp[(1) - (2)]));
4727 (yyval.interm.intermNode) = context->addBranch(EOpKill, (yylsp[(1) - (2)]));
Alexis Hetu17809052015-05-13 11:28:22 -04004728 }
4729 break;
4730
Alexis Hetu76a343a2015-06-04 17:21:22 -04004731 case 265:
Alexis Hetu17809052015-05-13 11:28:22 -04004732
4733 {
Alexis Hetue5246692015-06-18 12:34:52 -04004734 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
Alexis Hetu0a655842015-06-22 16:52:11 -04004735 context->setTreeRoot((yyval.interm.intermNode));
Alexis Hetu17809052015-05-13 11:28:22 -04004736 }
4737 break;
4738
Alexis Hetu76a343a2015-06-04 17:21:22 -04004739 case 266:
Alexis Hetuad6b8752015-06-09 16:15:30 -04004740
4741 {
Alexis Hetue5246692015-06-18 12:34:52 -04004742 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
Alexis Hetu0a655842015-06-22 16:52:11 -04004743 context->setTreeRoot((yyval.interm.intermNode));
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004744 }
4745 break;
4746
Alexis Hetu76a343a2015-06-04 17:21:22 -04004747 case 267:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004748
4749 {
4750 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4751 }
4752 break;
4753
Alexis Hetu76a343a2015-06-04 17:21:22 -04004754 case 268:
Alexis Hetudd7ff7a2015-06-11 08:25:30 -04004755
4756 {
Alexis Hetue5246692015-06-18 12:34:52 -04004757 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4758 }
4759 break;
4760
4761 case 269:
4762
4763 {
John Bauman66b8ab22014-05-06 15:57:45 -04004764 TFunction* function = (yyvsp[(1) - (1)].interm).function;
4765
Alexis Hetu0a655842015-06-22 16:52:11 -04004766 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->getShaderVersion());
John Bauman66b8ab22014-05-06 15:57:45 -04004767
4768 if (builtIn)
4769 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004770 context->error((yylsp[(1) - (1)]), "built-in functions cannot be redefined", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004771 context->recover();
4772 }
4773
Alexis Hetu0a655842015-06-22 16:52:11 -04004774 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->getShaderVersion()));
John Bauman66b8ab22014-05-06 15:57:45 -04004775 //
4776 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4777 // as it would have just been put in the symbol table. Otherwise, we're looking up
4778 // an earlier occurance.
4779 //
4780 if (prevDec->isDefined()) {
4781 //
4782 // Then this function already has a body.
4783 //
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004784 context->error((yylsp[(1) - (1)]), "function already has a body", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004785 context->recover();
4786 }
4787 prevDec->setDefined();
4788
4789 //
4790 // Raise error message if main function takes any parameters or return anything other than void
4791 //
4792 if (function->getName() == "main") {
4793 if (function->getParamCount() > 0) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004794 context->error((yylsp[(1) - (1)]), "function cannot take any parameter(s)", function->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004795 context->recover();
4796 }
4797 if (function->getReturnType().getBasicType() != EbtVoid) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004798 context->error((yylsp[(1) - (1)]), "", function->getReturnType().getBasicString(), "main function cannot return a value");
John Bauman66b8ab22014-05-06 15:57:45 -04004799 context->recover();
4800 }
4801 }
4802
4803 //
4804 // Remember the return type for later checking for RETURN statements.
4805 //
Alexis Hetu0a655842015-06-22 16:52:11 -04004806 context->setCurrentFunctionType(&(prevDec->getReturnType()));
4807 context->setFunctionReturnsValue(false);
John Bauman66b8ab22014-05-06 15:57:45 -04004808
4809 //
4810 // Insert parameters into the symbol table.
4811 // If the parameter has no name, it's not an error, just don't insert it
4812 // (could be used for unused args).
4813 //
4814 // Also, accumulate the list of parameters into the HIL, so lower level code
4815 // knows where to find parameters.
4816 //
4817 TIntermAggregate* paramNodes = new TIntermAggregate;
Alexis Hetu76a343a2015-06-04 17:21:22 -04004818 for (size_t i = 0; i < function->getParamCount(); i++) {
John Bauman66b8ab22014-05-06 15:57:45 -04004819 const TParameter& param = function->getParam(i);
4820 if (param.name != 0) {
4821 TVariable *variable = new TVariable(param.name, *param.type);
4822 //
4823 // Insert the parameters with name in the symbol table.
4824 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05004825 if (! context->symbolTable.declare(*variable)) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004826 context->error((yylsp[(1) - (1)]), "redefinition", variable->getName().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004827 context->recover();
4828 delete variable;
4829 }
4830
4831 //
4832 // Add the parameter to the HIL
4833 //
4834 paramNodes = context->intermediate.growAggregate(
4835 paramNodes,
4836 context->intermediate.addSymbol(variable->getUniqueId(),
4837 variable->getName(),
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004838 variable->getType(), (yylsp[(1) - (1)])),
4839 (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004840 } else {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004841 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (1)])), (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004842 }
4843 }
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004844 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yylsp[(1) - (1)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004845 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
Alexis Hetu0a655842015-06-22 16:52:11 -04004846 context->setLoopNestingLevel(0);
John Bauman66b8ab22014-05-06 15:57:45 -04004847 }
4848 break;
4849
Alexis Hetue5246692015-06-18 12:34:52 -04004850 case 270:
John Bauman66b8ab22014-05-06 15:57:45 -04004851
4852 {
4853 //?? Check that all paths return a value if return type != void ?
4854 // May be best done as post process phase on intermediate code
Alexis Hetu0a655842015-06-22 16:52:11 -04004855 if (context->getCurrentFunctionType()->getBasicType() != EbtVoid && ! context->getFunctionReturnsValue()) {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004856 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 -04004857 context->recover();
4858 }
4859
4860 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004861 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yylsp[(1) - (3)]));
John Bauman66b8ab22014-05-06 15:57:45 -04004862 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4863 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4864
4865 // store the pragma information for debug and optimize and other vendor specific
4866 // information. This information can be queried from the parse tree
4867 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4868 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
4869
4870 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
4871 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
4872
4873 context->symbolTable.pop();
4874 }
4875 break;
4876
4877
4878
4879 default: break;
4880 }
4881 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4882
4883 YYPOPSTACK (yylen);
4884 yylen = 0;
4885 YY_STACK_PRINT (yyss, yyssp);
4886
4887 *++yyvsp = yyval;
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004888 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04004889
4890 /* Now `shift' the result of the reduction. Determine what state
4891 that goes to, based on the state we popped back to and the rule
4892 number reduced by. */
4893
4894 yyn = yyr1[yyn];
4895
4896 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
4897 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
4898 yystate = yytable[yystate];
4899 else
4900 yystate = yydefgoto[yyn - YYNTOKENS];
4901
4902 goto yynewstate;
4903
4904
4905/*------------------------------------.
4906| yyerrlab -- here on detecting error |
4907`------------------------------------*/
4908yyerrlab:
4909 /* If not already recovering from an error, report this error. */
4910 if (!yyerrstatus)
4911 {
4912 ++yynerrs;
4913#if ! YYERROR_VERBOSE
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004914 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04004915#else
4916 {
4917 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
4918 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
4919 {
4920 YYSIZE_T yyalloc = 2 * yysize;
4921 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
4922 yyalloc = YYSTACK_ALLOC_MAXIMUM;
4923 if (yymsg != yymsgbuf)
4924 YYSTACK_FREE (yymsg);
4925 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
4926 if (yymsg)
4927 yymsg_alloc = yyalloc;
4928 else
4929 {
4930 yymsg = yymsgbuf;
4931 yymsg_alloc = sizeof yymsgbuf;
4932 }
4933 }
4934
4935 if (0 < yysize && yysize <= yymsg_alloc)
4936 {
4937 (void) yysyntax_error (yymsg, yystate, yychar);
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004938 yyerror (&yylloc, context, yymsg);
John Bauman66b8ab22014-05-06 15:57:45 -04004939 }
4940 else
4941 {
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004942 yyerror (&yylloc, context, YY_("syntax error"));
John Bauman66b8ab22014-05-06 15:57:45 -04004943 if (yysize != 0)
4944 goto yyexhaustedlab;
4945 }
4946 }
4947#endif
4948 }
4949
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004950 yyerror_range[0] = yylloc;
John Bauman66b8ab22014-05-06 15:57:45 -04004951
4952 if (yyerrstatus == 3)
4953 {
4954 /* If just tried and failed to reuse lookahead token after an
4955 error, discard it. */
4956
4957 if (yychar <= YYEOF)
4958 {
4959 /* Return failure if at end of input. */
4960 if (yychar == YYEOF)
4961 YYABORT;
4962 }
4963 else
4964 {
4965 yydestruct ("Error: discarding",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004966 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04004967 yychar = YYEMPTY;
4968 }
4969 }
4970
4971 /* Else will try to reuse lookahead token after shifting the error
4972 token. */
4973 goto yyerrlab1;
4974
4975
4976/*---------------------------------------------------.
4977| yyerrorlab -- error raised explicitly by YYERROR. |
4978`---------------------------------------------------*/
4979yyerrorlab:
4980
4981 /* Pacify compilers like GCC when the user code never invokes
4982 YYERROR and the label yyerrorlab therefore never appears in user
4983 code. */
4984 if (/*CONSTCOND*/ 0)
4985 goto yyerrorlab;
4986
Alexis Hetu15ae36c2015-06-18 21:10:09 -04004987 yyerror_range[0] = yylsp[1-yylen];
John Bauman66b8ab22014-05-06 15:57:45 -04004988 /* Do not reclaim the symbols of the rule which action triggered
4989 this YYERROR. */
4990 YYPOPSTACK (yylen);
4991 yylen = 0;
4992 YY_STACK_PRINT (yyss, yyssp);
4993 yystate = *yyssp;
4994 goto yyerrlab1;
4995
4996
4997/*-------------------------------------------------------------.
4998| yyerrlab1 -- common code for both syntax error and YYERROR. |
4999`-------------------------------------------------------------*/
5000yyerrlab1:
5001 yyerrstatus = 3; /* Each real token shifted decrements this. */
5002
5003 for (;;)
5004 {
5005 yyn = yypact[yystate];
5006 if (yyn != YYPACT_NINF)
5007 {
5008 yyn += YYTERROR;
5009 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5010 {
5011 yyn = yytable[yyn];
5012 if (0 < yyn)
5013 break;
5014 }
5015 }
5016
5017 /* Pop the current state because it cannot handle the error token. */
5018 if (yyssp == yyss)
5019 YYABORT;
5020
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005021 yyerror_range[0] = *yylsp;
John Bauman66b8ab22014-05-06 15:57:45 -04005022 yydestruct ("Error: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005023 yystos[yystate], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005024 YYPOPSTACK (1);
5025 yystate = *yyssp;
5026 YY_STACK_PRINT (yyss, yyssp);
5027 }
5028
5029 *++yyvsp = yylval;
5030
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005031 yyerror_range[1] = yylloc;
5032 /* Using YYLLOC is tempting, but would change the location of
5033 the lookahead. YYLOC is available though. */
5034 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
5035 *++yylsp = yyloc;
John Bauman66b8ab22014-05-06 15:57:45 -04005036
5037 /* Shift the error token. */
5038 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5039
5040 yystate = yyn;
5041 goto yynewstate;
5042
5043
5044/*-------------------------------------.
5045| yyacceptlab -- YYACCEPT comes here. |
5046`-------------------------------------*/
5047yyacceptlab:
5048 yyresult = 0;
5049 goto yyreturn;
5050
5051/*-----------------------------------.
5052| yyabortlab -- YYABORT comes here. |
5053`-----------------------------------*/
5054yyabortlab:
5055 yyresult = 1;
5056 goto yyreturn;
5057
5058#if !defined(yyoverflow) || YYERROR_VERBOSE
5059/*-------------------------------------------------.
5060| yyexhaustedlab -- memory exhaustion comes here. |
5061`-------------------------------------------------*/
5062yyexhaustedlab:
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005063 yyerror (&yylloc, context, YY_("memory exhausted"));
John Bauman66b8ab22014-05-06 15:57:45 -04005064 yyresult = 2;
5065 /* Fall through. */
5066#endif
5067
5068yyreturn:
5069 if (yychar != YYEMPTY)
5070 yydestruct ("Cleanup: discarding lookahead",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005071 yytoken, &yylval, &yylloc, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005072 /* Do not reclaim the symbols of the rule which action triggered
5073 this YYABORT or YYACCEPT. */
5074 YYPOPSTACK (yylen);
5075 YY_STACK_PRINT (yyss, yyssp);
5076 while (yyssp != yyss)
5077 {
5078 yydestruct ("Cleanup: popping",
Alexis Hetu15ae36c2015-06-18 21:10:09 -04005079 yystos[*yyssp], yyvsp, yylsp, context);
John Bauman66b8ab22014-05-06 15:57:45 -04005080 YYPOPSTACK (1);
5081 }
5082#ifndef yyoverflow
5083 if (yyss != yyssa)
5084 YYSTACK_FREE (yyss);
5085#endif
5086#if YYERROR_VERBOSE
5087 if (yymsg != yymsgbuf)
5088 YYSTACK_FREE (yymsg);
5089#endif
5090 /* Make sure YYID is used. */
5091 return YYID (yyresult);
5092}
5093
5094
5095
5096
5097
5098int glslang_parse(TParseContext* context) {
5099 return yyparse(context);
5100}
5101