blob: d73a1f4b2e3a4418aa0228ecc91c04c37ffff28d [file] [log] [blame]
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001
2/* A Bison parser, made by GNU Bison 2.4.1. */
John Bauman66b8ab22014-05-06 15:57:45 -04003
4/* Skeleton implementation for Bison's Yacc-like parsers in C
5
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04006 Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
7 Free Software Foundation, Inc.
John Bauman66b8ab22014-05-06 15:57:45 -04008
9 This program is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
21
22/* As a special exception, you may create a larger work that contains
23 part or all of the Bison parser skeleton and distribute that work
24 under terms of your choice, so long as that work isn't itself a
25 parser generator using the skeleton or a modified version thereof
26 as a parser skeleton. Alternatively, if you modify or redistribute
27 the parser skeleton itself, you may (at your option) remove this
28 special exception, which will cause the skeleton and the resulting
29 Bison output files to be licensed under the GNU General Public
30 License without this special exception.
31
32 This special exception was added by the Free Software Foundation in
33 version 2.2 of Bison. */
34
35/* C LALR(1) parser skeleton written by Richard Stallman, by
36 simplifying the original so-called "semantic" parser. */
37
38/* All symbols defined below should begin with yy or YY, to avoid
39 infringing on user name space. This should be done even for local
40 variables, as they might otherwise be expanded by user macros.
41 There are some unavoidable exceptions within include files to
42 define necessary library symbols; they are noted "INFRINGES ON
43 USER NAME SPACE" below. */
44
45/* Identify Bison output. */
46#define YYBISON 1
47
48/* Bison version. */
Nicolas Capense9c5e4f2014-05-28 22:46:43 -040049#define YYBISON_VERSION "2.4.1"
John Bauman66b8ab22014-05-06 15:57:45 -040050
51/* Skeleton name. */
52#define YYSKELETON_NAME "yacc.c"
53
54/* Pure parsers. */
55#define YYPURE 1
56
57/* Push parsers. */
58#define YYPUSH 0
59
60/* Pull parsers. */
61#define YYPULL 1
62
63/* Using locations. */
64#define YYLSP_NEEDED 0
65
66
67
68/* Copy the first part of user declarations. */
69
70
71//
Alexis Hetub14178b2015-04-13 13:23:20 -040072// Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved.
John Bauman66b8ab22014-05-06 15:57:45 -040073// Use of this source code is governed by a BSD-style license that can be
74// found in the LICENSE file.
75//
76
77// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
78
79// Ignore errors in auto-generated code.
80#if defined(__GNUC__)
81#pragma GCC diagnostic ignored "-Wunused-function"
82#pragma GCC diagnostic ignored "-Wunused-variable"
83#pragma GCC diagnostic ignored "-Wswitch-enum"
84#elif defined(_MSC_VER)
85#pragma warning(disable: 4065)
86#pragma warning(disable: 4189)
87#pragma warning(disable: 4505)
88#pragma warning(disable: 4701)
89#endif
90
Nicolas Capenscc863da2015-01-21 15:50:55 -050091#include "SymbolTable.h"
92#include "ParseHelper.h"
John Bauman66b8ab22014-05-06 15:57:45 -040093
John Baumand4ae8632014-05-06 16:18:33 -040094#define YYENABLE_NLS 0
95#define YYLTYPE_IS_TRIVIAL 1
96
John Bauman66b8ab22014-05-06 15:57:45 -040097#define YYLEX_PARAM context->scanner
98
99
100
101/* Enabling traces. */
102#ifndef YYDEBUG
103# define YYDEBUG 0
104#endif
105
106/* Enabling verbose error messages. */
107#ifdef YYERROR_VERBOSE
108# undef YYERROR_VERBOSE
109# define YYERROR_VERBOSE 1
110#else
111# define YYERROR_VERBOSE 0
112#endif
113
114/* Enabling the token table. */
115#ifndef YYTOKEN_TABLE
116# define YYTOKEN_TABLE 0
117#endif
118
119
120/* Tokens. */
121#ifndef YYTOKENTYPE
122# define YYTOKENTYPE
123 /* Put the tokens into the symbol table, so that GDB and other debuggers
124 know about them. */
125 enum yytokentype {
126 INVARIANT = 258,
127 HIGH_PRECISION = 259,
128 MEDIUM_PRECISION = 260,
129 LOW_PRECISION = 261,
130 PRECISION = 262,
131 ATTRIBUTE = 263,
132 CONST_QUAL = 264,
133 BOOL_TYPE = 265,
134 FLOAT_TYPE = 266,
135 INT_TYPE = 267,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500136 UINT_TYPE = 268,
137 BREAK = 269,
138 CONTINUE = 270,
139 DO = 271,
140 ELSE = 272,
141 FOR = 273,
142 IF = 274,
143 DISCARD = 275,
144 RETURN = 276,
145 SWITCH = 277,
146 CASE = 278,
147 DEFAULT = 279,
148 BVEC2 = 280,
149 BVEC3 = 281,
150 BVEC4 = 282,
151 IVEC2 = 283,
152 IVEC3 = 284,
153 IVEC4 = 285,
154 VEC2 = 286,
155 VEC3 = 287,
156 VEC4 = 288,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500157 UVEC2 = 289,
158 UVEC3 = 290,
159 UVEC4 = 291,
160 MATRIX2 = 292,
161 MATRIX3 = 293,
162 MATRIX4 = 294,
163 IN_QUAL = 295,
164 OUT_QUAL = 296,
165 INOUT_QUAL = 297,
166 UNIFORM = 298,
167 VARYING = 299,
Alexis Hetub14178b2015-04-13 13:23:20 -0400168 MATRIX2x3 = 300,
169 MATRIX3x2 = 301,
170 MATRIX2x4 = 302,
171 MATRIX4x2 = 303,
172 MATRIX3x4 = 304,
173 MATRIX4x3 = 305,
174 CENTROID = 306,
175 FLAT = 307,
176 SMOOTH = 308,
177 STRUCT = 309,
178 VOID_TYPE = 310,
179 WHILE = 311,
180 SAMPLER2D = 312,
181 SAMPLERCUBE = 313,
182 SAMPLER_EXTERNAL_OES = 314,
183 SAMPLER2DRECT = 315,
184 SAMPLER2DARRAY = 316,
185 ISAMPLER2D = 317,
186 ISAMPLER3D = 318,
187 ISAMPLERCUBE = 319,
188 ISAMPLER2DARRAY = 320,
189 USAMPLER2D = 321,
190 USAMPLER3D = 322,
191 USAMPLERCUBE = 323,
192 USAMPLER2DARRAY = 324,
193 SAMPLER3D = 325,
194 SAMPLER3DRECT = 326,
195 SAMPLER2DSHADOW = 327,
196 SAMPLERCUBESHADOW = 328,
197 SAMPLER2DARRAYSHADOW = 329,
198 LAYOUT = 330,
199 IDENTIFIER = 331,
200 TYPE_NAME = 332,
201 FLOATCONSTANT = 333,
202 INTCONSTANT = 334,
203 UINTCONSTANT = 335,
204 BOOLCONSTANT = 336,
205 FIELD_SELECTION = 337,
206 LEFT_OP = 338,
207 RIGHT_OP = 339,
208 INC_OP = 340,
209 DEC_OP = 341,
210 LE_OP = 342,
211 GE_OP = 343,
212 EQ_OP = 344,
213 NE_OP = 345,
214 AND_OP = 346,
215 OR_OP = 347,
216 XOR_OP = 348,
217 MUL_ASSIGN = 349,
218 DIV_ASSIGN = 350,
219 ADD_ASSIGN = 351,
220 MOD_ASSIGN = 352,
221 LEFT_ASSIGN = 353,
222 RIGHT_ASSIGN = 354,
223 AND_ASSIGN = 355,
224 XOR_ASSIGN = 356,
225 OR_ASSIGN = 357,
226 SUB_ASSIGN = 358,
227 LEFT_PAREN = 359,
228 RIGHT_PAREN = 360,
229 LEFT_BRACKET = 361,
230 RIGHT_BRACKET = 362,
231 LEFT_BRACE = 363,
232 RIGHT_BRACE = 364,
233 DOT = 365,
234 COMMA = 366,
235 COLON = 367,
236 EQUAL = 368,
237 SEMICOLON = 369,
238 BANG = 370,
239 DASH = 371,
240 TILDE = 372,
241 PLUS = 373,
242 STAR = 374,
243 SLASH = 375,
244 PERCENT = 376,
245 LEFT_ANGLE = 377,
246 RIGHT_ANGLE = 378,
247 VERTICAL_BAR = 379,
248 CARET = 380,
249 AMPERSAND = 381,
250 QUESTION = 382
John Bauman66b8ab22014-05-06 15:57:45 -0400251 };
252#endif
253
254
255
256#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
257typedef union YYSTYPE
258{
259
260
261 struct {
262 TSourceLoc line;
263 union {
264 TString *string;
265 float f;
266 int i;
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500267 unsigned int u;
John Bauman66b8ab22014-05-06 15:57:45 -0400268 bool b;
269 };
270 TSymbol* symbol;
271 } lex;
272 struct {
273 TSourceLoc line;
274 TOperator op;
275 union {
276 TIntermNode* intermNode;
277 TIntermNodePair nodePair;
278 TIntermTyped* intermTypedNode;
279 TIntermAggregate* intermAggregate;
280 };
281 union {
282 TPublicType type;
283 TPrecision precision;
Nicolas Capens7d626792015-02-17 17:58:31 -0500284 TLayoutQualifier layoutQualifier;
John Bauman66b8ab22014-05-06 15:57:45 -0400285 TQualifier qualifier;
286 TFunction* function;
287 TParameter param;
288 TTypeLine typeLine;
289 TTypeList* typeList;
290 };
291 } interm;
292
293
294
295} YYSTYPE;
296# define YYSTYPE_IS_TRIVIAL 1
297# define yystype YYSTYPE /* obsolescent; will be withdrawn */
298# define YYSTYPE_IS_DECLARED 1
299#endif
300
301
302/* Copy the second part of user declarations. */
303
304
305extern int yylex(YYSTYPE* yylval_param, void* yyscanner);
306extern void yyerror(TParseContext* context, const char* reason);
307
308#define FRAG_VERT_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500309 if (context->shaderType != GL_FRAGMENT_SHADER && \
310 context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400311 context->error(L, " supported in vertex/fragment shaders only ", S); \
312 context->recover(); \
313 } \
314}
315
316#define VERTEX_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500317 if (context->shaderType != GL_VERTEX_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400318 context->error(L, " supported in vertex shaders only ", S); \
319 context->recover(); \
320 } \
321}
322
323#define FRAG_ONLY(S, L) { \
Nicolas Capens08ca3c62015-02-13 16:06:45 -0500324 if (context->shaderType != GL_FRAGMENT_SHADER) { \
John Bauman66b8ab22014-05-06 15:57:45 -0400325 context->error(L, " supported in fragment shaders only ", S); \
326 context->recover(); \
327 } \
328}
329
Nicolas Capensc6841852015-02-15 14:25:37 -0500330#define ES2_ONLY(S, L) { \
331 if (context->shaderVersion != 100) { \
332 context->error(L, " supported in GLSL ES 1.00 only ", S); \
333 context->recover(); \
334 } \
335}
336
337#define ES3_ONLY(S, L) { \
338 if (context->shaderVersion != 300) { \
339 context->error(L, " supported in GLSL ES 3.00 only ", S); \
340 context->recover(); \
341 } \
342}
343
John Bauman66b8ab22014-05-06 15:57:45 -0400344
345
346#ifdef short
347# undef short
348#endif
349
350#ifdef YYTYPE_UINT8
351typedef YYTYPE_UINT8 yytype_uint8;
352#else
353typedef unsigned char yytype_uint8;
354#endif
355
356#ifdef YYTYPE_INT8
357typedef YYTYPE_INT8 yytype_int8;
358#elif (defined __STDC__ || defined __C99__FUNC__ \
359 || defined __cplusplus || defined _MSC_VER)
360typedef signed char yytype_int8;
361#else
362typedef short int yytype_int8;
363#endif
364
365#ifdef YYTYPE_UINT16
366typedef YYTYPE_UINT16 yytype_uint16;
367#else
368typedef unsigned short int yytype_uint16;
369#endif
370
371#ifdef YYTYPE_INT16
372typedef YYTYPE_INT16 yytype_int16;
373#else
374typedef short int yytype_int16;
375#endif
376
377#ifndef YYSIZE_T
378# ifdef __SIZE_TYPE__
379# define YYSIZE_T __SIZE_TYPE__
380# elif defined size_t
381# define YYSIZE_T size_t
382# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
383 || defined __cplusplus || defined _MSC_VER)
384# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
385# define YYSIZE_T size_t
386# else
387# define YYSIZE_T unsigned int
388# endif
389#endif
390
391#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
392
393#ifndef YY_
Nicolas Capense9c5e4f2014-05-28 22:46:43 -0400394# if YYENABLE_NLS
John Bauman66b8ab22014-05-06 15:57:45 -0400395# if ENABLE_NLS
396# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
397# define YY_(msgid) dgettext ("bison-runtime", msgid)
398# endif
399# endif
400# ifndef YY_
401# define YY_(msgid) msgid
402# endif
403#endif
404
405/* Suppress unused-variable warnings by "using" E. */
406#if ! defined lint || defined __GNUC__
407# define YYUSE(e) ((void) (e))
408#else
409# define YYUSE(e) /* empty */
410#endif
411
412/* Identity function, used to suppress warnings about constant conditions. */
413#ifndef lint
414# define YYID(n) (n)
415#else
416#if (defined __STDC__ || defined __C99__FUNC__ \
417 || defined __cplusplus || defined _MSC_VER)
418static int
419YYID (int yyi)
420#else
421static int
422YYID (yyi)
423 int yyi;
424#endif
425{
426 return yyi;
427}
428#endif
429
430#if ! defined yyoverflow || YYERROR_VERBOSE
431
432/* The parser invokes alloca or malloc; define the necessary symbols. */
433
434# ifdef YYSTACK_USE_ALLOCA
435# if YYSTACK_USE_ALLOCA
436# ifdef __GNUC__
437# define YYSTACK_ALLOC __builtin_alloca
438# elif defined __BUILTIN_VA_ARG_INCR
439# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
440# elif defined _AIX
441# define YYSTACK_ALLOC __alloca
442# elif defined _MSC_VER
443# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
444# define alloca _alloca
445# else
446# define YYSTACK_ALLOC alloca
447# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
448 || defined __cplusplus || defined _MSC_VER)
449# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
450# ifndef _STDLIB_H
451# define _STDLIB_H 1
452# endif
453# endif
454# endif
455# endif
456# endif
457
458# ifdef YYSTACK_ALLOC
459 /* Pacify GCC's `empty if-body' warning. */
460# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
461# ifndef YYSTACK_ALLOC_MAXIMUM
462 /* The OS might guarantee only one guard page at the bottom of the stack,
463 and a page size can be as small as 4096 bytes. So we cannot safely
464 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
465 to allow for a few compiler-allocated temporary stack slots. */
466# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
467# endif
468# else
469# define YYSTACK_ALLOC YYMALLOC
470# define YYSTACK_FREE YYFREE
471# ifndef YYSTACK_ALLOC_MAXIMUM
472# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
473# endif
474# if (defined __cplusplus && ! defined _STDLIB_H \
475 && ! ((defined YYMALLOC || defined malloc) \
476 && (defined YYFREE || defined free)))
477# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
478# ifndef _STDLIB_H
479# define _STDLIB_H 1
480# endif
481# endif
482# ifndef YYMALLOC
483# define YYMALLOC malloc
484# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
485 || defined __cplusplus || defined _MSC_VER)
486void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
487# endif
488# endif
489# ifndef YYFREE
490# define YYFREE free
491# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
492 || defined __cplusplus || defined _MSC_VER)
493void free (void *); /* INFRINGES ON USER NAME SPACE */
494# endif
495# endif
496# endif
497#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
498
499
500#if (! defined yyoverflow \
501 && (! defined __cplusplus \
502 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
503
504/* A type that is properly aligned for any stack member. */
505union yyalloc
506{
507 yytype_int16 yyss_alloc;
508 YYSTYPE yyvs_alloc;
509};
510
511/* The size of the maximum gap between one aligned stack and the next. */
512# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
513
514/* The size of an array large to enough to hold all stacks, each with
515 N elements. */
516# define YYSTACK_BYTES(N) \
517 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
518 + YYSTACK_GAP_MAXIMUM)
519
520/* Copy COUNT objects from FROM to TO. The source and destination do
521 not overlap. */
522# ifndef YYCOPY
523# if defined __GNUC__ && 1 < __GNUC__
524# define YYCOPY(To, From, Count) \
525 __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
526# else
527# define YYCOPY(To, From, Count) \
528 do \
529 { \
530 YYSIZE_T yyi; \
531 for (yyi = 0; yyi < (Count); yyi++) \
532 (To)[yyi] = (From)[yyi]; \
533 } \
534 while (YYID (0))
535# endif
536# endif
537
538/* Relocate STACK from its old location to the new one. The
539 local variables YYSIZE and YYSTACKSIZE give the old and new number of
540 elements in the stack, and YYPTR gives the new location of the
541 stack. Advance YYPTR to a properly aligned location for the next
542 stack. */
543# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
544 do \
545 { \
546 YYSIZE_T yynewbytes; \
547 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
548 Stack = &yyptr->Stack_alloc; \
549 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
550 yyptr += yynewbytes / sizeof (*yyptr); \
551 } \
552 while (YYID (0))
553
554#endif
555
556/* YYFINAL -- State number of the termination state. */
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400557#define YYFINAL 107
John Bauman66b8ab22014-05-06 15:57:45 -0400558/* YYLAST -- Last index in YYTABLE. */
Alexis Hetu17809052015-05-13 11:28:22 -0400559#define YYLAST 2056
John Bauman66b8ab22014-05-06 15:57:45 -0400560
561/* YYNTOKENS -- Number of terminals. */
Alexis Hetub14178b2015-04-13 13:23:20 -0400562#define YYNTOKENS 128
John Bauman66b8ab22014-05-06 15:57:45 -0400563/* YYNNTS -- Number of nonterminals. */
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400564#define YYNNTS 89
John Bauman66b8ab22014-05-06 15:57:45 -0400565/* YYNRULES -- Number of rules. */
Alexis Hetu17809052015-05-13 11:28:22 -0400566#define YYNRULES 255
John Bauman66b8ab22014-05-06 15:57:45 -0400567/* YYNRULES -- Number of states. */
Alexis Hetu17809052015-05-13 11:28:22 -0400568#define YYNSTATES 370
John Bauman66b8ab22014-05-06 15:57:45 -0400569
570/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
571#define YYUNDEFTOK 2
Alexis Hetub14178b2015-04-13 13:23:20 -0400572#define YYMAXUTOK 382
John Bauman66b8ab22014-05-06 15:57:45 -0400573
574#define YYTRANSLATE(YYX) \
575 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
576
577/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
578static const yytype_uint8 yytranslate[] =
579{
580 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
581 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
582 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
583 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
584 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
606 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
607 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
608 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
609 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
610 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
611 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
612 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
613 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
Alexis Hetub027aa92015-01-19 15:56:12 -0500614 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
Nicolas Capens3c20f802015-02-17 17:17:20 -0500615 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
Alexis Hetub14178b2015-04-13 13:23:20 -0400616 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
617 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
618 125, 126, 127
John Bauman66b8ab22014-05-06 15:57:45 -0400619};
620
621#if YYDEBUG
622/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
623 YYRHS. */
624static const yytype_uint16 yyprhs[] =
625{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500626 0, 0, 3, 5, 7, 9, 11, 13, 15, 19,
627 21, 26, 28, 32, 35, 38, 40, 42, 44, 48,
628 51, 54, 57, 59, 62, 66, 69, 71, 73, 75,
Alexis Hetu17809052015-05-13 11:28:22 -0400629 77, 80, 83, 86, 88, 90, 92, 94, 96, 100,
630 104, 108, 110, 114, 118, 120, 124, 128, 130, 134,
631 138, 142, 146, 148, 152, 156, 158, 162, 164, 168,
632 170, 174, 176, 180, 182, 186, 188, 192, 194, 200,
633 202, 206, 208, 210, 212, 214, 216, 218, 220, 222,
634 224, 226, 228, 230, 234, 236, 239, 242, 247, 250,
635 252, 254, 257, 261, 265, 268, 274, 278, 281, 285,
636 288, 289, 291, 293, 295, 297, 299, 303, 309, 316,
637 322, 324, 327, 332, 338, 343, 346, 348, 351, 353,
638 355, 357, 359, 361, 364, 366, 369, 371, 373, 376,
639 378, 380, 382, 385, 388, 390, 392, 395, 397, 399,
640 401, 406, 408, 412, 414, 418, 422, 424, 429, 431,
641 433, 435, 437, 439, 441, 443, 445, 447, 449, 451,
642 453, 455, 457, 459, 461, 463, 465, 467, 469, 471,
643 473, 475, 477, 479, 481, 483, 485, 487, 489, 491,
644 493, 495, 497, 499, 501, 503, 505, 507, 509, 511,
645 513, 515, 517, 518, 525, 526, 532, 534, 537, 541,
646 543, 547, 549, 554, 556, 558, 560, 562, 564, 566,
647 568, 570, 572, 575, 576, 577, 583, 585, 587, 588,
648 591, 592, 595, 598, 602, 604, 607, 609, 612, 618,
649 622, 624, 626, 631, 632, 639, 640, 649, 650, 658,
650 660, 662, 664, 665, 668, 672, 675, 678, 681, 685,
651 688, 690, 693, 695, 697, 698
John Bauman66b8ab22014-05-06 15:57:45 -0400652};
653
654/* YYRHS -- A `-1'-separated list of the rules' RHS. */
655static const yytype_int16 yyrhs[] =
656{
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400657 213, 0, -1, 76, -1, 129, -1, 79, -1, 80,
Alexis Hetub14178b2015-04-13 13:23:20 -0400658 -1, 78, -1, 81, -1, 104, 156, 105, -1, 130,
659 -1, 131, 106, 132, 107, -1, 133, -1, 131, 110,
660 82, -1, 131, 85, -1, 131, 86, -1, 156, -1,
661 134, -1, 135, -1, 131, 110, 135, -1, 137, 105,
662 -1, 136, 105, -1, 138, 55, -1, 138, -1, 138,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400663 154, -1, 137, 111, 154, -1, 139, 104, -1, 180,
Alexis Hetub14178b2015-04-13 13:23:20 -0400664 -1, 76, -1, 82, -1, 131, -1, 85, 140, -1,
665 86, 140, -1, 141, 140, -1, 118, -1, 116, -1,
Alexis Hetu17809052015-05-13 11:28:22 -0400666 115, -1, 117, -1, 140, -1, 142, 119, 140, -1,
667 142, 120, 140, -1, 142, 121, 140, -1, 142, -1,
668 143, 118, 142, -1, 143, 116, 142, -1, 143, -1,
669 144, 83, 143, -1, 144, 84, 143, -1, 144, -1,
670 145, 122, 144, -1, 145, 123, 144, -1, 145, 87,
671 144, -1, 145, 88, 144, -1, 145, -1, 146, 89,
672 145, -1, 146, 90, 145, -1, 146, -1, 147, 126,
673 146, -1, 147, -1, 148, 125, 147, -1, 148, -1,
674 149, 124, 148, -1, 149, -1, 150, 91, 149, -1,
675 150, -1, 151, 93, 150, -1, 151, -1, 152, 92,
676 151, -1, 152, -1, 152, 127, 156, 112, 154, -1,
677 153, -1, 140, 155, 154, -1, 113, -1, 94, -1,
678 95, -1, 97, -1, 96, -1, 103, -1, 98, -1,
679 99, -1, 100, -1, 101, -1, 102, -1, 154, -1,
680 156, 111, 154, -1, 153, -1, 159, 114, -1, 167,
681 114, -1, 7, 175, 179, 114, -1, 160, 105, -1,
682 162, -1, 161, -1, 162, 164, -1, 161, 111, 164,
683 -1, 169, 76, 104, -1, 174, 76, -1, 174, 76,
684 106, 157, 107, -1, 171, 165, 163, -1, 165, 163,
685 -1, 171, 165, 166, -1, 165, 166, -1, -1, 40,
686 -1, 41, -1, 42, -1, 174, -1, 168, -1, 167,
687 111, 76, -1, 167, 111, 76, 106, 107, -1, 167,
688 111, 76, 106, 157, 107, -1, 167, 111, 76, 113,
689 188, -1, 169, -1, 169, 76, -1, 169, 76, 106,
690 107, -1, 169, 76, 106, 157, 107, -1, 169, 76,
691 113, 188, -1, 3, 76, -1, 174, -1, 172, 174,
692 -1, 53, -1, 52, -1, 9, -1, 8, -1, 44,
693 -1, 3, 44, -1, 173, -1, 170, 173, -1, 170,
694 -1, 176, -1, 176, 173, -1, 9, -1, 40, -1,
695 41, -1, 51, 40, -1, 51, 41, -1, 43, -1,
696 179, -1, 175, 179, -1, 4, -1, 5, -1, 6,
697 -1, 75, 104, 177, 105, -1, 178, -1, 177, 111,
698 178, -1, 76, -1, 76, 113, 79, -1, 76, 113,
699 80, -1, 180, -1, 180, 106, 157, 107, -1, 55,
700 -1, 11, -1, 12, -1, 13, -1, 10, -1, 31,
701 -1, 32, -1, 33, -1, 25, -1, 26, -1, 27,
702 -1, 28, -1, 29, -1, 30, -1, 34, -1, 35,
703 -1, 36, -1, 37, -1, 38, -1, 39, -1, 45,
704 -1, 46, -1, 47, -1, 48, -1, 49, -1, 50,
705 -1, 57, -1, 58, -1, 59, -1, 70, -1, 61,
706 -1, 62, -1, 63, -1, 64, -1, 65, -1, 66,
707 -1, 67, -1, 68, -1, 69, -1, 72, -1, 73,
708 -1, 74, -1, 181, -1, 77, -1, -1, 54, 76,
709 108, 182, 184, 109, -1, -1, 54, 108, 183, 184,
710 109, -1, 185, -1, 184, 185, -1, 174, 186, 114,
711 -1, 187, -1, 186, 111, 187, -1, 76, -1, 76,
712 106, 157, 107, -1, 154, -1, 158, -1, 192, -1,
713 191, -1, 189, -1, 201, -1, 202, -1, 205, -1,
714 212, -1, 108, 109, -1, -1, -1, 108, 193, 200,
715 194, 109, -1, 199, -1, 191, -1, -1, 197, 199,
716 -1, -1, 198, 191, -1, 108, 109, -1, 108, 200,
717 109, -1, 190, -1, 200, 190, -1, 114, -1, 156,
718 114, -1, 19, 104, 156, 105, 203, -1, 196, 17,
719 196, -1, 196, -1, 156, -1, 169, 76, 113, 188,
720 -1, -1, 56, 104, 206, 204, 105, 195, -1, -1,
721 16, 207, 196, 56, 104, 156, 105, 114, -1, -1,
722 18, 104, 208, 209, 211, 105, 195, -1, 201, -1,
723 189, -1, 204, -1, -1, 210, 114, -1, 210, 114,
724 156, -1, 15, 114, -1, 14, 114, -1, 21, 114,
725 -1, 21, 156, 114, -1, 20, 114, -1, 214, -1,
726 213, 214, -1, 215, -1, 158, -1, -1, 159, 216,
727 199, -1
John Bauman66b8ab22014-05-06 15:57:45 -0400728};
729
730/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
731static const yytype_uint16 yyrline[] =
732{
Alexis Hetub14178b2015-04-13 13:23:20 -0400733 0, 190, 190, 225, 228, 233, 238, 243, 248, 254,
734 257, 336, 339, 440, 450, 463, 471, 571, 574, 582,
Alexis Hetub7c46af2015-05-12 15:58:09 -0400735 586, 593, 597, 604, 610, 619, 627, 704, 711, 721,
Alexis Hetu17809052015-05-13 11:28:22 -0400736 724, 734, 744, 765, 766, 767, 768, 776, 777, 786,
737 795, 808, 809, 817, 828, 829, 838, 850, 851, 861,
738 871, 881, 894, 895, 905, 918, 919, 933, 934, 948,
739 949, 963, 964, 977, 978, 991, 992, 1005, 1006, 1023,
740 1024, 1037, 1038, 1039, 1040, 1042, 1043, 1044, 1046, 1048,
741 1050, 1052, 1057, 1060, 1071, 1079, 1106, 1111, 1121, 1159,
742 1162, 1169, 1177, 1198, 1219, 1230, 1259, 1264, 1274, 1279,
743 1289, 1292, 1295, 1298, 1304, 1311, 1314, 1336, 1354, 1378,
744 1401, 1405, 1423, 1431, 1463, 1483, 1571, 1580, 1603, 1606,
745 1612, 1618, 1625, 1634, 1643, 1646, 1649, 1656, 1660, 1667,
746 1671, 1676, 1681, 1687, 1693, 1702, 1712, 1719, 1722, 1725,
747 1731, 1738, 1741, 1747, 1750, 1753, 1759, 1762, 1777, 1781,
748 1785, 1789, 1793, 1797, 1802, 1807, 1812, 1817, 1822, 1827,
749 1832, 1837, 1842, 1847, 1852, 1857, 1863, 1869, 1875, 1881,
750 1887, 1893, 1899, 1905, 1911, 1916, 1921, 1930, 1935, 1940,
751 1945, 1950, 1955, 1960, 1965, 1970, 1975, 1980, 1985, 1990,
752 1995, 2000, 2013, 2013, 2027, 2027, 2036, 2039, 2054, 2086,
753 2090, 2096, 2104, 2120, 2124, 2128, 2129, 2135, 2136, 2137,
754 2138, 2139, 2143, 2144, 2144, 2144, 2154, 2155, 2159, 2159,
755 2160, 2160, 2165, 2168, 2178, 2181, 2187, 2188, 2192, 2200,
756 2204, 2214, 2219, 2236, 2236, 2241, 2241, 2248, 2248, 2256,
757 2259, 2265, 2268, 2274, 2278, 2285, 2292, 2299, 2306, 2317,
758 2326, 2330, 2337, 2340, 2346, 2346
John Bauman66b8ab22014-05-06 15:57:45 -0400759};
760#endif
761
762#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
763/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
764 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
765static const char *const yytname[] =
766{
767 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
768 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
Nicolas Capens3c20f802015-02-17 17:17:20 -0500769 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE",
770 "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN",
771 "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
Nicolas Capense4b1b1d2015-02-17 17:26:01 -0500772 "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2",
773 "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
Alexis Hetub14178b2015-04-13 13:23:20 -0400774 "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2",
775 "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT",
776 "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES",
777 "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D",
778 "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
779 "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT",
780 "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT",
781 "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
782 "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
783 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
784 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
785 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
786 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500787 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
788 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
789 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
790 "AMPERSAND", "QUESTION", "$accept", "variable_identifier",
791 "primary_expression", "postfix_expression", "integer_expression",
792 "function_call", "function_call_or_method", "function_call_generic",
John Bauman66b8ab22014-05-06 15:57:45 -0400793 "function_call_header_no_parameters",
794 "function_call_header_with_parameters", "function_call_header",
795 "function_identifier", "unary_expression", "unary_operator",
796 "multiplicative_expression", "additive_expression", "shift_expression",
797 "relational_expression", "equality_expression", "and_expression",
798 "exclusive_or_expression", "inclusive_or_expression",
799 "logical_and_expression", "logical_xor_expression",
800 "logical_or_expression", "conditional_expression",
801 "assignment_expression", "assignment_operator", "expression",
802 "constant_expression", "declaration", "function_prototype",
803 "function_declarator", "function_header_with_parameters",
804 "function_header", "parameter_declarator", "parameter_declaration",
805 "parameter_qualifier", "parameter_type_specifier",
806 "init_declarator_list", "single_declaration", "fully_specified_type",
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400807 "interpolation_qualifier", "parameter_type_qualifier", "type_qualifier",
808 "storage_qualifier", "type_specifier", "precision_qualifier",
809 "layout_qualifier", "layout_qualifier_id_list", "layout_qualifier_id",
Nicolas Capens7d626792015-02-17 17:58:31 -0500810 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
811 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
John Bauman66b8ab22014-05-06 15:57:45 -0400812 "struct_declarator_list", "struct_declarator", "initializer",
813 "declaration_statement", "statement", "simple_statement",
814 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
815 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
816 "statement_list", "expression_statement", "selection_statement",
817 "selection_rest_statement", "condition", "iteration_statement", "$@7",
818 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
819 "jump_statement", "translation_unit", "external_declaration",
820 "function_definition", "$@10", 0
821};
822#endif
823
824# ifdef YYPRINT
825/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
826 token YYLEX-NUM. */
827static const yytype_uint16 yytoknum[] =
828{
829 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
830 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
831 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
832 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
833 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
834 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
835 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
836 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
837 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
Nicolas Capensc6841852015-02-15 14:25:37 -0500838 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
Nicolas Capens7d626792015-02-17 17:58:31 -0500839 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
Alexis Hetub14178b2015-04-13 13:23:20 -0400840 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
841 375, 376, 377, 378, 379, 380, 381, 382
John Bauman66b8ab22014-05-06 15:57:45 -0400842};
843# endif
844
845/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
846static const yytype_uint8 yyr1[] =
847{
Alexis Hetub14178b2015-04-13 13:23:20 -0400848 0, 128, 129, 130, 130, 130, 130, 130, 130, 131,
849 131, 131, 131, 131, 131, 132, 133, 134, 134, 135,
850 135, 136, 136, 137, 137, 138, 139, 139, 139, 140,
Alexis Hetu17809052015-05-13 11:28:22 -0400851 140, 140, 140, 141, 141, 141, 141, 142, 142, 142,
852 142, 143, 143, 143, 144, 144, 144, 145, 145, 145,
853 145, 145, 146, 146, 146, 147, 147, 148, 148, 149,
854 149, 150, 150, 151, 151, 152, 152, 153, 153, 154,
855 154, 155, 155, 155, 155, 155, 155, 155, 155, 155,
856 155, 155, 156, 156, 157, 158, 158, 158, 159, 160,
857 160, 161, 161, 162, 163, 163, 164, 164, 164, 164,
858 165, 165, 165, 165, 166, 167, 167, 167, 167, 167,
859 168, 168, 168, 168, 168, 168, 169, 169, 170, 170,
860 171, 172, 172, 172, 172, 172, 172, 172, 172, 173,
861 173, 173, 173, 173, 173, 174, 174, 175, 175, 175,
862 176, 177, 177, 178, 178, 178, 179, 179, 180, 180,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400863 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
864 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
865 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
Alexis Hetu17809052015-05-13 11:28:22 -0400866 180, 180, 180, 180, 180, 180, 180, 180, 180, 180,
867 180, 180, 182, 181, 183, 181, 184, 184, 185, 186,
868 186, 187, 187, 188, 189, 190, 190, 191, 191, 191,
869 191, 191, 192, 193, 194, 192, 195, 195, 197, 196,
870 198, 196, 199, 199, 200, 200, 201, 201, 202, 203,
871 203, 204, 204, 206, 205, 207, 205, 208, 205, 209,
872 209, 210, 210, 211, 211, 212, 212, 212, 212, 212,
873 213, 213, 214, 214, 216, 215
John Bauman66b8ab22014-05-06 15:57:45 -0400874};
875
876/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
877static const yytype_uint8 yyr2[] =
878{
Nicolas Capens2c1239f2015-02-17 17:30:04 -0500879 0, 2, 1, 1, 1, 1, 1, 1, 3, 1,
880 4, 1, 3, 2, 2, 1, 1, 1, 3, 2,
881 2, 2, 1, 2, 3, 2, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400882 2, 2, 2, 1, 1, 1, 1, 1, 3, 3,
883 3, 1, 3, 3, 1, 3, 3, 1, 3, 3,
884 3, 3, 1, 3, 3, 1, 3, 1, 3, 1,
885 3, 1, 3, 1, 3, 1, 3, 1, 5, 1,
886 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
887 1, 1, 1, 3, 1, 2, 2, 4, 2, 1,
888 1, 2, 3, 3, 2, 5, 3, 2, 3, 2,
889 0, 1, 1, 1, 1, 1, 3, 5, 6, 5,
890 1, 2, 4, 5, 4, 2, 1, 2, 1, 1,
891 1, 1, 1, 2, 1, 2, 1, 1, 2, 1,
892 1, 1, 2, 2, 1, 1, 2, 1, 1, 1,
893 4, 1, 3, 1, 3, 3, 1, 4, 1, 1,
John Bauman66b8ab22014-05-06 15:57:45 -0400894 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetub14178b2015-04-13 13:23:20 -0400895 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
896 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Alexis Hetu17809052015-05-13 11:28:22 -0400897 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
898 1, 1, 0, 6, 0, 5, 1, 2, 3, 1,
899 3, 1, 4, 1, 1, 1, 1, 1, 1, 1,
900 1, 1, 2, 0, 0, 5, 1, 1, 0, 2,
901 0, 2, 2, 3, 1, 2, 1, 2, 5, 3,
902 1, 1, 4, 0, 6, 0, 8, 0, 7, 1,
903 1, 1, 0, 2, 3, 2, 2, 2, 3, 2,
904 1, 2, 1, 1, 0, 3
John Bauman66b8ab22014-05-06 15:57:45 -0400905};
906
907/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
908 STATE-NUM when YYTABLE doesn't specify something else to do. Zero
909 means the default is an error. */
910static const yytype_uint8 yydefact[] =
911{
Alexis Hetu17809052015-05-13 11:28:22 -0400912 0, 0, 137, 138, 139, 0, 121, 129, 152, 149,
913 150, 151, 156, 157, 158, 159, 160, 161, 153, 154,
914 155, 162, 163, 164, 165, 166, 167, 130, 131, 134,
915 122, 168, 169, 170, 171, 172, 173, 0, 119, 118,
916 0, 148, 174, 175, 176, 178, 179, 180, 181, 182,
917 183, 184, 185, 186, 177, 187, 188, 189, 0, 191,
918 253, 254, 0, 90, 100, 0, 105, 110, 126, 0,
919 124, 116, 0, 127, 135, 146, 190, 0, 250, 252,
920 123, 115, 0, 132, 133, 0, 194, 0, 85, 0,
921 88, 100, 120, 101, 102, 103, 91, 0, 100, 0,
922 86, 111, 125, 117, 136, 128, 0, 1, 251, 0,
923 192, 0, 143, 0, 141, 0, 255, 92, 97, 99,
924 104, 0, 106, 93, 0, 0, 2, 6, 4, 5,
925 7, 28, 0, 0, 0, 35, 34, 36, 33, 3,
926 9, 29, 11, 16, 17, 0, 0, 22, 0, 37,
927 0, 41, 44, 47, 52, 55, 57, 59, 61, 63,
928 65, 67, 84, 0, 26, 87, 0, 0, 0, 196,
929 0, 140, 0, 0, 0, 235, 0, 0, 0, 0,
930 0, 213, 222, 226, 37, 69, 82, 0, 204, 0,
931 146, 207, 224, 206, 205, 0, 208, 209, 210, 211,
932 94, 96, 98, 0, 0, 112, 0, 203, 114, 30,
933 31, 0, 13, 14, 0, 0, 20, 19, 0, 21,
934 23, 25, 32, 0, 0, 0, 0, 0, 0, 0,
935 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
936 0, 0, 0, 147, 0, 201, 0, 199, 195, 197,
937 144, 145, 142, 246, 245, 220, 237, 0, 249, 247,
938 0, 233, 212, 0, 72, 73, 75, 74, 77, 78,
939 79, 80, 81, 76, 71, 0, 0, 227, 223, 225,
940 0, 107, 0, 109, 113, 8, 0, 15, 27, 12,
941 18, 24, 38, 39, 40, 43, 42, 45, 46, 50,
942 51, 48, 49, 53, 54, 56, 58, 60, 62, 64,
943 66, 0, 193, 0, 0, 198, 0, 0, 0, 0,
944 0, 248, 0, 214, 70, 83, 0, 108, 10, 0,
945 0, 200, 0, 219, 221, 240, 239, 242, 220, 0,
946 231, 0, 0, 0, 95, 68, 202, 0, 241, 0,
947 0, 230, 228, 0, 0, 215, 0, 243, 0, 220,
948 0, 217, 234, 216, 0, 244, 238, 229, 232, 236
John Bauman66b8ab22014-05-06 15:57:45 -0400949};
950
951/* YYDEFGOTO[NTERM-NUM]. */
952static const yytype_int16 yydefgoto[] =
953{
Alexis Hetu17809052015-05-13 11:28:22 -0400954 -1, 139, 140, 141, 286, 142, 143, 144, 145, 146,
955 147, 148, 184, 150, 151, 152, 153, 154, 155, 156,
956 157, 158, 159, 160, 161, 185, 186, 275, 187, 163,
957 188, 189, 62, 63, 64, 118, 96, 97, 119, 65,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -0400958 66, 67, 68, 98, 69, 70, 71, 72, 73, 113,
Alexis Hetu17809052015-05-13 11:28:22 -0400959 114, 74, 164, 76, 166, 111, 168, 169, 246, 247,
960 208, 191, 192, 193, 194, 263, 343, 362, 316, 317,
961 318, 363, 195, 196, 197, 352, 342, 198, 322, 255,
962 319, 337, 349, 350, 199, 77, 78, 79, 89
John Bauman66b8ab22014-05-06 15:57:45 -0400963};
964
965/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
966 STATE-NUM. */
Alexis Hetu17809052015-05-13 11:28:22 -0400967#define YYPACT_NINF -324
John Bauman66b8ab22014-05-06 15:57:45 -0400968static const yytype_int16 yypact[] =
969{
Alexis Hetu17809052015-05-13 11:28:22 -0400970 1769, -31, -324, -324, -324, 144, -324, -324, -324, -324,
971 -324, -324, -324, -324, -324, -324, -324, -324, -324, -324,
972 -324, -324, -324, -324, -324, -324, -324, -324, -324, -324,
973 -324, -324, -324, -324, -324, -324, -324, 69, -324, -324,
974 -60, -324, -324, -324, -324, -324, -324, -324, -324, -324,
975 -324, -324, -324, -324, -324, -324, -324, -324, -82, -324,
976 -324, -88, -52, -48, 1, -23, -324, 2, 11, 1843,
977 -324, -324, 1979, 11, -324, -7, -324, 1694, -324, -324,
978 -324, -324, 1979, -324, -324, 18, -324, 31, -324, 59,
979 -324, 78, -324, -324, -324, -324, -324, 1843, 113, 85,
980 -324, -79, -324, -324, -324, -324, 1419, -324, -324, 55,
981 -324, 1843, 61, -55, -324, 356, -324, -324, -324, -324,
982 102, 1843, -67, -324, 1128, 1419, 75, -324, -324, -324,
983 -324, -324, 1419, 1419, 1419, -324, -324, -324, -324, -324,
984 -324, -27, -324, -324, -324, 76, -44, 1514, 79, -324,
985 1419, 37, -45, 30, -57, 27, 56, 62, 60, 95,
986 96, -83, -324, 81, -324, -324, 1843, 114, 243, -324,
987 80, -324, 31, 77, 83, -324, 89, 90, 84, 1226,
988 97, 91, -324, -324, 230, -324, -324, -19, -324, -88,
989 -1, -324, -324, -324, -324, 472, -324, -324, -324, -324,
990 93, -324, -324, 1321, 1419, -324, 99, -324, -324, -324,
991 -324, -37, -324, -324, 1419, 1911, -324, -324, 1419, 98,
992 -324, -324, -324, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
993 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419, 1419,
994 1419, 1419, 1419, -324, 1609, 103, -18, -324, -324, -324,
995 -324, -324, -324, -324, -324, 100, -324, 1419, -324, -324,
996 -13, -324, -324, 588, -324, -324, -324, -324, -324, -324,
997 -324, -324, -324, -324, -324, 1419, 1419, -324, -324, -324,
998 1419, -324, 104, -324, -324, -324, 105, 92, -324, 109,
999 -324, -324, -324, -324, -324, 37, 37, -45, -45, 30,
1000 30, 30, 30, -57, -57, 27, 56, 62, 60, 95,
1001 96, 53, -324, 1419, 114, -324, 148, 59, 820, 936,
1002 -35, -324, 1033, 588, -324, -324, 107, -324, -324, 1419,
1003 108, -324, 112, -324, -324, -324, -324, 1033, 100, 175,
1004 92, 145, 115, 116, -324, -324, -324, 1419, -324, 110,
1005 117, 206, -324, 118, 704, -324, -30, 1419, 704, 100,
1006 1419, -324, -324, -324, 119, 92, -324, -324, -324, -324
John Bauman66b8ab22014-05-06 15:57:45 -04001007};
1008
1009/* YYPGOTO[NTERM-NUM]. */
1010static const yytype_int16 yypgoto[] =
1011{
Alexis Hetu17809052015-05-13 11:28:22 -04001012 -324, -324, -324, -324, -324, -324, -324, 13, -324, -324,
1013 -324, -324, -95, -324, -56, -53, -108, -62, -10, -8,
1014 -6, -5, -3, -2, -324, -103, -124, -324, -130, -117,
1015 8, 12, -324, -324, -324, 120, 147, 137, 121, -324,
1016 -324, -305, -324, -324, -324, -33, -64, 235, -324, -324,
1017 71, -54, 0, -324, -324, -324, 86, -154, -324, -69,
1018 -198, -73, -176, -294, -324, -324, -324, -107, -323, -324,
1019 -324, -87, -4, -61, -324, -324, -80, -324, -324, -324,
1020 -324, -324, -324, -324, -324, -324, 173, -324, -324
John Bauman66b8ab22014-05-06 15:57:45 -04001021};
1022
1023/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1024 positive, shift that token. If negative, reduce the rule which
1025 number is the opposite. If zero, do what YYDEFACT says.
1026 If YYTABLE_NINF, syntax error. */
Alexis Hetu17809052015-05-13 11:28:22 -04001027#define YYTABLE_NINF -219
John Bauman66b8ab22014-05-06 15:57:45 -04001028static const yytype_int16 yytable[] =
1029{
Alexis Hetu17809052015-05-13 11:28:22 -04001030 75, 207, 116, 162, 211, 103, 283, 206, 60, 241,
1031 92, 149, 61, 80, 249, 351, 85, 341, 104, 279,
1032 7, 162, 87, 220, 334, 123, 88, 124, 109, 149,
1033 230, 231, 341, 120, 125, 102, 367, 209, 210, 203,
1034 105, 93, 94, 95, 242, 81, 204, 167, 86, 260,
1035 171, 27, 28, 90, 29, 222, 172, 120, 212, 213,
1036 361, 217, 37, 91, 361, 232, 233, 218, 285, 75,
1037 338, 226, 75, 227, 276, 364, 276, 75, 101, 214,
1038 207, 276, 75, 215, 287, 60, 282, 92, 99, 61,
1039 249, 100, 276, 314, 291, 277, 315, 75, 276, 106,
1040 162, 321, 167, -26, 167, 106, -89, 112, 149, 83,
1041 84, 75, 311, 228, 229, 190, 234, 235, 93, 94,
1042 95, 75, 299, 300, 301, 302, 110, 320, 292, 293,
1043 294, 149, 149, 149, 149, 149, 149, 149, 149, 149,
1044 149, 149, 149, 149, 149, 149, 149, 279, 2, 3,
1045 4, 324, 325, 93, 94, 95, 223, 224, 225, 250,
1046 251, 122, 368, 326, 276, 329, 75, 115, 75, 165,
1047 295, 296, 303, 304, 170, 297, 298, 162, 200, -27,
1048 167, 216, 236, 221, 238, 149, 239, 237, 243, 240,
1049 245, 253, 340, 256, 257, 190, 330, 254, 258, 280,
1050 262, 261, -148, 276, 332, 345, 284, 340, -218, 313,
1051 162, 327, 328, -28, 344, 346, 347, 356, 149, 80,
1052 354, 353, 358, 359, 357, 355, 305, 365, 290, 306,
1053 333, 360, 307, 369, 308, 121, 207, 309, 117, 310,
1054 82, 201, 202, 252, 75, 331, 335, 2, 3, 4,
1055 108, 366, 244, 8, 9, 10, 11, 348, 336, 323,
1056 0, 0, 0, 190, 0, 0, 0, 0, 12, 13,
1057 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1058 24, 25, 26, 0, 0, 0, 0, 0, 31, 32,
1059 33, 34, 35, 36, 0, 0, 0, 40, 41, 0,
1060 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1061 51, 52, 53, 54, 0, 55, 56, 57, 190, 190,
1062 59, 0, 190, 190, 264, 265, 266, 267, 268, 269,
1063 270, 271, 272, 273, 0, 0, 0, 190, 0, 0,
1064 0, 0, 0, 274, 0, 0, 0, 0, 0, 0,
1065 0, 0, 248, 0, 190, 0, 0, 0, 190, 1,
1066 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1067 173, 174, 175, 0, 176, 177, 178, 179, 0, 0,
1068 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1069 21, 22, 23, 24, 25, 26, 27, 28, 0, 29,
1070 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1071 40, 41, 180, 42, 43, 44, 0, 45, 46, 47,
1072 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1073 57, 58, 126, 59, 127, 128, 129, 130, 131, 0,
1074 0, 132, 133, 0, 0, 0, 0, 0, 0, 0,
1075 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1076 134, 0, 0, 0, 181, 182, 0, 0, 0, 0,
1077 183, 135, 136, 137, 138, 1, 2, 3, 4, 5,
1078 6, 7, 8, 9, 10, 11, 173, 174, 175, 0,
1079 176, 177, 178, 179, 0, 0, 0, 12, 13, 14,
1080 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1081 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1082 34, 35, 36, 37, 38, 39, 40, 41, 180, 42,
1083 43, 44, 0, 45, 46, 47, 48, 49, 50, 51,
1084 52, 53, 54, 0, 55, 56, 57, 58, 126, 59,
1085 127, 128, 129, 130, 131, 0, 0, 132, 133, 0,
1086 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1087 0, 0, 0, 0, 0, 0, 134, 0, 0, 0,
1088 181, 278, 0, 0, 0, 0, 183, 135, 136, 137,
1089 138, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1090 10, 11, 173, 174, 175, 0, 176, 177, 178, 179,
1091 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1092 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1093 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1094 38, 39, 40, 41, 180, 42, 43, 44, 0, 45,
1095 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1096 55, 56, 57, 58, 126, 59, 127, 128, 129, 130,
1097 131, 0, 0, 132, 133, 0, 0, 0, 0, 0,
1098 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1099 0, 0, 134, 0, 0, 0, 181, 0, 0, 0,
1100 0, 0, 183, 135, 136, 137, 138, 1, 2, 3,
1101 4, 5, 6, 7, 8, 9, 10, 11, 173, 174,
1102 175, 0, 176, 177, 178, 179, 0, 0, 0, 12,
1103 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1104 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1105 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1106 180, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1107 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1108 126, 59, 127, 128, 129, 130, 131, 0, 0, 132,
1109 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1110 0, 0, 0, 0, 0, 0, 0, 0, 134, 0,
1111 0, 0, 115, 0, 0, 0, 0, 0, 183, 135,
1112 136, 137, 138, 1, 2, 3, 4, 5, 6, 7,
1113 8, 9, 10, 11, 173, 174, 175, 0, 176, 177,
1114 178, 179, 0, 0, 0, 12, 13, 14, 15, 16,
1115 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1116 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1117 36, 37, 38, 39, 40, 41, 180, 42, 43, 44,
1118 0, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1119 54, 0, 55, 56, 57, 58, 126, 59, 127, 128,
1120 129, 130, 131, 0, 0, 132, 133, 0, 0, 0,
1121 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1122 0, 0, 0, 0, 134, 0, 0, 0, 0, 0,
1123 0, 0, 0, 0, 183, 135, 136, 137, 138, 1,
1124 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1125 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1126 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1127 21, 22, 23, 24, 25, 26, 27, 28, 0, 29,
1128 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001129 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1130 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
Alexis Hetu17809052015-05-13 11:28:22 -04001131 57, 58, 126, 59, 127, 128, 129, 130, 131, 0,
1132 0, 132, 133, 0, 0, 0, 0, 0, 0, 0,
1133 0, 0, 0, 0, 0, 0, 339, 2, 3, 4,
1134 134, 6, 7, 8, 9, 10, 11, 0, 0, 0,
1135 183, 135, 136, 137, 138, 0, 0, 0, 12, 13,
Alexis Hetub14178b2015-04-13 13:23:20 -04001136 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1137 24, 25, 26, 27, 28, 0, 29, 30, 31, 32,
Alexis Hetu17809052015-05-13 11:28:22 -04001138 33, 34, 35, 36, 37, 38, 39, 40, 41, 0,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001139 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1140 51, 52, 53, 54, 0, 55, 56, 57, 58, 126,
1141 59, 127, 128, 129, 130, 131, 0, 0, 132, 133,
Alexis Hetub14178b2015-04-13 13:23:20 -04001142 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001143 0, 0, 0, 0, 0, 0, 0, 134, 8, 9,
1144 10, 11, 0, 0, 0, 0, 0, 0, 135, 136,
1145 137, 138, 0, 12, 13, 14, 15, 16, 17, 18,
1146 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
1147 0, 0, 0, 31, 32, 33, 34, 35, 36, 0,
1148 0, 0, 40, 41, 0, 42, 43, 44, 0, 45,
1149 46, 47, 48, 49, 50, 51, 52, 53, 54, 0,
1150 55, 56, 57, 0, 126, 59, 127, 128, 129, 130,
1151 131, 0, 0, 132, 133, 0, 0, 0, 0, 0,
Alexis Hetub14178b2015-04-13 13:23:20 -04001152 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001153 0, 0, 134, 0, 0, 205, 8, 9, 10, 11,
1154 0, 0, 0, 135, 136, 137, 138, 0, 0, 0,
1155 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1156 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1157 0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1158 40, 41, 0, 42, 43, 44, 0, 45, 46, 47,
1159 48, 49, 50, 51, 52, 53, 54, 0, 55, 56,
1160 57, 0, 126, 59, 127, 128, 129, 130, 131, 0,
1161 0, 132, 133, 0, 0, 0, 0, 0, 0, 0,
1162 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1163 134, 8, 9, 10, 11, 0, 0, 0, 0, 0,
1164 259, 135, 136, 137, 138, 0, 12, 13, 14, 15,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001165 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
Alexis Hetu17809052015-05-13 11:28:22 -04001166 26, 0, 0, 0, 0, 0, 31, 32, 33, 34,
1167 35, 36, 0, 0, 0, 40, 41, 0, 42, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001168 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
Alexis Hetu17809052015-05-13 11:28:22 -04001169 53, 54, 0, 55, 56, 57, 0, 126, 59, 127,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001170 128, 129, 130, 131, 0, 0, 132, 133, 0, 0,
Nicolas Capens7d626792015-02-17 17:58:31 -05001171 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001172 0, 0, 0, 0, 0, 134, 0, 0, 281, 8,
1173 9, 10, 11, 0, 0, 0, 135, 136, 137, 138,
1174 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001175 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1176 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1177 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1178 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1179 0, 55, 56, 57, 0, 126, 59, 127, 128, 129,
1180 130, 131, 0, 0, 132, 133, 0, 0, 0, 0,
1181 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1182 0, 0, 0, 134, 8, 9, 10, 11, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001183 0, 0, 0, 0, 135, 136, 137, 138, 0, 12,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001184 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1185 23, 24, 25, 26, 0, 0, 0, 0, 0, 31,
Alexis Hetu17809052015-05-13 11:28:22 -04001186 32, 33, 34, 35, 36, 0, 0, 0, 40, 219,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001187 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1188 50, 51, 52, 53, 54, 0, 55, 56, 57, 0,
1189 126, 59, 127, 128, 129, 130, 131, 0, 0, 132,
1190 133, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Alexis Hetu17809052015-05-13 11:28:22 -04001191 0, 0, 0, 2, 3, 4, 0, 0, 134, 8,
1192 9, 10, 11, 0, 0, 0, 0, 0, 0, 135,
1193 136, 137, 138, 0, 12, 13, 14, 15, 16, 17,
1194 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1195 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1196 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1197 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1198 0, 55, 56, 57, 0, 0, 59, 0, 0, 0,
1199 0, 0, 0, 0, 107, 0, 0, 1, 2, 3,
1200 4, 5, 6, 7, 8, 9, 10, 11, 0, 0,
1201 0, 0, 0, 0, 0, 0, 0, 0, 312, 12,
1202 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1203 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1204 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1205 0, 42, 43, 44, 0, 45, 46, 47, 48, 49,
1206 50, 51, 52, 53, 54, 0, 55, 56, 57, 58,
1207 0, 59, 1, 2, 3, 4, 5, 6, 7, 8,
1208 9, 10, 11, 0, 0, 0, 0, 0, 0, 0,
1209 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
1210 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
1211 28, 0, 29, 30, 31, 32, 33, 34, 35, 36,
1212 37, 38, 39, 40, 41, 0, 42, 43, 44, 0,
1213 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1214 0, 55, 56, 57, 58, 0, 59, 2, 3, 4,
1215 0, 0, 0, 8, 9, 10, 11, 0, 0, 0,
1216 0, 0, 0, 0, 0, 0, 0, 0, 12, 13,
1217 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1218 24, 25, 26, 0, 0, 0, 0, 0, 31, 32,
1219 33, 34, 35, 36, 0, 0, 0, 40, 41, 0,
1220 42, 43, 44, 0, 45, 46, 47, 48, 49, 50,
1221 51, 52, 53, 54, 0, 55, 56, 57, 0, 0,
1222 59, 8, 9, 10, 11, 0, 0, 0, 0, 0,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001223 0, 0, 0, 0, 0, 0, 12, 13, 14, 15,
1224 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1225 26, 0, 0, 0, 0, 0, 31, 32, 33, 34,
1226 35, 36, 0, 0, 0, 40, 41, 0, 42, 43,
1227 44, 0, 45, 46, 47, 48, 49, 50, 51, 52,
Alexis Hetu17809052015-05-13 11:28:22 -04001228 53, 54, 0, 55, 56, 57, 0, 288, 59, 8,
1229 9, 10, 11, 289, 0, 0, 0, 0, 0, 0,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001230 0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
1231 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
1232 0, 0, 0, 0, 31, 32, 33, 34, 35, 36,
1233 0, 0, 0, 40, 41, 0, 42, 43, 44, 0,
1234 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
Alexis Hetu17809052015-05-13 11:28:22 -04001235 0, 55, 56, 57, 0, 0, 59
John Bauman66b8ab22014-05-06 15:57:45 -04001236};
1237
1238static const yytype_int16 yycheck[] =
1239{
Alexis Hetu17809052015-05-13 11:28:22 -04001240 0, 125, 89, 106, 134, 69, 204, 124, 0, 92,
1241 9, 106, 0, 44, 168, 338, 76, 322, 72, 195,
1242 9, 124, 104, 147, 318, 104, 114, 106, 82, 124,
1243 87, 88, 337, 97, 113, 68, 359, 132, 133, 106,
1244 73, 40, 41, 42, 127, 76, 113, 111, 108, 179,
1245 105, 40, 41, 105, 43, 150, 111, 121, 85, 86,
1246 354, 105, 51, 111, 358, 122, 123, 111, 105, 69,
1247 105, 116, 72, 118, 111, 105, 111, 77, 76, 106,
1248 204, 111, 82, 110, 214, 77, 203, 9, 111, 77,
1249 244, 114, 111, 111, 218, 114, 114, 97, 111, 106,
1250 203, 114, 166, 104, 168, 106, 105, 76, 203, 40,
1251 41, 111, 242, 83, 84, 115, 89, 90, 40, 41,
1252 42, 121, 230, 231, 232, 233, 108, 257, 223, 224,
1253 225, 226, 227, 228, 229, 230, 231, 232, 233, 234,
1254 235, 236, 237, 238, 239, 240, 241, 323, 4, 5,
1255 6, 275, 276, 40, 41, 42, 119, 120, 121, 79,
1256 80, 76, 360, 280, 111, 112, 166, 108, 168, 114,
1257 226, 227, 234, 235, 113, 228, 229, 280, 76, 104,
1258 244, 105, 126, 104, 124, 280, 91, 125, 107, 93,
1259 76, 114, 322, 104, 104, 195, 313, 114, 114, 106,
1260 109, 104, 104, 111, 56, 329, 107, 337, 108, 106,
1261 313, 107, 107, 104, 107, 107, 104, 347, 313, 44,
1262 105, 76, 105, 17, 114, 109, 236, 357, 215, 237,
1263 317, 113, 238, 114, 239, 98, 360, 240, 91, 241,
1264 5, 121, 121, 172, 244, 314, 319, 4, 5, 6,
1265 77, 358, 166, 10, 11, 12, 13, 337, 319, 263,
1266 -1, -1, -1, 263, -1, -1, -1, -1, 25, 26,
1267 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1268 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
1269 47, 48, 49, 50, -1, -1, -1, 54, 55, -1,
1270 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1271 67, 68, 69, 70, -1, 72, 73, 74, 318, 319,
1272 77, -1, 322, 323, 94, 95, 96, 97, 98, 99,
1273 100, 101, 102, 103, -1, -1, -1, 337, -1, -1,
1274 -1, -1, -1, 113, -1, -1, -1, -1, -1, -1,
1275 -1, -1, 109, -1, 354, -1, -1, -1, 358, 3,
1276 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1277 14, 15, 16, -1, 18, 19, 20, 21, -1, -1,
1278 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1279 34, 35, 36, 37, 38, 39, 40, 41, -1, 43,
1280 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1281 54, 55, 56, 57, 58, 59, -1, 61, 62, 63,
1282 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1283 74, 75, 76, 77, 78, 79, 80, 81, 82, -1,
1284 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1285 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1286 104, -1, -1, -1, 108, 109, -1, -1, -1, -1,
1287 114, 115, 116, 117, 118, 3, 4, 5, 6, 7,
1288 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1289 18, 19, 20, 21, -1, -1, -1, 25, 26, 27,
1290 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1291 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1292 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
1293 58, 59, -1, 61, 62, 63, 64, 65, 66, 67,
1294 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
1295 78, 79, 80, 81, 82, -1, -1, 85, 86, -1,
1296 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1297 -1, -1, -1, -1, -1, -1, 104, -1, -1, -1,
1298 108, 109, -1, -1, -1, -1, 114, 115, 116, 117,
1299 118, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1300 12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
1301 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1302 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1303 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1304 52, 53, 54, 55, 56, 57, 58, 59, -1, 61,
1305 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1306 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1307 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1308 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1309 -1, -1, 104, -1, -1, -1, 108, -1, -1, -1,
1310 -1, -1, 114, 115, 116, 117, 118, 3, 4, 5,
1311 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1312 16, -1, 18, 19, 20, 21, -1, -1, -1, 25,
1313 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1314 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1315 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1316 56, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1317 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1318 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1319 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1320 -1, -1, -1, -1, -1, -1, -1, -1, 104, -1,
1321 -1, -1, 108, -1, -1, -1, -1, -1, 114, 115,
1322 116, 117, 118, 3, 4, 5, 6, 7, 8, 9,
1323 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
1324 20, 21, -1, -1, -1, 25, 26, 27, 28, 29,
1325 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1326 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1327 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1328 -1, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1329 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
1330 80, 81, 82, -1, -1, 85, 86, -1, -1, -1,
1331 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1332 -1, -1, -1, -1, 104, -1, -1, -1, -1, -1,
1333 -1, -1, -1, -1, 114, 115, 116, 117, 118, 3,
1334 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1335 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1336 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1337 34, 35, 36, 37, 38, 39, 40, 41, -1, 43,
1338 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001339 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1340 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
Alexis Hetu17809052015-05-13 11:28:22 -04001341 74, 75, 76, 77, 78, 79, 80, 81, 82, -1,
1342 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1343 -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
1344 104, 8, 9, 10, 11, 12, 13, -1, -1, -1,
1345 114, 115, 116, 117, 118, -1, -1, -1, 25, 26,
Alexis Hetub14178b2015-04-13 13:23:20 -04001346 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1347 37, 38, 39, 40, 41, -1, 43, 44, 45, 46,
Alexis Hetu17809052015-05-13 11:28:22 -04001348 47, 48, 49, 50, 51, 52, 53, 54, 55, -1,
Alexis Hetub14178b2015-04-13 13:23:20 -04001349 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1350 67, 68, 69, 70, -1, 72, 73, 74, 75, 76,
1351 77, 78, 79, 80, 81, 82, -1, -1, 85, 86,
1352 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001353 -1, -1, -1, -1, -1, -1, -1, 104, 10, 11,
1354 12, 13, -1, -1, -1, -1, -1, -1, 115, 116,
1355 117, 118, -1, 25, 26, 27, 28, 29, 30, 31,
1356 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
1357 -1, -1, -1, 45, 46, 47, 48, 49, 50, -1,
1358 -1, -1, 54, 55, -1, 57, 58, 59, -1, 61,
1359 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1360 72, 73, 74, -1, 76, 77, 78, 79, 80, 81,
1361 82, -1, -1, 85, 86, -1, -1, -1, -1, -1,
Alexis Hetub14178b2015-04-13 13:23:20 -04001362 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001363 -1, -1, 104, -1, -1, 107, 10, 11, 12, 13,
1364 -1, -1, -1, 115, 116, 117, 118, -1, -1, -1,
1365 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1366 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1367 -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1368 54, 55, -1, 57, 58, 59, -1, 61, 62, 63,
1369 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1370 74, -1, 76, 77, 78, 79, 80, 81, 82, -1,
1371 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1372 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1373 104, 10, 11, 12, 13, -1, -1, -1, -1, -1,
1374 114, 115, 116, 117, 118, -1, 25, 26, 27, 28,
Nicolas Capens7d626792015-02-17 17:58:31 -05001375 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
Alexis Hetu17809052015-05-13 11:28:22 -04001376 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
1377 49, 50, -1, -1, -1, 54, 55, -1, 57, 58,
Alexis Hetub14178b2015-04-13 13:23:20 -04001378 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
Alexis Hetu17809052015-05-13 11:28:22 -04001379 69, 70, -1, 72, 73, 74, -1, 76, 77, 78,
Alexis Hetub14178b2015-04-13 13:23:20 -04001380 79, 80, 81, 82, -1, -1, 85, 86, -1, -1,
Nicolas Capens7d626792015-02-17 17:58:31 -05001381 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001382 -1, -1, -1, -1, -1, 104, -1, -1, 107, 10,
1383 11, 12, 13, -1, -1, -1, 115, 116, 117, 118,
1384 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001385 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1386 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1387 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1388 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1389 -1, 72, 73, 74, -1, 76, 77, 78, 79, 80,
1390 81, 82, -1, -1, 85, 86, -1, -1, -1, -1,
Nicolas Capens7d626792015-02-17 17:58:31 -05001391 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001392 -1, -1, -1, 104, 10, 11, 12, 13, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001393 -1, -1, -1, -1, 115, 116, 117, 118, -1, 25,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001394 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1395 36, 37, 38, 39, -1, -1, -1, -1, -1, 45,
1396 46, 47, 48, 49, 50, -1, -1, -1, 54, 55,
1397 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1398 66, 67, 68, 69, 70, -1, 72, 73, 74, -1,
1399 76, 77, 78, 79, 80, 81, 82, -1, -1, 85,
1400 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
Alexis Hetu17809052015-05-13 11:28:22 -04001401 -1, -1, -1, 4, 5, 6, -1, -1, 104, 10,
1402 11, 12, 13, -1, -1, -1, -1, -1, -1, 115,
1403 116, 117, 118, -1, 25, 26, 27, 28, 29, 30,
1404 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1405 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1406 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1407 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1408 -1, 72, 73, 74, -1, -1, 77, -1, -1, -1,
1409 -1, -1, -1, -1, 0, -1, -1, 3, 4, 5,
1410 6, 7, 8, 9, 10, 11, 12, 13, -1, -1,
1411 -1, -1, -1, -1, -1, -1, -1, -1, 109, 25,
1412 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1413 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1414 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1415 -1, 57, 58, 59, -1, 61, 62, 63, 64, 65,
1416 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1417 -1, 77, 3, 4, 5, 6, 7, 8, 9, 10,
1418 11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
1419 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
1420 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1421 41, -1, 43, 44, 45, 46, 47, 48, 49, 50,
1422 51, 52, 53, 54, 55, -1, 57, 58, 59, -1,
1423 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
1424 -1, 72, 73, 74, 75, -1, 77, 4, 5, 6,
1425 -1, -1, -1, 10, 11, 12, 13, -1, -1, -1,
1426 -1, -1, -1, -1, -1, -1, -1, -1, 25, 26,
1427 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1428 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
1429 47, 48, 49, 50, -1, -1, -1, 54, 55, -1,
1430 57, 58, 59, -1, 61, 62, 63, 64, 65, 66,
1431 67, 68, 69, 70, -1, 72, 73, 74, -1, -1,
1432 77, 10, 11, 12, 13, -1, -1, -1, -1, -1,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001433 -1, -1, -1, -1, -1, -1, 25, 26, 27, 28,
1434 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1435 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
1436 49, 50, -1, -1, -1, 54, 55, -1, 57, 58,
1437 59, -1, 61, 62, 63, 64, 65, 66, 67, 68,
Alexis Hetu17809052015-05-13 11:28:22 -04001438 69, 70, -1, 72, 73, 74, -1, 76, 77, 10,
1439 11, 12, 13, 82, -1, -1, -1, -1, -1, -1,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001440 -1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
1441 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
1442 -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
1443 -1, -1, -1, 54, 55, -1, 57, 58, 59, -1,
1444 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
Alexis Hetu17809052015-05-13 11:28:22 -04001445 -1, 72, 73, 74, -1, -1, 77
John Bauman66b8ab22014-05-06 15:57:45 -04001446};
1447
1448/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1449 symbol of state STATE-NUM. */
1450static const yytype_uint8 yystos[] =
1451{
1452 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
Nicolas Capens3c20f802015-02-17 17:17:20 -05001453 12, 13, 25, 26, 27, 28, 29, 30, 31, 32,
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05001454 33, 34, 35, 36, 37, 38, 39, 40, 41, 43,
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04001455 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1456 54, 55, 57, 58, 59, 61, 62, 63, 64, 65,
1457 66, 67, 68, 69, 70, 72, 73, 74, 75, 77,
1458 158, 159, 160, 161, 162, 167, 168, 169, 170, 172,
1459 173, 174, 175, 176, 179, 180, 181, 213, 214, 215,
1460 44, 76, 175, 40, 41, 76, 108, 104, 114, 216,
1461 105, 111, 9, 40, 41, 42, 164, 165, 171, 111,
1462 114, 76, 173, 174, 179, 173, 106, 0, 214, 179,
1463 108, 183, 76, 177, 178, 108, 199, 164, 163, 166,
1464 174, 165, 76, 104, 106, 113, 76, 78, 79, 80,
Alexis Hetu17809052015-05-13 11:28:22 -04001465 81, 82, 85, 86, 104, 115, 116, 117, 118, 129,
1466 130, 131, 133, 134, 135, 136, 137, 138, 139, 140,
1467 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
1468 151, 152, 153, 157, 180, 114, 182, 174, 184, 185,
1469 113, 105, 111, 14, 15, 16, 18, 19, 20, 21,
1470 56, 108, 109, 114, 140, 153, 154, 156, 158, 159,
1471 180, 189, 190, 191, 192, 200, 201, 202, 205, 212,
1472 76, 163, 166, 106, 113, 107, 157, 154, 188, 140,
1473 140, 156, 85, 86, 106, 110, 105, 105, 111, 55,
1474 154, 104, 140, 119, 120, 121, 116, 118, 83, 84,
1475 87, 88, 122, 123, 89, 90, 126, 125, 124, 91,
1476 93, 92, 127, 107, 184, 76, 186, 187, 109, 185,
1477 79, 80, 178, 114, 114, 207, 104, 104, 114, 114,
1478 156, 104, 109, 193, 94, 95, 96, 97, 98, 99,
1479 100, 101, 102, 103, 113, 155, 111, 114, 109, 190,
1480 106, 107, 157, 188, 107, 105, 132, 156, 76, 82,
1481 135, 154, 140, 140, 140, 142, 142, 143, 143, 144,
1482 144, 144, 144, 145, 145, 146, 147, 148, 149, 150,
1483 151, 156, 109, 106, 111, 114, 196, 197, 198, 208,
1484 156, 114, 206, 200, 154, 154, 157, 107, 107, 112,
1485 157, 187, 56, 199, 191, 189, 201, 209, 105, 3,
1486 156, 169, 204, 194, 107, 154, 107, 104, 204, 210,
1487 211, 196, 203, 76, 105, 109, 156, 114, 105, 17,
1488 113, 191, 195, 199, 105, 156, 195, 196, 188, 114
John Bauman66b8ab22014-05-06 15:57:45 -04001489};
1490
1491#define yyerrok (yyerrstatus = 0)
1492#define yyclearin (yychar = YYEMPTY)
1493#define YYEMPTY (-2)
1494#define YYEOF 0
1495
1496#define YYACCEPT goto yyacceptlab
1497#define YYABORT goto yyabortlab
1498#define YYERROR goto yyerrorlab
1499
1500
1501/* Like YYERROR except do call yyerror. This remains here temporarily
1502 to ease the transition to the new meaning of YYERROR, for GCC.
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001503 Once GCC version 2 has supplanted version 1, this can go. */
John Bauman66b8ab22014-05-06 15:57:45 -04001504
1505#define YYFAIL goto yyerrlab
John Bauman66b8ab22014-05-06 15:57:45 -04001506
1507#define YYRECOVERING() (!!yyerrstatus)
1508
1509#define YYBACKUP(Token, Value) \
1510do \
1511 if (yychar == YYEMPTY && yylen == 1) \
1512 { \
1513 yychar = (Token); \
1514 yylval = (Value); \
1515 yytoken = YYTRANSLATE (yychar); \
1516 YYPOPSTACK (1); \
1517 goto yybackup; \
1518 } \
1519 else \
1520 { \
1521 yyerror (context, YY_("syntax error: cannot back up")); \
1522 YYERROR; \
1523 } \
1524while (YYID (0))
1525
1526
1527#define YYTERROR 1
1528#define YYERRCODE 256
1529
1530
1531/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1532 If N is 0, then set CURRENT to the empty location which ends
1533 the previous symbol: RHS[0] (always defined). */
1534
1535#define YYRHSLOC(Rhs, K) ((Rhs)[K])
1536#ifndef YYLLOC_DEFAULT
1537# define YYLLOC_DEFAULT(Current, Rhs, N) \
1538 do \
1539 if (YYID (N)) \
1540 { \
1541 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1542 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1543 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1544 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1545 } \
1546 else \
1547 { \
1548 (Current).first_line = (Current).last_line = \
1549 YYRHSLOC (Rhs, 0).last_line; \
1550 (Current).first_column = (Current).last_column = \
1551 YYRHSLOC (Rhs, 0).last_column; \
1552 } \
1553 while (YYID (0))
1554#endif
1555
1556
1557/* YY_LOCATION_PRINT -- Print the location on the stream.
1558 This macro was not mandated originally: define only if we know
1559 we won't break user code: when these are the locations we know. */
1560
1561#ifndef YY_LOCATION_PRINT
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04001562# if YYLTYPE_IS_TRIVIAL
John Bauman66b8ab22014-05-06 15:57:45 -04001563# define YY_LOCATION_PRINT(File, Loc) \
1564 fprintf (File, "%d.%d-%d.%d", \
1565 (Loc).first_line, (Loc).first_column, \
1566 (Loc).last_line, (Loc).last_column)
1567# else
1568# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1569# endif
1570#endif
1571
1572
1573/* YYLEX -- calling `yylex' with the right arguments. */
1574
1575#ifdef YYLEX_PARAM
1576# define YYLEX yylex (&yylval, YYLEX_PARAM)
1577#else
1578# define YYLEX yylex (&yylval)
1579#endif
1580
1581/* Enable debugging if requested. */
1582#if YYDEBUG
1583
1584# ifndef YYFPRINTF
1585# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1586# define YYFPRINTF fprintf
1587# endif
1588
1589# define YYDPRINTF(Args) \
1590do { \
1591 if (yydebug) \
1592 YYFPRINTF Args; \
1593} while (YYID (0))
1594
1595# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1596do { \
1597 if (yydebug) \
1598 { \
1599 YYFPRINTF (stderr, "%s ", Title); \
1600 yy_symbol_print (stderr, \
1601 Type, Value, context); \
1602 YYFPRINTF (stderr, "\n"); \
1603 } \
1604} while (YYID (0))
1605
1606
1607/*--------------------------------.
1608| Print this symbol on YYOUTPUT. |
1609`--------------------------------*/
1610
1611/*ARGSUSED*/
1612#if (defined __STDC__ || defined __C99__FUNC__ \
1613 || defined __cplusplus || defined _MSC_VER)
1614static void
1615yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1616#else
1617static void
1618yy_symbol_value_print (yyoutput, yytype, yyvaluep, context)
1619 FILE *yyoutput;
1620 int yytype;
1621 YYSTYPE const * const yyvaluep;
1622 TParseContext* context;
1623#endif
1624{
1625 if (!yyvaluep)
1626 return;
1627 YYUSE (context);
1628# ifdef YYPRINT
1629 if (yytype < YYNTOKENS)
1630 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1631# else
1632 YYUSE (yyoutput);
1633# endif
1634 switch (yytype)
1635 {
1636 default:
1637 break;
1638 }
1639}
1640
1641
1642/*--------------------------------.
1643| Print this symbol on YYOUTPUT. |
1644`--------------------------------*/
1645
1646#if (defined __STDC__ || defined __C99__FUNC__ \
1647 || defined __cplusplus || defined _MSC_VER)
1648static void
1649yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, TParseContext* context)
1650#else
1651static void
1652yy_symbol_print (yyoutput, yytype, yyvaluep, context)
1653 FILE *yyoutput;
1654 int yytype;
1655 YYSTYPE const * const yyvaluep;
1656 TParseContext* context;
1657#endif
1658{
1659 if (yytype < YYNTOKENS)
1660 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1661 else
1662 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1663
1664 yy_symbol_value_print (yyoutput, yytype, yyvaluep, context);
1665 YYFPRINTF (yyoutput, ")");
1666}
1667
1668/*------------------------------------------------------------------.
1669| yy_stack_print -- Print the state stack from its BOTTOM up to its |
1670| TOP (included). |
1671`------------------------------------------------------------------*/
1672
1673#if (defined __STDC__ || defined __C99__FUNC__ \
1674 || defined __cplusplus || defined _MSC_VER)
1675static void
1676yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1677#else
1678static void
1679yy_stack_print (yybottom, yytop)
1680 yytype_int16 *yybottom;
1681 yytype_int16 *yytop;
1682#endif
1683{
1684 YYFPRINTF (stderr, "Stack now");
1685 for (; yybottom <= yytop; yybottom++)
1686 {
1687 int yybot = *yybottom;
1688 YYFPRINTF (stderr, " %d", yybot);
1689 }
1690 YYFPRINTF (stderr, "\n");
1691}
1692
1693# define YY_STACK_PRINT(Bottom, Top) \
1694do { \
1695 if (yydebug) \
1696 yy_stack_print ((Bottom), (Top)); \
1697} while (YYID (0))
1698
1699
1700/*------------------------------------------------.
1701| Report that the YYRULE is going to be reduced. |
1702`------------------------------------------------*/
1703
1704#if (defined __STDC__ || defined __C99__FUNC__ \
1705 || defined __cplusplus || defined _MSC_VER)
1706static void
1707yy_reduce_print (YYSTYPE *yyvsp, int yyrule, TParseContext* context)
1708#else
1709static void
1710yy_reduce_print (yyvsp, yyrule, context)
1711 YYSTYPE *yyvsp;
1712 int yyrule;
1713 TParseContext* context;
1714#endif
1715{
1716 int yynrhs = yyr2[yyrule];
1717 int yyi;
1718 unsigned long int yylno = yyrline[yyrule];
1719 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1720 yyrule - 1, yylno);
1721 /* The symbols being reduced. */
1722 for (yyi = 0; yyi < yynrhs; yyi++)
1723 {
1724 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1725 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1726 &(yyvsp[(yyi + 1) - (yynrhs)])
1727 , context);
1728 YYFPRINTF (stderr, "\n");
1729 }
1730}
1731
1732# define YY_REDUCE_PRINT(Rule) \
1733do { \
1734 if (yydebug) \
1735 yy_reduce_print (yyvsp, Rule, context); \
1736} while (YYID (0))
1737
1738/* Nonzero means print parse trace. It is left uninitialized so that
1739 multiple parsers can coexist. */
1740int yydebug;
1741#else /* !YYDEBUG */
1742# define YYDPRINTF(Args)
1743# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1744# define YY_STACK_PRINT(Bottom, Top)
1745# define YY_REDUCE_PRINT(Rule)
1746#endif /* !YYDEBUG */
1747
1748
1749/* YYINITDEPTH -- initial size of the parser's stacks. */
1750#ifndef YYINITDEPTH
1751# define YYINITDEPTH 200
1752#endif
1753
1754/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1755 if the built-in stack extension method is used).
1756
1757 Do not make this value too large; the results are undefined if
1758 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1759 evaluated with infinite-precision integer arithmetic. */
1760
1761#ifndef YYMAXDEPTH
1762# define YYMAXDEPTH 10000
1763#endif
1764
1765
1766
1767#if YYERROR_VERBOSE
1768
1769# ifndef yystrlen
1770# if defined __GLIBC__ && defined _STRING_H
1771# define yystrlen strlen
1772# else
1773/* Return the length of YYSTR. */
1774#if (defined __STDC__ || defined __C99__FUNC__ \
1775 || defined __cplusplus || defined _MSC_VER)
1776static YYSIZE_T
1777yystrlen (const char *yystr)
1778#else
1779static YYSIZE_T
1780yystrlen (yystr)
1781 const char *yystr;
1782#endif
1783{
1784 YYSIZE_T yylen;
1785 for (yylen = 0; yystr[yylen]; yylen++)
1786 continue;
1787 return yylen;
1788}
1789# endif
1790# endif
1791
1792# ifndef yystpcpy
1793# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1794# define yystpcpy stpcpy
1795# else
1796/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1797 YYDEST. */
1798#if (defined __STDC__ || defined __C99__FUNC__ \
1799 || defined __cplusplus || defined _MSC_VER)
1800static char *
1801yystpcpy (char *yydest, const char *yysrc)
1802#else
1803static char *
1804yystpcpy (yydest, yysrc)
1805 char *yydest;
1806 const char *yysrc;
1807#endif
1808{
1809 char *yyd = yydest;
1810 const char *yys = yysrc;
1811
1812 while ((*yyd++ = *yys++) != '\0')
1813 continue;
1814
1815 return yyd - 1;
1816}
1817# endif
1818# endif
1819
1820# ifndef yytnamerr
1821/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
1822 quotes and backslashes, so that it's suitable for yyerror. The
1823 heuristic is that double-quoting is unnecessary unless the string
1824 contains an apostrophe, a comma, or backslash (other than
1825 backslash-backslash). YYSTR is taken from yytname. If YYRES is
1826 null, do not copy; instead, return the length of what the result
1827 would have been. */
1828static YYSIZE_T
1829yytnamerr (char *yyres, const char *yystr)
1830{
1831 if (*yystr == '"')
1832 {
1833 YYSIZE_T yyn = 0;
1834 char const *yyp = yystr;
1835
1836 for (;;)
1837 switch (*++yyp)
1838 {
1839 case '\'':
1840 case ',':
1841 goto do_not_strip_quotes;
1842
1843 case '\\':
1844 if (*++yyp != '\\')
1845 goto do_not_strip_quotes;
1846 /* Fall through. */
1847 default:
1848 if (yyres)
1849 yyres[yyn] = *yyp;
1850 yyn++;
1851 break;
1852
1853 case '"':
1854 if (yyres)
1855 yyres[yyn] = '\0';
1856 return yyn;
1857 }
1858 do_not_strip_quotes: ;
1859 }
1860
1861 if (! yyres)
1862 return yystrlen (yystr);
1863
1864 return yystpcpy (yyres, yystr) - yyres;
1865}
1866# endif
1867
1868/* Copy into YYRESULT an error message about the unexpected token
1869 YYCHAR while in state YYSTATE. Return the number of bytes copied,
1870 including the terminating null byte. If YYRESULT is null, do not
1871 copy anything; just return the number of bytes that would be
1872 copied. As a special case, return 0 if an ordinary "syntax error"
1873 message will do. Return YYSIZE_MAXIMUM if overflow occurs during
1874 size calculation. */
1875static YYSIZE_T
1876yysyntax_error (char *yyresult, int yystate, int yychar)
1877{
1878 int yyn = yypact[yystate];
1879
1880 if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
1881 return 0;
1882 else
1883 {
1884 int yytype = YYTRANSLATE (yychar);
1885 YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
1886 YYSIZE_T yysize = yysize0;
1887 YYSIZE_T yysize1;
1888 int yysize_overflow = 0;
1889 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
1890 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
1891 int yyx;
1892
1893# if 0
1894 /* This is so xgettext sees the translatable formats that are
1895 constructed on the fly. */
1896 YY_("syntax error, unexpected %s");
1897 YY_("syntax error, unexpected %s, expecting %s");
1898 YY_("syntax error, unexpected %s, expecting %s or %s");
1899 YY_("syntax error, unexpected %s, expecting %s or %s or %s");
1900 YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
1901# endif
1902 char *yyfmt;
1903 char const *yyf;
1904 static char const yyunexpected[] = "syntax error, unexpected %s";
1905 static char const yyexpecting[] = ", expecting %s";
1906 static char const yyor[] = " or %s";
1907 char yyformat[sizeof yyunexpected
1908 + sizeof yyexpecting - 1
1909 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
1910 * (sizeof yyor - 1))];
1911 char const *yyprefix = yyexpecting;
1912
1913 /* Start YYX at -YYN if negative to avoid negative indexes in
1914 YYCHECK. */
1915 int yyxbegin = yyn < 0 ? -yyn : 0;
1916
1917 /* Stay within bounds of both yycheck and yytname. */
1918 int yychecklim = YYLAST - yyn + 1;
1919 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
1920 int yycount = 1;
1921
1922 yyarg[0] = yytname[yytype];
1923 yyfmt = yystpcpy (yyformat, yyunexpected);
1924
1925 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
1926 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1927 {
1928 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
1929 {
1930 yycount = 1;
1931 yysize = yysize0;
1932 yyformat[sizeof yyunexpected - 1] = '\0';
1933 break;
1934 }
1935 yyarg[yycount++] = yytname[yyx];
1936 yysize1 = yysize + yytnamerr (0, yytname[yyx]);
1937 yysize_overflow |= (yysize1 < yysize);
1938 yysize = yysize1;
1939 yyfmt = yystpcpy (yyfmt, yyprefix);
1940 yyprefix = yyor;
1941 }
1942
1943 yyf = YY_(yyformat);
1944 yysize1 = yysize + yystrlen (yyf);
1945 yysize_overflow |= (yysize1 < yysize);
1946 yysize = yysize1;
1947
1948 if (yysize_overflow)
1949 return YYSIZE_MAXIMUM;
1950
1951 if (yyresult)
1952 {
1953 /* Avoid sprintf, as that infringes on the user's name space.
1954 Don't have undefined behavior even if the translation
1955 produced a string with the wrong number of "%s"s. */
1956 char *yyp = yyresult;
1957 int yyi = 0;
1958 while ((*yyp = *yyf) != '\0')
1959 {
1960 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
1961 {
1962 yyp += yytnamerr (yyp, yyarg[yyi++]);
1963 yyf += 2;
1964 }
1965 else
1966 {
1967 yyp++;
1968 yyf++;
1969 }
1970 }
1971 }
1972 return yysize;
1973 }
1974}
1975#endif /* YYERROR_VERBOSE */
1976
1977
1978/*-----------------------------------------------.
1979| Release the memory associated to this symbol. |
1980`-----------------------------------------------*/
1981
1982/*ARGSUSED*/
1983#if (defined __STDC__ || defined __C99__FUNC__ \
1984 || defined __cplusplus || defined _MSC_VER)
1985static void
1986yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, TParseContext* context)
1987#else
1988static void
1989yydestruct (yymsg, yytype, yyvaluep, context)
1990 const char *yymsg;
1991 int yytype;
1992 YYSTYPE *yyvaluep;
1993 TParseContext* context;
1994#endif
1995{
1996 YYUSE (yyvaluep);
1997 YYUSE (context);
1998
1999 if (!yymsg)
2000 yymsg = "Deleting";
2001 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2002
2003 switch (yytype)
2004 {
2005
2006 default:
2007 break;
2008 }
2009}
2010
2011/* Prevent warnings from -Wmissing-prototypes. */
2012#ifdef YYPARSE_PARAM
2013#if defined __STDC__ || defined __cplusplus
2014int yyparse (void *YYPARSE_PARAM);
2015#else
2016int yyparse ();
2017#endif
2018#else /* ! YYPARSE_PARAM */
2019#if defined __STDC__ || defined __cplusplus
2020int yyparse (TParseContext* context);
2021#else
2022int yyparse ();
2023#endif
2024#endif /* ! YYPARSE_PARAM */
2025
2026
2027
2028
2029
2030/*-------------------------.
2031| yyparse or yypush_parse. |
2032`-------------------------*/
2033
2034#ifdef YYPARSE_PARAM
2035#if (defined __STDC__ || defined __C99__FUNC__ \
2036 || defined __cplusplus || defined _MSC_VER)
2037int
2038yyparse (void *YYPARSE_PARAM)
2039#else
2040int
2041yyparse (YYPARSE_PARAM)
2042 void *YYPARSE_PARAM;
2043#endif
2044#else /* ! YYPARSE_PARAM */
2045#if (defined __STDC__ || defined __C99__FUNC__ \
2046 || defined __cplusplus || defined _MSC_VER)
2047int
2048yyparse (TParseContext* context)
2049#else
2050int
2051yyparse (context)
2052 TParseContext* context;
2053#endif
2054#endif
2055{
2056/* The lookahead symbol. */
2057int yychar;
2058
2059/* The semantic value of the lookahead symbol. */
2060YYSTYPE yylval;
2061
2062 /* Number of syntax errors so far. */
2063 int yynerrs;
2064
2065 int yystate;
2066 /* Number of tokens to shift before error messages enabled. */
2067 int yyerrstatus;
2068
2069 /* The stacks and their tools:
2070 `yyss': related to states.
2071 `yyvs': related to semantic values.
2072
2073 Refer to the stacks thru separate pointers, to allow yyoverflow
2074 to reallocate them elsewhere. */
2075
2076 /* The state stack. */
2077 yytype_int16 yyssa[YYINITDEPTH];
2078 yytype_int16 *yyss;
2079 yytype_int16 *yyssp;
2080
2081 /* The semantic value stack. */
2082 YYSTYPE yyvsa[YYINITDEPTH];
2083 YYSTYPE *yyvs;
2084 YYSTYPE *yyvsp;
2085
2086 YYSIZE_T yystacksize;
2087
2088 int yyn;
2089 int yyresult;
2090 /* Lookahead token as an internal (translated) token number. */
2091 int yytoken;
2092 /* The variables used to return semantic value and location from the
2093 action routines. */
2094 YYSTYPE yyval;
2095
2096#if YYERROR_VERBOSE
2097 /* Buffer for error messages, and its allocated size. */
2098 char yymsgbuf[128];
2099 char *yymsg = yymsgbuf;
2100 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2101#endif
2102
2103#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
2104
2105 /* The number of symbols on the RHS of the reduced rule.
2106 Keep to zero when no symbol should be popped. */
2107 int yylen = 0;
2108
2109 yytoken = 0;
2110 yyss = yyssa;
2111 yyvs = yyvsa;
2112 yystacksize = YYINITDEPTH;
2113
2114 YYDPRINTF ((stderr, "Starting parse\n"));
2115
2116 yystate = 0;
2117 yyerrstatus = 0;
2118 yynerrs = 0;
2119 yychar = YYEMPTY; /* Cause a token to be read. */
2120
2121 /* Initialize stack pointers.
2122 Waste one element of value and location stack
2123 so that they stay on the same level as the state stack.
2124 The wasted elements are never initialized. */
2125 yyssp = yyss;
2126 yyvsp = yyvs;
2127
2128 goto yysetstate;
2129
2130/*------------------------------------------------------------.
2131| yynewstate -- Push a new state, which is found in yystate. |
2132`------------------------------------------------------------*/
2133 yynewstate:
2134 /* In all cases, when you get here, the value and location stacks
2135 have just been pushed. So pushing a state here evens the stacks. */
2136 yyssp++;
2137
2138 yysetstate:
2139 *yyssp = yystate;
2140
2141 if (yyss + yystacksize - 1 <= yyssp)
2142 {
2143 /* Get the current used size of the three stacks, in elements. */
2144 YYSIZE_T yysize = yyssp - yyss + 1;
2145
2146#ifdef yyoverflow
2147 {
2148 /* Give user a chance to reallocate the stack. Use copies of
2149 these so that the &'s don't force the real ones into
2150 memory. */
2151 YYSTYPE *yyvs1 = yyvs;
2152 yytype_int16 *yyss1 = yyss;
2153
2154 /* Each stack pointer address is followed by the size of the
2155 data in use in that stack, in bytes. This used to be a
2156 conditional around just the two extra args, but that might
2157 be undefined if yyoverflow is a macro. */
2158 yyoverflow (YY_("memory exhausted"),
2159 &yyss1, yysize * sizeof (*yyssp),
2160 &yyvs1, yysize * sizeof (*yyvsp),
2161 &yystacksize);
2162
2163 yyss = yyss1;
2164 yyvs = yyvs1;
2165 }
2166#else /* no yyoverflow */
2167# ifndef YYSTACK_RELOCATE
2168 goto yyexhaustedlab;
2169# else
2170 /* Extend the stack our own way. */
2171 if (YYMAXDEPTH <= yystacksize)
2172 goto yyexhaustedlab;
2173 yystacksize *= 2;
2174 if (YYMAXDEPTH < yystacksize)
2175 yystacksize = YYMAXDEPTH;
2176
2177 {
2178 yytype_int16 *yyss1 = yyss;
2179 union yyalloc *yyptr =
2180 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2181 if (! yyptr)
2182 goto yyexhaustedlab;
2183 YYSTACK_RELOCATE (yyss_alloc, yyss);
2184 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2185# undef YYSTACK_RELOCATE
2186 if (yyss1 != yyssa)
2187 YYSTACK_FREE (yyss1);
2188 }
2189# endif
2190#endif /* no yyoverflow */
2191
2192 yyssp = yyss + yysize - 1;
2193 yyvsp = yyvs + yysize - 1;
2194
2195 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2196 (unsigned long int) yystacksize));
2197
2198 if (yyss + yystacksize - 1 <= yyssp)
2199 YYABORT;
2200 }
2201
2202 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2203
2204 if (yystate == YYFINAL)
2205 YYACCEPT;
2206
2207 goto yybackup;
2208
2209/*-----------.
2210| yybackup. |
2211`-----------*/
2212yybackup:
2213
2214 /* Do appropriate processing given the current state. Read a
2215 lookahead token if we need one and don't already have one. */
2216
2217 /* First try to decide what to do without reference to lookahead token. */
2218 yyn = yypact[yystate];
2219 if (yyn == YYPACT_NINF)
2220 goto yydefault;
2221
2222 /* Not known => get a lookahead token if don't already have one. */
2223
2224 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2225 if (yychar == YYEMPTY)
2226 {
2227 YYDPRINTF ((stderr, "Reading a token: "));
2228 yychar = YYLEX;
2229 }
2230
2231 if (yychar <= YYEOF)
2232 {
2233 yychar = yytoken = YYEOF;
2234 YYDPRINTF ((stderr, "Now at end of input.\n"));
2235 }
2236 else
2237 {
2238 yytoken = YYTRANSLATE (yychar);
2239 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2240 }
2241
2242 /* If the proper action on seeing token YYTOKEN is to reduce or to
2243 detect an error, take that action. */
2244 yyn += yytoken;
2245 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2246 goto yydefault;
2247 yyn = yytable[yyn];
2248 if (yyn <= 0)
2249 {
2250 if (yyn == 0 || yyn == YYTABLE_NINF)
2251 goto yyerrlab;
2252 yyn = -yyn;
2253 goto yyreduce;
2254 }
2255
2256 /* Count tokens shifted since error; after three, turn off error
2257 status. */
2258 if (yyerrstatus)
2259 yyerrstatus--;
2260
2261 /* Shift the lookahead token. */
2262 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2263
2264 /* Discard the shifted token. */
2265 yychar = YYEMPTY;
2266
2267 yystate = yyn;
2268 *++yyvsp = yylval;
2269
2270 goto yynewstate;
2271
2272
2273/*-----------------------------------------------------------.
2274| yydefault -- do the default action for the current state. |
2275`-----------------------------------------------------------*/
2276yydefault:
2277 yyn = yydefact[yystate];
2278 if (yyn == 0)
2279 goto yyerrlab;
2280 goto yyreduce;
2281
2282
2283/*-----------------------------.
2284| yyreduce -- Do a reduction. |
2285`-----------------------------*/
2286yyreduce:
2287 /* yyn is the number of a rule to reduce with. */
2288 yylen = yyr2[yyn];
2289
2290 /* If YYLEN is nonzero, implement the default value of the action:
2291 `$$ = $1'.
2292
2293 Otherwise, the following line sets YYVAL to garbage.
2294 This behavior is undocumented and Bison
2295 users should not rely upon it. Assigning to YYVAL
2296 unconditionally makes the parser a bit smaller, and it avoids a
2297 GCC warning that YYVAL may be used uninitialized. */
2298 yyval = yyvsp[1-yylen];
2299
2300
2301 YY_REDUCE_PRINT (yyn);
2302 switch (yyn)
2303 {
2304 case 2:
2305
2306 {
2307 // The symbol table search was done in the lexical phase
2308 const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol;
2309 const TVariable* variable;
2310 if (symbol == 0) {
2311 context->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str());
2312 context->recover();
2313 TType type(EbtFloat, EbpUndefined);
2314 TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05002315 context->symbolTable.declare(*fakeVariable);
John Bauman66b8ab22014-05-06 15:57:45 -04002316 variable = fakeVariable;
2317 } else {
2318 // This identifier can only be a variable type symbol
2319 if (! symbol->isVariable()) {
2320 context->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str());
2321 context->recover();
2322 }
2323 variable = static_cast<const TVariable*>(symbol);
2324 }
2325
2326 // don't delete $1.string, it's used by error recovery, and the pool
2327 // pop will reclaim the memory
2328
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002329 if (variable->getType().getQualifier() == EvqConstExpr ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002330 ConstantUnion* constArray = variable->getConstPointer();
2331 TType t(variable->getType());
2332 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line);
2333 } else
2334 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2335 variable->getName(),
2336 variable->getType(), (yyvsp[(1) - (1)].lex).line);
2337 }
2338 break;
2339
2340 case 3:
2341
2342 {
2343 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2344 }
2345 break;
2346
2347 case 4:
2348
2349 {
John Bauman66b8ab22014-05-06 15:57:45 -04002350 ConstantUnion *unionArray = new ConstantUnion[1];
2351 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002352 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002353 }
2354 break;
2355
2356 case 5:
2357
2358 {
2359 ConstantUnion *unionArray = new ConstantUnion[1];
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002360 unionArray->setUConst((yyvsp[(1) - (1)].lex).u);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002361 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002362 }
2363 break;
2364
2365 case 6:
2366
2367 {
2368 ConstantUnion *unionArray = new ConstantUnion[1];
John Bauman66b8ab22014-05-06 15:57:45 -04002369 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002370 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002371 }
2372 break;
2373
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002374 case 7:
John Bauman66b8ab22014-05-06 15:57:45 -04002375
2376 {
2377 ConstantUnion *unionArray = new ConstantUnion[1];
2378 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002379 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002380 }
2381 break;
2382
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002383 case 8:
John Bauman66b8ab22014-05-06 15:57:45 -04002384
2385 {
2386 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
2387 }
2388 break;
2389
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002390 case 9:
John Bauman66b8ab22014-05-06 15:57:45 -04002391
2392 {
2393 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2394 }
2395 break;
2396
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002397 case 10:
John Bauman66b8ab22014-05-06 15:57:45 -04002398
2399 {
2400 if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) {
2401 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode())
2402 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", (yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()->getSymbol().c_str());
2403 else
2404 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", "expression");
2405 context->recover();
2406 }
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002407 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConstExpr) {
John Bauman66b8ab22014-05-06 15:57:45 -04002408 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays
Nicolas Capens198529d2015-02-10 13:54:19 -05002409 (yyval.interm.intermTypedNode) = context->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002410 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors
2411 TVectorFields fields;
2412 fields.num = 1;
Nicolas Capens198529d2015-02-10 13:54:19 -05002413 fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0); // need to do it this way because v.xy sends fields integer array
John Bauman66b8ab22014-05-06 15:57:45 -04002414 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2415 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices
Nicolas Capens198529d2015-02-10 13:54:19 -05002416 (yyval.interm.intermTypedNode) = context->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002417 }
2418 } else {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002419 if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConstExpr) {
Nicolas Capens198529d2015-02-10 13:54:19 -05002420 if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() ) {
John Bauman66b8ab22014-05-06 15:57:45 -04002421 std::stringstream extraInfoStream;
Nicolas Capens198529d2015-02-10 13:54:19 -05002422 extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
John Bauman66b8ab22014-05-06 15:57:45 -04002423 std::string extraInfo = extraInfoStream.str();
2424 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
2425 context->recover();
2426 } else {
2427 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2428 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
Nicolas Capens198529d2015-02-10 13:54:19 -05002429 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0)) {
2430 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), true, (yyvsp[(2) - (4)].lex).line))
John Bauman66b8ab22014-05-06 15:57:45 -04002431 context->recover();
2432 } else {
2433 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line))
2434 context->recover();
2435 }
Nicolas Capens198529d2015-02-10 13:54:19 -05002436 } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) {
John Bauman66b8ab22014-05-06 15:57:45 -04002437 std::stringstream extraInfoStream;
Nicolas Capens198529d2015-02-10 13:54:19 -05002438 extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
John Bauman66b8ab22014-05-06 15:57:45 -04002439 std::string extraInfo = extraInfoStream.str();
2440 context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
2441 context->recover();
2442 }
2443 }
2444 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2445 }
2446 } else {
2447 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
2448 context->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable");
2449 context->recover();
2450 }
2451
2452 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
2453 }
2454 }
2455 if ((yyval.interm.intermTypedNode) == 0) {
2456 ConstantUnion *unionArray = new ConstantUnion[1];
2457 unionArray->setFConst(0.0f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002458 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConstExpr), (yyvsp[(2) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002459 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
2460 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct())
2461 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName()));
2462 else
Alexis Hetub14178b2015-04-13 13:23:20 -04002463 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getSecondarySize()));
John Bauman66b8ab22014-05-06 15:57:45 -04002464
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002465 if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr)
2466 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConstExpr);
2467 } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr)
2468 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConstExpr, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
John Bauman66b8ab22014-05-06 15:57:45 -04002469 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())
2470 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize()));
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002471 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr)
2472 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConstExpr));
John Bauman66b8ab22014-05-06 15:57:45 -04002473 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector())
2474 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary));
2475 else
2476 (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType());
2477 }
2478 break;
2479
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002480 case 11:
John Bauman66b8ab22014-05-06 15:57:45 -04002481
2482 {
2483 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2484 }
2485 break;
2486
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002487 case 12:
John Bauman66b8ab22014-05-06 15:57:45 -04002488
2489 {
2490 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) {
2491 context->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", ".");
2492 context->recover();
2493 }
2494
2495 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) {
2496 TVectorFields fields;
2497 if (! context->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2498 fields.num = 1;
2499 fields.offsets[0] = 0;
2500 context->recover();
2501 }
2502
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002503 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr) { // constant folding for vector fields
John Bauman66b8ab22014-05-06 15:57:45 -04002504 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line);
2505 if ((yyval.interm.intermTypedNode) == 0) {
2506 context->recover();
2507 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2508 }
2509 else
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002510 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqConstExpr, (int) (*(yyvsp[(3) - (3)].lex).string).size()));
John Bauman66b8ab22014-05-06 15:57:45 -04002511 } else {
2512 TString vectorString = *(yyvsp[(3) - (3)].lex).string;
2513 TIntermTyped* index = context->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line);
2514 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2515 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (int) vectorString.size()));
2516 }
2517 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) {
2518 TMatrixFields fields;
2519 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) {
2520 fields.wholeRow = false;
2521 fields.wholeCol = false;
2522 fields.row = 0;
2523 fields.col = 0;
2524 context->recover();
2525 }
2526
2527 if (fields.wholeRow || fields.wholeCol) {
2528 context->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", ".");
2529 context->recover();
2530 ConstantUnion *unionArray = new ConstantUnion[1];
2531 unionArray->setIConst(0);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002532 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(3) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002533 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2534 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize()));
2535 } else {
2536 ConstantUnion *unionArray = new ConstantUnion[1];
2537 unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002538 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConstExpr), (yyvsp[(3) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002539 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2540 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision()));
2541 }
2542 } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) {
2543 bool fieldFound = false;
2544 const TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct();
2545 if (fields == 0) {
2546 context->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error");
2547 context->recover();
2548 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2549 } else {
2550 unsigned int i;
2551 for (i = 0; i < fields->size(); ++i) {
2552 if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) {
2553 fieldFound = true;
2554 break;
2555 }
2556 }
2557 if (fieldFound) {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002558 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr) {
John Bauman66b8ab22014-05-06 15:57:45 -04002559 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2560 if ((yyval.interm.intermTypedNode) == 0) {
2561 context->recover();
2562 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2563 }
2564 else {
2565 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2566 // change the qualifier of the return type, not of the structure field
2567 // as the structure definition is shared between various structures.
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002568 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConstExpr);
John Bauman66b8ab22014-05-06 15:57:45 -04002569 }
2570 } else {
2571 ConstantUnion *unionArray = new ConstantUnion[1];
2572 unionArray->setIConst(i);
2573 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line);
2574 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
2575 (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type);
2576 }
2577 } else {
2578 context->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str());
2579 context->recover();
2580 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2581 }
2582 }
2583 } else {
2584 context->error((yyvsp[(2) - (3)].lex).line, " field selection requires structure, vector, or matrix on left hand side", (yyvsp[(3) - (3)].lex).string->c_str());
2585 context->recover();
2586 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2587 }
2588 // don't delete $3.string, it's from the pool
2589 }
2590 break;
2591
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002592 case 13:
John Bauman66b8ab22014-05-06 15:57:45 -04002593
2594 {
2595 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2596 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002597 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002598 if ((yyval.interm.intermTypedNode) == 0) {
2599 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2600 context->recover();
2601 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2602 }
2603 }
2604 break;
2605
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002606 case 14:
John Bauman66b8ab22014-05-06 15:57:45 -04002607
2608 {
2609 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2610 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002611 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002612 if ((yyval.interm.intermTypedNode) == 0) {
2613 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2614 context->recover();
2615 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2616 }
2617 }
2618 break;
2619
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002620 case 15:
John Bauman66b8ab22014-05-06 15:57:45 -04002621
2622 {
2623 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2624 context->recover();
2625 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2626 }
2627 break;
2628
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002629 case 16:
John Bauman66b8ab22014-05-06 15:57:45 -04002630
2631 {
2632 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2633 TOperator op = fnCall->getBuiltInOp();
2634
2635 if (op != EOpNull)
2636 {
2637 //
2638 // Then this should be a constructor.
2639 // Don't go through the symbol table for constructors.
2640 // Their parameters will be verified algorithmically.
2641 //
2642 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2643 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2644 (yyval.interm.intermTypedNode) = 0;
2645 } else {
2646 //
2647 // It's a constructor, of type 'type'.
2648 //
2649 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2650 }
2651
2652 if ((yyval.interm.intermTypedNode) == 0) {
2653 context->recover();
2654 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2655 }
2656 (yyval.interm.intermTypedNode)->setType(type);
2657 } else {
2658 //
2659 // Not a constructor. Find it in the symbol table.
2660 //
2661 const TFunction* fnCandidate;
2662 bool builtIn;
2663 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn);
2664 if (fnCandidate) {
2665 //
2666 // A declared function.
2667 //
2668 if (builtIn && !fnCandidate->getExtension().empty() &&
2669 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2670 context->recover();
2671 }
2672 op = fnCandidate->getBuiltInOp();
2673 if (builtIn && op != EOpNull) {
2674 //
2675 // A function call mapped to a built-in operation.
2676 //
2677 if (fnCandidate->getParamCount() == 1) {
2678 //
2679 // Treat it like a built-in unary operator.
2680 //
John Baumand4ae8632014-05-06 16:18:33 -04002681 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0);
John Bauman66b8ab22014-05-06 15:57:45 -04002682 if ((yyval.interm.intermTypedNode) == 0) {
2683 std::stringstream extraInfoStream;
2684 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2685 std::string extraInfo = extraInfoStream.str();
2686 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
2687 YYERROR;
2688 }
2689 } else {
2690 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2691 }
2692 } else {
2693 // This is a real function call
2694
2695 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2696 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2697
2698 // this is how we know whether the given function is a builtIn function or a user defined function
2699 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2700 // if builtIn == true, it's definitely a builtIn function with EOpNull
2701 if (!builtIn)
2702 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2703 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2704
2705 TQualifier qual;
2706 for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
2707 qual = fnCandidate->getParam(i).type->getQualifier();
2708 if (qual == EvqOut || qual == EvqInOut) {
2709 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
2710 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
2711 context->recover();
2712 }
2713 }
2714 }
2715 }
2716 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2717 } else {
2718 // error message was put out by PaFindFunction()
2719 // Put on a dummy node for error recovery
2720 ConstantUnion *unionArray = new ConstantUnion[1];
2721 unionArray->setFConst(0.0f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002722 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002723 context->recover();
2724 }
2725 }
2726 delete fnCall;
2727 }
2728 break;
2729
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002730 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002731
2732 {
2733 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2734 }
2735 break;
2736
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002737 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002738
2739 {
2740 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
2741 context->recover();
2742 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2743 }
2744 break;
2745
John Bauman66b8ab22014-05-06 15:57:45 -04002746 case 19:
2747
2748 {
2749 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2750 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2751 }
2752 break;
2753
2754 case 20:
2755
2756 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002757 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2758 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2759 }
2760 break;
2761
2762 case 21:
2763
2764 {
John Bauman66b8ab22014-05-06 15:57:45 -04002765 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2766 (yyval.interm).intermNode = 0;
2767 }
2768 break;
2769
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002770 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002771
2772 {
2773 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2774 (yyval.interm).intermNode = 0;
2775 }
2776 break;
2777
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002778 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002779
2780 {
2781 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2782 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2783 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2784 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2785 }
2786 break;
2787
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002788 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002789
2790 {
2791 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2792 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2793 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2794 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2795 }
2796 break;
2797
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002798 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002799
2800 {
2801 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2802 }
2803 break;
2804
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002805 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002806
2807 {
2808 //
2809 // Constructor
2810 //
2811 TOperator op = EOpNull;
2812 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2813 op = EOpConstructStruct;
2814 } else {
2815 switch ((yyvsp[(1) - (1)].interm.type).type) {
2816 case EbtFloat:
Alexis Hetub14178b2015-04-13 13:23:20 -04002817 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2818 case 1:
2819 op = EOpConstructFloat; break;
2820 case 2:
2821 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2822 case 1: op = EOpConstructVec2; break;
2823 case 2: op = EOpConstructMat2; break;
2824 case 3: op = EOpConstructMat2x3; break;
2825 case 4: op = EOpConstructMat2x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002826 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002827 break;
2828 case 3:
2829 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2830 case 1: op = EOpConstructVec3; break;
2831 case 2: op = EOpConstructMat3x2; break;
2832 case 3: op = EOpConstructMat3; break;
2833 case 4: op = EOpConstructMat3x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002834 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002835 break;
2836 case 4:
2837 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2838 case 1: op = EOpConstructVec4; break;
2839 case 2: op = EOpConstructMat4x2; break;
2840 case 3: op = EOpConstructMat4x3; break;
2841 case 4: op = EOpConstructMat4; break;
2842 }
2843 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002844 }
2845 break;
2846 case EbtInt:
Alexis Hetub14178b2015-04-13 13:23:20 -04002847 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002848 case 1: op = EOpConstructInt; break;
2849 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2850 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2851 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2852 }
2853 break;
Alexis Hetub7c46af2015-05-12 15:58:09 -04002854 case EbtUInt:
2855 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2856 case 1: op = EOpConstructUInt; break;
2857 case 2: FRAG_VERT_ONLY("uvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec2; break;
2858 case 3: FRAG_VERT_ONLY("uvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec3; break;
2859 case 4: FRAG_VERT_ONLY("uvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec4; break;
2860 }
2861 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002862 case EbtBool:
Alexis Hetub14178b2015-04-13 13:23:20 -04002863 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002864 case 1: op = EOpConstructBool; break;
2865 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2866 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2867 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2868 }
2869 break;
2870 default: break;
2871 }
2872 if (op == EOpNull) {
2873 context->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type));
2874 context->recover();
2875 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2876 op = EOpConstructFloat;
2877 }
2878 }
2879 TString tempString;
2880 TType type((yyvsp[(1) - (1)].interm.type));
2881 TFunction *function = new TFunction(&tempString, type, op);
2882 (yyval.interm.function) = function;
2883 }
2884 break;
2885
John Bauman66b8ab22014-05-06 15:57:45 -04002886 case 27:
2887
2888 {
2889 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2890 context->recover();
2891 TType type(EbtVoid, EbpUndefined);
2892 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2893 (yyval.interm.function) = function;
2894 }
2895 break;
2896
2897 case 28:
2898
2899 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002900 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2901 context->recover();
2902 TType type(EbtVoid, EbpUndefined);
2903 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2904 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002905 }
2906 break;
2907
2908 case 29:
2909
2910 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002911 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2912 }
2913 break;
2914
2915 case 30:
2916
2917 {
John Bauman66b8ab22014-05-06 15:57:45 -04002918 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2919 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002920 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002921 if ((yyval.interm.intermTypedNode) == 0) {
2922 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2923 context->recover();
2924 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2925 }
2926 }
2927 break;
2928
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002929 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002930
2931 {
2932 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2933 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002934 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002935 if ((yyval.interm.intermTypedNode) == 0) {
2936 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2937 context->recover();
2938 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2939 }
2940 }
2941 break;
2942
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002943 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002944
2945 {
2946 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
John Baumand4ae8632014-05-06 16:18:33 -04002947 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002948 if ((yyval.interm.intermTypedNode) == 0) {
2949 const char* errorOp = "";
2950 switch((yyvsp[(1) - (2)].interm).op) {
2951 case EOpNegative: errorOp = "-"; break;
2952 case EOpLogicalNot: errorOp = "!"; break;
2953 default: break;
2954 }
2955 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2956 context->recover();
2957 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2958 }
2959 } else
2960 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2961 }
2962 break;
2963
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002964 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002965
2966 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
2967 break;
2968
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002969 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002970
2971 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
2972 break;
2973
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002974 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002975
2976 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
2977 break;
2978
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002979 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002980
Alexis Hetu17809052015-05-13 11:28:22 -04002981 {
2982 ES3_ONLY("~", (yyvsp[(1) - (1)].lex).line);
2983 (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseNot;
2984 }
John Bauman66b8ab22014-05-06 15:57:45 -04002985 break;
2986
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002987 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002988
Alexis Hetu17809052015-05-13 11:28:22 -04002989 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2990 break;
2991
2992 case 38:
2993
John Bauman66b8ab22014-05-06 15:57:45 -04002994 {
2995 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04002996 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002997 if ((yyval.interm.intermTypedNode) == 0) {
2998 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2999 context->recover();
3000 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3001 }
3002 }
3003 break;
3004
Alexis Hetu17809052015-05-13 11:28:22 -04003005 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04003006
3007 {
3008 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04003009 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003010 if ((yyval.interm.intermTypedNode) == 0) {
3011 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3012 context->recover();
3013 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3014 }
3015 }
3016 break;
3017
Alexis Hetu17809052015-05-13 11:28:22 -04003018 case 40:
3019
3020 {
3021 FRAG_VERT_ONLY("%", (yyvsp[(2) - (3)].lex).line);
3022 ES3_ONLY("%", (yyvsp[(2) - (3)].lex).line);
3023 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpIMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3024 if ((yyval.interm.intermTypedNode) == 0) {
3025 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "%", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3026 context->recover();
3027 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3028 }
3029 }
3030 break;
3031
3032 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04003033
3034 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3035 break;
3036
Alexis Hetu17809052015-05-13 11:28:22 -04003037 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04003038
3039 {
John Baumand4ae8632014-05-06 16:18:33 -04003040 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003041 if ((yyval.interm.intermTypedNode) == 0) {
3042 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3043 context->recover();
3044 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3045 }
3046 }
3047 break;
3048
Alexis Hetu17809052015-05-13 11:28:22 -04003049 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04003050
3051 {
John Baumand4ae8632014-05-06 16:18:33 -04003052 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003053 if ((yyval.interm.intermTypedNode) == 0) {
3054 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3055 context->recover();
3056 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3057 }
3058 }
3059 break;
3060
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003061 case 44:
3062
Alexis Hetu17809052015-05-13 11:28:22 -04003063 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3064 break;
3065
3066 case 45:
3067
3068 {
3069 ES3_ONLY("<<", (yyvsp[(2) - (3)].lex).line);
3070 context->intermediate.addBinaryMath(EOpBitShiftLeft, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3071 if ((yyval.interm.intermTypedNode) == 0) {
3072 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3073 context->recover();
3074 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3075 }
3076 }
3077 break;
3078
3079 case 46:
3080
3081 {
3082 ES3_ONLY(">>", (yyvsp[(2) - (3)].lex).line);
3083 context->intermediate.addBinaryMath(EOpBitShiftRight, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3084 if ((yyval.interm.intermTypedNode) == 0) {
3085 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">>", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3086 context->recover();
3087 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3088 }
3089 }
3090 break;
3091
3092 case 47:
3093
3094 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3095 break;
3096
3097 case 48:
3098
John Bauman66b8ab22014-05-06 15:57:45 -04003099 {
John Baumand4ae8632014-05-06 16:18:33 -04003100 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003101 if ((yyval.interm.intermTypedNode) == 0) {
3102 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3103 context->recover();
3104 ConstantUnion *unionArray = new ConstantUnion[1];
3105 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003106 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003107 }
3108 }
3109 break;
3110
Alexis Hetu17809052015-05-13 11:28:22 -04003111 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04003112
3113 {
John Baumand4ae8632014-05-06 16:18:33 -04003114 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003115 if ((yyval.interm.intermTypedNode) == 0) {
3116 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3117 context->recover();
3118 ConstantUnion *unionArray = new ConstantUnion[1];
3119 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003120 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003121 }
3122 }
3123 break;
3124
Alexis Hetu17809052015-05-13 11:28:22 -04003125 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04003126
3127 {
John Baumand4ae8632014-05-06 16:18:33 -04003128 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003129 if ((yyval.interm.intermTypedNode) == 0) {
3130 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3131 context->recover();
3132 ConstantUnion *unionArray = new ConstantUnion[1];
3133 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003134 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003135 }
3136 }
3137 break;
3138
Alexis Hetu17809052015-05-13 11:28:22 -04003139 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04003140
3141 {
John Baumand4ae8632014-05-06 16:18:33 -04003142 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003143 if ((yyval.interm.intermTypedNode) == 0) {
3144 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3145 context->recover();
3146 ConstantUnion *unionArray = new ConstantUnion[1];
3147 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003148 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003149 }
3150 }
3151 break;
3152
Alexis Hetu17809052015-05-13 11:28:22 -04003153 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04003154
3155 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3156 break;
3157
Alexis Hetu17809052015-05-13 11:28:22 -04003158 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04003159
3160 {
John Baumand4ae8632014-05-06 16:18:33 -04003161 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003162 if ((yyval.interm.intermTypedNode) == 0) {
3163 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3164 context->recover();
3165 ConstantUnion *unionArray = new ConstantUnion[1];
3166 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003167 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003168 }
3169 }
3170 break;
3171
Alexis Hetu17809052015-05-13 11:28:22 -04003172 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04003173
3174 {
John Baumand4ae8632014-05-06 16:18:33 -04003175 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003176 if ((yyval.interm.intermTypedNode) == 0) {
3177 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3178 context->recover();
3179 ConstantUnion *unionArray = new ConstantUnion[1];
3180 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003181 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003182 }
3183 }
3184 break;
3185
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003186 case 55:
3187
Alexis Hetu17809052015-05-13 11:28:22 -04003188 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3189 break;
3190
3191 case 56:
3192
3193 {
3194 ES3_ONLY("&", (yyvsp[(2) - (3)].lex).line);
3195 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3196 if ((yyval.interm.intermTypedNode) == 0) {
3197 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3198 context->recover();
3199 ConstantUnion *unionArray = new ConstantUnion[1];
3200 unionArray->setBConst(false);
3201 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3202 }
3203 }
3204 break;
3205
3206 case 57:
3207
3208 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3209 break;
3210
3211 case 58:
3212
3213 {
3214 ES3_ONLY("^", (yyvsp[(2) - (3)].lex).line);
3215 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3216 if ((yyval.interm.intermTypedNode) == 0) {
3217 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3218 context->recover();
3219 ConstantUnion *unionArray = new ConstantUnion[1];
3220 unionArray->setBConst(false);
3221 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3222 }
3223 }
3224 break;
3225
3226 case 59:
3227
3228 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3229 break;
3230
3231 case 60:
3232
3233 {
3234 ES3_ONLY("|", (yyvsp[(2) - (3)].lex).line);
3235 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3236 if ((yyval.interm.intermTypedNode) == 0) {
3237 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "|", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3238 context->recover();
3239 ConstantUnion *unionArray = new ConstantUnion[1];
3240 unionArray->setBConst(false);
3241 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3242 }
3243 }
3244 break;
3245
3246 case 61:
3247
3248 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3249 break;
3250
3251 case 62:
3252
John Bauman66b8ab22014-05-06 15:57:45 -04003253 {
John Baumand4ae8632014-05-06 16:18:33 -04003254 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003255 if ((yyval.interm.intermTypedNode) == 0) {
3256 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3257 context->recover();
3258 ConstantUnion *unionArray = new ConstantUnion[1];
3259 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003260 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003261 }
3262 }
3263 break;
3264
Alexis Hetu17809052015-05-13 11:28:22 -04003265 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04003266
3267 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3268 break;
3269
Alexis Hetu17809052015-05-13 11:28:22 -04003270 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003271
3272 {
John Baumand4ae8632014-05-06 16:18:33 -04003273 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003274 if ((yyval.interm.intermTypedNode) == 0) {
3275 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3276 context->recover();
3277 ConstantUnion *unionArray = new ConstantUnion[1];
3278 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003279 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003280 }
3281 }
3282 break;
3283
Alexis Hetu17809052015-05-13 11:28:22 -04003284 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003285
3286 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3287 break;
3288
Alexis Hetu17809052015-05-13 11:28:22 -04003289 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003290
3291 {
John Baumand4ae8632014-05-06 16:18:33 -04003292 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003293 if ((yyval.interm.intermTypedNode) == 0) {
3294 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3295 context->recover();
3296 ConstantUnion *unionArray = new ConstantUnion[1];
3297 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003298 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003299 }
3300 }
3301 break;
3302
Alexis Hetu17809052015-05-13 11:28:22 -04003303 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003304
3305 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3306 break;
3307
Alexis Hetu17809052015-05-13 11:28:22 -04003308 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003309
3310 {
3311 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3312 context->recover();
3313
3314 (yyval.interm.intermTypedNode) = context->intermediate.addSelection((yyvsp[(1) - (5)].interm.intermTypedNode), (yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.intermTypedNode), (yyvsp[(2) - (5)].lex).line);
3315 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3316 (yyval.interm.intermTypedNode) = 0;
3317
3318 if ((yyval.interm.intermTypedNode) == 0) {
3319 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3320 context->recover();
3321 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3322 }
3323 }
3324 break;
3325
Alexis Hetu17809052015-05-13 11:28:22 -04003326 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003327
3328 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3329 break;
3330
Alexis Hetu17809052015-05-13 11:28:22 -04003331 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003332
3333 {
3334 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3335 context->recover();
3336 (yyval.interm.intermTypedNode) = context->intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].interm).line);
3337 if ((yyval.interm.intermTypedNode) == 0) {
3338 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3339 context->recover();
3340 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3341 }
3342 }
3343 break;
3344
Alexis Hetu17809052015-05-13 11:28:22 -04003345 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003346
3347 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
3348 break;
3349
Alexis Hetu17809052015-05-13 11:28:22 -04003350 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003351
3352 { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; }
3353 break;
3354
Alexis Hetu17809052015-05-13 11:28:22 -04003355 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003356
3357 { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; }
3358 break;
3359
Alexis Hetu17809052015-05-13 11:28:22 -04003360 case 74:
3361
3362 { ES3_ONLY("%=", (yyvsp[(1) - (1)].lex).line);
3363 FRAG_VERT_ONLY("%=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpIModAssign; }
3364 break;
3365
3366 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003367
3368 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
3369 break;
3370
Alexis Hetu17809052015-05-13 11:28:22 -04003371 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003372
3373 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
3374 break;
3375
Alexis Hetu17809052015-05-13 11:28:22 -04003376 case 77:
3377
3378 { ES3_ONLY("<<=", (yyvsp[(1) - (1)].lex).line);
3379 FRAG_VERT_ONLY("<<=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftLeftAssign; }
3380 break;
3381
3382 case 78:
3383
3384 { ES3_ONLY(">>=", (yyvsp[(1) - (1)].lex).line);
3385 FRAG_VERT_ONLY(">>=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftRightAssign; }
3386 break;
3387
3388 case 79:
3389
3390 { ES3_ONLY("&=", (yyvsp[(1) - (1)].lex).line);
3391 FRAG_VERT_ONLY("&=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseAndAssign; }
3392 break;
3393
3394 case 80:
3395
3396 { ES3_ONLY("^=", (yyvsp[(1) - (1)].lex).line);
3397 FRAG_VERT_ONLY("^=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseXorAssign; }
3398 break;
3399
3400 case 81:
3401
3402 { ES3_ONLY("|=", (yyvsp[(1) - (1)].lex).line);
3403 FRAG_VERT_ONLY("|=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseOrAssign; }
3404 break;
3405
3406 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003407
3408 {
3409 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3410 }
3411 break;
3412
Alexis Hetu17809052015-05-13 11:28:22 -04003413 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003414
3415 {
3416 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3417 if ((yyval.interm.intermTypedNode) == 0) {
3418 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3419 context->recover();
3420 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3421 }
3422 }
3423 break;
3424
Alexis Hetu17809052015-05-13 11:28:22 -04003425 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003426
3427 {
3428 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3429 context->recover();
3430 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3431 }
3432 break;
3433
Alexis Hetu17809052015-05-13 11:28:22 -04003434 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003435
3436 {
3437 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3438
3439 TIntermAggregate *prototype = new TIntermAggregate;
3440 prototype->setType(function.getReturnType());
3441 prototype->setName(function.getName());
3442
3443 for (int i = 0; i < function.getParamCount(); i++)
3444 {
3445 const TParameter &param = function.getParam(i);
3446 if (param.name != 0)
3447 {
John Baumand4ae8632014-05-06 16:18:33 -04003448 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003449
John Baumand4ae8632014-05-06 16:18:33 -04003450 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003451 }
3452 else
3453 {
3454 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3455 }
3456 }
3457
3458 prototype->setOp(EOpPrototype);
3459 (yyval.interm.intermNode) = prototype;
3460
3461 context->symbolTable.pop();
3462 }
3463 break;
3464
Alexis Hetu17809052015-05-13 11:28:22 -04003465 case 86:
John Bauman66b8ab22014-05-06 15:57:45 -04003466
3467 {
3468 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3469 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3470 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
3471 }
3472 break;
3473
Alexis Hetu17809052015-05-13 11:28:22 -04003474 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003475
3476 {
John Baumand4ae8632014-05-06 16:18:33 -04003477 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3478 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3479 context->recover();
3480 }
John Bauman66b8ab22014-05-06 15:57:45 -04003481 (yyval.interm.intermNode) = 0;
3482 }
3483 break;
3484
Alexis Hetu17809052015-05-13 11:28:22 -04003485 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003486
3487 {
3488 //
3489 // Multiple declarations of the same function are allowed.
3490 //
3491 // If this is a definition, the definition production code will check for redefinitions
3492 // (we don't know at this point if it's a definition or not).
3493 //
3494 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3495 //
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05003496 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04003497 if (prevDec) {
3498 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
3499 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
3500 context->recover();
3501 }
3502 for (int i = 0; i < prevDec->getParamCount(); ++i) {
3503 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
3504 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
3505 context->recover();
3506 }
3507 }
3508 }
3509
3510 //
3511 // If this is a redeclaration, it could also be a definition,
3512 // in which case, we want to use the variable names from this one, and not the one that's
3513 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3514 //
3515 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3516 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3517
3518 // We're at the inner scope level of the function's arguments and body statement.
3519 // Add the function prototype to the surrounding scope instead.
3520 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3521 }
3522 break;
3523
Alexis Hetu17809052015-05-13 11:28:22 -04003524 case 89:
John Bauman66b8ab22014-05-06 15:57:45 -04003525
3526 {
3527 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3528 }
3529 break;
3530
Alexis Hetu17809052015-05-13 11:28:22 -04003531 case 90:
John Bauman66b8ab22014-05-06 15:57:45 -04003532
3533 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003534 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3535 }
3536 break;
3537
Alexis Hetu17809052015-05-13 11:28:22 -04003538 case 91:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003539
3540 {
John Bauman66b8ab22014-05-06 15:57:45 -04003541 // Add the parameter
3542 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3543 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3544 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3545 else
3546 delete (yyvsp[(2) - (2)].interm).param.type;
3547 }
3548 break;
3549
Alexis Hetu17809052015-05-13 11:28:22 -04003550 case 92:
John Bauman66b8ab22014-05-06 15:57:45 -04003551
3552 {
3553 //
3554 // Only first parameter of one-parameter functions can be void
3555 // The check for named parameters not being void is done in parameter_declarator
3556 //
3557 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3558 //
3559 // This parameter > first is void
3560 //
3561 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
3562 context->recover();
3563 delete (yyvsp[(3) - (3)].interm).param.type;
3564 } else {
3565 // Add the parameter
3566 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3567 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3568 }
3569 }
3570 break;
3571
Alexis Hetu17809052015-05-13 11:28:22 -04003572 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003573
3574 {
3575 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
3576 context->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));
3577 context->recover();
3578 }
3579 // make sure a sampler is not involved as well...
3580 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3581 context->recover();
3582
3583 // Add the function as a prototype after parsing it (we do not support recursion)
3584 TFunction *function;
3585 TType type((yyvsp[(1) - (3)].interm.type));
3586 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3587 (yyval.interm.function) = function;
3588
3589 context->symbolTable.push();
3590 }
3591 break;
3592
Alexis Hetu17809052015-05-13 11:28:22 -04003593 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003594
3595 {
3596 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
3597 context->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
3598 context->recover();
3599 }
3600 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3601 context->recover();
3602 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3603 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3604 (yyval.interm).param = param;
3605 }
3606 break;
3607
Alexis Hetu17809052015-05-13 11:28:22 -04003608 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003609
3610 {
3611 // Check that we can make an array out of this type
3612 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3613 context->recover();
3614
3615 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3616 context->recover();
3617
3618 int size;
3619 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3620 context->recover();
3621 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3622
3623 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3624 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3625 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3626 (yyval.interm).param = param;
3627 }
3628 break;
3629
Alexis Hetu17809052015-05-13 11:28:22 -04003630 case 96:
John Bauman66b8ab22014-05-06 15:57:45 -04003631
3632 {
3633 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003634 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
John Bauman66b8ab22014-05-06 15:57:45 -04003635 context->recover();
3636 }
3637 break;
3638
Alexis Hetu17809052015-05-13 11:28:22 -04003639 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003640
3641 {
John Bauman66b8ab22014-05-06 15:57:45 -04003642 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3643 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3644 context->recover();
3645 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3646 context->recover();
3647 }
3648 break;
3649
Alexis Hetu17809052015-05-13 11:28:22 -04003650 case 98:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003651
3652 {
3653 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3654 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3655 context->recover();
3656 }
3657 break;
3658
Alexis Hetu17809052015-05-13 11:28:22 -04003659 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003660
3661 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003662 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3663 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3664 context->recover();
3665 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3666 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003667 }
3668 break;
3669
Alexis Hetu17809052015-05-13 11:28:22 -04003670 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003671
3672 {
3673 (yyval.interm.qualifier) = EvqIn;
3674 }
3675 break;
3676
Alexis Hetu17809052015-05-13 11:28:22 -04003677 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003678
3679 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003680 (yyval.interm.qualifier) = EvqIn;
John Bauman66b8ab22014-05-06 15:57:45 -04003681 }
3682 break;
3683
Alexis Hetu17809052015-05-13 11:28:22 -04003684 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003685
3686 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003687 (yyval.interm.qualifier) = EvqOut;
John Bauman66b8ab22014-05-06 15:57:45 -04003688 }
3689 break;
3690
Alexis Hetu17809052015-05-13 11:28:22 -04003691 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003692
3693 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003694 (yyval.interm.qualifier) = EvqInOut;
3695 }
3696 break;
3697
Alexis Hetu17809052015-05-13 11:28:22 -04003698 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003699
3700 {
John Bauman66b8ab22014-05-06 15:57:45 -04003701 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3702 (yyval.interm).param = param;
3703 }
3704 break;
3705
Alexis Hetu17809052015-05-13 11:28:22 -04003706 case 105:
John Bauman66b8ab22014-05-06 15:57:45 -04003707
3708 {
3709 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3710 }
3711 break;
3712
Alexis Hetu17809052015-05-13 11:28:22 -04003713 case 106:
John Bauman66b8ab22014-05-06 15:57:45 -04003714
3715 {
3716 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3717 {
3718 context->error((yyvsp[(3) - (3)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(3) - (3)].lex).string->c_str());
3719 context->recover();
3720 }
3721
3722 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3723 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, symbol, (yyvsp[(3) - (3)].lex).line);
3724
3725 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3726 context->recover();
3727
3728 if (context->nonInitConstErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, false))
3729 context->recover();
3730
3731 TVariable* variable = 0;
3732 if (context->nonInitErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, variable))
3733 context->recover();
3734 if (symbol && variable)
3735 symbol->setId(variable->getUniqueId());
3736 }
3737 break;
3738
Alexis Hetu17809052015-05-13 11:28:22 -04003739 case 107:
John Bauman66b8ab22014-05-06 15:57:45 -04003740
3741 {
3742 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3743 context->recover();
3744
3745 if (context->nonInitConstErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, true))
3746 context->recover();
3747
3748 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3749
3750 if (context->arrayTypeErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type) || context->arrayQualifierErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3751 context->recover();
3752 else {
3753 (yyvsp[(1) - (5)].interm).type.setArray(true);
3754 TVariable* variable;
3755 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3756 context->recover();
3757 }
3758 }
3759 break;
3760
Alexis Hetu17809052015-05-13 11:28:22 -04003761 case 108:
John Bauman66b8ab22014-05-06 15:57:45 -04003762
3763 {
3764 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3765 context->recover();
3766
3767 if (context->nonInitConstErrorCheck((yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, true))
3768 context->recover();
3769
3770 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3771
3772 if (context->arrayTypeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type) || context->arrayQualifierErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3773 context->recover();
3774 else {
3775 int size;
3776 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3777 context->recover();
3778 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
3779 TVariable* variable = 0;
3780 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3781 context->recover();
3782 TType type = TType((yyvsp[(1) - (6)].interm).type);
3783 type.setArraySize(size);
3784 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (6)].interm).intermNode, context->intermediate.addSymbol(variable ? variable->getUniqueId() : 0, *(yyvsp[(3) - (6)].lex).string, type, (yyvsp[(3) - (6)].lex).line), (yyvsp[(3) - (6)].lex).line);
3785 }
3786 }
3787 break;
3788
Alexis Hetu17809052015-05-13 11:28:22 -04003789 case 109:
John Bauman66b8ab22014-05-06 15:57:45 -04003790
3791 {
3792 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3793 context->recover();
3794
3795 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3796
3797 TIntermNode* intermNode;
3798 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3799 //
3800 // build the intermediate representation
3801 //
3802 if (intermNode)
3803 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3804 else
3805 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3806 } else {
3807 context->recover();
3808 (yyval.interm).intermAggregate = 0;
3809 }
3810 }
3811 break;
3812
Alexis Hetu17809052015-05-13 11:28:22 -04003813 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003814
3815 {
3816 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3817 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(context->intermediate.addSymbol(0, "", TType((yyvsp[(1) - (1)].interm.type)), (yyvsp[(1) - (1)].interm.type).line), (yyvsp[(1) - (1)].interm.type).line);
3818 }
3819 break;
3820
Alexis Hetu17809052015-05-13 11:28:22 -04003821 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003822
3823 {
3824 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3825 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3826
3827 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3828 context->recover();
3829
3830 if (context->nonInitConstErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, false))
3831 context->recover();
3832
3833 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3834
3835 TVariable* variable = 0;
3836 if (context->nonInitErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, variable))
3837 context->recover();
3838 if (variable && symbol)
3839 symbol->setId(variable->getUniqueId());
3840 }
3841 break;
3842
Alexis Hetu17809052015-05-13 11:28:22 -04003843 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003844
3845 {
3846 context->error((yyvsp[(2) - (4)].lex).line, "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str());
3847 context->recover();
3848
3849 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3850 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
3851 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3852 }
3853 break;
3854
Alexis Hetu17809052015-05-13 11:28:22 -04003855 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003856
3857 {
3858 TType type = TType((yyvsp[(1) - (5)].interm.type));
3859 int size;
3860 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3861 context->recover();
3862 type.setArraySize(size);
3863 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3864 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
3865
3866 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3867 context->recover();
3868
3869 if (context->nonInitConstErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), true))
3870 context->recover();
3871
3872 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3873
3874 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)) || context->arrayQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3875 context->recover();
3876 else {
3877 int size;
3878 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3879 context->recover();
3880
3881 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3882 TVariable* variable = 0;
3883 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3884 context->recover();
3885 if (variable && symbol)
3886 symbol->setId(variable->getUniqueId());
3887 }
3888 }
3889 break;
3890
Alexis Hetu17809052015-05-13 11:28:22 -04003891 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003892
3893 {
3894 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3895 context->recover();
3896
3897 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3898
3899 TIntermNode* intermNode;
3900 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3901 //
3902 // Build intermediate representation
3903 //
3904 if(intermNode)
3905 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3906 else
3907 (yyval.interm).intermAggregate = 0;
3908 } else {
3909 context->recover();
3910 (yyval.interm).intermAggregate = 0;
3911 }
3912 }
3913 break;
3914
Alexis Hetu17809052015-05-13 11:28:22 -04003915 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003916
3917 {
John Bauman66b8ab22014-05-06 15:57:45 -04003918 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3919 context->recover();
3920 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3921 if (!(yyvsp[(2) - (2)].lex).symbol)
3922 {
3923 context->error((yyvsp[(2) - (2)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(2) - (2)].lex).string->c_str());
3924 context->recover();
3925
3926 (yyval.interm).intermAggregate = 0;
3927 }
3928 else
3929 {
3930 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3931 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3932 }
3933 }
3934 break;
3935
Alexis Hetu17809052015-05-13 11:28:22 -04003936 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003937
3938 {
3939 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3940
3941 if ((yyvsp[(1) - (1)].interm.type).array) {
3942 context->error((yyvsp[(1) - (1)].interm.type).line, "not supported", "first-class array");
3943 context->recover();
3944 (yyvsp[(1) - (1)].interm.type).setArray(false);
3945 }
3946 }
3947 break;
3948
Alexis Hetu17809052015-05-13 11:28:22 -04003949 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003950
3951 {
3952 if ((yyvsp[(2) - (2)].interm.type).array) {
3953 context->error((yyvsp[(2) - (2)].interm.type).line, "not supported", "first-class array");
3954 context->recover();
3955 (yyvsp[(2) - (2)].interm.type).setArray(false);
3956 }
3957
3958 if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute &&
3959 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
3960 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));
3961 context->recover();
3962 }
3963 if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) &&
3964 ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) {
3965 context->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier));
3966 context->recover();
3967 }
3968 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3969 (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier;
3970 }
3971 break;
3972
Alexis Hetu17809052015-05-13 11:28:22 -04003973 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003974
3975 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003976 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003977 }
3978 break;
3979
Alexis Hetu17809052015-05-13 11:28:22 -04003980 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003981
3982 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003983 (yyval.interm.type).qualifier = EvqFlat;
3984 }
3985 break;
3986
Alexis Hetu17809052015-05-13 11:28:22 -04003987 case 120:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003988
3989 {
3990 (yyval.interm.qualifier) = EvqConstReadOnly;
3991 }
3992 break;
3993
Alexis Hetu17809052015-05-13 11:28:22 -04003994 case 121:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003995
3996 {
John Bauman66b8ab22014-05-06 15:57:45 -04003997 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
Nicolas Capensc6841852015-02-15 14:25:37 -05003998 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003999 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
4000 context->recover();
4001 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
4002 }
4003 break;
4004
Alexis Hetu17809052015-05-13 11:28:22 -04004005 case 122:
John Bauman66b8ab22014-05-06 15:57:45 -04004006
4007 {
Nicolas Capensc6841852015-02-15 14:25:37 -05004008 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004009 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
4010 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05004011 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04004012 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
4013 else
4014 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
4015 }
4016 break;
4017
Alexis Hetu17809052015-05-13 11:28:22 -04004018 case 123:
John Bauman66b8ab22014-05-06 15:57:45 -04004019
4020 {
Nicolas Capensc6841852015-02-15 14:25:37 -05004021 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004022 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
4023 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05004024 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04004025 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
4026 else
4027 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
4028 }
4029 break;
4030
Alexis Hetu17809052015-05-13 11:28:22 -04004031 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04004032
4033 {
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004034 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yyvsp[(1) - (1)].interm.type).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004035 }
4036 break;
4037
Alexis Hetu17809052015-05-13 11:28:22 -04004038 case 125:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004039
4040 {
4041 (yyval.interm.type) = context->joinInterpolationQualifiers((yyvsp[(1) - (2)].interm.type).line, (yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line, (yyvsp[(2) - (2)].interm.type).qualifier);
4042 }
4043 break;
4044
Alexis Hetu17809052015-05-13 11:28:22 -04004045 case 126:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004046
4047 {
4048 context->error((yyvsp[(1) - (1)].interm.type).line, "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getQualifierString((yyvsp[(1) - (1)].interm.type).qualifier));
4049 context->recover();
4050
4051 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4052 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
4053 }
4054 break;
4055
Alexis Hetu17809052015-05-13 11:28:22 -04004056 case 127:
John Bauman66b8ab22014-05-06 15:57:45 -04004057
4058 {
Nicolas Capens7d626792015-02-17 17:58:31 -05004059 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4060 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
4061 }
4062 break;
4063
Alexis Hetu17809052015-05-13 11:28:22 -04004064 case 128:
Nicolas Capens7d626792015-02-17 17:58:31 -05004065
4066 {
4067 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
4068 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
4069 }
4070 break;
4071
Alexis Hetu17809052015-05-13 11:28:22 -04004072 case 129:
Nicolas Capens7d626792015-02-17 17:58:31 -05004073
4074 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05004075 (yyval.interm.type).qualifier = EvqConstExpr;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004076 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4077 }
4078 break;
4079
Alexis Hetu17809052015-05-13 11:28:22 -04004080 case 130:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004081
4082 {
4083 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
4084 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqVaryingIn : EvqAttribute;
4085 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4086 }
4087 break;
4088
Alexis Hetu17809052015-05-13 11:28:22 -04004089 case 131:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004090
4091 {
4092 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
4093 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragColor : EvqVaryingOut;
4094 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4095 }
4096 break;
4097
Alexis Hetu17809052015-05-13 11:28:22 -04004098 case 132:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004099
4100 {
4101 ES3_ONLY("in", (yyvsp[(1) - (2)].lex).line);
4102 // FIXME: Handle centroid qualifier
4103 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqVaryingIn : EvqAttribute;
4104 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
4105 }
4106 break;
4107
Alexis Hetu17809052015-05-13 11:28:22 -04004108 case 133:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004109
4110 {
4111 ES3_ONLY("out", (yyvsp[(1) - (2)].lex).line);
4112 // FIXME: Handle centroid qualifier
4113 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragColor : EvqVaryingOut;
4114 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
4115 }
4116 break;
4117
Alexis Hetu17809052015-05-13 11:28:22 -04004118 case 134:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004119
4120 {
4121 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
4122 context->recover();
4123 (yyval.interm.type).qualifier = EvqUniform;
4124 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4125 }
4126 break;
4127
Alexis Hetu17809052015-05-13 11:28:22 -04004128 case 135:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004129
4130 {
John Bauman66b8ab22014-05-06 15:57:45 -04004131 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4132
4133 if ((yyval.interm.type).precision == EbpUndefined) {
4134 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
4135 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
4136 context->recover();
4137 }
4138 }
4139 }
4140 break;
4141
Alexis Hetu17809052015-05-13 11:28:22 -04004142 case 136:
John Bauman66b8ab22014-05-06 15:57:45 -04004143
4144 {
4145 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
4146 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
4147 }
4148 break;
4149
Alexis Hetu17809052015-05-13 11:28:22 -04004150 case 137:
John Bauman66b8ab22014-05-06 15:57:45 -04004151
4152 {
4153 (yyval.interm.precision) = EbpHigh;
4154 }
4155 break;
4156
Alexis Hetu17809052015-05-13 11:28:22 -04004157 case 138:
John Bauman66b8ab22014-05-06 15:57:45 -04004158
4159 {
4160 (yyval.interm.precision) = EbpMedium;
4161 }
4162 break;
4163
Alexis Hetu17809052015-05-13 11:28:22 -04004164 case 139:
John Bauman66b8ab22014-05-06 15:57:45 -04004165
4166 {
4167 (yyval.interm.precision) = EbpLow;
4168 }
4169 break;
4170
Alexis Hetu17809052015-05-13 11:28:22 -04004171 case 140:
Nicolas Capens7d626792015-02-17 17:58:31 -05004172
4173 {
4174 ES3_ONLY("layout", (yyvsp[(1) - (4)].lex).line);
4175 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
4176 }
4177 break;
4178
Alexis Hetu17809052015-05-13 11:28:22 -04004179 case 141:
Nicolas Capens7d626792015-02-17 17:58:31 -05004180
4181 {
4182 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
4183 }
4184 break;
4185
Alexis Hetu17809052015-05-13 11:28:22 -04004186 case 142:
Nicolas Capens7d626792015-02-17 17:58:31 -05004187
4188 {
4189 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
4190 }
4191 break;
4192
Alexis Hetu17809052015-05-13 11:28:22 -04004193 case 143:
Nicolas Capens7d626792015-02-17 17:58:31 -05004194
4195 {
4196 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line);
4197 }
4198 break;
4199
Alexis Hetu17809052015-05-13 11:28:22 -04004200 case 144:
Nicolas Capens7d626792015-02-17 17:58:31 -05004201
4202 {
4203 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line);
4204 }
4205 break;
4206
Alexis Hetu17809052015-05-13 11:28:22 -04004207 case 145:
Nicolas Capens7d626792015-02-17 17:58:31 -05004208
4209 {
4210 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yyvsp[(1) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yyvsp[(3) - (3)].lex).line);
4211 }
4212 break;
4213
Alexis Hetu17809052015-05-13 11:28:22 -04004214 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04004215
4216 {
4217 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4218 }
4219 break;
4220
Alexis Hetu17809052015-05-13 11:28:22 -04004221 case 147:
John Bauman66b8ab22014-05-06 15:57:45 -04004222
4223 {
4224 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
4225
4226 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4227 context->recover();
4228 else {
4229 int size;
4230 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4231 context->recover();
4232 (yyval.interm.type).setArray(true, size);
4233 }
4234 }
4235 break;
4236
Alexis Hetu17809052015-05-13 11:28:22 -04004237 case 148:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004238
4239 {
Nicolas Capens3c20f802015-02-17 17:17:20 -05004240 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004241 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capens7d626792015-02-17 17:58:31 -05004242 }
4243 break;
4244
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004245 case 149:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004246
4247 {
4248 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu17809052015-05-13 11:28:22 -04004249 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004250 }
4251 break;
4252
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004253 case 150:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004254
4255 {
4256 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu17809052015-05-13 11:28:22 -04004257 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004258 }
4259 break;
4260
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004261 case 151:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004262
4263 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004264 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4265 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004266 }
4267 break;
4268
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004269 case 152:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004270
4271 {
Alexis Hetu17809052015-05-13 11:28:22 -04004272 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4273 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4274 }
4275 break;
4276
4277 case 153:
4278
4279 {
4280 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4281 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4282 (yyval.interm.type).setAggregate(2);
4283 }
4284 break;
4285
4286 case 154:
4287
4288 {
4289 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4290 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4291 (yyval.interm.type).setAggregate(3);
4292 }
4293 break;
4294
4295 case 155:
4296
4297 {
4298 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4299 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4300 (yyval.interm.type).setAggregate(4);
4301 }
4302 break;
4303
4304 case 156:
4305
4306 {
4307 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4308 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4309 (yyval.interm.type).setAggregate(2);
4310 }
4311 break;
4312
4313 case 157:
4314
4315 {
4316 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4317 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4318 (yyval.interm.type).setAggregate(3);
4319 }
4320 break;
4321
4322 case 158:
4323
4324 {
4325 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4326 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4327 (yyval.interm.type).setAggregate(4);
4328 }
4329 break;
4330
4331 case 159:
4332
4333 {
4334 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4335 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4336 (yyval.interm.type).setAggregate(2);
4337 }
4338 break;
4339
4340 case 160:
4341
4342 {
4343 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4344 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4345 (yyval.interm.type).setAggregate(3);
4346 }
4347 break;
4348
4349 case 161:
4350
4351 {
4352 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4353 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4354 (yyval.interm.type).setAggregate(4);
4355 }
4356 break;
4357
4358 case 162:
4359
4360 {
4361 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4362 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4363 (yyval.interm.type).setAggregate(2);
4364 }
4365 break;
4366
4367 case 163:
4368
4369 {
4370 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4371 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4372 (yyval.interm.type).setAggregate(3);
4373 }
4374 break;
4375
4376 case 164:
4377
4378 {
4379 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4380 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4381 (yyval.interm.type).setAggregate(4);
4382 }
4383 break;
4384
4385 case 165:
4386
4387 {
John Bauman66b8ab22014-05-06 15:57:45 -04004388 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
4389 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4390 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004391 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004392 }
4393 break;
4394
Alexis Hetu17809052015-05-13 11:28:22 -04004395 case 166:
John Bauman66b8ab22014-05-06 15:57:45 -04004396
4397 {
4398 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
4399 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4400 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004401 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004402 }
4403 break;
4404
Alexis Hetu17809052015-05-13 11:28:22 -04004405 case 167:
John Bauman66b8ab22014-05-06 15:57:45 -04004406
4407 {
4408 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
4409 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4410 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004411 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004412 }
4413 break;
4414
Alexis Hetu17809052015-05-13 11:28:22 -04004415 case 168:
John Bauman66b8ab22014-05-06 15:57:45 -04004416
4417 {
Alexis Hetub14178b2015-04-13 13:23:20 -04004418 FRAG_VERT_ONLY("mat2x3", (yyvsp[(1) - (1)].lex).line);
4419 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4420 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4421 (yyval.interm.type).setMatrix(2, 3);
4422 }
4423 break;
4424
Alexis Hetu17809052015-05-13 11:28:22 -04004425 case 169:
Alexis Hetub14178b2015-04-13 13:23:20 -04004426
4427 {
4428 FRAG_VERT_ONLY("mat3x2", (yyvsp[(1) - (1)].lex).line);
4429 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4430 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4431 (yyval.interm.type).setMatrix(3, 2);
4432 }
4433 break;
4434
Alexis Hetu17809052015-05-13 11:28:22 -04004435 case 170:
Alexis Hetub14178b2015-04-13 13:23:20 -04004436
4437 {
4438 FRAG_VERT_ONLY("mat2x4", (yyvsp[(1) - (1)].lex).line);
4439 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4440 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4441 (yyval.interm.type).setMatrix(2, 4);
4442 }
4443 break;
4444
Alexis Hetu17809052015-05-13 11:28:22 -04004445 case 171:
Alexis Hetub14178b2015-04-13 13:23:20 -04004446
4447 {
4448 FRAG_VERT_ONLY("mat4x2", (yyvsp[(1) - (1)].lex).line);
4449 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4450 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4451 (yyval.interm.type).setMatrix(4, 2);
4452 }
4453 break;
4454
Alexis Hetu17809052015-05-13 11:28:22 -04004455 case 172:
Alexis Hetub14178b2015-04-13 13:23:20 -04004456
4457 {
4458 FRAG_VERT_ONLY("mat3x4", (yyvsp[(1) - (1)].lex).line);
4459 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4460 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4461 (yyval.interm.type).setMatrix(3, 4);
4462 }
4463 break;
4464
Alexis Hetu17809052015-05-13 11:28:22 -04004465 case 173:
Alexis Hetub14178b2015-04-13 13:23:20 -04004466
4467 {
4468 FRAG_VERT_ONLY("mat4x3", (yyvsp[(1) - (1)].lex).line);
4469 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4470 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4471 (yyval.interm.type).setMatrix(4, 3);
4472 }
4473 break;
4474
Alexis Hetu17809052015-05-13 11:28:22 -04004475 case 174:
Alexis Hetub14178b2015-04-13 13:23:20 -04004476
4477 {
John Bauman66b8ab22014-05-06 15:57:45 -04004478 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4479 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4480 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4481 }
4482 break;
4483
Alexis Hetu17809052015-05-13 11:28:22 -04004484 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004485
4486 {
4487 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4488 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4489 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4490 }
4491 break;
4492
Alexis Hetu17809052015-05-13 11:28:22 -04004493 case 176:
John Bauman66b8ab22014-05-06 15:57:45 -04004494
4495 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004496 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
4497 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES", "");
4498 context->recover();
4499 }
4500 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4501 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4502 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
4503 }
4504 break;
4505
Alexis Hetu17809052015-05-13 11:28:22 -04004506 case 177:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004507
4508 {
Alexis Hetub027aa92015-01-19 15:56:12 -05004509 FRAG_VERT_ONLY("sampler3D", (yyvsp[(1) - (1)].lex).line);
4510 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4511 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4512 }
4513 break;
4514
Alexis Hetu17809052015-05-13 11:28:22 -04004515 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004516
4517 {
4518 FRAG_VERT_ONLY("sampler2DArray", (yyvsp[(1) - (1)].lex).line);
4519 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4520 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4521 }
4522 break;
4523
Alexis Hetu17809052015-05-13 11:28:22 -04004524 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004525
4526 {
4527 FRAG_VERT_ONLY("isampler2D", (yyvsp[(1) - (1)].lex).line);
4528 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4529 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4530 }
4531 break;
4532
Alexis Hetu17809052015-05-13 11:28:22 -04004533 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004534
4535 {
4536 FRAG_VERT_ONLY("isampler3D", (yyvsp[(1) - (1)].lex).line);
4537 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4538 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4539 }
4540 break;
4541
Alexis Hetu17809052015-05-13 11:28:22 -04004542 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004543
4544 {
4545 FRAG_VERT_ONLY("isamplerCube", (yyvsp[(1) - (1)].lex).line);
4546 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4547 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4548 }
4549 break;
4550
Alexis Hetu17809052015-05-13 11:28:22 -04004551 case 182:
Alexis Hetub14178b2015-04-13 13:23:20 -04004552
4553 {
4554 FRAG_VERT_ONLY("isampler2DArray", (yyvsp[(1) - (1)].lex).line);
4555 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4556 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4557 }
4558 break;
4559
Alexis Hetu17809052015-05-13 11:28:22 -04004560 case 183:
Alexis Hetub14178b2015-04-13 13:23:20 -04004561
4562 {
4563 FRAG_VERT_ONLY("usampler2D", (yyvsp[(1) - (1)].lex).line);
4564 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4565 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4566 }
4567 break;
4568
Alexis Hetu17809052015-05-13 11:28:22 -04004569 case 184:
Alexis Hetub14178b2015-04-13 13:23:20 -04004570
4571 {
4572 FRAG_VERT_ONLY("usampler3D", (yyvsp[(1) - (1)].lex).line);
4573 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4574 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4575 }
4576 break;
4577
Alexis Hetu17809052015-05-13 11:28:22 -04004578 case 185:
Alexis Hetub14178b2015-04-13 13:23:20 -04004579
4580 {
4581 FRAG_VERT_ONLY("usamplerCube", (yyvsp[(1) - (1)].lex).line);
4582 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4583 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4584 }
4585 break;
4586
Alexis Hetu17809052015-05-13 11:28:22 -04004587 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004588
4589 {
4590 FRAG_VERT_ONLY("usampler2DArray", (yyvsp[(1) - (1)].lex).line);
4591 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4592 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4593 }
4594 break;
4595
Alexis Hetu17809052015-05-13 11:28:22 -04004596 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004597
4598 {
4599 FRAG_VERT_ONLY("sampler2DShadow", (yyvsp[(1) - (1)].lex).line);
4600 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4601 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yyvsp[(1) - (1)].lex).line);
4602 }
4603 break;
4604
Alexis Hetu17809052015-05-13 11:28:22 -04004605 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004606
4607 {
4608 FRAG_VERT_ONLY("samplerCubeShadow", (yyvsp[(1) - (1)].lex).line);
4609 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4610 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yyvsp[(1) - (1)].lex).line);
4611 }
4612 break;
4613
Alexis Hetu17809052015-05-13 11:28:22 -04004614 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004615
4616 {
4617 FRAG_VERT_ONLY("sampler2DArrayShadow", (yyvsp[(1) - (1)].lex).line);
4618 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4619 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yyvsp[(1) - (1)].lex).line);
4620 }
4621 break;
4622
Alexis Hetu17809052015-05-13 11:28:22 -04004623 case 190:
Alexis Hetub027aa92015-01-19 15:56:12 -05004624
4625 {
John Bauman66b8ab22014-05-06 15:57:45 -04004626 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4627 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4628 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4629 }
4630 break;
4631
Alexis Hetu17809052015-05-13 11:28:22 -04004632 case 191:
John Bauman66b8ab22014-05-06 15:57:45 -04004633
4634 {
4635 //
4636 // This is for user defined type names. The lexical phase looked up the
4637 // type.
4638 //
4639 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4640 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4641 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4642 (yyval.interm.type).userDef = &structure;
4643 }
4644 break;
4645
Alexis Hetu17809052015-05-13 11:28:22 -04004646 case 192:
John Bauman66b8ab22014-05-06 15:57:45 -04004647
4648 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
4649 break;
4650
Alexis Hetu17809052015-05-13 11:28:22 -04004651 case 193:
John Bauman66b8ab22014-05-06 15:57:45 -04004652
4653 {
4654 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
4655 context->recover();
4656
4657 TType* structure = new TType((yyvsp[(5) - (6)].interm.typeList), *(yyvsp[(2) - (6)].lex).string);
4658 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05004659 if (! context->symbolTable.declare(*userTypeDef)) {
John Bauman66b8ab22014-05-06 15:57:45 -04004660 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
4661 context->recover();
4662 }
4663 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
4664 (yyval.interm.type).userDef = structure;
4665 context->exitStructDeclaration();
4666 }
4667 break;
4668
Alexis Hetu17809052015-05-13 11:28:22 -04004669 case 194:
John Bauman66b8ab22014-05-06 15:57:45 -04004670
4671 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
4672 break;
4673
Alexis Hetu17809052015-05-13 11:28:22 -04004674 case 195:
John Bauman66b8ab22014-05-06 15:57:45 -04004675
4676 {
4677 TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), TString(""));
4678 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
4679 (yyval.interm.type).userDef = structure;
4680 context->exitStructDeclaration();
4681 }
4682 break;
4683
Alexis Hetu17809052015-05-13 11:28:22 -04004684 case 196:
John Bauman66b8ab22014-05-06 15:57:45 -04004685
4686 {
4687 (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList);
4688 }
4689 break;
4690
Alexis Hetu17809052015-05-13 11:28:22 -04004691 case 197:
John Bauman66b8ab22014-05-06 15:57:45 -04004692
4693 {
4694 (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList);
4695 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) {
4696 for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) {
4697 if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) {
4698 context->error((*(yyvsp[(2) - (2)].interm.typeList))[i].line, "duplicate field name in structure:", "struct", (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName().c_str());
4699 context->recover();
4700 }
4701 }
4702 (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]);
4703 }
4704 }
4705 break;
4706
Alexis Hetu17809052015-05-13 11:28:22 -04004707 case 198:
John Bauman66b8ab22014-05-06 15:57:45 -04004708
4709 {
4710 (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList);
4711
4712 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) {
4713 context->recover();
4714 }
4715 for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) {
4716 //
4717 // Careful not to replace already known aspects of type, like array-ness
4718 //
4719 TType* type = (*(yyval.interm.typeList))[i].type;
4720 type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
Alexis Hetub14178b2015-04-13 13:23:20 -04004721 type->setNominalSize((yyvsp[(1) - (3)].interm.type).primarySize);
4722 type->setSecondarySize((yyvsp[(1) - (3)].interm.type).secondarySize);
John Bauman66b8ab22014-05-06 15:57:45 -04004723 type->setPrecision((yyvsp[(1) - (3)].interm.type).precision);
4724
4725 // don't allow arrays of arrays
4726 if (type->isArray()) {
4727 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type)))
4728 context->recover();
4729 }
4730 if ((yyvsp[(1) - (3)].interm.type).array)
4731 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize);
4732 if ((yyvsp[(1) - (3)].interm.type).userDef) {
4733 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
4734 type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName());
4735 }
John Bauman66b8ab22014-05-06 15:57:45 -04004736 }
4737 }
4738 break;
4739
Alexis Hetu17809052015-05-13 11:28:22 -04004740 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004741
4742 {
4743 (yyval.interm.typeList) = NewPoolTTypeList();
4744 (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine));
4745 }
4746 break;
4747
Alexis Hetu17809052015-05-13 11:28:22 -04004748 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004749
4750 {
4751 (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine));
4752 }
4753 break;
4754
Alexis Hetu17809052015-05-13 11:28:22 -04004755 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004756
4757 {
4758 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4759 context->recover();
4760
4761 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4762 (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line;
4763 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string);
4764 }
4765 break;
4766
Alexis Hetu17809052015-05-13 11:28:22 -04004767 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004768
4769 {
4770 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4771 context->recover();
4772
4773 (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined);
4774 (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line;
4775 (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string);
4776
4777 int size;
4778 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4779 context->recover();
4780 (yyval.interm.typeLine).type->setArraySize(size);
4781 }
4782 break;
4783
Alexis Hetu17809052015-05-13 11:28:22 -04004784 case 203:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004785
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004786 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetub027aa92015-01-19 15:56:12 -05004787 break;
4788
Alexis Hetu17809052015-05-13 11:28:22 -04004789 case 204:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004790
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004791 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004792 break;
4793
Alexis Hetu17809052015-05-13 11:28:22 -04004794 case 205:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004795
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004796 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Nicolas Capens3c20f802015-02-17 17:17:20 -05004797 break;
4798
Alexis Hetu17809052015-05-13 11:28:22 -04004799 case 206:
Nicolas Capens3c20f802015-02-17 17:17:20 -05004800
Nicolas Capens7d626792015-02-17 17:58:31 -05004801 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004802 break;
4803
Alexis Hetu17809052015-05-13 11:28:22 -04004804 case 207:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004805
Nicolas Capens7d626792015-02-17 17:58:31 -05004806 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004807 break;
4808
Alexis Hetu17809052015-05-13 11:28:22 -04004809 case 208:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004810
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004811 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004812 break;
4813
Alexis Hetu17809052015-05-13 11:28:22 -04004814 case 209:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004815
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004816 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004817 break;
4818
Alexis Hetu17809052015-05-13 11:28:22 -04004819 case 210:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004820
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004821 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004822 break;
4823
Alexis Hetu17809052015-05-13 11:28:22 -04004824 case 211:
Nicolas Capens7d626792015-02-17 17:58:31 -05004825
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004826 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4827 break;
4828
Alexis Hetu17809052015-05-13 11:28:22 -04004829 case 212:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004830
4831 { (yyval.interm.intermAggregate) = 0; }
4832 break;
4833
Alexis Hetu17809052015-05-13 11:28:22 -04004834 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004835
4836 { context->symbolTable.push(); }
4837 break;
4838
Alexis Hetu17809052015-05-13 11:28:22 -04004839 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004840
4841 { context->symbolTable.pop(); }
4842 break;
4843
Alexis Hetu17809052015-05-13 11:28:22 -04004844 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004845
Nicolas Capens7d626792015-02-17 17:58:31 -05004846 {
4847 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4848 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4849 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4850 }
4851 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4852 }
4853 break;
4854
Alexis Hetu17809052015-05-13 11:28:22 -04004855 case 216:
Nicolas Capens7d626792015-02-17 17:58:31 -05004856
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004857 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004858 break;
4859
Alexis Hetu17809052015-05-13 11:28:22 -04004860 case 217:
Nicolas Capens7d626792015-02-17 17:58:31 -05004861
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004862 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004863 break;
4864
Alexis Hetu17809052015-05-13 11:28:22 -04004865 case 218:
Nicolas Capens7d626792015-02-17 17:58:31 -05004866
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004867 { context->symbolTable.push(); }
4868 break;
4869
Alexis Hetu17809052015-05-13 11:28:22 -04004870 case 219:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004871
4872 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4873 break;
4874
Alexis Hetu17809052015-05-13 11:28:22 -04004875 case 220:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004876
4877 { context->symbolTable.push(); }
4878 break;
4879
Alexis Hetu17809052015-05-13 11:28:22 -04004880 case 221:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004881
4882 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4883 break;
4884
Alexis Hetu17809052015-05-13 11:28:22 -04004885 case 222:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004886
John Bauman66b8ab22014-05-06 15:57:45 -04004887 {
4888 (yyval.interm.intermNode) = 0;
4889 }
4890 break;
4891
Alexis Hetu17809052015-05-13 11:28:22 -04004892 case 223:
John Bauman66b8ab22014-05-06 15:57:45 -04004893
4894 {
4895 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4896 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
4897 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4898 }
4899 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4900 }
4901 break;
4902
Alexis Hetu17809052015-05-13 11:28:22 -04004903 case 224:
John Bauman66b8ab22014-05-06 15:57:45 -04004904
4905 {
4906 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4907 }
4908 break;
4909
Alexis Hetu17809052015-05-13 11:28:22 -04004910 case 225:
John Bauman66b8ab22014-05-06 15:57:45 -04004911
4912 {
4913 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4914 }
4915 break;
4916
Alexis Hetu17809052015-05-13 11:28:22 -04004917 case 226:
John Bauman66b8ab22014-05-06 15:57:45 -04004918
4919 { (yyval.interm.intermNode) = 0; }
4920 break;
4921
Alexis Hetu17809052015-05-13 11:28:22 -04004922 case 227:
John Bauman66b8ab22014-05-06 15:57:45 -04004923
4924 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4925 break;
4926
Alexis Hetu17809052015-05-13 11:28:22 -04004927 case 228:
John Bauman66b8ab22014-05-06 15:57:45 -04004928
4929 {
4930 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4931 context->recover();
4932 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line);
4933 }
4934 break;
4935
Alexis Hetu17809052015-05-13 11:28:22 -04004936 case 229:
John Bauman66b8ab22014-05-06 15:57:45 -04004937
4938 {
4939 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4940 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4941 }
4942 break;
4943
Alexis Hetu17809052015-05-13 11:28:22 -04004944 case 230:
John Bauman66b8ab22014-05-06 15:57:45 -04004945
4946 {
4947 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4948 (yyval.interm.nodePair).node2 = 0;
4949 }
4950 break;
4951
Alexis Hetu17809052015-05-13 11:28:22 -04004952 case 231:
John Bauman66b8ab22014-05-06 15:57:45 -04004953
4954 {
4955 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4956 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4957 context->recover();
4958 }
4959 break;
4960
Alexis Hetu17809052015-05-13 11:28:22 -04004961 case 232:
John Bauman66b8ab22014-05-06 15:57:45 -04004962
4963 {
4964 TIntermNode* intermNode;
4965 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4966 context->recover();
4967 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4968 context->recover();
4969
4970 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4971 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4972 else {
4973 context->recover();
4974 (yyval.interm.intermTypedNode) = 0;
4975 }
4976 }
4977 break;
4978
Alexis Hetu17809052015-05-13 11:28:22 -04004979 case 233:
John Bauman66b8ab22014-05-06 15:57:45 -04004980
4981 { context->symbolTable.push(); ++context->loopNestingLevel; }
4982 break;
4983
Alexis Hetu17809052015-05-13 11:28:22 -04004984 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004985
4986 {
4987 context->symbolTable.pop();
4988 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(1) - (6)].lex).line);
4989 --context->loopNestingLevel;
4990 }
4991 break;
4992
Alexis Hetu17809052015-05-13 11:28:22 -04004993 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004994
4995 { ++context->loopNestingLevel; }
4996 break;
4997
Alexis Hetu17809052015-05-13 11:28:22 -04004998 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004999
5000 {
5001 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
5002 context->recover();
5003
5004 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(4) - (8)].lex).line);
5005 --context->loopNestingLevel;
5006 }
5007 break;
5008
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005009 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04005010
Alexis Hetu17809052015-05-13 11:28:22 -04005011 { context->symbolTable.push(); ++context->loopNestingLevel; }
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04005012 break;
5013
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005014 case 238:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04005015
5016 {
Alexis Hetu17809052015-05-13 11:28:22 -04005017 context->symbolTable.pop();
5018 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopFor, (yyvsp[(4) - (7)].interm.intermNode), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node2), (yyvsp[(7) - (7)].interm.intermNode), (yyvsp[(1) - (7)].lex).line);
5019 --context->loopNestingLevel;
Alexis Hetub027aa92015-01-19 15:56:12 -05005020 }
5021 break;
5022
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005023 case 239:
Alexis Hetub027aa92015-01-19 15:56:12 -05005024
5025 {
Nicolas Capens3c20f802015-02-17 17:17:20 -05005026 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5027 }
5028 break;
5029
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005030 case 240:
Nicolas Capens3c20f802015-02-17 17:17:20 -05005031
5032 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05005033 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5034 }
5035 break;
5036
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005037 case 241:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05005038
5039 {
Alexis Hetu17809052015-05-13 11:28:22 -04005040 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
5041 }
5042 break;
5043
5044 case 242:
5045
5046 {
5047 (yyval.interm.intermTypedNode) = 0;
5048 }
5049 break;
5050
5051 case 243:
5052
5053 {
5054 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
5055 (yyval.interm.nodePair).node2 = 0;
5056 }
5057 break;
5058
5059 case 244:
5060
5061 {
5062 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
5063 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
5064 }
5065 break;
5066
5067 case 245:
5068
5069 {
5070 if (context->loopNestingLevel <= 0) {
5071 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
5072 context->recover();
5073 }
5074 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
5075 }
5076 break;
5077
5078 case 246:
5079
5080 {
5081 if (context->loopNestingLevel <= 0) {
5082 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
5083 context->recover();
5084 }
5085 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
5086 }
5087 break;
5088
5089 case 247:
5090
5091 {
5092 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
5093 if (context->currentFunctionType->getBasicType() != EbtVoid) {
5094 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
5095 context->recover();
5096 }
5097 }
5098 break;
5099
5100 case 248:
5101
5102 {
5103 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
5104 context->functionReturnsValue = true;
5105 if (context->currentFunctionType->getBasicType() == EbtVoid) {
5106 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
5107 context->recover();
5108 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
5109 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
5110 context->recover();
5111 }
5112 }
5113 break;
5114
5115 case 249:
5116
5117 {
5118 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
5119 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
5120 }
5121 break;
5122
5123 case 250:
5124
5125 {
5126 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5127 context->treeRoot = (yyval.interm.intermNode);
5128 }
5129 break;
5130
5131 case 251:
5132
5133 {
5134 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
5135 context->treeRoot = (yyval.interm.intermNode);
5136 }
5137 break;
5138
5139 case 252:
5140
5141 {
5142 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5143 }
5144 break;
5145
5146 case 253:
5147
5148 {
5149 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5150 }
5151 break;
5152
5153 case 254:
5154
5155 {
John Bauman66b8ab22014-05-06 15:57:45 -04005156 TFunction* function = (yyvsp[(1) - (1)].interm).function;
5157
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05005158 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
John Bauman66b8ab22014-05-06 15:57:45 -04005159
5160 if (builtIn)
5161 {
5162 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
5163 context->recover();
5164 }
5165
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05005166 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04005167 //
5168 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
5169 // as it would have just been put in the symbol table. Otherwise, we're looking up
5170 // an earlier occurance.
5171 //
5172 if (prevDec->isDefined()) {
5173 //
5174 // Then this function already has a body.
5175 //
5176 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
5177 context->recover();
5178 }
5179 prevDec->setDefined();
5180
5181 //
5182 // Raise error message if main function takes any parameters or return anything other than void
5183 //
5184 if (function->getName() == "main") {
5185 if (function->getParamCount() > 0) {
5186 context->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function->getName().c_str());
5187 context->recover();
5188 }
5189 if (function->getReturnType().getBasicType() != EbtVoid) {
5190 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
5191 context->recover();
5192 }
5193 }
5194
5195 //
5196 // Remember the return type for later checking for RETURN statements.
5197 //
5198 context->currentFunctionType = &(prevDec->getReturnType());
5199 context->functionReturnsValue = false;
5200
5201 //
5202 // Insert parameters into the symbol table.
5203 // If the parameter has no name, it's not an error, just don't insert it
5204 // (could be used for unused args).
5205 //
5206 // Also, accumulate the list of parameters into the HIL, so lower level code
5207 // knows where to find parameters.
5208 //
5209 TIntermAggregate* paramNodes = new TIntermAggregate;
5210 for (int i = 0; i < function->getParamCount(); i++) {
5211 const TParameter& param = function->getParam(i);
5212 if (param.name != 0) {
5213 TVariable *variable = new TVariable(param.name, *param.type);
5214 //
5215 // Insert the parameters with name in the symbol table.
5216 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05005217 if (! context->symbolTable.declare(*variable)) {
John Bauman66b8ab22014-05-06 15:57:45 -04005218 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
5219 context->recover();
5220 delete variable;
5221 }
5222
5223 //
5224 // Add the parameter to the HIL
5225 //
5226 paramNodes = context->intermediate.growAggregate(
5227 paramNodes,
5228 context->intermediate.addSymbol(variable->getUniqueId(),
5229 variable->getName(),
5230 variable->getType(), (yyvsp[(1) - (1)].interm).line),
5231 (yyvsp[(1) - (1)].interm).line);
5232 } else {
5233 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
5234 }
5235 }
5236 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
5237 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
5238 context->loopNestingLevel = 0;
5239 }
5240 break;
5241
Alexis Hetu17809052015-05-13 11:28:22 -04005242 case 255:
John Bauman66b8ab22014-05-06 15:57:45 -04005243
5244 {
5245 //?? Check that all paths return a value if return type != void ?
5246 // May be best done as post process phase on intermediate code
5247 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
5248 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
5249 context->recover();
5250 }
5251
5252 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
5253 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
5254 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
5255 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
5256
5257 // store the pragma information for debug and optimize and other vendor specific
5258 // information. This information can be queried from the parse tree
5259 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
5260 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
5261
5262 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
5263 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
5264
5265 context->symbolTable.pop();
5266 }
5267 break;
5268
5269
5270
5271 default: break;
5272 }
5273 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
5274
5275 YYPOPSTACK (yylen);
5276 yylen = 0;
5277 YY_STACK_PRINT (yyss, yyssp);
5278
5279 *++yyvsp = yyval;
5280
5281 /* Now `shift' the result of the reduction. Determine what state
5282 that goes to, based on the state we popped back to and the rule
5283 number reduced by. */
5284
5285 yyn = yyr1[yyn];
5286
5287 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
5288 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
5289 yystate = yytable[yystate];
5290 else
5291 yystate = yydefgoto[yyn - YYNTOKENS];
5292
5293 goto yynewstate;
5294
5295
5296/*------------------------------------.
5297| yyerrlab -- here on detecting error |
5298`------------------------------------*/
5299yyerrlab:
5300 /* If not already recovering from an error, report this error. */
5301 if (!yyerrstatus)
5302 {
5303 ++yynerrs;
5304#if ! YYERROR_VERBOSE
5305 yyerror (context, YY_("syntax error"));
5306#else
5307 {
5308 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
5309 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
5310 {
5311 YYSIZE_T yyalloc = 2 * yysize;
5312 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
5313 yyalloc = YYSTACK_ALLOC_MAXIMUM;
5314 if (yymsg != yymsgbuf)
5315 YYSTACK_FREE (yymsg);
5316 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
5317 if (yymsg)
5318 yymsg_alloc = yyalloc;
5319 else
5320 {
5321 yymsg = yymsgbuf;
5322 yymsg_alloc = sizeof yymsgbuf;
5323 }
5324 }
5325
5326 if (0 < yysize && yysize <= yymsg_alloc)
5327 {
5328 (void) yysyntax_error (yymsg, yystate, yychar);
5329 yyerror (context, yymsg);
5330 }
5331 else
5332 {
5333 yyerror (context, YY_("syntax error"));
5334 if (yysize != 0)
5335 goto yyexhaustedlab;
5336 }
5337 }
5338#endif
5339 }
5340
5341
5342
5343 if (yyerrstatus == 3)
5344 {
5345 /* If just tried and failed to reuse lookahead token after an
5346 error, discard it. */
5347
5348 if (yychar <= YYEOF)
5349 {
5350 /* Return failure if at end of input. */
5351 if (yychar == YYEOF)
5352 YYABORT;
5353 }
5354 else
5355 {
5356 yydestruct ("Error: discarding",
5357 yytoken, &yylval, context);
5358 yychar = YYEMPTY;
5359 }
5360 }
5361
5362 /* Else will try to reuse lookahead token after shifting the error
5363 token. */
5364 goto yyerrlab1;
5365
5366
5367/*---------------------------------------------------.
5368| yyerrorlab -- error raised explicitly by YYERROR. |
5369`---------------------------------------------------*/
5370yyerrorlab:
5371
5372 /* Pacify compilers like GCC when the user code never invokes
5373 YYERROR and the label yyerrorlab therefore never appears in user
5374 code. */
5375 if (/*CONSTCOND*/ 0)
5376 goto yyerrorlab;
5377
5378 /* Do not reclaim the symbols of the rule which action triggered
5379 this YYERROR. */
5380 YYPOPSTACK (yylen);
5381 yylen = 0;
5382 YY_STACK_PRINT (yyss, yyssp);
5383 yystate = *yyssp;
5384 goto yyerrlab1;
5385
5386
5387/*-------------------------------------------------------------.
5388| yyerrlab1 -- common code for both syntax error and YYERROR. |
5389`-------------------------------------------------------------*/
5390yyerrlab1:
5391 yyerrstatus = 3; /* Each real token shifted decrements this. */
5392
5393 for (;;)
5394 {
5395 yyn = yypact[yystate];
5396 if (yyn != YYPACT_NINF)
5397 {
5398 yyn += YYTERROR;
5399 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5400 {
5401 yyn = yytable[yyn];
5402 if (0 < yyn)
5403 break;
5404 }
5405 }
5406
5407 /* Pop the current state because it cannot handle the error token. */
5408 if (yyssp == yyss)
5409 YYABORT;
5410
5411
5412 yydestruct ("Error: popping",
5413 yystos[yystate], yyvsp, context);
5414 YYPOPSTACK (1);
5415 yystate = *yyssp;
5416 YY_STACK_PRINT (yyss, yyssp);
5417 }
5418
5419 *++yyvsp = yylval;
5420
5421
5422 /* Shift the error token. */
5423 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5424
5425 yystate = yyn;
5426 goto yynewstate;
5427
5428
5429/*-------------------------------------.
5430| yyacceptlab -- YYACCEPT comes here. |
5431`-------------------------------------*/
5432yyacceptlab:
5433 yyresult = 0;
5434 goto yyreturn;
5435
5436/*-----------------------------------.
5437| yyabortlab -- YYABORT comes here. |
5438`-----------------------------------*/
5439yyabortlab:
5440 yyresult = 1;
5441 goto yyreturn;
5442
5443#if !defined(yyoverflow) || YYERROR_VERBOSE
5444/*-------------------------------------------------.
5445| yyexhaustedlab -- memory exhaustion comes here. |
5446`-------------------------------------------------*/
5447yyexhaustedlab:
5448 yyerror (context, YY_("memory exhausted"));
5449 yyresult = 2;
5450 /* Fall through. */
5451#endif
5452
5453yyreturn:
5454 if (yychar != YYEMPTY)
5455 yydestruct ("Cleanup: discarding lookahead",
5456 yytoken, &yylval, context);
5457 /* Do not reclaim the symbols of the rule which action triggered
5458 this YYABORT or YYACCEPT. */
5459 YYPOPSTACK (yylen);
5460 YY_STACK_PRINT (yyss, yyssp);
5461 while (yyssp != yyss)
5462 {
5463 yydestruct ("Cleanup: popping",
5464 yystos[*yyssp], yyvsp, context);
5465 YYPOPSTACK (1);
5466 }
5467#ifndef yyoverflow
5468 if (yyss != yyssa)
5469 YYSTACK_FREE (yyss);
5470#endif
5471#if YYERROR_VERBOSE
5472 if (yymsg != yymsgbuf)
5473 YYSTACK_FREE (yymsg);
5474#endif
5475 /* Make sure YYID is used. */
5476 return YYID (yyresult);
5477}
5478
5479
5480
5481
5482
5483int glslang_parse(TParseContext* context) {
5484 return yyparse(context);
5485}
5486