blob: e2b3472c08473ee33a801c4571633e42175b7c24 [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;
Alexis Hetua8b364b2015-06-10 11:48:40 -0400288 TField* field;
289 TFieldList* fieldList;
John Bauman66b8ab22014-05-06 15:57:45 -0400290 };
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,
Alexis Hetua8b364b2015-06-10 11:48:40 -0400734 257, 336, 339, 441, 451, 464, 472, 572, 575, 583,
735 587, 594, 598, 605, 611, 620, 628, 705, 712, 722,
736 725, 735, 745, 767, 768, 769, 770, 778, 779, 788,
737 797, 810, 811, 819, 830, 831, 840, 852, 853, 863,
738 873, 883, 896, 897, 907, 920, 921, 935, 936, 950,
739 951, 965, 966, 979, 980, 993, 994, 1007, 1008, 1025,
740 1026, 1039, 1040, 1041, 1042, 1044, 1045, 1046, 1048, 1050,
741 1052, 1054, 1059, 1062, 1073, 1081, 1108, 1113, 1123, 1161,
742 1164, 1171, 1179, 1200, 1221, 1232, 1261, 1266, 1276, 1281,
743 1291, 1294, 1297, 1300, 1306, 1313, 1316, 1338, 1356, 1380,
744 1403, 1407, 1425, 1433, 1465, 1485, 1573, 1583, 1589, 1592,
745 1598, 1604, 1611, 1620, 1629, 1632, 1635, 1642, 1646, 1653,
746 1657, 1662, 1667, 1677, 1687, 1696, 1706, 1713, 1716, 1719,
747 1725, 1732, 1735, 1741, 1744, 1747, 1753, 1756, 1771, 1775,
748 1779, 1783, 1787, 1791, 1796, 1801, 1806, 1811, 1816, 1821,
749 1826, 1831, 1836, 1841, 1846, 1851, 1857, 1863, 1869, 1875,
750 1881, 1887, 1893, 1899, 1905, 1910, 1915, 1924, 1929, 1934,
751 1939, 1944, 1949, 1954, 1959, 1964, 1969, 1974, 1979, 1984,
752 1989, 1994, 2007, 2007, 2021, 2021, 2031, 2034, 2050, 2081,
753 2085, 2091, 2098, 2113, 2117, 2121, 2122, 2128, 2129, 2130,
Alexis Hetu42ff6b12015-06-03 16:03:48 -0400754 2131, 2132, 2136, 2137, 2137, 2137, 2147, 2148, 2152, 2152,
755 2153, 2153, 2158, 2161, 2171, 2174, 2180, 2181, 2185, 2193,
756 2197, 2207, 2212, 2229, 2229, 2234, 2234, 2241, 2241, 2249,
757 2252, 2258, 2261, 2267, 2271, 2278, 2285, 2292, 2299, 2310,
758 2319, 2323, 2330, 2333, 2339, 2339
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())
Alexis Hetua8b364b2015-06-10 11:48:40 -04002461 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct()));
John Bauman66b8ab22014-05-06 15:57:45 -04002462 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)
Alexis Hetu00106d42015-04-23 11:45:35 -04002468 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConstExpr, (yyvsp[(1) - (4)].interm.intermTypedNode)->getSecondarySize()));
John Bauman66b8ab22014-05-06 15:57:45 -04002469 else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())
Alexis Hetu00106d42015-04-23 11:45:35 -04002470 (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getSecondarySize()));
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;
Alexis Hetu00106d42015-04-23 11:45:35 -04002519 if (! context->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getSecondarySize(), fields, (yyvsp[(3) - (3)].lex).line)) {
John Bauman66b8ab22014-05-06 15:57:45 -04002520 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;
Alexis Hetua8b364b2015-06-10 11:48:40 -04002544 const TStructure* structure = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct();
2545 if (structure == 0) {
John Bauman66b8ab22014-05-06 15:57:45 -04002546 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;
Alexis Hetua8b364b2015-06-10 11:48:40 -04002551 const TFieldList& fields = structure->fields();
2552 for (i = 0; i < fields.size(); ++i) {
2553 if (fields[i]->name() == *(yyvsp[(3) - (3)].lex).string) {
John Bauman66b8ab22014-05-06 15:57:45 -04002554 fieldFound = true;
2555 break;
2556 }
2557 }
2558 if (fieldFound) {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002559 if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConstExpr) {
John Bauman66b8ab22014-05-06 15:57:45 -04002560 (yyval.interm.intermTypedNode) = context->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2561 if ((yyval.interm.intermTypedNode) == 0) {
2562 context->recover();
2563 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2564 }
2565 else {
Alexis Hetua8b364b2015-06-10 11:48:40 -04002566 (yyval.interm.intermTypedNode)->setType(*fields[i]->type());
John Bauman66b8ab22014-05-06 15:57:45 -04002567 // change the qualifier of the return type, not of the structure field
2568 // as the structure definition is shared between various structures.
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002569 (yyval.interm.intermTypedNode)->getTypePointer()->setQualifier(EvqConstExpr);
John Bauman66b8ab22014-05-06 15:57:45 -04002570 }
2571 } else {
2572 ConstantUnion *unionArray = new ConstantUnion[1];
2573 unionArray->setIConst(i);
Alexis Hetua8b364b2015-06-10 11:48:40 -04002574 TIntermTyped* index = context->intermediate.addConstantUnion(unionArray, *(fields[i]->type()), (yyvsp[(3) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002575 (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line);
Alexis Hetua8b364b2015-06-10 11:48:40 -04002576 (yyval.interm.intermTypedNode)->setType(*fields[i]->type());
John Bauman66b8ab22014-05-06 15:57:45 -04002577 }
2578 } else {
2579 context->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str());
2580 context->recover();
2581 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2582 }
2583 }
2584 } else {
2585 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());
2586 context->recover();
2587 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2588 }
2589 // don't delete $3.string, it's from the pool
2590 }
2591 break;
2592
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002593 case 13:
John Bauman66b8ab22014-05-06 15:57:45 -04002594
2595 {
2596 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2597 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002598 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002599 if ((yyval.interm.intermTypedNode) == 0) {
2600 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2601 context->recover();
2602 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2603 }
2604 }
2605 break;
2606
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002607 case 14:
John Bauman66b8ab22014-05-06 15:57:45 -04002608
2609 {
2610 if (context->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2611 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002612 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002613 if ((yyval.interm.intermTypedNode) == 0) {
2614 context->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2615 context->recover();
2616 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2617 }
2618 }
2619 break;
2620
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002621 case 15:
John Bauman66b8ab22014-05-06 15:57:45 -04002622
2623 {
2624 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2625 context->recover();
2626 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2627 }
2628 break;
2629
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002630 case 16:
John Bauman66b8ab22014-05-06 15:57:45 -04002631
2632 {
2633 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2634 TOperator op = fnCall->getBuiltInOp();
2635
2636 if (op != EOpNull)
2637 {
2638 //
2639 // Then this should be a constructor.
2640 // Don't go through the symbol table for constructors.
2641 // Their parameters will be verified algorithmically.
2642 //
2643 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2644 if (context->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2645 (yyval.interm.intermTypedNode) = 0;
2646 } else {
2647 //
2648 // It's a constructor, of type 'type'.
2649 //
2650 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line);
2651 }
2652
2653 if ((yyval.interm.intermTypedNode) == 0) {
2654 context->recover();
2655 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line);
2656 }
2657 (yyval.interm.intermTypedNode)->setType(type);
2658 } else {
2659 //
2660 // Not a constructor. Find it in the symbol table.
2661 //
2662 const TFunction* fnCandidate;
2663 bool builtIn;
2664 fnCandidate = context->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn);
2665 if (fnCandidate) {
2666 //
2667 // A declared function.
2668 //
2669 if (builtIn && !fnCandidate->getExtension().empty() &&
2670 context->extensionErrorCheck((yyvsp[(1) - (1)].interm).line, fnCandidate->getExtension())) {
2671 context->recover();
2672 }
2673 op = fnCandidate->getBuiltInOp();
2674 if (builtIn && op != EOpNull) {
2675 //
2676 // A function call mapped to a built-in operation.
2677 //
2678 if (fnCandidate->getParamCount() == 1) {
2679 //
2680 // Treat it like a built-in unary operator.
2681 //
John Baumand4ae8632014-05-06 16:18:33 -04002682 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0);
John Bauman66b8ab22014-05-06 15:57:45 -04002683 if ((yyval.interm.intermTypedNode) == 0) {
2684 std::stringstream extraInfoStream;
2685 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2686 std::string extraInfo = extraInfoStream.str();
2687 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
2688 YYERROR;
2689 }
2690 } else {
2691 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line);
2692 }
2693 } else {
2694 // This is a real function call
2695
2696 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line);
2697 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2698
2699 // this is how we know whether the given function is a builtIn function or a user defined function
2700 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2701 // if builtIn == true, it's definitely a builtIn function with EOpNull
2702 if (!builtIn)
2703 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2704 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2705
2706 TQualifier qual;
2707 for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
2708 qual = fnCandidate->getParam(i).type->getQualifier();
2709 if (qual == EvqOut || qual == EvqInOut) {
2710 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
2711 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
2712 context->recover();
2713 }
2714 }
2715 }
2716 }
2717 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2718 } else {
2719 // error message was put out by PaFindFunction()
2720 // Put on a dummy node for error recovery
2721 ConstantUnion *unionArray = new ConstantUnion[1];
2722 unionArray->setFConst(0.0f);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05002723 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConstExpr), (yyvsp[(1) - (1)].interm).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002724 context->recover();
2725 }
2726 }
2727 delete fnCall;
2728 }
2729 break;
2730
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002731 case 17:
John Bauman66b8ab22014-05-06 15:57:45 -04002732
2733 {
2734 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2735 }
2736 break;
2737
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002738 case 18:
John Bauman66b8ab22014-05-06 15:57:45 -04002739
2740 {
2741 context->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "");
2742 context->recover();
2743 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2744 }
2745 break;
2746
John Bauman66b8ab22014-05-06 15:57:45 -04002747 case 19:
2748
2749 {
2750 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2751 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2752 }
2753 break;
2754
2755 case 20:
2756
2757 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002758 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2759 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
2760 }
2761 break;
2762
2763 case 21:
2764
2765 {
John Bauman66b8ab22014-05-06 15:57:45 -04002766 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2767 (yyval.interm).intermNode = 0;
2768 }
2769 break;
2770
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002771 case 22:
John Bauman66b8ab22014-05-06 15:57:45 -04002772
2773 {
2774 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2775 (yyval.interm).intermNode = 0;
2776 }
2777 break;
2778
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002779 case 23:
John Bauman66b8ab22014-05-06 15:57:45 -04002780
2781 {
2782 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2783 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2784 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2785 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2786 }
2787 break;
2788
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002789 case 24:
John Bauman66b8ab22014-05-06 15:57:45 -04002790
2791 {
2792 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2793 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2794 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2795 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
2796 }
2797 break;
2798
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002799 case 25:
John Bauman66b8ab22014-05-06 15:57:45 -04002800
2801 {
2802 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2803 }
2804 break;
2805
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002806 case 26:
John Bauman66b8ab22014-05-06 15:57:45 -04002807
2808 {
2809 //
2810 // Constructor
2811 //
2812 TOperator op = EOpNull;
2813 if ((yyvsp[(1) - (1)].interm.type).userDef) {
2814 op = EOpConstructStruct;
2815 } else {
2816 switch ((yyvsp[(1) - (1)].interm.type).type) {
2817 case EbtFloat:
Alexis Hetub14178b2015-04-13 13:23:20 -04002818 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2819 case 1:
2820 op = EOpConstructFloat; break;
2821 case 2:
2822 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2823 case 1: op = EOpConstructVec2; break;
2824 case 2: op = EOpConstructMat2; break;
2825 case 3: op = EOpConstructMat2x3; break;
2826 case 4: op = EOpConstructMat2x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002827 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002828 break;
2829 case 3:
2830 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2831 case 1: op = EOpConstructVec3; break;
2832 case 2: op = EOpConstructMat3x2; break;
2833 case 3: op = EOpConstructMat3; break;
2834 case 4: op = EOpConstructMat3x4; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002835 }
Alexis Hetub14178b2015-04-13 13:23:20 -04002836 break;
2837 case 4:
2838 switch((yyvsp[(1) - (1)].interm.type).secondarySize) {
2839 case 1: op = EOpConstructVec4; break;
2840 case 2: op = EOpConstructMat4x2; break;
2841 case 3: op = EOpConstructMat4x3; break;
2842 case 4: op = EOpConstructMat4; break;
2843 }
2844 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002845 }
2846 break;
2847 case EbtInt:
Alexis Hetub14178b2015-04-13 13:23:20 -04002848 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002849 case 1: op = EOpConstructInt; break;
2850 case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break;
2851 case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break;
2852 case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break;
2853 }
2854 break;
Alexis Hetub7c46af2015-05-12 15:58:09 -04002855 case EbtUInt:
2856 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
2857 case 1: op = EOpConstructUInt; break;
2858 case 2: FRAG_VERT_ONLY("uvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec2; break;
2859 case 3: FRAG_VERT_ONLY("uvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec3; break;
2860 case 4: FRAG_VERT_ONLY("uvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructUVec4; break;
2861 }
2862 break;
John Bauman66b8ab22014-05-06 15:57:45 -04002863 case EbtBool:
Alexis Hetub14178b2015-04-13 13:23:20 -04002864 switch((yyvsp[(1) - (1)].interm.type).primarySize) {
John Bauman66b8ab22014-05-06 15:57:45 -04002865 case 1: op = EOpConstructBool; break;
2866 case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break;
2867 case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break;
2868 case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break;
2869 }
2870 break;
2871 default: break;
2872 }
2873 if (op == EOpNull) {
2874 context->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", getBasicString((yyvsp[(1) - (1)].interm.type).type));
2875 context->recover();
2876 (yyvsp[(1) - (1)].interm.type).type = EbtFloat;
2877 op = EOpConstructFloat;
2878 }
2879 }
2880 TString tempString;
2881 TType type((yyvsp[(1) - (1)].interm.type));
2882 TFunction *function = new TFunction(&tempString, type, op);
2883 (yyval.interm.function) = function;
2884 }
2885 break;
2886
John Bauman66b8ab22014-05-06 15:57:45 -04002887 case 27:
2888
2889 {
2890 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2891 context->recover();
2892 TType type(EbtVoid, EbpUndefined);
2893 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2894 (yyval.interm.function) = function;
2895 }
2896 break;
2897
2898 case 28:
2899
2900 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002901 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
2902 context->recover();
2903 TType type(EbtVoid, EbpUndefined);
2904 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2905 (yyval.interm.function) = function;
John Bauman66b8ab22014-05-06 15:57:45 -04002906 }
2907 break;
2908
2909 case 29:
2910
2911 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002912 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2913 }
2914 break;
2915
2916 case 30:
2917
2918 {
John Bauman66b8ab22014-05-06 15:57:45 -04002919 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2920 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002921 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002922 if ((yyval.interm.intermTypedNode) == 0) {
2923 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2924 context->recover();
2925 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2926 }
2927 }
2928 break;
2929
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002930 case 31:
John Bauman66b8ab22014-05-06 15:57:45 -04002931
2932 {
2933 if (context->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2934 context->recover();
John Baumand4ae8632014-05-06 16:18:33 -04002935 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04002936 if ((yyval.interm.intermTypedNode) == 0) {
2937 context->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2938 context->recover();
2939 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2940 }
2941 }
2942 break;
2943
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002944 case 32:
John Bauman66b8ab22014-05-06 15:57:45 -04002945
2946 {
2947 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
John Baumand4ae8632014-05-06 16:18:33 -04002948 (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 -04002949 if ((yyval.interm.intermTypedNode) == 0) {
2950 const char* errorOp = "";
2951 switch((yyvsp[(1) - (2)].interm).op) {
2952 case EOpNegative: errorOp = "-"; break;
2953 case EOpLogicalNot: errorOp = "!"; break;
Alexis Hetud061e422015-05-13 16:37:50 -04002954 case EOpBitwiseNot: errorOp = "~"; break;
John Bauman66b8ab22014-05-06 15:57:45 -04002955 default: break;
2956 }
2957 context->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2958 context->recover();
2959 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2960 }
2961 } else
2962 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2963 }
2964 break;
2965
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002966 case 33:
John Bauman66b8ab22014-05-06 15:57:45 -04002967
2968 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; }
2969 break;
2970
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002971 case 34:
John Bauman66b8ab22014-05-06 15:57:45 -04002972
2973 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; }
2974 break;
2975
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002976 case 35:
John Bauman66b8ab22014-05-06 15:57:45 -04002977
2978 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; }
2979 break;
2980
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002981 case 36:
John Bauman66b8ab22014-05-06 15:57:45 -04002982
Alexis Hetu17809052015-05-13 11:28:22 -04002983 {
2984 ES3_ONLY("~", (yyvsp[(1) - (1)].lex).line);
2985 (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseNot;
2986 }
John Bauman66b8ab22014-05-06 15:57:45 -04002987 break;
2988
Nicolas Capens2c1239f2015-02-17 17:30:04 -05002989 case 37:
John Bauman66b8ab22014-05-06 15:57:45 -04002990
Alexis Hetu17809052015-05-13 11:28:22 -04002991 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2992 break;
2993
2994 case 38:
2995
John Bauman66b8ab22014-05-06 15:57:45 -04002996 {
2997 FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04002998 (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 -04002999 if ((yyval.interm.intermTypedNode) == 0) {
3000 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3001 context->recover();
3002 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3003 }
3004 }
3005 break;
3006
Alexis Hetu17809052015-05-13 11:28:22 -04003007 case 39:
John Bauman66b8ab22014-05-06 15:57:45 -04003008
3009 {
3010 FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line);
John Baumand4ae8632014-05-06 16:18:33 -04003011 (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 -04003012 if ((yyval.interm.intermTypedNode) == 0) {
3013 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3014 context->recover();
3015 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3016 }
3017 }
3018 break;
3019
Alexis Hetu17809052015-05-13 11:28:22 -04003020 case 40:
3021
3022 {
3023 FRAG_VERT_ONLY("%", (yyvsp[(2) - (3)].lex).line);
3024 ES3_ONLY("%", (yyvsp[(2) - (3)].lex).line);
3025 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpIMod, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3026 if ((yyval.interm.intermTypedNode) == 0) {
3027 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "%", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3028 context->recover();
3029 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3030 }
3031 }
3032 break;
3033
3034 case 41:
John Bauman66b8ab22014-05-06 15:57:45 -04003035
3036 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3037 break;
3038
Alexis Hetu17809052015-05-13 11:28:22 -04003039 case 42:
John Bauman66b8ab22014-05-06 15:57:45 -04003040
3041 {
John Baumand4ae8632014-05-06 16:18:33 -04003042 (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 -04003043 if ((yyval.interm.intermTypedNode) == 0) {
3044 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3045 context->recover();
3046 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3047 }
3048 }
3049 break;
3050
Alexis Hetu17809052015-05-13 11:28:22 -04003051 case 43:
John Bauman66b8ab22014-05-06 15:57:45 -04003052
3053 {
John Baumand4ae8632014-05-06 16:18:33 -04003054 (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 -04003055 if ((yyval.interm.intermTypedNode) == 0) {
3056 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3057 context->recover();
3058 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3059 }
3060 }
3061 break;
3062
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003063 case 44:
3064
Alexis Hetu17809052015-05-13 11:28:22 -04003065 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3066 break;
3067
3068 case 45:
3069
3070 {
3071 ES3_ONLY("<<", (yyvsp[(2) - (3)].lex).line);
3072 context->intermediate.addBinaryMath(EOpBitShiftLeft, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3073 if ((yyval.interm.intermTypedNode) == 0) {
3074 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3075 context->recover();
3076 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3077 }
3078 }
3079 break;
3080
3081 case 46:
3082
3083 {
3084 ES3_ONLY(">>", (yyvsp[(2) - (3)].lex).line);
3085 context->intermediate.addBinaryMath(EOpBitShiftRight, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3086 if ((yyval.interm.intermTypedNode) == 0) {
3087 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">>", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3088 context->recover();
3089 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3090 }
3091 }
3092 break;
3093
3094 case 47:
3095
3096 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3097 break;
3098
3099 case 48:
3100
John Bauman66b8ab22014-05-06 15:57:45 -04003101 {
John Baumand4ae8632014-05-06 16:18:33 -04003102 (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 -04003103 if ((yyval.interm.intermTypedNode) == 0) {
3104 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3105 context->recover();
3106 ConstantUnion *unionArray = new ConstantUnion[1];
3107 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003108 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003109 }
3110 }
3111 break;
3112
Alexis Hetu17809052015-05-13 11:28:22 -04003113 case 49:
John Bauman66b8ab22014-05-06 15:57:45 -04003114
3115 {
John Baumand4ae8632014-05-06 16:18:33 -04003116 (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 -04003117 if ((yyval.interm.intermTypedNode) == 0) {
3118 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3119 context->recover();
3120 ConstantUnion *unionArray = new ConstantUnion[1];
3121 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003122 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003123 }
3124 }
3125 break;
3126
Alexis Hetu17809052015-05-13 11:28:22 -04003127 case 50:
John Bauman66b8ab22014-05-06 15:57:45 -04003128
3129 {
John Baumand4ae8632014-05-06 16:18:33 -04003130 (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 -04003131 if ((yyval.interm.intermTypedNode) == 0) {
3132 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3133 context->recover();
3134 ConstantUnion *unionArray = new ConstantUnion[1];
3135 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003136 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003137 }
3138 }
3139 break;
3140
Alexis Hetu17809052015-05-13 11:28:22 -04003141 case 51:
John Bauman66b8ab22014-05-06 15:57:45 -04003142
3143 {
John Baumand4ae8632014-05-06 16:18:33 -04003144 (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 -04003145 if ((yyval.interm.intermTypedNode) == 0) {
3146 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3147 context->recover();
3148 ConstantUnion *unionArray = new ConstantUnion[1];
3149 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003150 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003151 }
3152 }
3153 break;
3154
Alexis Hetu17809052015-05-13 11:28:22 -04003155 case 52:
John Bauman66b8ab22014-05-06 15:57:45 -04003156
3157 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3158 break;
3159
Alexis Hetu17809052015-05-13 11:28:22 -04003160 case 53:
John Bauman66b8ab22014-05-06 15:57:45 -04003161
3162 {
John Baumand4ae8632014-05-06 16:18:33 -04003163 (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 -04003164 if ((yyval.interm.intermTypedNode) == 0) {
3165 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3166 context->recover();
3167 ConstantUnion *unionArray = new ConstantUnion[1];
3168 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003169 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003170 }
3171 }
3172 break;
3173
Alexis Hetu17809052015-05-13 11:28:22 -04003174 case 54:
John Bauman66b8ab22014-05-06 15:57:45 -04003175
3176 {
John Baumand4ae8632014-05-06 16:18:33 -04003177 (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 -04003178 if ((yyval.interm.intermTypedNode) == 0) {
3179 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3180 context->recover();
3181 ConstantUnion *unionArray = new ConstantUnion[1];
3182 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003183 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003184 }
3185 }
3186 break;
3187
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003188 case 55:
3189
Alexis Hetu17809052015-05-13 11:28:22 -04003190 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3191 break;
3192
3193 case 56:
3194
3195 {
3196 ES3_ONLY("&", (yyvsp[(2) - (3)].lex).line);
3197 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3198 if ((yyval.interm.intermTypedNode) == 0) {
3199 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3200 context->recover();
3201 ConstantUnion *unionArray = new ConstantUnion[1];
3202 unionArray->setBConst(false);
3203 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3204 }
3205 }
3206 break;
3207
3208 case 57:
3209
3210 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3211 break;
3212
3213 case 58:
3214
3215 {
3216 ES3_ONLY("^", (yyvsp[(2) - (3)].lex).line);
3217 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3218 if ((yyval.interm.intermTypedNode) == 0) {
3219 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3220 context->recover();
3221 ConstantUnion *unionArray = new ConstantUnion[1];
3222 unionArray->setBConst(false);
3223 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3224 }
3225 }
3226 break;
3227
3228 case 59:
3229
3230 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3231 break;
3232
3233 case 60:
3234
3235 {
3236 ES3_ONLY("|", (yyvsp[(2) - (3)].lex).line);
3237 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpBitwiseOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3238 if ((yyval.interm.intermTypedNode) == 0) {
3239 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "|", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3240 context->recover();
3241 ConstantUnion *unionArray = new ConstantUnion[1];
3242 unionArray->setBConst(false);
3243 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
3244 }
3245 }
3246 break;
3247
3248 case 61:
3249
3250 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3251 break;
3252
3253 case 62:
3254
John Bauman66b8ab22014-05-06 15:57:45 -04003255 {
John Baumand4ae8632014-05-06 16:18:33 -04003256 (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 -04003257 if ((yyval.interm.intermTypedNode) == 0) {
3258 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3259 context->recover();
3260 ConstantUnion *unionArray = new ConstantUnion[1];
3261 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003262 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003263 }
3264 }
3265 break;
3266
Alexis Hetu17809052015-05-13 11:28:22 -04003267 case 63:
John Bauman66b8ab22014-05-06 15:57:45 -04003268
3269 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3270 break;
3271
Alexis Hetu17809052015-05-13 11:28:22 -04003272 case 64:
John Bauman66b8ab22014-05-06 15:57:45 -04003273
3274 {
John Baumand4ae8632014-05-06 16:18:33 -04003275 (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 -04003276 if ((yyval.interm.intermTypedNode) == 0) {
3277 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3278 context->recover();
3279 ConstantUnion *unionArray = new ConstantUnion[1];
3280 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003281 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003282 }
3283 }
3284 break;
3285
Alexis Hetu17809052015-05-13 11:28:22 -04003286 case 65:
John Bauman66b8ab22014-05-06 15:57:45 -04003287
3288 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3289 break;
3290
Alexis Hetu17809052015-05-13 11:28:22 -04003291 case 66:
John Bauman66b8ab22014-05-06 15:57:45 -04003292
3293 {
John Baumand4ae8632014-05-06 16:18:33 -04003294 (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 -04003295 if ((yyval.interm.intermTypedNode) == 0) {
3296 context->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3297 context->recover();
3298 ConstantUnion *unionArray = new ConstantUnion[1];
3299 unionArray->setBConst(false);
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05003300 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConstExpr), (yyvsp[(2) - (3)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003301 }
3302 }
3303 break;
3304
Alexis Hetu17809052015-05-13 11:28:22 -04003305 case 67:
John Bauman66b8ab22014-05-06 15:57:45 -04003306
3307 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3308 break;
3309
Alexis Hetu17809052015-05-13 11:28:22 -04003310 case 68:
John Bauman66b8ab22014-05-06 15:57:45 -04003311
3312 {
3313 if (context->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode)))
3314 context->recover();
3315
3316 (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);
3317 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3318 (yyval.interm.intermTypedNode) = 0;
3319
3320 if ((yyval.interm.intermTypedNode) == 0) {
3321 context->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3322 context->recover();
3323 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3324 }
3325 }
3326 break;
3327
Alexis Hetu17809052015-05-13 11:28:22 -04003328 case 69:
John Bauman66b8ab22014-05-06 15:57:45 -04003329
3330 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3331 break;
3332
Alexis Hetu17809052015-05-13 11:28:22 -04003333 case 70:
John Bauman66b8ab22014-05-06 15:57:45 -04003334
3335 {
3336 if (context->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3337 context->recover();
3338 (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);
3339 if ((yyval.interm.intermTypedNode) == 0) {
3340 context->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3341 context->recover();
3342 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3343 }
3344 }
3345 break;
3346
Alexis Hetu17809052015-05-13 11:28:22 -04003347 case 71:
John Bauman66b8ab22014-05-06 15:57:45 -04003348
3349 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; }
3350 break;
3351
Alexis Hetu17809052015-05-13 11:28:22 -04003352 case 72:
John Bauman66b8ab22014-05-06 15:57:45 -04003353
3354 { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; }
3355 break;
3356
Alexis Hetu17809052015-05-13 11:28:22 -04003357 case 73:
John Bauman66b8ab22014-05-06 15:57:45 -04003358
3359 { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; }
3360 break;
3361
Alexis Hetu17809052015-05-13 11:28:22 -04003362 case 74:
3363
3364 { ES3_ONLY("%=", (yyvsp[(1) - (1)].lex).line);
3365 FRAG_VERT_ONLY("%=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpIModAssign; }
3366 break;
3367
3368 case 75:
John Bauman66b8ab22014-05-06 15:57:45 -04003369
3370 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; }
3371 break;
3372
Alexis Hetu17809052015-05-13 11:28:22 -04003373 case 76:
John Bauman66b8ab22014-05-06 15:57:45 -04003374
3375 { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; }
3376 break;
3377
Alexis Hetu17809052015-05-13 11:28:22 -04003378 case 77:
3379
3380 { ES3_ONLY("<<=", (yyvsp[(1) - (1)].lex).line);
3381 FRAG_VERT_ONLY("<<=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftLeftAssign; }
3382 break;
3383
3384 case 78:
3385
3386 { ES3_ONLY(">>=", (yyvsp[(1) - (1)].lex).line);
3387 FRAG_VERT_ONLY(">>=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitShiftRightAssign; }
3388 break;
3389
3390 case 79:
3391
3392 { ES3_ONLY("&=", (yyvsp[(1) - (1)].lex).line);
3393 FRAG_VERT_ONLY("&=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseAndAssign; }
3394 break;
3395
3396 case 80:
3397
3398 { ES3_ONLY("^=", (yyvsp[(1) - (1)].lex).line);
3399 FRAG_VERT_ONLY("^=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseXorAssign; }
3400 break;
3401
3402 case 81:
3403
3404 { ES3_ONLY("|=", (yyvsp[(1) - (1)].lex).line);
3405 FRAG_VERT_ONLY("|=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpBitwiseOrAssign; }
3406 break;
3407
3408 case 82:
John Bauman66b8ab22014-05-06 15:57:45 -04003409
3410 {
3411 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3412 }
3413 break;
3414
Alexis Hetu17809052015-05-13 11:28:22 -04003415 case 83:
John Bauman66b8ab22014-05-06 15:57:45 -04003416
3417 {
3418 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line);
3419 if ((yyval.interm.intermTypedNode) == 0) {
3420 context->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3421 context->recover();
3422 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3423 }
3424 }
3425 break;
3426
Alexis Hetu17809052015-05-13 11:28:22 -04003427 case 84:
John Bauman66b8ab22014-05-06 15:57:45 -04003428
3429 {
3430 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3431 context->recover();
3432 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3433 }
3434 break;
3435
Alexis Hetu17809052015-05-13 11:28:22 -04003436 case 85:
John Bauman66b8ab22014-05-06 15:57:45 -04003437
3438 {
3439 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3440
3441 TIntermAggregate *prototype = new TIntermAggregate;
3442 prototype->setType(function.getReturnType());
3443 prototype->setName(function.getName());
3444
3445 for (int i = 0; i < function.getParamCount(); i++)
3446 {
3447 const TParameter &param = function.getParam(i);
3448 if (param.name != 0)
3449 {
John Baumand4ae8632014-05-06 16:18:33 -04003450 TVariable variable(param.name, *param.type);
John Bauman66b8ab22014-05-06 15:57:45 -04003451
John Baumand4ae8632014-05-06 16:18:33 -04003452 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 -04003453 }
3454 else
3455 {
3456 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
3457 }
3458 }
3459
3460 prototype->setOp(EOpPrototype);
3461 (yyval.interm.intermNode) = prototype;
3462
3463 context->symbolTable.pop();
3464 }
3465 break;
3466
Alexis Hetu17809052015-05-13 11:28:22 -04003467 case 86:
John Bauman66b8ab22014-05-06 15:57:45 -04003468
3469 {
3470 if ((yyvsp[(1) - (2)].interm).intermAggregate)
3471 (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
3472 (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
3473 }
3474 break;
3475
Alexis Hetu17809052015-05-13 11:28:22 -04003476 case 87:
John Bauman66b8ab22014-05-06 15:57:45 -04003477
3478 {
John Baumand4ae8632014-05-06 16:18:33 -04003479 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3480 context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3481 context->recover();
3482 }
John Bauman66b8ab22014-05-06 15:57:45 -04003483 (yyval.interm.intermNode) = 0;
3484 }
3485 break;
3486
Alexis Hetu17809052015-05-13 11:28:22 -04003487 case 88:
John Bauman66b8ab22014-05-06 15:57:45 -04003488
3489 {
3490 //
3491 // Multiple declarations of the same function are allowed.
3492 //
3493 // If this is a definition, the definition production code will check for redefinitions
3494 // (we don't know at this point if it's a definition or not).
3495 //
3496 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3497 //
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05003498 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04003499 if (prevDec) {
3500 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
3501 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
3502 context->recover();
3503 }
3504 for (int i = 0; i < prevDec->getParamCount(); ++i) {
3505 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
3506 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
3507 context->recover();
3508 }
3509 }
3510 }
3511
3512 //
3513 // If this is a redeclaration, it could also be a definition,
3514 // in which case, we want to use the variable names from this one, and not the one that's
3515 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3516 //
3517 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3518 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3519
3520 // We're at the inner scope level of the function's arguments and body statement.
3521 // Add the function prototype to the surrounding scope instead.
3522 context->symbolTable.getOuterLevel()->insert(*(yyval.interm).function);
3523 }
3524 break;
3525
Alexis Hetu17809052015-05-13 11:28:22 -04003526 case 89:
John Bauman66b8ab22014-05-06 15:57:45 -04003527
3528 {
3529 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3530 }
3531 break;
3532
Alexis Hetu17809052015-05-13 11:28:22 -04003533 case 90:
John Bauman66b8ab22014-05-06 15:57:45 -04003534
3535 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003536 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3537 }
3538 break;
3539
Alexis Hetu17809052015-05-13 11:28:22 -04003540 case 91:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003541
3542 {
John Bauman66b8ab22014-05-06 15:57:45 -04003543 // Add the parameter
3544 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3545 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3546 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3547 else
3548 delete (yyvsp[(2) - (2)].interm).param.type;
3549 }
3550 break;
3551
Alexis Hetu17809052015-05-13 11:28:22 -04003552 case 92:
John Bauman66b8ab22014-05-06 15:57:45 -04003553
3554 {
3555 //
3556 // Only first parameter of one-parameter functions can be void
3557 // The check for named parameters not being void is done in parameter_declarator
3558 //
3559 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3560 //
3561 // This parameter > first is void
3562 //
3563 context->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void");
3564 context->recover();
3565 delete (yyvsp[(3) - (3)].interm).param.type;
3566 } else {
3567 // Add the parameter
3568 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3569 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3570 }
3571 }
3572 break;
3573
Alexis Hetu17809052015-05-13 11:28:22 -04003574 case 93:
John Bauman66b8ab22014-05-06 15:57:45 -04003575
3576 {
3577 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
3578 context->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));
3579 context->recover();
3580 }
3581 // make sure a sampler is not involved as well...
3582 if (context->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type)))
3583 context->recover();
3584
3585 // Add the function as a prototype after parsing it (we do not support recursion)
3586 TFunction *function;
3587 TType type((yyvsp[(1) - (3)].interm.type));
3588 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3589 (yyval.interm.function) = function;
3590
3591 context->symbolTable.push();
3592 }
3593 break;
3594
Alexis Hetu17809052015-05-13 11:28:22 -04003595 case 94:
John Bauman66b8ab22014-05-06 15:57:45 -04003596
3597 {
3598 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
3599 context->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
3600 context->recover();
3601 }
3602 if (context->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string))
3603 context->recover();
3604 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3605 (yyval.interm).line = (yyvsp[(2) - (2)].lex).line;
3606 (yyval.interm).param = param;
3607 }
3608 break;
3609
Alexis Hetu17809052015-05-13 11:28:22 -04003610 case 95:
John Bauman66b8ab22014-05-06 15:57:45 -04003611
3612 {
3613 // Check that we can make an array out of this type
3614 if (context->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3615 context->recover();
3616
3617 if (context->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string))
3618 context->recover();
3619
3620 int size;
3621 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3622 context->recover();
3623 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3624
3625 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3626 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3627 (yyval.interm).line = (yyvsp[(2) - (5)].lex).line;
3628 (yyval.interm).param = param;
3629 }
3630 break;
3631
Alexis Hetu17809052015-05-13 11:28:22 -04003632 case 96:
John Bauman66b8ab22014-05-06 15:57:45 -04003633
3634 {
3635 (yyval.interm) = (yyvsp[(3) - (3)].interm);
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05003636 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 -04003637 context->recover();
3638 }
3639 break;
3640
Alexis Hetu17809052015-05-13 11:28:22 -04003641 case 97:
John Bauman66b8ab22014-05-06 15:57:45 -04003642
3643 {
John Bauman66b8ab22014-05-06 15:57:45 -04003644 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3645 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3646 context->recover();
3647 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3648 context->recover();
3649 }
3650 break;
3651
Alexis Hetu17809052015-05-13 11:28:22 -04003652 case 98:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003653
3654 {
3655 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3656 if (context->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3657 context->recover();
3658 }
3659 break;
3660
Alexis Hetu17809052015-05-13 11:28:22 -04003661 case 99:
John Bauman66b8ab22014-05-06 15:57:45 -04003662
3663 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003664 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3665 if (context->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3666 context->recover();
3667 if (context->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3668 context->recover();
John Bauman66b8ab22014-05-06 15:57:45 -04003669 }
3670 break;
3671
Alexis Hetu17809052015-05-13 11:28:22 -04003672 case 100:
John Bauman66b8ab22014-05-06 15:57:45 -04003673
3674 {
3675 (yyval.interm.qualifier) = EvqIn;
3676 }
3677 break;
3678
Alexis Hetu17809052015-05-13 11:28:22 -04003679 case 101:
John Bauman66b8ab22014-05-06 15:57:45 -04003680
3681 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003682 (yyval.interm.qualifier) = EvqIn;
John Bauman66b8ab22014-05-06 15:57:45 -04003683 }
3684 break;
3685
Alexis Hetu17809052015-05-13 11:28:22 -04003686 case 102:
John Bauman66b8ab22014-05-06 15:57:45 -04003687
3688 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003689 (yyval.interm.qualifier) = EvqOut;
John Bauman66b8ab22014-05-06 15:57:45 -04003690 }
3691 break;
3692
Alexis Hetu17809052015-05-13 11:28:22 -04003693 case 103:
John Bauman66b8ab22014-05-06 15:57:45 -04003694
3695 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003696 (yyval.interm.qualifier) = EvqInOut;
3697 }
3698 break;
3699
Alexis Hetu17809052015-05-13 11:28:22 -04003700 case 104:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05003701
3702 {
John Bauman66b8ab22014-05-06 15:57:45 -04003703 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3704 (yyval.interm).param = param;
3705 }
3706 break;
3707
Alexis Hetu17809052015-05-13 11:28:22 -04003708 case 105:
John Bauman66b8ab22014-05-06 15:57:45 -04003709
3710 {
3711 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3712 }
3713 break;
3714
Alexis Hetu17809052015-05-13 11:28:22 -04003715 case 106:
John Bauman66b8ab22014-05-06 15:57:45 -04003716
3717 {
3718 if ((yyvsp[(1) - (3)].interm).type.type == EbtInvariant && !(yyvsp[(3) - (3)].lex).symbol)
3719 {
3720 context->error((yyvsp[(3) - (3)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(3) - (3)].lex).string->c_str());
3721 context->recover();
3722 }
3723
3724 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line);
3725 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, symbol, (yyvsp[(3) - (3)].lex).line);
3726
3727 if (context->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type))
3728 context->recover();
3729
3730 if (context->nonInitConstErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, false))
3731 context->recover();
3732
3733 TVariable* variable = 0;
3734 if (context->nonInitErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type, variable))
3735 context->recover();
3736 if (symbol && variable)
3737 symbol->setId(variable->getUniqueId());
3738 }
3739 break;
3740
Alexis Hetu17809052015-05-13 11:28:22 -04003741 case 107:
John Bauman66b8ab22014-05-06 15:57:45 -04003742
3743 {
3744 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3745 context->recover();
3746
3747 if (context->nonInitConstErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, true))
3748 context->recover();
3749
3750 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3751
3752 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))
3753 context->recover();
3754 else {
3755 (yyvsp[(1) - (5)].interm).type.setArray(true);
3756 TVariable* variable;
3757 if (context->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable))
3758 context->recover();
3759 }
3760 }
3761 break;
3762
Alexis Hetu17809052015-05-13 11:28:22 -04003763 case 108:
John Bauman66b8ab22014-05-06 15:57:45 -04003764
3765 {
3766 if (context->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type))
3767 context->recover();
3768
3769 if (context->nonInitConstErrorCheck((yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, true))
3770 context->recover();
3771
3772 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3773
3774 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))
3775 context->recover();
3776 else {
3777 int size;
3778 if (context->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size))
3779 context->recover();
3780 (yyvsp[(1) - (6)].interm).type.setArray(true, size);
3781 TVariable* variable = 0;
3782 if (context->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable))
3783 context->recover();
3784 TType type = TType((yyvsp[(1) - (6)].interm).type);
3785 type.setArraySize(size);
3786 (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);
3787 }
3788 }
3789 break;
3790
Alexis Hetu17809052015-05-13 11:28:22 -04003791 case 109:
John Bauman66b8ab22014-05-06 15:57:45 -04003792
3793 {
3794 if (context->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type))
3795 context->recover();
3796
3797 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3798
3799 TIntermNode* intermNode;
3800 if (!context->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) {
3801 //
3802 // build the intermediate representation
3803 //
3804 if (intermNode)
3805 (yyval.interm).intermAggregate = context->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line);
3806 else
3807 (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate;
3808 } else {
3809 context->recover();
3810 (yyval.interm).intermAggregate = 0;
3811 }
3812 }
3813 break;
3814
Alexis Hetu17809052015-05-13 11:28:22 -04003815 case 110:
John Bauman66b8ab22014-05-06 15:57:45 -04003816
3817 {
3818 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3819 (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);
3820 }
3821 break;
3822
Alexis Hetu17809052015-05-13 11:28:22 -04003823 case 111:
John Bauman66b8ab22014-05-06 15:57:45 -04003824
3825 {
3826 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line);
3827 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3828
3829 if (context->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type))
3830 context->recover();
3831
3832 if (context->nonInitConstErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, false))
3833 context->recover();
3834
3835 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3836
3837 TVariable* variable = 0;
3838 if (context->nonInitErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type, variable))
3839 context->recover();
3840 if (variable && symbol)
3841 symbol->setId(variable->getUniqueId());
3842 }
3843 break;
3844
Alexis Hetu17809052015-05-13 11:28:22 -04003845 case 112:
John Bauman66b8ab22014-05-06 15:57:45 -04003846
3847 {
3848 context->error((yyvsp[(2) - (4)].lex).line, "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str());
3849 context->recover();
3850
3851 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line);
3852 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (4)].lex).line);
3853 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3854 }
3855 break;
3856
Alexis Hetu17809052015-05-13 11:28:22 -04003857 case 113:
John Bauman66b8ab22014-05-06 15:57:45 -04003858
3859 {
3860 TType type = TType((yyvsp[(1) - (5)].interm.type));
3861 int size;
3862 if (context->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3863 context->recover();
3864 type.setArraySize(size);
3865 TIntermSymbol* symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line);
3866 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (5)].lex).line);
3867
3868 if (context->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)))
3869 context->recover();
3870
3871 if (context->nonInitConstErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), true))
3872 context->recover();
3873
3874 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3875
3876 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)))
3877 context->recover();
3878 else {
3879 int size;
3880 if (context->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3881 context->recover();
3882
3883 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3884 TVariable* variable = 0;
3885 if (context->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable))
3886 context->recover();
3887 if (variable && symbol)
3888 symbol->setId(variable->getUniqueId());
3889 }
3890 }
3891 break;
3892
Alexis Hetu17809052015-05-13 11:28:22 -04003893 case 114:
John Bauman66b8ab22014-05-06 15:57:45 -04003894
3895 {
3896 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
3897 context->recover();
3898
3899 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3900
3901 TIntermNode* intermNode;
3902 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) {
3903 //
3904 // Build intermediate representation
3905 //
3906 if(intermNode)
3907 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line);
3908 else
3909 (yyval.interm).intermAggregate = 0;
3910 } else {
3911 context->recover();
3912 (yyval.interm).intermAggregate = 0;
3913 }
3914 }
3915 break;
3916
Alexis Hetu17809052015-05-13 11:28:22 -04003917 case 115:
John Bauman66b8ab22014-05-06 15:57:45 -04003918
3919 {
John Bauman66b8ab22014-05-06 15:57:45 -04003920 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
3921 context->recover();
3922 (yyval.interm).type.setBasic(EbtInvariant, EvqInvariantVaryingOut, (yyvsp[(2) - (2)].lex).line);
3923 if (!(yyvsp[(2) - (2)].lex).symbol)
3924 {
3925 context->error((yyvsp[(2) - (2)].lex).line, "undeclared identifier declared as invariant", (yyvsp[(2) - (2)].lex).string->c_str());
3926 context->recover();
3927
3928 (yyval.interm).intermAggregate = 0;
3929 }
3930 else
3931 {
3932 TIntermSymbol *symbol = context->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyval.interm).type), (yyvsp[(2) - (2)].lex).line);
3933 (yyval.interm).intermAggregate = context->intermediate.makeAggregate(symbol, (yyvsp[(2) - (2)].lex).line);
3934 }
3935 }
3936 break;
3937
Alexis Hetu17809052015-05-13 11:28:22 -04003938 case 116:
John Bauman66b8ab22014-05-06 15:57:45 -04003939
3940 {
3941 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3942
3943 if ((yyvsp[(1) - (1)].interm.type).array) {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003944 ES3_ONLY("[]", (yyvsp[(1) - (1)].interm.type).line);
3945 if (context->getShaderVersion() != 300) {
3946 (yyvsp[(1) - (1)].interm.type).clearArrayness();
3947 }
John Bauman66b8ab22014-05-06 15:57:45 -04003948 }
3949 }
3950 break;
3951
Alexis Hetu17809052015-05-13 11:28:22 -04003952 case 117:
John Bauman66b8ab22014-05-06 15:57:45 -04003953
3954 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04003955 (yyval.interm.type) = context->addFullySpecifiedType((yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(1) - (2)].interm.type).invariant, (yyvsp[(1) - (2)].interm.type).layoutQualifier, (yyvsp[(2) - (2)].interm.type));
John Bauman66b8ab22014-05-06 15:57:45 -04003956 }
3957 break;
3958
Alexis Hetu17809052015-05-13 11:28:22 -04003959 case 118:
John Bauman66b8ab22014-05-06 15:57:45 -04003960
3961 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003962 (yyval.interm.type).qualifier = EvqSmooth;
John Bauman66b8ab22014-05-06 15:57:45 -04003963 }
3964 break;
3965
Alexis Hetu17809052015-05-13 11:28:22 -04003966 case 119:
John Bauman66b8ab22014-05-06 15:57:45 -04003967
3968 {
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003969 (yyval.interm.type).qualifier = EvqFlat;
3970 }
3971 break;
3972
Alexis Hetu17809052015-05-13 11:28:22 -04003973 case 120:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003974
3975 {
3976 (yyval.interm.qualifier) = EvqConstReadOnly;
3977 }
3978 break;
3979
Alexis Hetu17809052015-05-13 11:28:22 -04003980 case 121:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04003981
3982 {
John Bauman66b8ab22014-05-06 15:57:45 -04003983 VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
Nicolas Capensc6841852015-02-15 14:25:37 -05003984 ES2_ONLY("attribute", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003985 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "attribute"))
3986 context->recover();
3987 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line);
3988 }
3989 break;
3990
Alexis Hetu17809052015-05-13 11:28:22 -04003991 case 122:
John Bauman66b8ab22014-05-06 15:57:45 -04003992
3993 {
Nicolas Capensc6841852015-02-15 14:25:37 -05003994 ES2_ONLY("varying", (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04003995 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "varying"))
3996 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05003997 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04003998 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line);
3999 else
4000 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line);
4001 }
4002 break;
4003
Alexis Hetu17809052015-05-13 11:28:22 -04004004 case 123:
John Bauman66b8ab22014-05-06 15:57:45 -04004005
4006 {
Nicolas Capensc6841852015-02-15 14:25:37 -05004007 ES2_ONLY("varying", (yyvsp[(1) - (2)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004008 if (context->globalErrorCheck((yyvsp[(1) - (2)].lex).line, context->symbolTable.atGlobalLevel(), "invariant varying"))
4009 context->recover();
Nicolas Capens08ca3c62015-02-13 16:06:45 -05004010 if (context->shaderType == GL_VERTEX_SHADER)
John Bauman66b8ab22014-05-06 15:57:45 -04004011 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line);
4012 else
4013 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line);
4014 }
4015 break;
4016
Alexis Hetu17809052015-05-13 11:28:22 -04004017 case 124:
John Bauman66b8ab22014-05-06 15:57:45 -04004018
4019 {
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004020 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yyvsp[(1) - (1)].interm.type).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004021 }
4022 break;
4023
Alexis Hetu17809052015-05-13 11:28:22 -04004024 case 125:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004025
4026 {
4027 (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);
4028 }
4029 break;
4030
Alexis Hetu17809052015-05-13 11:28:22 -04004031 case 126:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004032
4033 {
4034 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));
4035 context->recover();
4036
4037 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4038 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].interm.type).line);
4039 }
4040 break;
4041
Alexis Hetu17809052015-05-13 11:28:22 -04004042 case 127:
John Bauman66b8ab22014-05-06 15:57:45 -04004043
4044 {
Nicolas Capens7d626792015-02-17 17:58:31 -05004045 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4046 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
4047 }
4048 break;
4049
Alexis Hetu17809052015-05-13 11:28:22 -04004050 case 128:
Nicolas Capens7d626792015-02-17 17:58:31 -05004051
4052 {
4053 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yyvsp[(2) - (2)].interm.type).line);
4054 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
4055 }
4056 break;
4057
Alexis Hetu17809052015-05-13 11:28:22 -04004058 case 129:
Nicolas Capens7d626792015-02-17 17:58:31 -05004059
4060 {
Nicolas Capens31ad2aa2015-02-26 13:14:27 -05004061 (yyval.interm.type).qualifier = EvqConstExpr;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004062 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4063 }
4064 break;
4065
Alexis Hetu17809052015-05-13 11:28:22 -04004066 case 130:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004067
4068 {
4069 ES3_ONLY("in", (yyvsp[(1) - (1)].lex).line);
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004070 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004071 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4072 }
4073 break;
4074
Alexis Hetu17809052015-05-13 11:28:22 -04004075 case 131:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004076
4077 {
4078 ES3_ONLY("out", (yyvsp[(1) - (1)].lex).line);
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004079 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004080 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4081 }
4082 break;
4083
Alexis Hetu17809052015-05-13 11:28:22 -04004084 case 132:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004085
4086 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004087 ES3_ONLY("centroid in", (yyvsp[(1) - (2)].lex).line);
4088 if (context->shaderType == GL_VERTEX_SHADER)
4089 {
4090 context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader");
4091 context->recover();
4092 }
4093 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004094 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
4095 }
4096 break;
4097
Alexis Hetu17809052015-05-13 11:28:22 -04004098 case 133:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004099
4100 {
Alexis Hetu42ff6b12015-06-03 16:03:48 -04004101 ES3_ONLY("centroid out", (yyvsp[(1) - (2)].lex).line);
4102 if (context->shaderType == GL_FRAGMENT_SHADER)
4103 {
4104 context->error((yyvsp[(1) - (2)].lex).line, "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader");
4105 context->recover();
4106 }
4107 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004108 (yyval.interm.type).line = (yyvsp[(2) - (2)].lex).line;
4109 }
4110 break;
4111
Alexis Hetu17809052015-05-13 11:28:22 -04004112 case 134:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004113
4114 {
4115 if (context->globalErrorCheck((yyvsp[(1) - (1)].lex).line, context->symbolTable.atGlobalLevel(), "uniform"))
4116 context->recover();
4117 (yyval.interm.type).qualifier = EvqUniform;
4118 (yyval.interm.type).line = (yyvsp[(1) - (1)].lex).line;
4119 }
4120 break;
4121
Alexis Hetu17809052015-05-13 11:28:22 -04004122 case 135:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004123
4124 {
John Bauman66b8ab22014-05-06 15:57:45 -04004125 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4126
4127 if ((yyval.interm.type).precision == EbpUndefined) {
4128 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
4129 if (context->precisionErrorCheck((yyvsp[(1) - (1)].interm.type).line, (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
4130 context->recover();
4131 }
4132 }
4133 }
4134 break;
4135
Alexis Hetu17809052015-05-13 11:28:22 -04004136 case 136:
John Bauman66b8ab22014-05-06 15:57:45 -04004137
4138 {
4139 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
4140 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
4141 }
4142 break;
4143
Alexis Hetu17809052015-05-13 11:28:22 -04004144 case 137:
John Bauman66b8ab22014-05-06 15:57:45 -04004145
4146 {
4147 (yyval.interm.precision) = EbpHigh;
4148 }
4149 break;
4150
Alexis Hetu17809052015-05-13 11:28:22 -04004151 case 138:
John Bauman66b8ab22014-05-06 15:57:45 -04004152
4153 {
4154 (yyval.interm.precision) = EbpMedium;
4155 }
4156 break;
4157
Alexis Hetu17809052015-05-13 11:28:22 -04004158 case 139:
John Bauman66b8ab22014-05-06 15:57:45 -04004159
4160 {
4161 (yyval.interm.precision) = EbpLow;
4162 }
4163 break;
4164
Alexis Hetu17809052015-05-13 11:28:22 -04004165 case 140:
Nicolas Capens7d626792015-02-17 17:58:31 -05004166
4167 {
4168 ES3_ONLY("layout", (yyvsp[(1) - (4)].lex).line);
4169 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
4170 }
4171 break;
4172
Alexis Hetu17809052015-05-13 11:28:22 -04004173 case 141:
Nicolas Capens7d626792015-02-17 17:58:31 -05004174
4175 {
4176 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
4177 }
4178 break;
4179
Alexis Hetu17809052015-05-13 11:28:22 -04004180 case 142:
Nicolas Capens7d626792015-02-17 17:58:31 -05004181
4182 {
4183 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
4184 }
4185 break;
4186
Alexis Hetu17809052015-05-13 11:28:22 -04004187 case 143:
Nicolas Capens7d626792015-02-17 17:58:31 -05004188
4189 {
4190 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line);
4191 }
4192 break;
4193
Alexis Hetu17809052015-05-13 11:28:22 -04004194 case 144:
Nicolas Capens7d626792015-02-17 17:58:31 -05004195
4196 {
4197 (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);
4198 }
4199 break;
4200
Alexis Hetu17809052015-05-13 11:28:22 -04004201 case 145:
Nicolas Capens7d626792015-02-17 17:58:31 -05004202
4203 {
4204 (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);
4205 }
4206 break;
4207
Alexis Hetu17809052015-05-13 11:28:22 -04004208 case 146:
John Bauman66b8ab22014-05-06 15:57:45 -04004209
4210 {
4211 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4212 }
4213 break;
4214
Alexis Hetu17809052015-05-13 11:28:22 -04004215 case 147:
John Bauman66b8ab22014-05-06 15:57:45 -04004216
4217 {
4218 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
4219
4220 if (context->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4221 context->recover();
4222 else {
4223 int size;
4224 if (context->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4225 context->recover();
4226 (yyval.interm.type).setArray(true, size);
4227 }
4228 }
4229 break;
4230
Alexis Hetu17809052015-05-13 11:28:22 -04004231 case 148:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004232
4233 {
Nicolas Capens3c20f802015-02-17 17:17:20 -05004234 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004235 (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capens7d626792015-02-17 17:58:31 -05004236 }
4237 break;
4238
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004239 case 149:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004240
4241 {
4242 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu17809052015-05-13 11:28:22 -04004243 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004244 }
4245 break;
4246
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004247 case 150:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004248
4249 {
4250 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
Alexis Hetu17809052015-05-13 11:28:22 -04004251 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004252 }
4253 break;
4254
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004255 case 151:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004256
4257 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004258 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4259 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004260 }
4261 break;
4262
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004263 case 152:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004264
4265 {
Alexis Hetu17809052015-05-13 11:28:22 -04004266 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4267 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4268 }
4269 break;
4270
4271 case 153:
4272
4273 {
4274 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4275 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4276 (yyval.interm.type).setAggregate(2);
4277 }
4278 break;
4279
4280 case 154:
4281
4282 {
4283 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4284 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4285 (yyval.interm.type).setAggregate(3);
4286 }
4287 break;
4288
4289 case 155:
4290
4291 {
4292 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4293 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4294 (yyval.interm.type).setAggregate(4);
4295 }
4296 break;
4297
4298 case 156:
4299
4300 {
4301 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4302 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4303 (yyval.interm.type).setAggregate(2);
4304 }
4305 break;
4306
4307 case 157:
4308
4309 {
4310 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4311 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4312 (yyval.interm.type).setAggregate(3);
4313 }
4314 break;
4315
4316 case 158:
4317
4318 {
4319 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4320 (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line);
4321 (yyval.interm.type).setAggregate(4);
4322 }
4323 break;
4324
4325 case 159:
4326
4327 {
4328 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4329 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4330 (yyval.interm.type).setAggregate(2);
4331 }
4332 break;
4333
4334 case 160:
4335
4336 {
4337 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4338 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4339 (yyval.interm.type).setAggregate(3);
4340 }
4341 break;
4342
4343 case 161:
4344
4345 {
4346 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4347 (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line);
4348 (yyval.interm.type).setAggregate(4);
4349 }
4350 break;
4351
4352 case 162:
4353
4354 {
4355 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4356 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4357 (yyval.interm.type).setAggregate(2);
4358 }
4359 break;
4360
4361 case 163:
4362
4363 {
4364 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4365 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4366 (yyval.interm.type).setAggregate(3);
4367 }
4368 break;
4369
4370 case 164:
4371
4372 {
4373 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4374 (yyval.interm.type).setBasic(EbtUInt, qual, (yyvsp[(1) - (1)].lex).line);
4375 (yyval.interm.type).setAggregate(4);
4376 }
4377 break;
4378
4379 case 165:
4380
4381 {
John Bauman66b8ab22014-05-06 15:57:45 -04004382 FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line);
4383 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4384 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004385 (yyval.interm.type).setMatrix(2, 2);
John Bauman66b8ab22014-05-06 15:57:45 -04004386 }
4387 break;
4388
Alexis Hetu17809052015-05-13 11:28:22 -04004389 case 166:
John Bauman66b8ab22014-05-06 15:57:45 -04004390
4391 {
4392 FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line);
4393 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4394 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004395 (yyval.interm.type).setMatrix(3, 3);
John Bauman66b8ab22014-05-06 15:57:45 -04004396 }
4397 break;
4398
Alexis Hetu17809052015-05-13 11:28:22 -04004399 case 167:
John Bauman66b8ab22014-05-06 15:57:45 -04004400
4401 {
4402 FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line);
4403 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4404 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
Alexis Hetub14178b2015-04-13 13:23:20 -04004405 (yyval.interm.type).setMatrix(4, 4);
John Bauman66b8ab22014-05-06 15:57:45 -04004406 }
4407 break;
4408
Alexis Hetu17809052015-05-13 11:28:22 -04004409 case 168:
John Bauman66b8ab22014-05-06 15:57:45 -04004410
4411 {
Alexis Hetub14178b2015-04-13 13:23:20 -04004412 FRAG_VERT_ONLY("mat2x3", (yyvsp[(1) - (1)].lex).line);
4413 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4414 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4415 (yyval.interm.type).setMatrix(2, 3);
4416 }
4417 break;
4418
Alexis Hetu17809052015-05-13 11:28:22 -04004419 case 169:
Alexis Hetub14178b2015-04-13 13:23:20 -04004420
4421 {
4422 FRAG_VERT_ONLY("mat3x2", (yyvsp[(1) - (1)].lex).line);
4423 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4424 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4425 (yyval.interm.type).setMatrix(3, 2);
4426 }
4427 break;
4428
Alexis Hetu17809052015-05-13 11:28:22 -04004429 case 170:
Alexis Hetub14178b2015-04-13 13:23:20 -04004430
4431 {
4432 FRAG_VERT_ONLY("mat2x4", (yyvsp[(1) - (1)].lex).line);
4433 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4434 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4435 (yyval.interm.type).setMatrix(2, 4);
4436 }
4437 break;
4438
Alexis Hetu17809052015-05-13 11:28:22 -04004439 case 171:
Alexis Hetub14178b2015-04-13 13:23:20 -04004440
4441 {
4442 FRAG_VERT_ONLY("mat4x2", (yyvsp[(1) - (1)].lex).line);
4443 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4444 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4445 (yyval.interm.type).setMatrix(4, 2);
4446 }
4447 break;
4448
Alexis Hetu17809052015-05-13 11:28:22 -04004449 case 172:
Alexis Hetub14178b2015-04-13 13:23:20 -04004450
4451 {
4452 FRAG_VERT_ONLY("mat3x4", (yyvsp[(1) - (1)].lex).line);
4453 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4454 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4455 (yyval.interm.type).setMatrix(3, 4);
4456 }
4457 break;
4458
Alexis Hetu17809052015-05-13 11:28:22 -04004459 case 173:
Alexis Hetub14178b2015-04-13 13:23:20 -04004460
4461 {
4462 FRAG_VERT_ONLY("mat4x3", (yyvsp[(1) - (1)].lex).line);
4463 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4464 (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line);
4465 (yyval.interm.type).setMatrix(4, 3);
4466 }
4467 break;
4468
Alexis Hetu17809052015-05-13 11:28:22 -04004469 case 174:
Alexis Hetub14178b2015-04-13 13:23:20 -04004470
4471 {
John Bauman66b8ab22014-05-06 15:57:45 -04004472 FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line);
4473 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4474 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4475 }
4476 break;
4477
Alexis Hetu17809052015-05-13 11:28:22 -04004478 case 175:
John Bauman66b8ab22014-05-06 15:57:45 -04004479
4480 {
4481 FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line);
4482 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4483 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4484 }
4485 break;
4486
Alexis Hetu17809052015-05-13 11:28:22 -04004487 case 176:
John Bauman66b8ab22014-05-06 15:57:45 -04004488
4489 {
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004490 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
4491 context->error((yyvsp[(1) - (1)].lex).line, "unsupported type", "samplerExternalOES", "");
4492 context->recover();
4493 }
4494 FRAG_VERT_ONLY("samplerExternalOES", (yyvsp[(1) - (1)].lex).line);
4495 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4496 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yyvsp[(1) - (1)].lex).line);
4497 }
4498 break;
4499
Alexis Hetu17809052015-05-13 11:28:22 -04004500 case 177:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04004501
4502 {
Alexis Hetub027aa92015-01-19 15:56:12 -05004503 FRAG_VERT_ONLY("sampler3D", (yyvsp[(1) - (1)].lex).line);
4504 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4505 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4506 }
4507 break;
4508
Alexis Hetu17809052015-05-13 11:28:22 -04004509 case 178:
Alexis Hetub14178b2015-04-13 13:23:20 -04004510
4511 {
4512 FRAG_VERT_ONLY("sampler2DArray", (yyvsp[(1) - (1)].lex).line);
4513 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4514 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4515 }
4516 break;
4517
Alexis Hetu17809052015-05-13 11:28:22 -04004518 case 179:
Alexis Hetub14178b2015-04-13 13:23:20 -04004519
4520 {
4521 FRAG_VERT_ONLY("isampler2D", (yyvsp[(1) - (1)].lex).line);
4522 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4523 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4524 }
4525 break;
4526
Alexis Hetu17809052015-05-13 11:28:22 -04004527 case 180:
Alexis Hetub14178b2015-04-13 13:23:20 -04004528
4529 {
4530 FRAG_VERT_ONLY("isampler3D", (yyvsp[(1) - (1)].lex).line);
4531 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4532 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4533 }
4534 break;
4535
Alexis Hetu17809052015-05-13 11:28:22 -04004536 case 181:
Alexis Hetub14178b2015-04-13 13:23:20 -04004537
4538 {
4539 FRAG_VERT_ONLY("isamplerCube", (yyvsp[(1) - (1)].lex).line);
4540 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4541 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4542 }
4543 break;
4544
Alexis Hetu17809052015-05-13 11:28:22 -04004545 case 182:
Alexis Hetub14178b2015-04-13 13:23:20 -04004546
4547 {
4548 FRAG_VERT_ONLY("isampler2DArray", (yyvsp[(1) - (1)].lex).line);
4549 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4550 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4551 }
4552 break;
4553
Alexis Hetu17809052015-05-13 11:28:22 -04004554 case 183:
Alexis Hetub14178b2015-04-13 13:23:20 -04004555
4556 {
4557 FRAG_VERT_ONLY("usampler2D", (yyvsp[(1) - (1)].lex).line);
4558 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4559 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yyvsp[(1) - (1)].lex).line);
4560 }
4561 break;
4562
Alexis Hetu17809052015-05-13 11:28:22 -04004563 case 184:
Alexis Hetub14178b2015-04-13 13:23:20 -04004564
4565 {
4566 FRAG_VERT_ONLY("usampler3D", (yyvsp[(1) - (1)].lex).line);
4567 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4568 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yyvsp[(1) - (1)].lex).line);
4569 }
4570 break;
4571
Alexis Hetu17809052015-05-13 11:28:22 -04004572 case 185:
Alexis Hetub14178b2015-04-13 13:23:20 -04004573
4574 {
4575 FRAG_VERT_ONLY("usamplerCube", (yyvsp[(1) - (1)].lex).line);
4576 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4577 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yyvsp[(1) - (1)].lex).line);
4578 }
4579 break;
4580
Alexis Hetu17809052015-05-13 11:28:22 -04004581 case 186:
Alexis Hetub14178b2015-04-13 13:23:20 -04004582
4583 {
4584 FRAG_VERT_ONLY("usampler2DArray", (yyvsp[(1) - (1)].lex).line);
4585 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4586 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yyvsp[(1) - (1)].lex).line);
4587 }
4588 break;
4589
Alexis Hetu17809052015-05-13 11:28:22 -04004590 case 187:
Alexis Hetub14178b2015-04-13 13:23:20 -04004591
4592 {
4593 FRAG_VERT_ONLY("sampler2DShadow", (yyvsp[(1) - (1)].lex).line);
4594 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4595 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yyvsp[(1) - (1)].lex).line);
4596 }
4597 break;
4598
Alexis Hetu17809052015-05-13 11:28:22 -04004599 case 188:
Alexis Hetub14178b2015-04-13 13:23:20 -04004600
4601 {
4602 FRAG_VERT_ONLY("samplerCubeShadow", (yyvsp[(1) - (1)].lex).line);
4603 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4604 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yyvsp[(1) - (1)].lex).line);
4605 }
4606 break;
4607
Alexis Hetu17809052015-05-13 11:28:22 -04004608 case 189:
Alexis Hetub14178b2015-04-13 13:23:20 -04004609
4610 {
4611 FRAG_VERT_ONLY("sampler2DArrayShadow", (yyvsp[(1) - (1)].lex).line);
4612 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4613 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yyvsp[(1) - (1)].lex).line);
4614 }
4615 break;
4616
Alexis Hetu17809052015-05-13 11:28:22 -04004617 case 190:
Alexis Hetub027aa92015-01-19 15:56:12 -05004618
4619 {
John Bauman66b8ab22014-05-06 15:57:45 -04004620 FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line);
4621 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4622 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4623 }
4624 break;
4625
Alexis Hetu17809052015-05-13 11:28:22 -04004626 case 191:
John Bauman66b8ab22014-05-06 15:57:45 -04004627
4628 {
4629 //
4630 // This is for user defined type names. The lexical phase looked up the
4631 // type.
4632 //
4633 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4634 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4635 (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line);
4636 (yyval.interm.type).userDef = &structure;
4637 }
4638 break;
4639
Alexis Hetu17809052015-05-13 11:28:22 -04004640 case 192:
John Bauman66b8ab22014-05-06 15:57:45 -04004641
4642 { if (context->enterStructDeclaration((yyvsp[(2) - (3)].lex).line, *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
4643 break;
4644
Alexis Hetu17809052015-05-13 11:28:22 -04004645 case 193:
John Bauman66b8ab22014-05-06 15:57:45 -04004646
4647 {
4648 if (context->reservedErrorCheck((yyvsp[(2) - (6)].lex).line, *(yyvsp[(2) - (6)].lex).string))
4649 context->recover();
4650
Alexis Hetua8b364b2015-06-10 11:48:40 -04004651 TType* structure = new TType(new TStructure((yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.fieldList)));
John Bauman66b8ab22014-05-06 15:57:45 -04004652 TVariable* userTypeDef = new TVariable((yyvsp[(2) - (6)].lex).string, *structure, true);
Nicolas Capensd603ecd2015-02-18 14:52:21 -05004653 if (! context->symbolTable.declare(*userTypeDef)) {
John Bauman66b8ab22014-05-06 15:57:45 -04004654 context->error((yyvsp[(2) - (6)].lex).line, "redefinition", (yyvsp[(2) - (6)].lex).string->c_str(), "struct");
4655 context->recover();
4656 }
4657 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (6)].lex).line);
4658 (yyval.interm.type).userDef = structure;
4659 context->exitStructDeclaration();
4660 }
4661 break;
4662
Alexis Hetu17809052015-05-13 11:28:22 -04004663 case 194:
John Bauman66b8ab22014-05-06 15:57:45 -04004664
4665 { if (context->enterStructDeclaration((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
4666 break;
4667
Alexis Hetu17809052015-05-13 11:28:22 -04004668 case 195:
John Bauman66b8ab22014-05-06 15:57:45 -04004669
4670 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004671 TString emptyName("");
4672 TType* structure = new TType(new TStructure(&emptyName, (yyvsp[(4) - (5)].interm.fieldList)));
John Bauman66b8ab22014-05-06 15:57:45 -04004673 (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line);
4674 (yyval.interm.type).userDef = structure;
4675 context->exitStructDeclaration();
4676 }
4677 break;
4678
Alexis Hetu17809052015-05-13 11:28:22 -04004679 case 196:
John Bauman66b8ab22014-05-06 15:57:45 -04004680
4681 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004682 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
John Bauman66b8ab22014-05-06 15:57:45 -04004683 }
4684 break;
4685
Alexis Hetu17809052015-05-13 11:28:22 -04004686 case 197:
John Bauman66b8ab22014-05-06 15:57:45 -04004687
4688 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004689 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
4690 for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) {
4691 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i];
4692 for (unsigned int j = 0; j < (yyval.interm.fieldList)->size(); ++j) {
4693 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) {
4694 context->error((*(yyvsp[(2) - (2)].interm.fieldList))[i]->line(), "duplicate field name in structure:", "struct", field->name().c_str());
John Bauman66b8ab22014-05-06 15:57:45 -04004695 context->recover();
4696 }
4697 }
Alexis Hetua8b364b2015-06-10 11:48:40 -04004698 (yyval.interm.fieldList)->push_back((*(yyvsp[(2) - (2)].interm.fieldList))[i]);
John Bauman66b8ab22014-05-06 15:57:45 -04004699 }
4700 }
4701 break;
4702
Alexis Hetu17809052015-05-13 11:28:22 -04004703 case 198:
John Bauman66b8ab22014-05-06 15:57:45 -04004704
4705 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004706 (yyval.interm.fieldList) = (yyvsp[(2) - (3)].interm.fieldList);
John Bauman66b8ab22014-05-06 15:57:45 -04004707
Alexis Hetua8b364b2015-06-10 11:48:40 -04004708 if (context->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.fieldList))[0]->name(), (yyvsp[(1) - (3)].interm.type))) {
John Bauman66b8ab22014-05-06 15:57:45 -04004709 context->recover();
4710 }
Alexis Hetua8b364b2015-06-10 11:48:40 -04004711 for (unsigned int i = 0; i < (yyval.interm.fieldList)->size(); ++i) {
John Bauman66b8ab22014-05-06 15:57:45 -04004712 //
4713 // Careful not to replace already known aspects of type, like array-ness
4714 //
Alexis Hetua8b364b2015-06-10 11:48:40 -04004715 TType* type = (*(yyval.interm.fieldList))[i]->type();
John Bauman66b8ab22014-05-06 15:57:45 -04004716 type->setBasicType((yyvsp[(1) - (3)].interm.type).type);
Alexis Hetub14178b2015-04-13 13:23:20 -04004717 type->setNominalSize((yyvsp[(1) - (3)].interm.type).primarySize);
4718 type->setSecondarySize((yyvsp[(1) - (3)].interm.type).secondarySize);
John Bauman66b8ab22014-05-06 15:57:45 -04004719 type->setPrecision((yyvsp[(1) - (3)].interm.type).precision);
4720
4721 // don't allow arrays of arrays
4722 if (type->isArray()) {
4723 if (context->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type)))
4724 context->recover();
4725 }
4726 if ((yyvsp[(1) - (3)].interm.type).array)
4727 type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize);
4728 if ((yyvsp[(1) - (3)].interm.type).userDef) {
4729 type->setStruct((yyvsp[(1) - (3)].interm.type).userDef->getStruct());
John Bauman66b8ab22014-05-06 15:57:45 -04004730 }
John Bauman66b8ab22014-05-06 15:57:45 -04004731 }
4732 }
4733 break;
4734
Alexis Hetu17809052015-05-13 11:28:22 -04004735 case 199:
John Bauman66b8ab22014-05-06 15:57:45 -04004736
4737 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004738 (yyval.interm.fieldList) = NewPoolTFieldList();
4739 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004740 }
4741 break;
4742
Alexis Hetu17809052015-05-13 11:28:22 -04004743 case 200:
John Bauman66b8ab22014-05-06 15:57:45 -04004744
4745 {
Alexis Hetua8b364b2015-06-10 11:48:40 -04004746 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
John Bauman66b8ab22014-05-06 15:57:45 -04004747 }
4748 break;
4749
Alexis Hetu17809052015-05-13 11:28:22 -04004750 case 201:
John Bauman66b8ab22014-05-06 15:57:45 -04004751
4752 {
4753 if (context->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string))
4754 context->recover();
4755
Alexis Hetua8b364b2015-06-10 11:48:40 -04004756 TType* type = new TType(EbtVoid, EbpUndefined);
4757 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004758 }
4759 break;
4760
Alexis Hetu17809052015-05-13 11:28:22 -04004761 case 202:
John Bauman66b8ab22014-05-06 15:57:45 -04004762
4763 {
4764 if (context->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string))
4765 context->recover();
4766
Alexis Hetua8b364b2015-06-10 11:48:40 -04004767 TType* type = new TType(EbtVoid, EbpUndefined);
John Bauman66b8ab22014-05-06 15:57:45 -04004768 int size;
Alexis Hetua8b364b2015-06-10 11:48:40 -04004769 if (context->arraySizeErrorCheck((yyvsp[(3) - (4)].interm.intermTypedNode)->getLine(), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
John Bauman66b8ab22014-05-06 15:57:45 -04004770 context->recover();
Alexis Hetua8b364b2015-06-10 11:48:40 -04004771 type->setArraySize(size);
4772
4773 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yyvsp[(1) - (4)].lex).line);
John Bauman66b8ab22014-05-06 15:57:45 -04004774 }
4775 break;
4776
Alexis Hetu17809052015-05-13 11:28:22 -04004777 case 203:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004778
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004779 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
Alexis Hetub027aa92015-01-19 15:56:12 -05004780 break;
4781
Alexis Hetu17809052015-05-13 11:28:22 -04004782 case 204:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004783
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004784 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004785 break;
4786
Alexis Hetu17809052015-05-13 11:28:22 -04004787 case 205:
Nicolas Capensa6a79ab2015-02-17 12:42:14 -05004788
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004789 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
Nicolas Capens3c20f802015-02-17 17:17:20 -05004790 break;
4791
Alexis Hetu17809052015-05-13 11:28:22 -04004792 case 206:
Nicolas Capens3c20f802015-02-17 17:17:20 -05004793
Nicolas Capens7d626792015-02-17 17:58:31 -05004794 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004795 break;
4796
Alexis Hetu17809052015-05-13 11:28:22 -04004797 case 207:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004798
Nicolas Capens7d626792015-02-17 17:58:31 -05004799 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004800 break;
4801
Alexis Hetu17809052015-05-13 11:28:22 -04004802 case 208:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004803
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004804 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004805 break;
4806
Alexis Hetu17809052015-05-13 11:28:22 -04004807 case 209:
Nicolas Capense4b1b1d2015-02-17 17:26:01 -05004808
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004809 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004810 break;
4811
Alexis Hetu17809052015-05-13 11:28:22 -04004812 case 210:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05004813
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004814 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004815 break;
4816
Alexis Hetu17809052015-05-13 11:28:22 -04004817 case 211:
Nicolas Capens7d626792015-02-17 17:58:31 -05004818
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004819 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4820 break;
4821
Alexis Hetu17809052015-05-13 11:28:22 -04004822 case 212:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004823
4824 { (yyval.interm.intermAggregate) = 0; }
4825 break;
4826
Alexis Hetu17809052015-05-13 11:28:22 -04004827 case 213:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004828
4829 { context->symbolTable.push(); }
4830 break;
4831
Alexis Hetu17809052015-05-13 11:28:22 -04004832 case 214:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004833
4834 { context->symbolTable.pop(); }
4835 break;
4836
Alexis Hetu17809052015-05-13 11:28:22 -04004837 case 215:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004838
Nicolas Capens7d626792015-02-17 17:58:31 -05004839 {
4840 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4841 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4842 (yyvsp[(3) - (5)].interm.intermAggregate)->setEndLine((yyvsp[(5) - (5)].lex).line);
4843 }
4844 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4845 }
4846 break;
4847
Alexis Hetu17809052015-05-13 11:28:22 -04004848 case 216:
Nicolas Capens7d626792015-02-17 17:58:31 -05004849
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004850 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004851 break;
4852
Alexis Hetu17809052015-05-13 11:28:22 -04004853 case 217:
Nicolas Capens7d626792015-02-17 17:58:31 -05004854
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004855 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
Nicolas Capens7d626792015-02-17 17:58:31 -05004856 break;
4857
Alexis Hetu17809052015-05-13 11:28:22 -04004858 case 218:
Nicolas Capens7d626792015-02-17 17:58:31 -05004859
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004860 { context->symbolTable.push(); }
4861 break;
4862
Alexis Hetu17809052015-05-13 11:28:22 -04004863 case 219:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004864
4865 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4866 break;
4867
Alexis Hetu17809052015-05-13 11:28:22 -04004868 case 220:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004869
4870 { context->symbolTable.push(); }
4871 break;
4872
Alexis Hetu17809052015-05-13 11:28:22 -04004873 case 221:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004874
4875 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4876 break;
4877
Alexis Hetu17809052015-05-13 11:28:22 -04004878 case 222:
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04004879
John Bauman66b8ab22014-05-06 15:57:45 -04004880 {
4881 (yyval.interm.intermNode) = 0;
4882 }
4883 break;
4884
Alexis Hetu17809052015-05-13 11:28:22 -04004885 case 223:
John Bauman66b8ab22014-05-06 15:57:45 -04004886
4887 {
4888 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4889 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
4890 (yyvsp[(2) - (3)].interm.intermAggregate)->setEndLine((yyvsp[(3) - (3)].lex).line);
4891 }
4892 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4893 }
4894 break;
4895
Alexis Hetu17809052015-05-13 11:28:22 -04004896 case 224:
John Bauman66b8ab22014-05-06 15:57:45 -04004897
4898 {
4899 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0);
4900 }
4901 break;
4902
Alexis Hetu17809052015-05-13 11:28:22 -04004903 case 225:
John Bauman66b8ab22014-05-06 15:57:45 -04004904
4905 {
4906 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0);
4907 }
4908 break;
4909
Alexis Hetu17809052015-05-13 11:28:22 -04004910 case 226:
John Bauman66b8ab22014-05-06 15:57:45 -04004911
4912 { (yyval.interm.intermNode) = 0; }
4913 break;
4914
Alexis Hetu17809052015-05-13 11:28:22 -04004915 case 227:
John Bauman66b8ab22014-05-06 15:57:45 -04004916
4917 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4918 break;
4919
Alexis Hetu17809052015-05-13 11:28:22 -04004920 case 228:
John Bauman66b8ab22014-05-06 15:57:45 -04004921
4922 {
4923 if (context->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode)))
4924 context->recover();
4925 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line);
4926 }
4927 break;
4928
Alexis Hetu17809052015-05-13 11:28:22 -04004929 case 229:
John Bauman66b8ab22014-05-06 15:57:45 -04004930
4931 {
4932 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4933 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4934 }
4935 break;
4936
Alexis Hetu17809052015-05-13 11:28:22 -04004937 case 230:
John Bauman66b8ab22014-05-06 15:57:45 -04004938
4939 {
4940 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4941 (yyval.interm.nodePair).node2 = 0;
4942 }
4943 break;
4944
Alexis Hetu17809052015-05-13 11:28:22 -04004945 case 231:
John Bauman66b8ab22014-05-06 15:57:45 -04004946
4947 {
4948 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4949 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4950 context->recover();
4951 }
4952 break;
4953
Alexis Hetu17809052015-05-13 11:28:22 -04004954 case 232:
John Bauman66b8ab22014-05-06 15:57:45 -04004955
4956 {
4957 TIntermNode* intermNode;
4958 if (context->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4959 context->recover();
4960 if (context->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)))
4961 context->recover();
4962
4963 if (!context->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4964 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4965 else {
4966 context->recover();
4967 (yyval.interm.intermTypedNode) = 0;
4968 }
4969 }
4970 break;
4971
Alexis Hetu17809052015-05-13 11:28:22 -04004972 case 233:
John Bauman66b8ab22014-05-06 15:57:45 -04004973
4974 { context->symbolTable.push(); ++context->loopNestingLevel; }
4975 break;
4976
Alexis Hetu17809052015-05-13 11:28:22 -04004977 case 234:
John Bauman66b8ab22014-05-06 15:57:45 -04004978
4979 {
4980 context->symbolTable.pop();
4981 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(1) - (6)].lex).line);
4982 --context->loopNestingLevel;
4983 }
4984 break;
4985
Alexis Hetu17809052015-05-13 11:28:22 -04004986 case 235:
John Bauman66b8ab22014-05-06 15:57:45 -04004987
4988 { ++context->loopNestingLevel; }
4989 break;
4990
Alexis Hetu17809052015-05-13 11:28:22 -04004991 case 236:
John Bauman66b8ab22014-05-06 15:57:45 -04004992
4993 {
4994 if (context->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode)))
4995 context->recover();
4996
4997 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(4) - (8)].lex).line);
4998 --context->loopNestingLevel;
4999 }
5000 break;
5001
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005002 case 237:
John Bauman66b8ab22014-05-06 15:57:45 -04005003
Alexis Hetu17809052015-05-13 11:28:22 -04005004 { context->symbolTable.push(); ++context->loopNestingLevel; }
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04005005 break;
5006
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005007 case 238:
Nicolas Capense9c5e4f2014-05-28 22:46:43 -04005008
5009 {
Alexis Hetu17809052015-05-13 11:28:22 -04005010 context->symbolTable.pop();
5011 (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);
5012 --context->loopNestingLevel;
Alexis Hetub027aa92015-01-19 15:56:12 -05005013 }
5014 break;
5015
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005016 case 239:
Alexis Hetub027aa92015-01-19 15:56:12 -05005017
5018 {
Nicolas Capens3c20f802015-02-17 17:17:20 -05005019 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5020 }
5021 break;
5022
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005023 case 240:
Nicolas Capens3c20f802015-02-17 17:17:20 -05005024
5025 {
Nicolas Capens2c1239f2015-02-17 17:30:04 -05005026 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5027 }
5028 break;
5029
Alexis Hetu55a2cbc2015-04-16 10:49:45 -04005030 case 241:
Nicolas Capens2c1239f2015-02-17 17:30:04 -05005031
5032 {
Alexis Hetu17809052015-05-13 11:28:22 -04005033 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
5034 }
5035 break;
5036
5037 case 242:
5038
5039 {
5040 (yyval.interm.intermTypedNode) = 0;
5041 }
5042 break;
5043
5044 case 243:
5045
5046 {
5047 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
5048 (yyval.interm.nodePair).node2 = 0;
5049 }
5050 break;
5051
5052 case 244:
5053
5054 {
5055 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
5056 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
5057 }
5058 break;
5059
5060 case 245:
5061
5062 {
5063 if (context->loopNestingLevel <= 0) {
5064 context->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "");
5065 context->recover();
5066 }
5067 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line);
5068 }
5069 break;
5070
5071 case 246:
5072
5073 {
5074 if (context->loopNestingLevel <= 0) {
5075 context->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "");
5076 context->recover();
5077 }
5078 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line);
5079 }
5080 break;
5081
5082 case 247:
5083
5084 {
5085 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line);
5086 if (context->currentFunctionType->getBasicType() != EbtVoid) {
5087 context->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return");
5088 context->recover();
5089 }
5090 }
5091 break;
5092
5093 case 248:
5094
5095 {
5096 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line);
5097 context->functionReturnsValue = true;
5098 if (context->currentFunctionType->getBasicType() == EbtVoid) {
5099 context->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return");
5100 context->recover();
5101 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
5102 context->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return");
5103 context->recover();
5104 }
5105 }
5106 break;
5107
5108 case 249:
5109
5110 {
5111 FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line);
5112 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line);
5113 }
5114 break;
5115
5116 case 250:
5117
5118 {
5119 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5120 context->treeRoot = (yyval.interm.intermNode);
5121 }
5122 break;
5123
5124 case 251:
5125
5126 {
5127 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0);
5128 context->treeRoot = (yyval.interm.intermNode);
5129 }
5130 break;
5131
5132 case 252:
5133
5134 {
5135 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5136 }
5137 break;
5138
5139 case 253:
5140
5141 {
5142 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
5143 }
5144 break;
5145
5146 case 254:
5147
5148 {
John Bauman66b8ab22014-05-06 15:57:45 -04005149 TFunction* function = (yyvsp[(1) - (1)].interm).function;
5150
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05005151 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
John Bauman66b8ab22014-05-06 15:57:45 -04005152
5153 if (builtIn)
5154 {
5155 context->error((yyvsp[(1) - (1)].interm).line, "built-in functions cannot be redefined", function->getName().c_str());
5156 context->recover();
5157 }
5158
Nicolas Capens0a7f0c22015-02-18 14:47:31 -05005159 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
John Bauman66b8ab22014-05-06 15:57:45 -04005160 //
5161 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
5162 // as it would have just been put in the symbol table. Otherwise, we're looking up
5163 // an earlier occurance.
5164 //
5165 if (prevDec->isDefined()) {
5166 //
5167 // Then this function already has a body.
5168 //
5169 context->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function->getName().c_str());
5170 context->recover();
5171 }
5172 prevDec->setDefined();
5173
5174 //
5175 // Raise error message if main function takes any parameters or return anything other than void
5176 //
5177 if (function->getName() == "main") {
5178 if (function->getParamCount() > 0) {
5179 context->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function->getName().c_str());
5180 context->recover();
5181 }
5182 if (function->getReturnType().getBasicType() != EbtVoid) {
5183 context->error((yyvsp[(1) - (1)].interm).line, "", function->getReturnType().getBasicString(), "main function cannot return a value");
5184 context->recover();
5185 }
5186 }
5187
5188 //
5189 // Remember the return type for later checking for RETURN statements.
5190 //
5191 context->currentFunctionType = &(prevDec->getReturnType());
5192 context->functionReturnsValue = false;
5193
5194 //
5195 // Insert parameters into the symbol table.
5196 // If the parameter has no name, it's not an error, just don't insert it
5197 // (could be used for unused args).
5198 //
5199 // Also, accumulate the list of parameters into the HIL, so lower level code
5200 // knows where to find parameters.
5201 //
5202 TIntermAggregate* paramNodes = new TIntermAggregate;
5203 for (int i = 0; i < function->getParamCount(); i++) {
5204 const TParameter& param = function->getParam(i);
5205 if (param.name != 0) {
5206 TVariable *variable = new TVariable(param.name, *param.type);
5207 //
5208 // Insert the parameters with name in the symbol table.
5209 //
Nicolas Capensd603ecd2015-02-18 14:52:21 -05005210 if (! context->symbolTable.declare(*variable)) {
John Bauman66b8ab22014-05-06 15:57:45 -04005211 context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
5212 context->recover();
5213 delete variable;
5214 }
5215
5216 //
5217 // Add the parameter to the HIL
5218 //
5219 paramNodes = context->intermediate.growAggregate(
5220 paramNodes,
5221 context->intermediate.addSymbol(variable->getUniqueId(),
5222 variable->getName(),
5223 variable->getType(), (yyvsp[(1) - (1)].interm).line),
5224 (yyvsp[(1) - (1)].interm).line);
5225 } else {
5226 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line);
5227 }
5228 }
5229 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line);
5230 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
5231 context->loopNestingLevel = 0;
5232 }
5233 break;
5234
Alexis Hetu17809052015-05-13 11:28:22 -04005235 case 255:
John Bauman66b8ab22014-05-06 15:57:45 -04005236
5237 {
5238 //?? Check that all paths return a value if return type != void ?
5239 // May be best done as post process phase on intermediate code
5240 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
5241 context->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
5242 context->recover();
5243 }
5244
5245 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0);
5246 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line);
5247 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
5248 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
5249
5250 // store the pragma information for debug and optimize and other vendor specific
5251 // information. This information can be queried from the parse tree
5252 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
5253 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
5254
5255 if ((yyvsp[(3) - (3)].interm.intermNode) && (yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate())
5256 (yyval.interm.intermNode)->getAsAggregate()->setEndLine((yyvsp[(3) - (3)].interm.intermNode)->getAsAggregate()->getEndLine());
5257
5258 context->symbolTable.pop();
5259 }
5260 break;
5261
5262
5263
5264 default: break;
5265 }
5266 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
5267
5268 YYPOPSTACK (yylen);
5269 yylen = 0;
5270 YY_STACK_PRINT (yyss, yyssp);
5271
5272 *++yyvsp = yyval;
5273
5274 /* Now `shift' the result of the reduction. Determine what state
5275 that goes to, based on the state we popped back to and the rule
5276 number reduced by. */
5277
5278 yyn = yyr1[yyn];
5279
5280 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
5281 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
5282 yystate = yytable[yystate];
5283 else
5284 yystate = yydefgoto[yyn - YYNTOKENS];
5285
5286 goto yynewstate;
5287
5288
5289/*------------------------------------.
5290| yyerrlab -- here on detecting error |
5291`------------------------------------*/
5292yyerrlab:
5293 /* If not already recovering from an error, report this error. */
5294 if (!yyerrstatus)
5295 {
5296 ++yynerrs;
5297#if ! YYERROR_VERBOSE
5298 yyerror (context, YY_("syntax error"));
5299#else
5300 {
5301 YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
5302 if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
5303 {
5304 YYSIZE_T yyalloc = 2 * yysize;
5305 if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
5306 yyalloc = YYSTACK_ALLOC_MAXIMUM;
5307 if (yymsg != yymsgbuf)
5308 YYSTACK_FREE (yymsg);
5309 yymsg = (char *) YYSTACK_ALLOC (yyalloc);
5310 if (yymsg)
5311 yymsg_alloc = yyalloc;
5312 else
5313 {
5314 yymsg = yymsgbuf;
5315 yymsg_alloc = sizeof yymsgbuf;
5316 }
5317 }
5318
5319 if (0 < yysize && yysize <= yymsg_alloc)
5320 {
5321 (void) yysyntax_error (yymsg, yystate, yychar);
5322 yyerror (context, yymsg);
5323 }
5324 else
5325 {
5326 yyerror (context, YY_("syntax error"));
5327 if (yysize != 0)
5328 goto yyexhaustedlab;
5329 }
5330 }
5331#endif
5332 }
5333
5334
5335
5336 if (yyerrstatus == 3)
5337 {
5338 /* If just tried and failed to reuse lookahead token after an
5339 error, discard it. */
5340
5341 if (yychar <= YYEOF)
5342 {
5343 /* Return failure if at end of input. */
5344 if (yychar == YYEOF)
5345 YYABORT;
5346 }
5347 else
5348 {
5349 yydestruct ("Error: discarding",
5350 yytoken, &yylval, context);
5351 yychar = YYEMPTY;
5352 }
5353 }
5354
5355 /* Else will try to reuse lookahead token after shifting the error
5356 token. */
5357 goto yyerrlab1;
5358
5359
5360/*---------------------------------------------------.
5361| yyerrorlab -- error raised explicitly by YYERROR. |
5362`---------------------------------------------------*/
5363yyerrorlab:
5364
5365 /* Pacify compilers like GCC when the user code never invokes
5366 YYERROR and the label yyerrorlab therefore never appears in user
5367 code. */
5368 if (/*CONSTCOND*/ 0)
5369 goto yyerrorlab;
5370
5371 /* Do not reclaim the symbols of the rule which action triggered
5372 this YYERROR. */
5373 YYPOPSTACK (yylen);
5374 yylen = 0;
5375 YY_STACK_PRINT (yyss, yyssp);
5376 yystate = *yyssp;
5377 goto yyerrlab1;
5378
5379
5380/*-------------------------------------------------------------.
5381| yyerrlab1 -- common code for both syntax error and YYERROR. |
5382`-------------------------------------------------------------*/
5383yyerrlab1:
5384 yyerrstatus = 3; /* Each real token shifted decrements this. */
5385
5386 for (;;)
5387 {
5388 yyn = yypact[yystate];
5389 if (yyn != YYPACT_NINF)
5390 {
5391 yyn += YYTERROR;
5392 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5393 {
5394 yyn = yytable[yyn];
5395 if (0 < yyn)
5396 break;
5397 }
5398 }
5399
5400 /* Pop the current state because it cannot handle the error token. */
5401 if (yyssp == yyss)
5402 YYABORT;
5403
5404
5405 yydestruct ("Error: popping",
5406 yystos[yystate], yyvsp, context);
5407 YYPOPSTACK (1);
5408 yystate = *yyssp;
5409 YY_STACK_PRINT (yyss, yyssp);
5410 }
5411
5412 *++yyvsp = yylval;
5413
5414
5415 /* Shift the error token. */
5416 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5417
5418 yystate = yyn;
5419 goto yynewstate;
5420
5421
5422/*-------------------------------------.
5423| yyacceptlab -- YYACCEPT comes here. |
5424`-------------------------------------*/
5425yyacceptlab:
5426 yyresult = 0;
5427 goto yyreturn;
5428
5429/*-----------------------------------.
5430| yyabortlab -- YYABORT comes here. |
5431`-----------------------------------*/
5432yyabortlab:
5433 yyresult = 1;
5434 goto yyreturn;
5435
5436#if !defined(yyoverflow) || YYERROR_VERBOSE
5437/*-------------------------------------------------.
5438| yyexhaustedlab -- memory exhaustion comes here. |
5439`-------------------------------------------------*/
5440yyexhaustedlab:
5441 yyerror (context, YY_("memory exhausted"));
5442 yyresult = 2;
5443 /* Fall through. */
5444#endif
5445
5446yyreturn:
5447 if (yychar != YYEMPTY)
5448 yydestruct ("Cleanup: discarding lookahead",
5449 yytoken, &yylval, context);
5450 /* Do not reclaim the symbols of the rule which action triggered
5451 this YYABORT or YYACCEPT. */
5452 YYPOPSTACK (yylen);
5453 YY_STACK_PRINT (yyss, yyssp);
5454 while (yyssp != yyss)
5455 {
5456 yydestruct ("Cleanup: popping",
5457 yystos[*yyssp], yyvsp, context);
5458 YYPOPSTACK (1);
5459 }
5460#ifndef yyoverflow
5461 if (yyss != yyssa)
5462 YYSTACK_FREE (yyss);
5463#endif
5464#if YYERROR_VERBOSE
5465 if (yymsg != yymsgbuf)
5466 YYSTACK_FREE (yymsg);
5467#endif
5468 /* Make sure YYID is used. */
5469 return YYID (yyresult);
5470}
5471
5472
5473
5474
5475
5476int glslang_parse(TParseContext* context) {
5477 return yyparse(context);
5478}
5479