1 /* A Bison parser, made by GNU Bison 2.7.1. */
3 /* Bison implementation for Yacc-like parsers in C
5 Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* As a special exception, you may create a larger work that contains
21 part or all of the Bison parser skeleton and distribute that work
22 under terms of your choice, so long as that work isn't itself a
23 parser generator using the skeleton or a modified version thereof
24 as a parser skeleton. Alternatively, if you modify or redistribute
25 the parser skeleton itself, you may (at your option) remove this
26 special exception, which will cause the skeleton and the resulting
27 Bison output files to be licensed under the GNU General Public
28 License without this special exception.
30 This special exception was added by the Free Software Foundation in
31 version 2.2 of Bison. */
33 /* C LALR(1) parser skeleton written by Richard Stallman, by
34 simplifying the original so-called "semantic" parser. */
36 /* All symbols defined below should begin with yy or YY, to avoid
37 infringing on user name space. This should be done even for local
38 variables, as they might otherwise be expanded by user macros.
39 There are some unavoidable exceptions within include files to
40 define necessary library symbols; they are noted "INFRINGES ON
41 USER NAME SPACE" below. */
43 /* Identify Bison output. */
47 #define YYBISON_VERSION "2.7.1"
50 #define YYSKELETON_NAME "yacc.c"
64 /* Copy the first part of user declarations. */
68 // Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
69 // Use of this source code is governed by a BSD-style license that can be
70 // found in the LICENSE file.
73 // This file is auto-generated by generate_parser.sh. DO NOT EDIT!
75 // Ignore errors in auto-generated code.
77 #pragma GCC diagnostic ignored "-Wunused-function"
78 #pragma GCC diagnostic ignored "-Wunused-variable"
79 #pragma GCC diagnostic ignored "-Wswitch-enum"
80 #elif defined(_MSC_VER)
81 #pragma warning(disable: 4065)
82 #pragma warning(disable: 4189)
83 #pragma warning(disable: 4505)
84 #pragma warning(disable: 4701)
88 #include "compiler/translator/SymbolTable.h"
89 #include "compiler/translator/ParseContext.h"
90 #include "GLSLANG/ShaderLang.h"
92 #define YYENABLE_NLS 0
94 #define YYLEX_PARAM context->scanner
100 # if defined __cplusplus && 201103L <= __cplusplus
101 # define YY_NULL nullptr
107 /* Enabling verbose error messages. */
108 #ifdef YYERROR_VERBOSE
109 # undef YYERROR_VERBOSE
110 # define YYERROR_VERBOSE 1
112 # define YYERROR_VERBOSE 0
115 /* In a future release of Bison, this section will be replaced
116 by #include "glslang_tab.h". */
117 #ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
118 # define YY_YY_GLSLANG_TAB_H_INCLUDED
119 /* Enabling traces. */
126 /* "%code requires" blocks. */
129 #define YYLTYPE TSourceLoc
130 #define YYLTYPE_IS_DECLARED 1
138 /* Put the tokens into the symbol table, so that GDB and other debuggers
142 HIGH_PRECISION = 259,
143 MEDIUM_PRECISION = 260,
197 SAMPLER_EXTERNAL_OES = 314,
199 SAMPLER2DARRAY = 316,
203 ISAMPLER2DARRAY = 320,
207 USAMPLER2DARRAY = 324,
210 SAMPLER2DSHADOW = 327,
211 SAMPLERCUBESHADOW = 328,
212 SAMPLER2DARRAYSHADOW = 329,
220 FIELD_SELECTION = 337,
270 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
271 typedef union YYSTYPE
288 TIntermNode* intermNode;
289 TIntermNodePair nodePair;
290 TIntermTyped* intermTypedNode;
291 TIntermAggregate* intermAggregate;
295 TPrecision precision;
296 TLayoutQualifier layoutQualifier;
297 TQualifier qualifier;
301 TFieldList* fieldList;
308 # define YYSTYPE_IS_TRIVIAL 1
309 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
310 # define YYSTYPE_IS_DECLARED 1
313 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
314 typedef struct YYLTYPE
321 # define yyltype YYLTYPE /* obsolescent; will be withdrawn */
322 # define YYLTYPE_IS_DECLARED 1
323 # define YYLTYPE_IS_TRIVIAL 1
328 #if defined __STDC__ || defined __cplusplus
329 int yyparse (void *YYPARSE_PARAM);
333 #else /* ! YYPARSE_PARAM */
334 #if defined __STDC__ || defined __cplusplus
335 int yyparse (TParseContext* context);
339 #endif /* ! YYPARSE_PARAM */
341 #endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
343 /* Copy the second part of user declarations. */
346 extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner);
347 extern void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason);
349 #define YYLLOC_DEFAULT(Current, Rhs, N) \
352 (Current).first_file = YYRHSLOC(Rhs, 1).first_file; \
353 (Current).first_line = YYRHSLOC(Rhs, 1).first_line; \
354 (Current).last_file = YYRHSLOC(Rhs, N).last_file; \
355 (Current).last_line = YYRHSLOC(Rhs, N).last_line; \
358 (Current).first_file = YYRHSLOC(Rhs, 0).last_file; \
359 (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \
360 (Current).last_file = YYRHSLOC(Rhs, 0).last_file; \
361 (Current).last_line = YYRHSLOC(Rhs, 0).last_line; \
365 #define VERTEX_ONLY(S, L) { \
366 if (context->shaderType != GL_VERTEX_SHADER) { \
367 context->error(L, " supported in vertex shaders only ", S); \
368 context->recover(); \
372 #define FRAG_ONLY(S, L) { \
373 if (context->shaderType != GL_FRAGMENT_SHADER) { \
374 context->error(L, " supported in fragment shaders only ", S); \
375 context->recover(); \
379 #define ES2_ONLY(S, L) { \
380 if (context->shaderVersion != 100) { \
381 context->error(L, " supported in GLSL ES 1.00 only ", S); \
382 context->recover(); \
386 #define ES3_ONLY(TOKEN, LINE, REASON) { \
387 if (context->shaderVersion != 300) { \
388 context->error(LINE, REASON " supported in GLSL ES 3.00 only ", TOKEN); \
389 context->recover(); \
400 typedef YYTYPE_UINT8 yytype_uint8;
402 typedef unsigned char yytype_uint8;
406 typedef YYTYPE_INT8 yytype_int8;
407 #elif (defined __STDC__ || defined __C99__FUNC__ \
408 || defined __cplusplus || defined _MSC_VER)
409 typedef signed char yytype_int8;
411 typedef short int yytype_int8;
415 typedef YYTYPE_UINT16 yytype_uint16;
417 typedef unsigned short int yytype_uint16;
421 typedef YYTYPE_INT16 yytype_int16;
423 typedef short int yytype_int16;
427 # ifdef __SIZE_TYPE__
428 # define YYSIZE_T __SIZE_TYPE__
429 # elif defined size_t
430 # define YYSIZE_T size_t
431 # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
432 || defined __cplusplus || defined _MSC_VER)
433 # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
434 # define YYSIZE_T size_t
436 # define YYSIZE_T unsigned int
440 #define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
443 # if defined YYENABLE_NLS && YYENABLE_NLS
445 # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
446 # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
450 # define YY_(Msgid) Msgid
454 #ifndef __attribute__
455 /* This feature is available in gcc versions 2.5 and later. */
456 # if (! defined __GNUC__ || __GNUC__ < 2 \
457 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
458 # define __attribute__(Spec) /* empty */
462 /* Suppress unused-variable warnings by "using" E. */
463 #if ! defined lint || defined __GNUC__
464 # define YYUSE(E) ((void) (E))
466 # define YYUSE(E) /* empty */
470 /* Identity function, used to suppress warnings about constant conditions. */
474 #if (defined __STDC__ || defined __C99__FUNC__ \
475 || defined __cplusplus || defined _MSC_VER)
488 #if ! defined yyoverflow || YYERROR_VERBOSE
490 /* The parser invokes alloca or malloc; define the necessary symbols. */
492 # ifdef YYSTACK_USE_ALLOCA
493 # if YYSTACK_USE_ALLOCA
495 # define YYSTACK_ALLOC __builtin_alloca
496 # elif defined __BUILTIN_VA_ARG_INCR
497 # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
499 # define YYSTACK_ALLOC __alloca
500 # elif defined _MSC_VER
501 # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
502 # define alloca _alloca
504 # define YYSTACK_ALLOC alloca
505 # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
506 || defined __cplusplus || defined _MSC_VER)
507 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
508 /* Use EXIT_SUCCESS as a witness for stdlib.h. */
509 # ifndef EXIT_SUCCESS
510 # define EXIT_SUCCESS 0
517 # ifdef YYSTACK_ALLOC
518 /* Pacify GCC's `empty if-body' warning. */
519 # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
520 # ifndef YYSTACK_ALLOC_MAXIMUM
521 /* The OS might guarantee only one guard page at the bottom of the stack,
522 and a page size can be as small as 4096 bytes. So we cannot safely
523 invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
524 to allow for a few compiler-allocated temporary stack slots. */
525 # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
528 # define YYSTACK_ALLOC YYMALLOC
529 # define YYSTACK_FREE YYFREE
530 # ifndef YYSTACK_ALLOC_MAXIMUM
531 # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
533 # if (defined __cplusplus && ! defined EXIT_SUCCESS \
534 && ! ((defined YYMALLOC || defined malloc) \
535 && (defined YYFREE || defined free)))
536 # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
537 # ifndef EXIT_SUCCESS
538 # define EXIT_SUCCESS 0
542 # define YYMALLOC malloc
543 # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
544 || defined __cplusplus || defined _MSC_VER)
545 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
550 # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
551 || defined __cplusplus || defined _MSC_VER)
552 void free (void *); /* INFRINGES ON USER NAME SPACE */
556 #endif /* ! defined yyoverflow || YYERROR_VERBOSE */
559 #if (! defined yyoverflow \
560 && (! defined __cplusplus \
561 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
562 && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
564 /* A type that is properly aligned for any stack member. */
567 yytype_int16 yyss_alloc;
572 /* The size of the maximum gap between one aligned stack and the next. */
573 # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
575 /* The size of an array large to enough to hold all stacks, each with
577 # define YYSTACK_BYTES(N) \
578 ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
579 + 2 * YYSTACK_GAP_MAXIMUM)
581 # define YYCOPY_NEEDED 1
583 /* Relocate STACK from its old location to the new one. The
584 local variables YYSIZE and YYSTACKSIZE give the old and new number of
585 elements in the stack, and YYPTR gives the new location of the
586 stack. Advance YYPTR to a properly aligned location for the next
588 # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
591 YYSIZE_T yynewbytes; \
592 YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
593 Stack = &yyptr->Stack_alloc; \
594 yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
595 yyptr += yynewbytes / sizeof (*yyptr); \
601 #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
602 /* Copy COUNT objects from SRC to DST. The source and destination do
605 # if defined __GNUC__ && 1 < __GNUC__
606 # define YYCOPY(Dst, Src, Count) \
607 __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
609 # define YYCOPY(Dst, Src, Count) \
613 for (yyi = 0; yyi < (Count); yyi++) \
614 (Dst)[yyi] = (Src)[yyi]; \
619 #endif /* !YYCOPY_NEEDED */
621 /* YYFINAL -- State number of the termination state. */
623 /* YYLAST -- Last index in YYTABLE. */
626 /* YYNTOKENS -- Number of terminals. */
627 #define YYNTOKENS 128
628 /* YYNNTS -- Number of nonterminals. */
630 /* YYNRULES -- Number of rules. */
632 /* YYNRULES -- Number of states. */
633 #define YYNSTATES 373
635 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
637 #define YYMAXUTOK 382
639 #define YYTRANSLATE(YYX) \
640 ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
642 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
643 static const yytype_uint8 yytranslate[] =
645 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
646 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
647 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
648 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
649 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
650 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
651 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
652 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
653 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
654 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
655 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
656 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
657 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
658 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
659 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
660 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
661 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
662 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
663 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
664 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
665 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
666 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
667 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
668 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
669 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
670 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
671 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
672 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
673 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
674 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
675 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
676 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
677 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
678 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
679 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
680 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
681 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
682 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
687 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
689 static const yytype_uint16 yyprhs[] =
691 0, 0, 3, 5, 7, 9, 11, 13, 15, 17,
692 19, 23, 25, 30, 32, 36, 39, 42, 44, 46,
693 48, 52, 55, 58, 61, 63, 66, 70, 73, 75,
694 77, 79, 82, 85, 88, 90, 92, 94, 96, 100,
695 104, 106, 110, 114, 116, 118, 122, 126, 130, 134,
696 136, 140, 144, 146, 148, 150, 152, 156, 158, 162,
697 164, 168, 170, 176, 178, 182, 184, 186, 188, 190,
698 192, 194, 198, 200, 203, 206, 209, 214, 220, 227,
699 237, 240, 243, 245, 247, 250, 254, 258, 261, 267,
700 271, 274, 278, 281, 282, 284, 286, 288, 290, 292,
701 296, 302, 309, 315, 317, 320, 325, 331, 336, 339,
702 341, 344, 346, 348, 350, 352, 354, 357, 359, 362,
703 364, 366, 369, 371, 373, 375, 378, 381, 383, 385,
704 388, 390, 392, 394, 399, 401, 405, 407, 411, 415,
705 417, 422, 424, 426, 428, 430, 432, 434, 436, 438,
706 440, 442, 444, 446, 448, 450, 452, 454, 456, 458,
707 460, 462, 464, 466, 468, 470, 472, 474, 476, 478,
708 480, 482, 484, 486, 488, 490, 492, 494, 496, 498,
709 500, 502, 504, 506, 508, 510, 512, 513, 520, 521,
710 527, 529, 532, 536, 541, 543, 547, 549, 554, 556,
711 558, 560, 562, 564, 566, 568, 570, 572, 575, 576,
712 577, 583, 585, 587, 588, 591, 592, 595, 598, 602,
713 604, 607, 609, 612, 618, 622, 624, 626, 631, 632,
714 639, 640, 649, 650, 658, 660, 662, 664, 665, 668,
715 672, 675, 678, 681, 685, 688, 690, 693, 695, 697,
719 /* YYRHS -- A `-1'-separated list of the rules' RHS. */
720 static const yytype_int16 yyrhs[] =
722 215, 0, -1, 76, -1, 77, -1, 76, -1, 130,
723 -1, 79, -1, 80, -1, 78, -1, 81, -1, 104,
724 157, 105, -1, 131, -1, 132, 106, 133, 107, -1,
725 134, -1, 132, 110, 129, -1, 132, 85, -1, 132,
726 86, -1, 157, -1, 135, -1, 136, -1, 132, 110,
727 136, -1, 138, 105, -1, 137, 105, -1, 139, 55,
728 -1, 139, -1, 139, 155, -1, 138, 111, 155, -1,
729 140, 104, -1, 182, -1, 76, -1, 132, -1, 85,
730 141, -1, 86, 141, -1, 142, 141, -1, 118, -1,
731 116, -1, 115, -1, 141, -1, 143, 119, 141, -1,
732 143, 120, 141, -1, 143, -1, 144, 118, 143, -1,
733 144, 116, 143, -1, 144, -1, 145, -1, 146, 122,
734 145, -1, 146, 123, 145, -1, 146, 87, 145, -1,
735 146, 88, 145, -1, 146, -1, 147, 89, 146, -1,
736 147, 90, 146, -1, 147, -1, 148, -1, 149, -1,
737 150, -1, 151, 91, 150, -1, 151, -1, 152, 93,
738 151, -1, 152, -1, 153, 92, 152, -1, 153, -1,
739 153, 127, 157, 112, 155, -1, 154, -1, 141, 156,
740 155, -1, 113, -1, 94, -1, 95, -1, 96, -1,
741 103, -1, 155, -1, 157, 111, 155, -1, 154, -1,
742 76, 108, -1, 161, 114, -1, 169, 114, -1, 7,
743 177, 181, 114, -1, 174, 159, 186, 109, 114, -1,
744 174, 159, 186, 109, 76, 114, -1, 174, 159, 186,
745 109, 76, 106, 158, 107, 114, -1, 174, 114, -1,
746 162, 105, -1, 164, -1, 163, -1, 164, 166, -1,
747 163, 111, 166, -1, 171, 76, 104, -1, 176, 129,
748 -1, 176, 129, 106, 158, 107, -1, 173, 167, 165,
749 -1, 167, 165, -1, 173, 167, 168, -1, 167, 168,
750 -1, -1, 40, -1, 41, -1, 42, -1, 176, -1,
751 170, -1, 169, 111, 129, -1, 169, 111, 129, 106,
752 107, -1, 169, 111, 129, 106, 158, 107, -1, 169,
753 111, 129, 113, 190, -1, 171, -1, 171, 129, -1,
754 171, 129, 106, 107, -1, 171, 129, 106, 158, 107,
755 -1, 171, 129, 113, 190, -1, 3, 76, -1, 176,
756 -1, 174, 176, -1, 53, -1, 52, -1, 9, -1,
757 8, -1, 44, -1, 3, 44, -1, 175, -1, 172,
758 175, -1, 172, -1, 178, -1, 178, 175, -1, 9,
759 -1, 40, -1, 41, -1, 51, 40, -1, 51, 41,
760 -1, 43, -1, 181, -1, 177, 181, -1, 4, -1,
761 5, -1, 6, -1, 75, 104, 179, 105, -1, 180,
762 -1, 179, 111, 180, -1, 76, -1, 76, 113, 79,
763 -1, 76, 113, 80, -1, 182, -1, 182, 106, 158,
764 107, -1, 55, -1, 11, -1, 12, -1, 13, -1,
765 10, -1, 31, -1, 32, -1, 33, -1, 25, -1,
766 26, -1, 27, -1, 28, -1, 29, -1, 30, -1,
767 34, -1, 35, -1, 36, -1, 37, -1, 38, -1,
768 39, -1, 45, -1, 46, -1, 47, -1, 48, -1,
769 49, -1, 50, -1, 57, -1, 70, -1, 58, -1,
770 61, -1, 62, -1, 63, -1, 64, -1, 65, -1,
771 66, -1, 67, -1, 68, -1, 69, -1, 72, -1,
772 73, -1, 74, -1, 59, -1, 60, -1, 183, -1,
773 77, -1, -1, 54, 129, 108, 184, 186, 109, -1,
774 -1, 54, 108, 185, 186, 109, -1, 187, -1, 186,
775 187, -1, 176, 188, 114, -1, 174, 176, 188, 114,
776 -1, 189, -1, 188, 111, 189, -1, 129, -1, 129,
777 106, 158, 107, -1, 155, -1, 160, -1, 194, -1,
778 193, -1, 191, -1, 203, -1, 204, -1, 207, -1,
779 214, -1, 108, 109, -1, -1, -1, 108, 195, 202,
780 196, 109, -1, 201, -1, 193, -1, -1, 199, 201,
781 -1, -1, 200, 193, -1, 108, 109, -1, 108, 202,
782 109, -1, 192, -1, 202, 192, -1, 114, -1, 157,
783 114, -1, 19, 104, 157, 105, 205, -1, 198, 17,
784 198, -1, 198, -1, 157, -1, 171, 129, 113, 190,
785 -1, -1, 56, 104, 208, 206, 105, 197, -1, -1,
786 16, 209, 198, 56, 104, 157, 105, 114, -1, -1,
787 18, 104, 210, 211, 213, 105, 197, -1, 203, -1,
788 191, -1, 206, -1, -1, 212, 114, -1, 212, 114,
789 157, -1, 15, 114, -1, 14, 114, -1, 21, 114,
790 -1, 21, 157, 114, -1, 20, 114, -1, 216, -1,
791 215, 216, -1, 217, -1, 160, -1, -1, 161, 218,
795 /* YYRLINE[YYN] -- source line where rule number YYN was defined. */
796 static const yytype_uint16 yyrline[] =
798 0, 206, 206, 207, 210, 234, 237, 242, 247, 252,
799 257, 263, 266, 269, 272, 275, 285, 298, 306, 406,
800 409, 417, 420, 426, 430, 437, 443, 452, 460, 463,
801 473, 476, 486, 496, 517, 518, 519, 524, 525, 533,
802 544, 545, 553, 564, 568, 569, 579, 589, 599, 612,
803 613, 623, 636, 640, 644, 648, 649, 662, 663, 676,
804 677, 690, 691, 708, 709, 722, 723, 724, 725, 726,
805 730, 733, 744, 752, 760, 787, 793, 804, 808, 812,
806 816, 823, 879, 882, 889, 897, 918, 939, 949, 977,
807 982, 992, 997, 1007, 1010, 1013, 1016, 1022, 1029, 1032,
808 1036, 1040, 1044, 1051, 1055, 1059, 1066, 1070, 1074, 1081,
809 1090, 1096, 1099, 1105, 1111, 1118, 1127, 1136, 1144, 1147,
810 1154, 1158, 1165, 1168, 1172, 1176, 1185, 1194, 1202, 1212,
811 1224, 1227, 1230, 1236, 1243, 1246, 1252, 1255, 1258, 1264,
812 1267, 1282, 1286, 1290, 1294, 1298, 1302, 1307, 1312, 1317,
813 1322, 1327, 1332, 1337, 1342, 1347, 1352, 1357, 1362, 1367,
814 1372, 1377, 1382, 1387, 1392, 1397, 1402, 1407, 1411, 1415,
815 1419, 1423, 1427, 1431, 1435, 1439, 1443, 1447, 1451, 1455,
816 1459, 1463, 1467, 1475, 1483, 1487, 1500, 1500, 1503, 1503,
817 1509, 1512, 1528, 1531, 1540, 1544, 1550, 1557, 1572, 1576,
818 1580, 1581, 1587, 1588, 1589, 1590, 1591, 1595, 1596, 1596,
819 1596, 1606, 1607, 1611, 1611, 1612, 1612, 1617, 1620, 1630,
820 1633, 1639, 1640, 1644, 1652, 1656, 1666, 1671, 1688, 1688,
821 1693, 1693, 1700, 1700, 1708, 1711, 1717, 1720, 1726, 1730,
822 1737, 1744, 1751, 1758, 1769, 1778, 1782, 1789, 1792, 1798,
827 #if YYDEBUG || YYERROR_VERBOSE || 0
828 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
829 First, the terminals, then, starting at YYNTOKENS, nonterminals. */
830 static const char *const yytname[] =
832 "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION",
833 "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE",
834 "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "UINT_TYPE",
835 "BREAK", "CONTINUE", "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN",
836 "SWITCH", "CASE", "DEFAULT", "BVEC2", "BVEC3", "BVEC4", "IVEC2", "IVEC3",
837 "IVEC4", "VEC2", "VEC3", "VEC4", "UVEC2", "UVEC3", "UVEC4", "MATRIX2",
838 "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM",
839 "VARYING", "MATRIX2x3", "MATRIX3x2", "MATRIX2x4", "MATRIX4x2",
840 "MATRIX3x4", "MATRIX4x3", "CENTROID", "FLAT", "SMOOTH", "STRUCT",
841 "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", "SAMPLER_EXTERNAL_OES",
842 "SAMPLER2DRECT", "SAMPLER2DARRAY", "ISAMPLER2D", "ISAMPLER3D",
843 "ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
844 "USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER3D", "SAMPLER3DRECT",
845 "SAMPLER2DSHADOW", "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "LAYOUT",
846 "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT",
847 "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP",
848 "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP",
849 "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN",
850 "MOD_ASSIGN", "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN",
851 "OR_ASSIGN", "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET",
852 "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON",
853 "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH",
854 "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET",
855 "AMPERSAND", "QUESTION", "$accept", "identifier", "variable_identifier",
856 "primary_expression", "postfix_expression", "integer_expression",
857 "function_call", "function_call_or_method", "function_call_generic",
858 "function_call_header_no_parameters",
859 "function_call_header_with_parameters", "function_call_header",
860 "function_identifier", "unary_expression", "unary_operator",
861 "multiplicative_expression", "additive_expression", "shift_expression",
862 "relational_expression", "equality_expression", "and_expression",
863 "exclusive_or_expression", "inclusive_or_expression",
864 "logical_and_expression", "logical_xor_expression",
865 "logical_or_expression", "conditional_expression",
866 "assignment_expression", "assignment_operator", "expression",
867 "constant_expression", "enter_struct", "declaration",
868 "function_prototype", "function_declarator",
869 "function_header_with_parameters", "function_header",
870 "parameter_declarator", "parameter_declaration", "parameter_qualifier",
871 "parameter_type_specifier", "init_declarator_list", "single_declaration",
872 "fully_specified_type", "interpolation_qualifier",
873 "parameter_type_qualifier", "type_qualifier", "storage_qualifier",
874 "type_specifier", "precision_qualifier", "layout_qualifier",
875 "layout_qualifier_id_list", "layout_qualifier_id",
876 "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier",
877 "$@1", "$@2", "struct_declaration_list", "struct_declaration",
878 "struct_declarator_list", "struct_declarator", "initializer",
879 "declaration_statement", "statement", "simple_statement",
880 "compound_statement", "$@3", "$@4", "statement_no_new_scope",
881 "statement_with_scope", "$@5", "$@6", "compound_statement_no_new_scope",
882 "statement_list", "expression_statement", "selection_statement",
883 "selection_rest_statement", "condition", "iteration_statement", "$@7",
884 "$@8", "$@9", "for_init_statement", "conditionopt", "for_rest_statement",
885 "jump_statement", "translation_unit", "external_declaration",
886 "function_definition", "$@10", YY_NULL
891 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
893 static const yytype_uint16 yytoknum[] =
895 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
896 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
897 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
898 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
899 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
900 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
901 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
902 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
903 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
904 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
905 355, 356, 357, 358, 359, 360, 361, 362, 363, 364,
906 365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
907 375, 376, 377, 378, 379, 380, 381, 382
911 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
912 static const yytype_uint8 yyr1[] =
914 0, 128, 129, 129, 130, 131, 131, 131, 131, 131,
915 131, 132, 132, 132, 132, 132, 132, 133, 134, 135,
916 135, 136, 136, 137, 137, 138, 138, 139, 140, 140,
917 141, 141, 141, 141, 142, 142, 142, 143, 143, 143,
918 144, 144, 144, 145, 146, 146, 146, 146, 146, 147,
919 147, 147, 148, 149, 150, 151, 151, 152, 152, 153,
920 153, 154, 154, 155, 155, 156, 156, 156, 156, 156,
921 157, 157, 158, 159, 160, 160, 160, 160, 160, 160,
922 160, 161, 162, 162, 163, 163, 164, 165, 165, 166,
923 166, 166, 166, 167, 167, 167, 167, 168, 169, 169,
924 169, 169, 169, 170, 170, 170, 170, 170, 170, 171,
925 171, 172, 172, 173, 174, 174, 174, 174, 174, 174,
926 174, 174, 175, 175, 175, 175, 175, 175, 176, 176,
927 177, 177, 177, 178, 179, 179, 180, 180, 180, 181,
928 181, 182, 182, 182, 182, 182, 182, 182, 182, 182,
929 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
930 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
931 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
932 182, 182, 182, 182, 182, 182, 184, 183, 185, 183,
933 186, 186, 187, 187, 188, 188, 189, 189, 190, 191,
934 192, 192, 193, 193, 193, 193, 193, 194, 195, 196,
935 194, 197, 197, 199, 198, 200, 198, 201, 201, 202,
936 202, 203, 203, 204, 205, 205, 206, 206, 208, 207,
937 209, 207, 210, 207, 211, 211, 212, 212, 213, 213,
938 214, 214, 214, 214, 214, 215, 215, 216, 216, 218,
942 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
943 static const yytype_uint8 yyr2[] =
945 0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
946 3, 1, 4, 1, 3, 2, 2, 1, 1, 1,
947 3, 2, 2, 2, 1, 2, 3, 2, 1, 1,
948 1, 2, 2, 2, 1, 1, 1, 1, 3, 3,
949 1, 3, 3, 1, 1, 3, 3, 3, 3, 1,
950 3, 3, 1, 1, 1, 1, 3, 1, 3, 1,
951 3, 1, 5, 1, 3, 1, 1, 1, 1, 1,
952 1, 3, 1, 2, 2, 2, 4, 5, 6, 9,
953 2, 2, 1, 1, 2, 3, 3, 2, 5, 3,
954 2, 3, 2, 0, 1, 1, 1, 1, 1, 3,
955 5, 6, 5, 1, 2, 4, 5, 4, 2, 1,
956 2, 1, 1, 1, 1, 1, 2, 1, 2, 1,
957 1, 2, 1, 1, 1, 2, 2, 1, 1, 2,
958 1, 1, 1, 4, 1, 3, 1, 3, 3, 1,
959 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
960 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
961 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
962 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
963 1, 1, 1, 1, 1, 1, 0, 6, 0, 5,
964 1, 2, 3, 4, 1, 3, 1, 4, 1, 1,
965 1, 1, 1, 1, 1, 1, 1, 2, 0, 0,
966 5, 1, 1, 0, 2, 0, 2, 2, 3, 1,
967 2, 1, 2, 5, 3, 1, 1, 4, 0, 6,
968 0, 8, 0, 7, 1, 1, 1, 0, 2, 3,
969 2, 2, 2, 3, 2, 1, 2, 1, 1, 0,
973 /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
974 Performed when YYTABLE doesn't specify something else to do. Zero
975 means the default is an error. */
976 static const yytype_uint8 yydefact[] =
978 0, 0, 130, 131, 132, 0, 114, 122, 145, 142,
979 143, 144, 149, 150, 151, 152, 153, 154, 146, 147,
980 148, 155, 156, 157, 158, 159, 160, 123, 124, 127,
981 115, 161, 162, 163, 164, 165, 166, 0, 112, 111,
982 0, 141, 167, 169, 182, 183, 170, 171, 172, 173,
983 174, 175, 176, 177, 178, 168, 179, 180, 181, 0,
984 185, 248, 249, 0, 83, 93, 0, 98, 103, 119,
985 0, 117, 109, 0, 120, 128, 139, 184, 0, 245,
986 247, 116, 108, 0, 125, 126, 2, 3, 188, 0,
987 0, 74, 0, 81, 93, 113, 94, 95, 96, 84,
988 0, 93, 0, 75, 2, 104, 118, 0, 80, 0,
989 110, 129, 121, 0, 1, 246, 0, 0, 186, 136,
990 0, 134, 0, 250, 85, 90, 92, 97, 0, 99,
991 86, 0, 0, 73, 0, 0, 0, 0, 190, 4,
992 8, 6, 7, 9, 0, 0, 0, 36, 35, 34,
993 5, 11, 30, 13, 18, 19, 0, 0, 24, 0,
994 37, 0, 40, 43, 44, 49, 52, 53, 54, 55,
995 57, 59, 61, 72, 0, 28, 76, 0, 0, 0,
996 133, 0, 0, 0, 230, 0, 0, 0, 0, 0,
997 208, 217, 221, 37, 63, 70, 0, 199, 0, 139,
998 202, 219, 201, 200, 0, 203, 204, 205, 206, 87,
999 89, 91, 0, 0, 105, 0, 198, 107, 0, 196,
1000 0, 194, 0, 191, 31, 32, 0, 15, 16, 0,
1001 0, 22, 21, 0, 23, 25, 27, 33, 0, 0,
1002 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1003 0, 0, 140, 189, 0, 137, 138, 135, 241, 240,
1004 215, 232, 0, 244, 242, 0, 228, 207, 0, 66,
1005 67, 68, 69, 65, 0, 0, 222, 218, 220, 0,
1006 100, 0, 102, 106, 0, 0, 0, 192, 0, 77,
1007 10, 0, 17, 2, 3, 14, 20, 26, 38, 39,
1008 42, 41, 47, 48, 45, 46, 50, 51, 56, 58,
1009 60, 0, 187, 0, 0, 0, 0, 0, 243, 0,
1010 209, 64, 71, 0, 101, 193, 0, 195, 0, 78,
1011 12, 0, 0, 214, 216, 235, 234, 237, 215, 226,
1012 0, 0, 0, 0, 88, 197, 0, 62, 0, 236,
1013 0, 0, 225, 223, 0, 0, 210, 0, 0, 238,
1014 0, 215, 0, 212, 229, 211, 79, 0, 239, 233,
1018 /* YYDEFGOTO[NTERM-NUM]. */
1019 static const yytype_int16 yydefgoto[] =
1021 -1, 219, 150, 151, 152, 291, 153, 154, 155, 156,
1022 157, 158, 159, 193, 161, 162, 163, 164, 165, 166,
1023 167, 168, 169, 170, 171, 172, 194, 195, 274, 196,
1024 174, 109, 197, 198, 63, 64, 65, 125, 99, 100,
1025 126, 66, 67, 68, 69, 101, 70, 71, 72, 73,
1026 74, 120, 121, 75, 175, 77, 178, 117, 137, 138,
1027 220, 221, 217, 200, 201, 202, 203, 268, 343, 364,
1028 313, 314, 315, 365, 204, 205, 206, 353, 342, 207,
1029 319, 260, 316, 337, 350, 351, 208, 78, 79, 80,
1033 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
1035 #define YYPACT_NINF -309
1036 static const yytype_int16 yypact[] =
1038 2013, -27, -309, -309, -309, 154, -309, -309, -309, -309,
1039 -309, -309, -309, -309, -309, -309, -309, -309, -309, -309,
1040 -309, -309, -309, -309, -309, -309, -309, -309, -309, -309,
1041 -309, -309, -309, -309, -309, -309, -309, 98, -309, -309,
1042 -40, -309, -309, -309, -309, -309, -309, -309, -309, -309,
1043 -309, -309, -309, -309, -309, -309, -309, -309, -309, -46,
1044 -309, -309, -42, -23, 8, 5, -87, -309, 91, 14,
1045 1130, -309, -309, 2298, 14, -309, -1, -309, 1938, -309,
1046 -309, -309, -309, 2298, -309, -309, -309, -309, -309, 13,
1047 47, -309, 43, -309, 39, -309, -309, -309, -309, -309,
1048 2162, 124, 94, -309, 51, -14, -309, 66, -309, 2088,
1049 -309, -309, -309, 1491, -309, -309, 62, 2088, -309, 48,
1050 -83, -309, 358, -309, -309, -309, -309, 94, 2162, -9,
1051 -309, 1200, 1491, -309, 148, 2162, 94, 1683, -309, 89,
1052 -309, -309, -309, -309, 1491, 1491, 1491, -309, -309, -309,
1053 -309, -309, 10, -309, -309, -309, 92, 20, 1586, 96,
1054 -309, 1491, 53, -76, -309, -62, 90, -309, -309, -309,
1055 104, 101, -61, -309, 95, -309, -309, 1768, 2088, 103,
1056 -309, 47, 82, 84, -309, 97, 99, 93, 1298, 105,
1057 102, -309, -309, -10, -309, -309, -13, -309, -42, 2,
1058 -309, -309, -309, -309, 474, -309, -309, -309, -309, 106,
1059 -309, -309, 1393, 1491, -309, 107, -309, -309, 94, 109,
1060 4, -309, -58, -309, -309, -309, 22, -309, -309, 1491,
1061 2230, -309, -309, 1491, 112, -309, -309, -309, 1491, 1491,
1062 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491, 1491,
1063 1491, 1491, -309, -309, 1853, -309, -309, -309, -309, -309,
1064 100, -309, 1491, -309, -309, 36, -309, -309, 590, -309,
1065 -309, -309, -309, -309, 1491, 1491, -309, -309, -309, 1491,
1066 -309, 113, -309, -309, 42, 1491, 94, -309, -73, -309,
1067 -309, 115, 108, 89, 119, -309, -309, -309, -309, -309,
1068 53, 53, -309, -309, -309, -309, -62, -62, -309, 104,
1069 101, 73, -309, 169, 43, 822, 938, 25, -309, 1035,
1070 590, -309, -309, 120, -309, -309, 121, -309, 1491, -309,
1071 -309, 1491, 122, -309, -309, -309, -309, 1035, 100, 108,
1072 94, 2162, 125, 123, -309, -309, 126, -309, 1491, -309,
1073 117, 129, 212, -309, 139, 706, -309, 141, 29, 1491,
1074 706, 100, 1491, -309, -309, -309, -309, 142, 108, -309,
1078 /* YYPGOTO[NTERM-NUM]. */
1079 static const yytype_int16 yypgoto[] =
1081 -309, -39, -309, -309, -309, -309, -309, -309, 7, -309,
1082 -309, -309, -309, 1, -309, -54, -309, -101, -57, -309,
1083 -309, -309, 9, -11, 3, -309, -110, -126, -309, -138,
1084 -122, -309, 11, 16, -309, -309, -309, 130, 165, 159,
1085 133, -309, -309, -299, -309, -309, -102, -30, -66, 257,
1086 -309, -309, 83, -6, 0, -309, -309, -309, -104, -125,
1087 45, -21, -208, -50, -194, -296, -309, -309, -309, -93,
1088 -308, -309, -309, -90, 6, -47, -309, -309, -67, -309,
1089 -309, -309, -309, -309, -309, -309, -309, -309, 193, -309,
1093 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
1094 positive, shift that token. If negative, reduce the rule which
1095 number is the opposite. If YYTABLE_NINF, syntax error. */
1096 #define YYTABLE_NINF -214
1097 static const yytype_int16 yytable[] =
1099 76, 89, 123, 173, 110, 282, 216, 135, 226, 215,
1100 278, 61, 223, 177, 95, 135, 62, 81, 288, 334,
1101 340, 173, 180, 7, 102, 242, 243, 103, 181, 105,
1102 352, 250, 235, 328, 127, 135, 86, 87, 340, 106,
1103 240, 329, 241, 136, 112, 96, 97, 98, 95, 82,
1104 265, 136, 223, 370, 27, 28, 289, 29, 90, 363,
1105 244, 245, 127, 129, 363, 37, 251, 111, 88, 218,
1106 76, 136, 91, 76, 254, 135, 135, 116, 76, 96,
1107 97, 98, 93, 76, 269, 270, 271, 216, 209, 61,
1108 281, 292, 131, 272, 62, 227, 228, 212, 275, 132,
1109 76, 276, 173, 273, 213, 113, -28, 297, 113, 76,
1110 -82, 136, 136, 311, 160, 286, 229, 76, 287, 94,
1111 230, 118, 199, 119, 317, 232, 278, 290, 76, 223,
1112 338, 233, 160, 275, 367, 76, 275, 76, 84, 85,
1113 275, 302, 303, 304, 305, 224, 225, 275, 321, 322,
1114 318, 122, 135, 286, 371, 130, 325, 323, 2, 3,
1115 4, 179, 237, 326, 96, 97, 98, 104, 87, 173,
1116 86, 87, 238, 239, 133, 173, 176, 76, 76, 246,
1117 247, 339, 255, 256, 275, 331, 300, 301, 136, 306,
1118 307, 295, 81, -29, 249, 248, 258, 231, 259, 339,
1119 236, 261, 252, 262, 199, 347, 346, 263, -213, 266,
1120 358, 267, 279, 160, 283, 285, -141, 341, 173, 275,
1121 324, 368, 330, -185, 333, 332, 348, 344, 345, 361,
1122 355, 359, 356, 357, 360, 341, 216, 296, 309, 298,
1123 299, 160, 160, 160, 160, 160, 160, 160, 160, 160,
1124 160, 160, 362, 310, 76, 366, 372, 308, 210, 124,
1125 128, 211, 83, 284, 257, 327, 335, 369, 199, 336,
1126 349, 115, 0, 0, 320, 110, 0, 0, 0, 0,
1127 160, 0, 0, 0, 0, 0, 160, 0, 0, 0,
1128 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1129 0, 354, 0, 0, 0, 0, 0, 0, 0, 0,
1130 0, 0, 0, 0, 0, 199, 199, 0, 0, 199,
1131 199, 0, 0, 0, 0, 0, 0, 0, 0, 160,
1132 0, 0, 0, 0, 0, 0, 0, 199, 0, 0,
1133 0, 76, 0, 0, 0, 0, 0, 0, 0, 0,
1134 0, 0, 0, 0, 0, 199, 0, 0, 0, 0,
1135 199, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1136 10, 11, 182, 183, 184, 0, 185, 186, 187, 188,
1137 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1138 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1139 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1140 38, 39, 40, 41, 189, 42, 43, 44, 45, 46,
1141 47, 48, 49, 50, 51, 52, 53, 54, 55, 0,
1142 56, 57, 58, 59, 139, 60, 140, 141, 142, 143,
1143 0, 0, 0, 144, 145, 0, 0, 0, 0, 0,
1144 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1145 0, 0, 146, 0, 0, 0, 190, 191, 0, 0,
1146 0, 0, 192, 147, 148, 0, 149, 1, 2, 3,
1147 4, 5, 6, 7, 8, 9, 10, 11, 182, 183,
1148 184, 0, 185, 186, 187, 188, 0, 0, 0, 12,
1149 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
1150 23, 24, 25, 26, 27, 28, 0, 29, 30, 31,
1151 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1152 189, 42, 43, 44, 45, 46, 47, 48, 49, 50,
1153 51, 52, 53, 54, 55, 0, 56, 57, 58, 59,
1154 139, 60, 140, 141, 142, 143, 0, 0, 0, 144,
1155 145, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1156 0, 0, 0, 0, 0, 0, 0, 0, 146, 0,
1157 0, 0, 190, 277, 0, 0, 0, 0, 192, 147,
1158 148, 0, 149, 1, 2, 3, 4, 5, 6, 7,
1159 8, 9, 10, 11, 182, 183, 184, 0, 185, 186,
1160 187, 188, 0, 0, 0, 12, 13, 14, 15, 16,
1161 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1162 27, 28, 0, 29, 30, 31, 32, 33, 34, 35,
1163 36, 37, 38, 39, 40, 41, 189, 42, 43, 44,
1164 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1165 55, 0, 56, 57, 58, 59, 139, 60, 140, 141,
1166 142, 143, 0, 0, 0, 144, 145, 0, 0, 0,
1167 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1168 0, 0, 0, 0, 146, 0, 0, 0, 190, 0,
1169 0, 0, 0, 0, 192, 147, 148, 0, 149, 1,
1170 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1171 182, 183, 184, 0, 185, 186, 187, 188, 0, 0,
1172 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1173 21, 22, 23, 24, 25, 26, 27, 28, 0, 29,
1174 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1175 40, 41, 189, 42, 43, 44, 45, 46, 47, 48,
1176 49, 50, 51, 52, 53, 54, 55, 0, 56, 57,
1177 58, 59, 139, 60, 140, 141, 142, 143, 0, 0,
1178 0, 144, 145, 0, 0, 0, 0, 0, 0, 0,
1179 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1180 146, 0, 0, 0, 122, 0, 0, 0, 0, 0,
1181 192, 147, 148, 0, 149, 1, 2, 3, 4, 5,
1182 6, 7, 8, 9, 10, 11, 182, 183, 184, 0,
1183 185, 186, 187, 188, 0, 0, 0, 12, 13, 14,
1184 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1185 25, 26, 27, 28, 0, 29, 30, 31, 32, 33,
1186 34, 35, 36, 37, 38, 39, 40, 41, 189, 42,
1187 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1188 53, 54, 55, 0, 56, 57, 58, 59, 139, 60,
1189 140, 141, 142, 143, 0, 0, 0, 144, 145, 0,
1190 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1191 0, 0, 0, 0, 0, 0, 146, 0, 0, 0,
1192 0, 0, 0, 0, 0, 0, 192, 147, 148, 0,
1193 149, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1194 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
1195 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1196 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1197 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1198 38, 39, 40, 41, 0, 42, 43, 44, 45, 46,
1199 47, 48, 49, 50, 51, 52, 53, 54, 55, 0,
1200 56, 57, 58, 59, 139, 60, 140, 141, 142, 143,
1201 0, 0, 0, 144, 145, 0, 0, 0, 0, 0,
1202 0, 0, 0, 0, 0, 0, 0, 0, 134, 2,
1203 3, 4, 146, 6, 7, 8, 9, 10, 11, 0,
1204 0, 0, 192, 147, 148, 0, 149, 0, 0, 0,
1205 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
1206 22, 23, 24, 25, 26, 27, 28, 0, 29, 30,
1207 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1208 41, 0, 42, 43, 44, 45, 46, 47, 48, 49,
1209 50, 51, 52, 53, 54, 55, 0, 56, 57, 58,
1210 59, 139, 60, 140, 141, 142, 143, 0, 0, 0,
1211 144, 145, 0, 0, 0, 0, 0, 0, 0, 0,
1212 0, 0, 0, 0, 2, 3, 4, 0, 0, 146,
1213 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
1214 147, 148, 0, 149, 0, 12, 13, 14, 15, 16,
1215 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1216 0, 0, 0, 0, 0, 31, 32, 33, 34, 35,
1217 36, 0, 0, 0, 40, 41, 0, 42, 43, 44,
1218 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1219 55, 0, 56, 57, 58, 0, 107, 60, 0, 0,
1220 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
1221 0, 0, 0, 0, 0, 12, 13, 14, 15, 16,
1222 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1223 0, 0, 0, 0, 108, 31, 32, 33, 34, 35,
1224 36, 0, 0, 0, 40, 41, 0, 42, 43, 44,
1225 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1226 55, 0, 56, 57, 58, 0, 139, 60, 140, 141,
1227 142, 143, 0, 0, 0, 144, 145, 0, 0, 0,
1228 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1229 0, 0, 0, 0, 146, 0, 0, 214, 8, 9,
1230 10, 11, 0, 0, 0, 147, 148, 0, 149, 0,
1231 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1232 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
1233 0, 0, 0, 31, 32, 33, 34, 35, 36, 0,
1234 0, 0, 40, 41, 0, 42, 43, 44, 45, 46,
1235 47, 48, 49, 50, 51, 52, 53, 54, 55, 0,
1236 56, 57, 58, 0, 139, 60, 140, 141, 142, 143,
1237 0, 0, 0, 144, 145, 0, 0, 0, 0, 0,
1238 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1239 0, 0, 146, 8, 9, 10, 11, 0, 0, 0,
1240 0, 0, 264, 147, 148, 0, 149, 0, 12, 13,
1241 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1242 24, 25, 26, 0, 0, 0, 0, 0, 31, 32,
1243 33, 34, 35, 36, 0, 0, 0, 40, 41, 0,
1244 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1245 52, 53, 54, 55, 0, 56, 57, 58, 0, 139,
1246 60, 140, 141, 142, 143, 0, 0, 0, 144, 145,
1247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1248 0, 0, 0, 0, 0, 0, 0, 146, 0, 0,
1249 280, 8, 9, 10, 11, 0, 0, 0, 147, 148,
1250 0, 149, 0, 0, 0, 0, 12, 13, 14, 15,
1251 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
1252 26, 0, 0, 0, 0, 0, 31, 32, 33, 34,
1253 35, 36, 0, 0, 0, 40, 41, 0, 42, 43,
1254 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1255 54, 55, 0, 56, 57, 58, 0, 139, 60, 140,
1256 141, 142, 143, 0, 0, 0, 144, 145, 0, 0,
1257 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1258 0, 0, 0, 0, 0, 146, 8, 9, 10, 11,
1259 0, 0, 0, 0, 0, 0, 147, 148, 0, 149,
1260 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
1261 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
1262 0, 31, 32, 33, 34, 35, 36, 0, 0, 0,
1263 40, 234, 0, 42, 43, 44, 45, 46, 47, 48,
1264 49, 50, 51, 52, 53, 54, 55, 0, 56, 57,
1265 58, 0, 139, 60, 140, 141, 142, 143, 0, 0,
1266 0, 144, 145, 0, 0, 0, 0, 0, 0, 0,
1267 0, 0, 0, 0, 0, 0, 134, 2, 3, 4,
1268 146, 6, 7, 8, 9, 10, 11, 0, 0, 0,
1269 0, 147, 148, 0, 149, 0, 0, 0, 12, 13,
1270 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1271 24, 25, 26, 27, 28, 0, 29, 30, 31, 32,
1272 33, 34, 35, 36, 37, 38, 39, 40, 41, 0,
1273 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1274 52, 53, 54, 55, 0, 56, 57, 58, 59, 0,
1275 60, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1276 0, 134, 2, 3, 4, 0, 6, 7, 8, 9,
1277 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
1278 0, 0, 222, 12, 13, 14, 15, 16, 17, 18,
1279 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1280 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1281 38, 39, 40, 41, 0, 42, 43, 44, 45, 46,
1282 47, 48, 49, 50, 51, 52, 53, 54, 55, 0,
1283 56, 57, 58, 59, 0, 60, 0, 0, 0, 0,
1284 0, 0, 0, 0, 0, 0, 134, 2, 3, 4,
1285 0, 6, 7, 8, 9, 10, 11, 0, 0, 0,
1286 0, 0, 0, 0, 0, 0, 0, 253, 12, 13,
1287 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1288 24, 25, 26, 27, 28, 0, 29, 30, 31, 32,
1289 33, 34, 35, 36, 37, 38, 39, 40, 41, 0,
1290 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1291 52, 53, 54, 55, 0, 56, 57, 58, 59, 0,
1292 60, 0, 0, 0, 0, 0, 0, 0, 114, 0,
1293 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
1294 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
1295 0, 0, 312, 12, 13, 14, 15, 16, 17, 18,
1296 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1297 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1298 38, 39, 40, 41, 0, 42, 43, 44, 45, 46,
1299 47, 48, 49, 50, 51, 52, 53, 54, 55, 0,
1300 56, 57, 58, 59, 0, 60, 1, 2, 3, 4,
1301 5, 6, 7, 8, 9, 10, 11, 0, 0, 0,
1302 0, 0, 0, 0, 0, 0, 0, 0, 12, 13,
1303 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
1304 24, 25, 26, 27, 28, 0, 29, 30, 31, 32,
1305 33, 34, 35, 36, 37, 38, 39, 40, 41, 0,
1306 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1307 52, 53, 54, 55, 0, 56, 57, 58, 59, 0,
1308 60, 134, 2, 3, 4, 0, 6, 7, 8, 9,
1309 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
1310 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1311 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
1312 0, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1313 38, 39, 40, 41, 0, 42, 43, 44, 45, 46,
1314 47, 48, 49, 50, 51, 52, 53, 54, 55, 0,
1315 56, 57, 58, 59, 0, 60, 2, 3, 4, 0,
1316 0, 0, 8, 9, 10, 11, 0, 0, 0, 0,
1317 0, 0, 0, 0, 0, 0, 0, 12, 13, 14,
1318 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
1319 25, 26, 0, 0, 0, 0, 0, 31, 32, 33,
1320 34, 35, 36, 0, 0, 0, 40, 41, 0, 42,
1321 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
1322 53, 54, 55, 0, 56, 57, 58, 0, 0, 60,
1323 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
1324 0, 0, 0, 0, 0, 12, 13, 14, 15, 16,
1325 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
1326 0, 0, 0, 0, 0, 31, 32, 33, 34, 35,
1327 36, 0, 0, 0, 40, 41, 0, 42, 43, 44,
1328 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1329 55, 0, 56, 57, 58, 0, 293, 294, 8, 9,
1330 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
1331 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
1332 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
1333 0, 0, 0, 31, 32, 33, 34, 35, 36, 0,
1334 0, 0, 40, 41, 0, 42, 43, 44, 45, 46,
1335 47, 48, 49, 50, 51, 52, 53, 54, 55, 0,
1336 56, 57, 58, 0, 0, 60
1339 #define yypact_value_is_default(Yystate) \
1340 (!!((Yystate) == (-309)))
1342 #define yytable_value_is_error(Yytable_value) \
1345 static const yytype_int16 yycheck[] =
1347 0, 40, 92, 113, 70, 213, 132, 109, 146, 131,
1348 204, 0, 137, 117, 9, 117, 0, 44, 76, 315,
1349 319, 131, 105, 9, 111, 87, 88, 114, 111, 68,
1350 338, 92, 158, 106, 100, 137, 76, 77, 337, 69,
1351 116, 114, 118, 109, 74, 40, 41, 42, 9, 76,
1352 188, 117, 177, 361, 40, 41, 114, 43, 104, 355,
1353 122, 123, 128, 102, 360, 51, 127, 73, 108, 135,
1354 70, 137, 114, 73, 178, 177, 178, 83, 78, 40,
1355 41, 42, 105, 83, 94, 95, 96, 213, 127, 78,
1356 212, 229, 106, 103, 78, 85, 86, 106, 111, 113,
1357 100, 114, 212, 113, 113, 106, 104, 233, 106, 109,
1358 105, 177, 178, 251, 113, 111, 106, 117, 114, 111,
1359 110, 108, 122, 76, 262, 105, 320, 105, 128, 254,
1360 105, 111, 131, 111, 105, 135, 111, 137, 40, 41,
1361 111, 242, 243, 244, 245, 144, 145, 111, 274, 275,
1362 114, 108, 254, 111, 362, 104, 114, 279, 4, 5,
1363 6, 113, 161, 285, 40, 41, 42, 76, 77, 279,
1364 76, 77, 119, 120, 108, 285, 114, 177, 178, 89,
1365 90, 319, 79, 80, 111, 112, 240, 241, 254, 246,
1366 247, 230, 44, 104, 93, 91, 114, 105, 114, 337,
1367 104, 104, 107, 104, 204, 331, 328, 114, 108, 104,
1368 348, 109, 106, 212, 107, 106, 104, 319, 328, 111,
1369 107, 359, 107, 104, 314, 56, 104, 107, 107, 17,
1370 105, 114, 109, 107, 105, 337, 362, 230, 249, 238,
1371 239, 240, 241, 242, 243, 244, 245, 246, 247, 248,
1372 249, 250, 113, 250, 254, 114, 114, 248, 128, 94,
1373 101, 128, 5, 218, 181, 286, 316, 360, 268, 316,
1374 337, 78, -1, -1, 268, 341, -1, -1, -1, -1,
1375 279, -1, -1, -1, -1, -1, 285, -1, -1, -1,
1376 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1377 -1, 340, -1, -1, -1, -1, -1, -1, -1, -1,
1378 -1, -1, -1, -1, -1, 315, 316, -1, -1, 319,
1379 320, -1, -1, -1, -1, -1, -1, -1, -1, 328,
1380 -1, -1, -1, -1, -1, -1, -1, 337, -1, -1,
1381 -1, 341, -1, -1, -1, -1, -1, -1, -1, -1,
1382 -1, -1, -1, -1, -1, 355, -1, -1, -1, -1,
1383 360, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1384 12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
1385 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1386 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1387 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1388 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
1389 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1390 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1391 -1, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1392 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1393 -1, -1, 104, -1, -1, -1, 108, 109, -1, -1,
1394 -1, -1, 114, 115, 116, -1, 118, 3, 4, 5,
1395 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
1396 16, -1, 18, 19, 20, 21, -1, -1, -1, 25,
1397 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
1398 36, 37, 38, 39, 40, 41, -1, 43, 44, 45,
1399 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
1400 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
1401 66, 67, 68, 69, 70, -1, 72, 73, 74, 75,
1402 76, 77, 78, 79, 80, 81, -1, -1, -1, 85,
1403 86, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1404 -1, -1, -1, -1, -1, -1, -1, -1, 104, -1,
1405 -1, -1, 108, 109, -1, -1, -1, -1, 114, 115,
1406 116, -1, 118, 3, 4, 5, 6, 7, 8, 9,
1407 10, 11, 12, 13, 14, 15, 16, -1, 18, 19,
1408 20, 21, -1, -1, -1, 25, 26, 27, 28, 29,
1409 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1410 40, 41, -1, 43, 44, 45, 46, 47, 48, 49,
1411 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
1412 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1413 70, -1, 72, 73, 74, 75, 76, 77, 78, 79,
1414 80, 81, -1, -1, -1, 85, 86, -1, -1, -1,
1415 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1416 -1, -1, -1, -1, 104, -1, -1, -1, 108, -1,
1417 -1, -1, -1, -1, 114, 115, 116, -1, 118, 3,
1418 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
1419 14, 15, 16, -1, 18, 19, 20, 21, -1, -1,
1420 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1421 34, 35, 36, 37, 38, 39, 40, 41, -1, 43,
1422 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1423 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
1424 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1425 74, 75, 76, 77, 78, 79, 80, 81, -1, -1,
1426 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1427 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1428 104, -1, -1, -1, 108, -1, -1, -1, -1, -1,
1429 114, 115, 116, -1, 118, 3, 4, 5, 6, 7,
1430 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
1431 18, 19, 20, 21, -1, -1, -1, 25, 26, 27,
1432 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1433 38, 39, 40, 41, -1, 43, 44, 45, 46, 47,
1434 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
1435 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1436 68, 69, 70, -1, 72, 73, 74, 75, 76, 77,
1437 78, 79, 80, 81, -1, -1, -1, 85, 86, -1,
1438 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1439 -1, -1, -1, -1, -1, -1, 104, -1, -1, -1,
1440 -1, -1, -1, -1, -1, -1, 114, 115, 116, -1,
1441 118, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1442 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
1443 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1444 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1445 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1446 52, 53, 54, 55, -1, 57, 58, 59, 60, 61,
1447 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1448 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
1449 -1, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1450 -1, -1, -1, -1, -1, -1, -1, -1, 3, 4,
1451 5, 6, 104, 8, 9, 10, 11, 12, 13, -1,
1452 -1, -1, 114, 115, 116, -1, 118, -1, -1, -1,
1453 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
1454 35, 36, 37, 38, 39, 40, 41, -1, 43, 44,
1455 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
1456 55, -1, 57, 58, 59, 60, 61, 62, 63, 64,
1457 65, 66, 67, 68, 69, 70, -1, 72, 73, 74,
1458 75, 76, 77, 78, 79, 80, 81, -1, -1, -1,
1459 85, 86, -1, -1, -1, -1, -1, -1, -1, -1,
1460 -1, -1, -1, -1, 4, 5, 6, -1, -1, 104,
1461 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
1462 115, 116, -1, 118, -1, 25, 26, 27, 28, 29,
1463 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1464 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
1465 50, -1, -1, -1, 54, 55, -1, 57, 58, 59,
1466 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1467 70, -1, 72, 73, 74, -1, 76, 77, -1, -1,
1468 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
1469 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
1470 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1471 -1, -1, -1, -1, 114, 45, 46, 47, 48, 49,
1472 50, -1, -1, -1, 54, 55, -1, 57, 58, 59,
1473 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1474 70, -1, 72, 73, 74, -1, 76, 77, 78, 79,
1475 80, 81, -1, -1, -1, 85, 86, -1, -1, -1,
1476 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1477 -1, -1, -1, -1, 104, -1, -1, 107, 10, 11,
1478 12, 13, -1, -1, -1, 115, 116, -1, 118, -1,
1479 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1480 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
1481 -1, -1, -1, 45, 46, 47, 48, 49, 50, -1,
1482 -1, -1, 54, 55, -1, 57, 58, 59, 60, 61,
1483 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1484 72, 73, 74, -1, 76, 77, 78, 79, 80, 81,
1485 -1, -1, -1, 85, 86, -1, -1, -1, -1, -1,
1486 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1487 -1, -1, 104, 10, 11, 12, 13, -1, -1, -1,
1488 -1, -1, 114, 115, 116, -1, 118, -1, 25, 26,
1489 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1490 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
1491 47, 48, 49, 50, -1, -1, -1, 54, 55, -1,
1492 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1493 67, 68, 69, 70, -1, 72, 73, 74, -1, 76,
1494 77, 78, 79, 80, 81, -1, -1, -1, 85, 86,
1495 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1496 -1, -1, -1, -1, -1, -1, -1, 104, -1, -1,
1497 107, 10, 11, 12, 13, -1, -1, -1, 115, 116,
1498 -1, 118, -1, -1, -1, -1, 25, 26, 27, 28,
1499 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
1500 39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
1501 49, 50, -1, -1, -1, 54, 55, -1, 57, 58,
1502 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
1503 69, 70, -1, 72, 73, 74, -1, 76, 77, 78,
1504 79, 80, 81, -1, -1, -1, 85, 86, -1, -1,
1505 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1506 -1, -1, -1, -1, -1, 104, 10, 11, 12, 13,
1507 -1, -1, -1, -1, -1, -1, 115, 116, -1, 118,
1508 -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
1509 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
1510 -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
1511 54, 55, -1, 57, 58, 59, 60, 61, 62, 63,
1512 64, 65, 66, 67, 68, 69, 70, -1, 72, 73,
1513 74, -1, 76, 77, 78, 79, 80, 81, -1, -1,
1514 -1, 85, 86, -1, -1, -1, -1, -1, -1, -1,
1515 -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
1516 104, 8, 9, 10, 11, 12, 13, -1, -1, -1,
1517 -1, 115, 116, -1, 118, -1, -1, -1, 25, 26,
1518 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1519 37, 38, 39, 40, 41, -1, 43, 44, 45, 46,
1520 47, 48, 49, 50, 51, 52, 53, 54, 55, -1,
1521 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1522 67, 68, 69, 70, -1, 72, 73, 74, 75, -1,
1523 77, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1524 -1, 3, 4, 5, 6, -1, 8, 9, 10, 11,
1525 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
1526 -1, -1, 109, 25, 26, 27, 28, 29, 30, 31,
1527 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1528 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1529 52, 53, 54, 55, -1, 57, 58, 59, 60, 61,
1530 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1531 72, 73, 74, 75, -1, 77, -1, -1, -1, -1,
1532 -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
1533 -1, 8, 9, 10, 11, 12, 13, -1, -1, -1,
1534 -1, -1, -1, -1, -1, -1, -1, 109, 25, 26,
1535 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1536 37, 38, 39, 40, 41, -1, 43, 44, 45, 46,
1537 47, 48, 49, 50, 51, 52, 53, 54, 55, -1,
1538 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1539 67, 68, 69, 70, -1, 72, 73, 74, 75, -1,
1540 77, -1, -1, -1, -1, -1, -1, -1, 0, -1,
1541 -1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1542 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
1543 -1, -1, 109, 25, 26, 27, 28, 29, 30, 31,
1544 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1545 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1546 52, 53, 54, 55, -1, 57, 58, 59, 60, 61,
1547 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1548 72, 73, 74, 75, -1, 77, 3, 4, 5, 6,
1549 7, 8, 9, 10, 11, 12, 13, -1, -1, -1,
1550 -1, -1, -1, -1, -1, -1, -1, -1, 25, 26,
1551 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
1552 37, 38, 39, 40, 41, -1, 43, 44, 45, 46,
1553 47, 48, 49, 50, 51, 52, 53, 54, 55, -1,
1554 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,
1555 67, 68, 69, 70, -1, 72, 73, 74, 75, -1,
1556 77, 3, 4, 5, 6, -1, 8, 9, 10, 11,
1557 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
1558 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1559 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
1560 -1, 43, 44, 45, 46, 47, 48, 49, 50, 51,
1561 52, 53, 54, 55, -1, 57, 58, 59, 60, 61,
1562 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1563 72, 73, 74, 75, -1, 77, 4, 5, 6, -1,
1564 -1, -1, 10, 11, 12, 13, -1, -1, -1, -1,
1565 -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
1566 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
1567 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
1568 48, 49, 50, -1, -1, -1, 54, 55, -1, 57,
1569 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
1570 68, 69, 70, -1, 72, 73, 74, -1, -1, 77,
1571 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
1572 -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
1573 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
1574 -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
1575 50, -1, -1, -1, 54, 55, -1, 57, 58, 59,
1576 60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
1577 70, -1, 72, 73, 74, -1, 76, 77, 10, 11,
1578 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
1579 -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
1580 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
1581 -1, -1, -1, 45, 46, 47, 48, 49, 50, -1,
1582 -1, -1, 54, 55, -1, 57, 58, 59, 60, 61,
1583 62, 63, 64, 65, 66, 67, 68, 69, 70, -1,
1584 72, 73, 74, -1, -1, 77
1587 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
1588 symbol of state STATE-NUM. */
1589 static const yytype_uint8 yystos[] =
1591 0, 3, 4, 5, 6, 7, 8, 9, 10, 11,
1592 12, 13, 25, 26, 27, 28, 29, 30, 31, 32,
1593 33, 34, 35, 36, 37, 38, 39, 40, 41, 43,
1594 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
1595 54, 55, 57, 58, 59, 60, 61, 62, 63, 64,
1596 65, 66, 67, 68, 69, 70, 72, 73, 74, 75,
1597 77, 160, 161, 162, 163, 164, 169, 170, 171, 172,
1598 174, 175, 176, 177, 178, 181, 182, 183, 215, 216,
1599 217, 44, 76, 177, 40, 41, 76, 77, 108, 129,
1600 104, 114, 218, 105, 111, 9, 40, 41, 42, 166,
1601 167, 173, 111, 114, 76, 129, 175, 76, 114, 159,
1602 176, 181, 175, 106, 0, 216, 181, 185, 108, 76,
1603 179, 180, 108, 201, 166, 165, 168, 176, 167, 129,
1604 104, 106, 113, 108, 3, 174, 176, 186, 187, 76,
1605 78, 79, 80, 81, 85, 86, 104, 115, 116, 118,
1606 130, 131, 132, 134, 135, 136, 137, 138, 139, 140,
1607 141, 142, 143, 144, 145, 146, 147, 148, 149, 150,
1608 151, 152, 153, 154, 158, 182, 114, 186, 184, 113,
1609 105, 111, 14, 15, 16, 18, 19, 20, 21, 56,
1610 108, 109, 114, 141, 154, 155, 157, 160, 161, 182,
1611 191, 192, 193, 194, 202, 203, 204, 207, 214, 129,
1612 165, 168, 106, 113, 107, 158, 155, 190, 176, 129,
1613 188, 189, 109, 187, 141, 141, 157, 85, 86, 106,
1614 110, 105, 105, 111, 55, 155, 104, 141, 119, 120,
1615 116, 118, 87, 88, 122, 123, 89, 90, 91, 93,
1616 92, 127, 107, 109, 186, 79, 80, 180, 114, 114,
1617 209, 104, 104, 114, 114, 157, 104, 109, 195, 94,
1618 95, 96, 103, 113, 156, 111, 114, 109, 192, 106,
1619 107, 158, 190, 107, 188, 106, 111, 114, 76, 114,
1620 105, 133, 157, 76, 77, 129, 136, 155, 141, 141,
1621 143, 143, 145, 145, 145, 145, 146, 146, 150, 151,
1622 152, 157, 109, 198, 199, 200, 210, 157, 114, 208,
1623 202, 155, 155, 158, 107, 114, 158, 189, 106, 114,
1624 107, 112, 56, 201, 193, 191, 203, 211, 105, 157,
1625 171, 174, 206, 196, 107, 107, 158, 155, 104, 206,
1626 212, 213, 198, 205, 129, 105, 109, 107, 157, 114,
1627 105, 17, 113, 193, 197, 201, 114, 105, 157, 197,
1631 #define yyerrok (yyerrstatus = 0)
1632 #define yyclearin (yychar = YYEMPTY)
1633 #define YYEMPTY (-2)
1636 #define YYACCEPT goto yyacceptlab
1637 #define YYABORT goto yyabortlab
1638 #define YYERROR goto yyerrorlab
1641 /* Like YYERROR except do call yyerror. This remains here temporarily
1642 to ease the transition to the new meaning of YYERROR, for GCC.
1643 Once GCC version 2 has supplanted version 1, this can go. However,
1644 YYFAIL appears to be in use. Nevertheless, it is formally deprecated
1645 in Bison 2.4.2's NEWS entry, where a plan to phase it out is
1648 #define YYFAIL goto yyerrlab
1650 /* This is here to suppress warnings from the GCC cpp's
1651 -Wunused-macros. Normally we don't worry about that warning, but
1652 some users do, and we want to make it easy for users to remove
1653 YYFAIL uses, which will produce warnings from Bison 2.5. */
1656 #define YYRECOVERING() (!!yyerrstatus)
1658 #define YYBACKUP(Token, Value) \
1660 if (yychar == YYEMPTY) \
1664 YYPOPSTACK (yylen); \
1670 yyerror (&yylloc, context, YY_("syntax error: cannot back up")); \
1675 /* Error token number */
1677 #define YYERRCODE 256
1680 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
1681 If N is 0, then set CURRENT to the empty location which ends
1682 the previous symbol: RHS[0] (always defined). */
1684 #ifndef YYLLOC_DEFAULT
1685 # define YYLLOC_DEFAULT(Current, Rhs, N) \
1689 (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
1690 (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
1691 (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
1692 (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
1696 (Current).first_line = (Current).last_line = \
1697 YYRHSLOC (Rhs, 0).last_line; \
1698 (Current).first_column = (Current).last_column = \
1699 YYRHSLOC (Rhs, 0).last_column; \
1704 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
1707 /* YY_LOCATION_PRINT -- Print the location on the stream.
1708 This macro was not mandated originally: define only if we know
1709 we won't break user code: when these are the locations we know. */
1711 #ifndef YY_LOCATION_PRINT
1712 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
1714 /* Print *YYLOCP on YYO. Private, do not rely on its existence. */
1716 __attribute__((__unused__))
1717 #if (defined __STDC__ || defined __C99__FUNC__ \
1718 || defined __cplusplus || defined _MSC_VER)
1720 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
1723 yy_location_print_ (yyo, yylocp)
1725 YYLTYPE const * const yylocp;
1729 int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
1730 if (0 <= yylocp->first_line)
1732 res += fprintf (yyo, "%d", yylocp->first_line);
1733 if (0 <= yylocp->first_column)
1734 res += fprintf (yyo, ".%d", yylocp->first_column);
1736 if (0 <= yylocp->last_line)
1738 if (yylocp->first_line < yylocp->last_line)
1740 res += fprintf (yyo, "-%d", yylocp->last_line);
1742 res += fprintf (yyo, ".%d", end_col);
1744 else if (0 <= end_col && yylocp->first_column < end_col)
1745 res += fprintf (yyo, "-%d", end_col);
1750 # define YY_LOCATION_PRINT(File, Loc) \
1751 yy_location_print_ (File, &(Loc))
1754 # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
1759 /* YYLEX -- calling `yylex' with the right arguments. */
1761 # define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
1763 # define YYLEX yylex (&yylval, &yylloc)
1766 /* Enable debugging if requested. */
1770 # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
1771 # define YYFPRINTF fprintf
1774 # define YYDPRINTF(Args) \
1780 # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
1784 YYFPRINTF (stderr, "%s ", Title); \
1785 yy_symbol_print (stderr, \
1786 Type, Value, Location, context); \
1787 YYFPRINTF (stderr, "\n"); \
1792 /*--------------------------------.
1793 | Print this symbol on YYOUTPUT. |
1794 `--------------------------------*/
1797 #if (defined __STDC__ || defined __C99__FUNC__ \
1798 || defined __cplusplus || defined _MSC_VER)
1800 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
1803 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context)
1806 YYSTYPE const * const yyvaluep;
1807 YYLTYPE const * const yylocationp;
1808 TParseContext* context;
1811 FILE *yyo = yyoutput;
1815 YYUSE (yylocationp);
1818 if (yytype < YYNTOKENS)
1819 YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
1827 /*--------------------------------.
1828 | Print this symbol on YYOUTPUT. |
1829 `--------------------------------*/
1831 #if (defined __STDC__ || defined __C99__FUNC__ \
1832 || defined __cplusplus || defined _MSC_VER)
1834 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context)
1837 yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, context)
1840 YYSTYPE const * const yyvaluep;
1841 YYLTYPE const * const yylocationp;
1842 TParseContext* context;
1845 if (yytype < YYNTOKENS)
1846 YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
1848 YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1850 YY_LOCATION_PRINT (yyoutput, *yylocationp);
1851 YYFPRINTF (yyoutput, ": ");
1852 yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context);
1853 YYFPRINTF (yyoutput, ")");
1856 /*------------------------------------------------------------------.
1857 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1859 `------------------------------------------------------------------*/
1861 #if (defined __STDC__ || defined __C99__FUNC__ \
1862 || defined __cplusplus || defined _MSC_VER)
1864 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
1867 yy_stack_print (yybottom, yytop)
1868 yytype_int16 *yybottom;
1869 yytype_int16 *yytop;
1872 YYFPRINTF (stderr, "Stack now");
1873 for (; yybottom <= yytop; yybottom++)
1875 int yybot = *yybottom;
1876 YYFPRINTF (stderr, " %d", yybot);
1878 YYFPRINTF (stderr, "\n");
1881 # define YY_STACK_PRINT(Bottom, Top) \
1884 yy_stack_print ((Bottom), (Top)); \
1888 /*------------------------------------------------.
1889 | Report that the YYRULE is going to be reduced. |
1890 `------------------------------------------------*/
1892 #if (defined __STDC__ || defined __C99__FUNC__ \
1893 || defined __cplusplus || defined _MSC_VER)
1895 yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, TParseContext* context)
1898 yy_reduce_print (yyvsp, yylsp, yyrule, context)
1902 TParseContext* context;
1905 int yynrhs = yyr2[yyrule];
1907 unsigned long int yylno = yyrline[yyrule];
1908 YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
1910 /* The symbols being reduced. */
1911 for (yyi = 0; yyi < yynrhs; yyi++)
1913 YYFPRINTF (stderr, " $%d = ", yyi + 1);
1914 yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
1915 &(yyvsp[(yyi + 1) - (yynrhs)])
1916 , &(yylsp[(yyi + 1) - (yynrhs)]) , context);
1917 YYFPRINTF (stderr, "\n");
1921 # define YY_REDUCE_PRINT(Rule) \
1924 yy_reduce_print (yyvsp, yylsp, Rule, context); \
1927 /* Nonzero means print parse trace. It is left uninitialized so that
1928 multiple parsers can coexist. */
1930 #else /* !YYDEBUG */
1931 # define YYDPRINTF(Args)
1932 # define YY_SYMBOL_PRINT(Title, Type, Value, Location)
1933 # define YY_STACK_PRINT(Bottom, Top)
1934 # define YY_REDUCE_PRINT(Rule)
1935 #endif /* !YYDEBUG */
1938 /* YYINITDEPTH -- initial size of the parser's stacks. */
1940 # define YYINITDEPTH 200
1943 /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
1944 if the built-in stack extension method is used).
1946 Do not make this value too large; the results are undefined if
1947 YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
1948 evaluated with infinite-precision integer arithmetic. */
1951 # define YYMAXDEPTH 10000
1958 # if defined __GLIBC__ && defined _STRING_H
1959 # define yystrlen strlen
1961 /* Return the length of YYSTR. */
1962 #if (defined __STDC__ || defined __C99__FUNC__ \
1963 || defined __cplusplus || defined _MSC_VER)
1965 yystrlen (const char *yystr)
1973 for (yylen = 0; yystr[yylen]; yylen++)
1981 # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
1982 # define yystpcpy stpcpy
1984 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
1986 #if (defined __STDC__ || defined __C99__FUNC__ \
1987 || defined __cplusplus || defined _MSC_VER)
1989 yystpcpy (char *yydest, const char *yysrc)
1992 yystpcpy (yydest, yysrc)
1998 const char *yys = yysrc;
2000 while ((*yyd++ = *yys++) != '\0')
2009 /* Copy to YYRES the contents of YYSTR after stripping away unnecessary
2010 quotes and backslashes, so that it's suitable for yyerror. The
2011 heuristic is that double-quoting is unnecessary unless the string
2012 contains an apostrophe, a comma, or backslash (other than
2013 backslash-backslash). YYSTR is taken from yytname. If YYRES is
2014 null, do not copy; instead, return the length of what the result
2017 yytnamerr (char *yyres, const char *yystr)
2022 char const *yyp = yystr;
2029 goto do_not_strip_quotes;
2033 goto do_not_strip_quotes;
2046 do_not_strip_quotes: ;
2050 return yystrlen (yystr);
2052 return yystpcpy (yyres, yystr) - yyres;
2056 /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
2057 about the unexpected token YYTOKEN for the state stack whose top is
2060 Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
2061 not large enough to hold the message. In that case, also set
2062 *YYMSG_ALLOC to the required number of bytes. Return 2 if the
2063 required number of bytes is too large to store. */
2065 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
2066 yytype_int16 *yyssp, int yytoken)
2068 YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
2069 YYSIZE_T yysize = yysize0;
2070 enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
2071 /* Internationalized format string. */
2072 const char *yyformat = YY_NULL;
2073 /* Arguments of yyformat. */
2074 char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
2075 /* Number of reported tokens (one for the "unexpected", one per
2079 /* There are many possibilities here to consider:
2080 - Assume YYFAIL is not used. It's too flawed to consider. See
2081 <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
2082 for details. YYERROR is fine as it does not invoke this
2084 - If this state is a consistent state with a default action, then
2085 the only way this function was invoked is if the default action
2086 is an error action. In that case, don't check for expected
2087 tokens because there are none.
2088 - The only way there can be no lookahead present (in yychar) is if
2089 this state is a consistent state with a default action. Thus,
2090 detecting the absence of a lookahead is sufficient to determine
2091 that there is no unexpected or expected token to report. In that
2092 case, just report a simple "syntax error".
2093 - Don't assume there isn't a lookahead just because this state is a
2094 consistent state with a default action. There might have been a
2095 previous inconsistent state, consistent state with a non-default
2096 action, or user semantic action that manipulated yychar.
2097 - Of course, the expected token list depends on states to have
2098 correct lookahead information, and it depends on the parser not
2099 to perform extra reductions after fetching a lookahead from the
2100 scanner and before detecting a syntax error. Thus, state merging
2101 (from LALR or IELR) and default reductions corrupt the expected
2102 token list. However, the list is correct for canonical LR with
2103 one exception: it will still contain any token that will not be
2104 accepted due to an error action in a later state.
2106 if (yytoken != YYEMPTY)
2108 int yyn = yypact[*yyssp];
2109 yyarg[yycount++] = yytname[yytoken];
2110 if (!yypact_value_is_default (yyn))
2112 /* Start YYX at -YYN if negative to avoid negative indexes in
2113 YYCHECK. In other words, skip the first -YYN actions for
2114 this state because they are default actions. */
2115 int yyxbegin = yyn < 0 ? -yyn : 0;
2116 /* Stay within bounds of both yycheck and yytname. */
2117 int yychecklim = YYLAST - yyn + 1;
2118 int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
2121 for (yyx = yyxbegin; yyx < yyxend; ++yyx)
2122 if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
2123 && !yytable_value_is_error (yytable[yyx + yyn]))
2125 if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
2131 yyarg[yycount++] = yytname[yyx];
2133 YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
2134 if (! (yysize <= yysize1
2135 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2145 # define YYCASE_(N, S) \
2149 YYCASE_(0, YY_("syntax error"));
2150 YYCASE_(1, YY_("syntax error, unexpected %s"));
2151 YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
2152 YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
2153 YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
2154 YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
2159 YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
2160 if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
2165 if (*yymsg_alloc < yysize)
2167 *yymsg_alloc = 2 * yysize;
2168 if (! (yysize <= *yymsg_alloc
2169 && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
2170 *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
2174 /* Avoid sprintf, as that infringes on the user's name space.
2175 Don't have undefined behavior even if the translation
2176 produced a string with the wrong number of "%s"s. */
2180 while ((*yyp = *yyformat) != '\0')
2181 if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
2183 yyp += yytnamerr (yyp, yyarg[yyi++]);
2194 #endif /* YYERROR_VERBOSE */
2196 /*-----------------------------------------------.
2197 | Release the memory associated to this symbol. |
2198 `-----------------------------------------------*/
2201 #if (defined __STDC__ || defined __C99__FUNC__ \
2202 || defined __cplusplus || defined _MSC_VER)
2204 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, TParseContext* context)
2207 yydestruct (yymsg, yytype, yyvaluep, yylocationp, context)
2211 YYLTYPE *yylocationp;
2212 TParseContext* context;
2216 YYUSE (yylocationp);
2221 YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
2233 #ifdef YYPARSE_PARAM
2234 #if (defined __STDC__ || defined __C99__FUNC__ \
2235 || defined __cplusplus || defined _MSC_VER)
2237 yyparse (void *YYPARSE_PARAM)
2240 yyparse (YYPARSE_PARAM)
2241 void *YYPARSE_PARAM;
2243 #else /* ! YYPARSE_PARAM */
2244 #if (defined __STDC__ || defined __C99__FUNC__ \
2245 || defined __cplusplus || defined _MSC_VER)
2247 yyparse (TParseContext* context)
2251 TParseContext* context;
2255 /* The lookahead symbol. */
2259 #if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
2260 /* Suppress an incorrect diagnostic about yylval being uninitialized. */
2261 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
2262 _Pragma ("GCC diagnostic push") \
2263 _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
2264 _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
2265 # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
2266 _Pragma ("GCC diagnostic pop")
2268 /* Default value used for initialization, for pacifying older GCCs
2269 or non-GCC compilers. */
2270 static YYSTYPE yyval_default;
2271 # define YY_INITIAL_VALUE(Value) = Value
2273 static YYLTYPE yyloc_default
2274 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
2278 #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2279 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2280 # define YY_IGNORE_MAYBE_UNINITIALIZED_END
2282 #ifndef YY_INITIAL_VALUE
2283 # define YY_INITIAL_VALUE(Value) /* Nothing. */
2286 /* The semantic value of the lookahead symbol. */
2287 YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
2289 /* Location data for the lookahead symbol. */
2290 YYLTYPE yylloc = yyloc_default;
2293 /* Number of syntax errors so far. */
2297 /* Number of tokens to shift before error messages enabled. */
2300 /* The stacks and their tools:
2301 `yyss': related to states.
2302 `yyvs': related to semantic values.
2303 `yyls': related to locations.
2305 Refer to the stacks through separate pointers, to allow yyoverflow
2306 to reallocate them elsewhere. */
2308 /* The state stack. */
2309 yytype_int16 yyssa[YYINITDEPTH];
2311 yytype_int16 *yyssp;
2313 /* The semantic value stack. */
2314 YYSTYPE yyvsa[YYINITDEPTH];
2318 /* The location stack. */
2319 YYLTYPE yylsa[YYINITDEPTH];
2323 /* The locations where the error started and ended. */
2324 YYLTYPE yyerror_range[3];
2326 YYSIZE_T yystacksize;
2330 /* Lookahead token as an internal (translated) token number. */
2332 /* The variables used to return semantic value and location from the
2338 /* Buffer for error messages, and its allocated size. */
2340 char *yymsg = yymsgbuf;
2341 YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
2344 #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
2346 /* The number of symbols on the RHS of the reduced rule.
2347 Keep to zero when no symbol should be popped. */
2350 yyssp = yyss = yyssa;
2351 yyvsp = yyvs = yyvsa;
2352 yylsp = yyls = yylsa;
2353 yystacksize = YYINITDEPTH;
2355 YYDPRINTF ((stderr, "Starting parse\n"));
2360 yychar = YYEMPTY; /* Cause a token to be read. */
2364 /*------------------------------------------------------------.
2365 | yynewstate -- Push a new state, which is found in yystate. |
2366 `------------------------------------------------------------*/
2368 /* In all cases, when you get here, the value and location stacks
2369 have just been pushed. So pushing a state here evens the stacks. */
2375 if (yyss + yystacksize - 1 <= yyssp)
2377 /* Get the current used size of the three stacks, in elements. */
2378 YYSIZE_T yysize = yyssp - yyss + 1;
2382 /* Give user a chance to reallocate the stack. Use copies of
2383 these so that the &'s don't force the real ones into
2385 YYSTYPE *yyvs1 = yyvs;
2386 yytype_int16 *yyss1 = yyss;
2387 YYLTYPE *yyls1 = yyls;
2389 /* Each stack pointer address is followed by the size of the
2390 data in use in that stack, in bytes. This used to be a
2391 conditional around just the two extra args, but that might
2392 be undefined if yyoverflow is a macro. */
2393 yyoverflow (YY_("memory exhausted"),
2394 &yyss1, yysize * sizeof (*yyssp),
2395 &yyvs1, yysize * sizeof (*yyvsp),
2396 &yyls1, yysize * sizeof (*yylsp),
2403 #else /* no yyoverflow */
2404 # ifndef YYSTACK_RELOCATE
2405 goto yyexhaustedlab;
2407 /* Extend the stack our own way. */
2408 if (YYMAXDEPTH <= yystacksize)
2409 goto yyexhaustedlab;
2411 if (YYMAXDEPTH < yystacksize)
2412 yystacksize = YYMAXDEPTH;
2415 yytype_int16 *yyss1 = yyss;
2416 union yyalloc *yyptr =
2417 (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
2419 goto yyexhaustedlab;
2420 YYSTACK_RELOCATE (yyss_alloc, yyss);
2421 YYSTACK_RELOCATE (yyvs_alloc, yyvs);
2422 YYSTACK_RELOCATE (yyls_alloc, yyls);
2423 # undef YYSTACK_RELOCATE
2425 YYSTACK_FREE (yyss1);
2428 #endif /* no yyoverflow */
2430 yyssp = yyss + yysize - 1;
2431 yyvsp = yyvs + yysize - 1;
2432 yylsp = yyls + yysize - 1;
2434 YYDPRINTF ((stderr, "Stack size increased to %lu\n",
2435 (unsigned long int) yystacksize));
2437 if (yyss + yystacksize - 1 <= yyssp)
2441 YYDPRINTF ((stderr, "Entering state %d\n", yystate));
2443 if (yystate == YYFINAL)
2453 /* Do appropriate processing given the current state. Read a
2454 lookahead token if we need one and don't already have one. */
2456 /* First try to decide what to do without reference to lookahead token. */
2457 yyn = yypact[yystate];
2458 if (yypact_value_is_default (yyn))
2461 /* Not known => get a lookahead token if don't already have one. */
2463 /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
2464 if (yychar == YYEMPTY)
2466 YYDPRINTF ((stderr, "Reading a token: "));
2470 if (yychar <= YYEOF)
2472 yychar = yytoken = YYEOF;
2473 YYDPRINTF ((stderr, "Now at end of input.\n"));
2477 yytoken = YYTRANSLATE (yychar);
2478 YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
2481 /* If the proper action on seeing token YYTOKEN is to reduce or to
2482 detect an error, take that action. */
2484 if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
2489 if (yytable_value_is_error (yyn))
2495 /* Count tokens shifted since error; after three, turn off error
2500 /* Shift the lookahead token. */
2501 YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
2503 /* Discard the shifted token. */
2507 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
2509 YY_IGNORE_MAYBE_UNINITIALIZED_END
2514 /*-----------------------------------------------------------.
2515 | yydefault -- do the default action for the current state. |
2516 `-----------------------------------------------------------*/
2518 yyn = yydefact[yystate];
2524 /*-----------------------------.
2525 | yyreduce -- Do a reduction. |
2526 `-----------------------------*/
2528 /* yyn is the number of a rule to reduce with. */
2531 /* If YYLEN is nonzero, implement the default value of the action:
2534 Otherwise, the following line sets YYVAL to garbage.
2535 This behavior is undocumented and Bison
2536 users should not rely upon it. Assigning to YYVAL
2537 unconditionally makes the parser a bit smaller, and it avoids a
2538 GCC warning that YYVAL may be used uninitialized. */
2539 yyval = yyvsp[1-yylen];
2541 /* Default location. */
2542 YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
2543 YY_REDUCE_PRINT (yyn);
2549 // The symbol table search was done in the lexical phase
2550 const TVariable *variable = context->getNamedVariable((yylsp[(1) - (1)]), (yyvsp[(1) - (1)].lex).string, (yyvsp[(1) - (1)].lex).symbol);
2552 if (variable->getType().getQualifier() == EvqConst)
2554 ConstantUnion* constArray = variable->getConstPointer();
2555 TType t(variable->getType());
2556 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(constArray, t, (yylsp[(1) - (1)]));
2560 (yyval.interm.intermTypedNode) = context->intermediate.addSymbol(variable->getUniqueId(),
2561 variable->getName(),
2562 variable->getType(),
2563 (yylsp[(1) - (1)]));
2566 // don't delete $1.string, it's used by error recovery, and the pool
2567 // pop will reclaim the memory
2574 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2581 ConstantUnion *unionArray = new ConstantUnion[1];
2582 unionArray->setIConst((yyvsp[(1) - (1)].lex).i);
2583 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yylsp[(1) - (1)]));
2590 ConstantUnion *unionArray = new ConstantUnion[1];
2591 unionArray->setUConst((yyvsp[(1) - (1)].lex).u);
2592 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtUInt, EbpUndefined, EvqConst), (yylsp[(1) - (1)]));
2599 ConstantUnion *unionArray = new ConstantUnion[1];
2600 unionArray->setFConst((yyvsp[(1) - (1)].lex).f);
2601 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yylsp[(1) - (1)]));
2608 ConstantUnion *unionArray = new ConstantUnion[1];
2609 unionArray->setBConst((yyvsp[(1) - (1)].lex).b);
2610 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(1) - (1)]));
2617 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode);
2624 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2631 (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[(1) - (4)].interm.intermTypedNode), (yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode));
2638 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2645 (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[(1) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yylsp[(3) - (3)]));
2652 if (context->lValueErrorCheck((yylsp[(2) - (2)]), "++", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2654 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
2655 if ((yyval.interm.intermTypedNode) == 0) {
2656 context->unaryOpError((yylsp[(2) - (2)]), "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2658 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2666 if (context->lValueErrorCheck((yylsp[(2) - (2)]), "--", (yyvsp[(1) - (2)].interm.intermTypedNode)))
2668 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yylsp[(2) - (2)]));
2669 if ((yyval.interm.intermTypedNode) == 0) {
2670 context->unaryOpError((yylsp[(2) - (2)]), "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString());
2672 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode);
2680 if (context->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]"))
2682 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2689 TFunction* fnCall = (yyvsp[(1) - (1)].interm).function;
2690 TOperator op = fnCall->getBuiltInOp();
2695 // Then this should be a constructor.
2696 // Don't go through the symbol table for constructors.
2697 // Their parameters will be verified algorithmically.
2699 TType type(EbtVoid, EbpUndefined); // use this to get the type back
2700 if (context->constructorErrorCheck((yylsp[(1) - (1)]), (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) {
2701 (yyval.interm.intermTypedNode) = 0;
2704 // It's a constructor, of type 'type'.
2706 (yyval.interm.intermTypedNode) = context->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yylsp[(1) - (1)]));
2709 if ((yyval.interm.intermTypedNode) == 0) {
2711 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator(0, op, (yylsp[(1) - (1)]));
2713 (yyval.interm.intermTypedNode)->setType(type);
2716 // Not a constructor. Find it in the symbol table.
2718 const TFunction* fnCandidate;
2720 fnCandidate = context->findFunction((yylsp[(1) - (1)]), fnCall, context->shaderVersion, &builtIn);
2723 // A declared function.
2725 if (builtIn && !fnCandidate->getExtension().empty() &&
2726 context->extensionErrorCheck((yylsp[(1) - (1)]), fnCandidate->getExtension())) {
2729 op = fnCandidate->getBuiltInOp();
2730 if (builtIn && op != EOpNull) {
2732 // A function call mapped to a built-in operation.
2734 if (fnCandidate->getParamCount() == 1) {
2736 // Treat it like a built-in unary operator.
2738 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, (yylsp[(1) - (1)]));
2739 if ((yyval.interm.intermTypedNode) == 0) {
2740 std::stringstream extraInfoStream;
2741 extraInfoStream << "built in unary operator function. Type: " << static_cast<TIntermTyped*>((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString();
2742 std::string extraInfo = extraInfoStream.str();
2743 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", extraInfo.c_str());
2747 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yylsp[(1) - (1)]));
2750 // This is a real function call
2752 (yyval.interm.intermTypedNode) = context->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yylsp[(1) - (1)]));
2753 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2755 // this is how we know whether the given function is a builtIn function or a user defined function
2756 // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
2757 // if builtIn == true, it's definitely a builtIn function with EOpNull
2759 (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
2760 (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
2763 for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
2764 qual = fnCandidate->getParam(i).type->getQualifier();
2765 if (qual == EvqOut || qual == EvqInOut) {
2766 if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (*((yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()))[i]->getAsTyped())) {
2767 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
2773 (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType());
2775 // error message was put out by PaFindFunction()
2776 // Put on a dummy node for error recovery
2777 ConstantUnion *unionArray = new ConstantUnion[1];
2778 unionArray->setFConst(0.0f);
2779 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yylsp[(1) - (1)]));
2790 (yyval.interm) = (yyvsp[(1) - (1)].interm);
2797 context->error((yylsp[(3) - (3)]), "methods are not supported", "");
2799 (yyval.interm) = (yyvsp[(3) - (3)].interm);
2806 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2813 (yyval.interm) = (yyvsp[(1) - (2)].interm);
2820 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2821 (yyval.interm).intermNode = 0;
2828 (yyval.interm).function = (yyvsp[(1) - (1)].interm.function);
2829 (yyval.interm).intermNode = 0;
2836 TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) };
2837 (yyvsp[(1) - (2)].interm.function)->addParameter(param);
2838 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
2839 (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode);
2846 TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) };
2847 (yyvsp[(1) - (3)].interm).function->addParameter(param);
2848 (yyval.interm).function = (yyvsp[(1) - (3)].interm).function;
2849 (yyval.interm).intermNode = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
2856 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
2863 (yyval.interm.function) = context->addConstructorFunc((yyvsp[(1) - (1)].interm.type));
2870 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
2872 TType type(EbtVoid, EbpUndefined);
2873 TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type);
2874 (yyval.interm.function) = function;
2881 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
2888 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2890 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
2891 if ((yyval.interm.intermTypedNode) == 0) {
2892 context->unaryOpError((yylsp[(1) - (2)]), "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2894 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2902 if (context->lValueErrorCheck((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)))
2904 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
2905 if ((yyval.interm.intermTypedNode) == 0) {
2906 context->unaryOpError((yylsp[(1) - (2)]), "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2908 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2916 if ((yyvsp[(1) - (2)].interm).op != EOpNull) {
2917 (yyval.interm.intermTypedNode) = context->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yylsp[(1) - (2)]));
2918 if ((yyval.interm.intermTypedNode) == 0) {
2919 const char* errorOp = "";
2920 switch((yyvsp[(1) - (2)].interm).op) {
2921 case EOpNegative: errorOp = "-"; break;
2922 case EOpLogicalNot: errorOp = "!"; break;
2925 context->unaryOpError((yylsp[(1) - (2)]), errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString());
2927 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2930 (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode);
2936 { (yyval.interm).op = EOpNull; }
2941 { (yyval.interm).op = EOpNegative; }
2946 { (yyval.interm).op = EOpLogicalNot; }
2951 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2957 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
2958 if ((yyval.interm.intermTypedNode) == 0) {
2959 context->binaryOpError((yylsp[(2) - (3)]), "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2961 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2969 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
2970 if ((yyval.interm.intermTypedNode) == 0) {
2971 context->binaryOpError((yylsp[(2) - (3)]), "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2973 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2980 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
2986 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
2987 if ((yyval.interm.intermTypedNode) == 0) {
2988 context->binaryOpError((yylsp[(2) - (3)]), "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
2990 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
2998 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
2999 if ((yyval.interm.intermTypedNode) == 0) {
3000 context->binaryOpError((yylsp[(2) - (3)]), "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3002 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3009 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3014 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3020 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3021 if ((yyval.interm.intermTypedNode) == 0) {
3022 context->binaryOpError((yylsp[(2) - (3)]), "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3024 ConstantUnion *unionArray = new ConstantUnion[1];
3025 unionArray->setBConst(false);
3026 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3034 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3035 if ((yyval.interm.intermTypedNode) == 0) {
3036 context->binaryOpError((yylsp[(2) - (3)]), ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3038 ConstantUnion *unionArray = new ConstantUnion[1];
3039 unionArray->setBConst(false);
3040 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3048 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3049 if ((yyval.interm.intermTypedNode) == 0) {
3050 context->binaryOpError((yylsp[(2) - (3)]), "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3052 ConstantUnion *unionArray = new ConstantUnion[1];
3053 unionArray->setBConst(false);
3054 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3062 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3063 if ((yyval.interm.intermTypedNode) == 0) {
3064 context->binaryOpError((yylsp[(2) - (3)]), ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3066 ConstantUnion *unionArray = new ConstantUnion[1];
3067 unionArray->setBConst(false);
3068 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3075 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3081 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3082 if ((yyval.interm.intermTypedNode) == 0) {
3083 context->binaryOpError((yylsp[(2) - (3)]), "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3085 ConstantUnion *unionArray = new ConstantUnion[1];
3086 unionArray->setBConst(false);
3087 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3095 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3096 if ((yyval.interm.intermTypedNode) == 0) {
3097 context->binaryOpError((yylsp[(2) - (3)]), "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3099 ConstantUnion *unionArray = new ConstantUnion[1];
3100 unionArray->setBConst(false);
3101 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3108 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3113 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3118 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3123 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3129 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3130 if ((yyval.interm.intermTypedNode) == 0) {
3131 context->binaryOpError((yylsp[(2) - (3)]), "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3133 ConstantUnion *unionArray = new ConstantUnion[1];
3134 unionArray->setBConst(false);
3135 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3142 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3148 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3149 if ((yyval.interm.intermTypedNode) == 0) {
3150 context->binaryOpError((yylsp[(2) - (3)]), "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3152 ConstantUnion *unionArray = new ConstantUnion[1];
3153 unionArray->setBConst(false);
3154 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3161 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3167 (yyval.interm.intermTypedNode) = context->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3168 if ((yyval.interm.intermTypedNode) == 0) {
3169 context->binaryOpError((yylsp[(2) - (3)]), "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3171 ConstantUnion *unionArray = new ConstantUnion[1];
3172 unionArray->setBConst(false);
3173 (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yylsp[(2) - (3)]));
3180 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3186 if (context->boolErrorCheck((yylsp[(2) - (5)]), (yyvsp[(1) - (5)].interm.intermTypedNode)))
3189 (yyval.interm.intermTypedNode) = context->intermediate.addSelection((yyvsp[(1) - (5)].interm.intermTypedNode), (yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.intermTypedNode), (yylsp[(2) - (5)]));
3190 if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType())
3191 (yyval.interm.intermTypedNode) = 0;
3193 if ((yyval.interm.intermTypedNode) == 0) {
3194 context->binaryOpError((yylsp[(2) - (5)]), ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString());
3196 (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode);
3203 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
3209 if (context->lValueErrorCheck((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)))
3211 (yyval.interm.intermTypedNode) = context->intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3212 if ((yyval.interm.intermTypedNode) == 0) {
3213 context->assignError((yylsp[(2) - (3)]), "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3215 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode);
3222 { (yyval.interm).op = EOpAssign; }
3227 { (yyval.interm).op = EOpMulAssign; }
3232 { (yyval.interm).op = EOpDivAssign; }
3237 { (yyval.interm).op = EOpAddAssign; }
3242 { (yyval.interm).op = EOpSubAssign; }
3248 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3255 (yyval.interm.intermTypedNode) = context->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yylsp[(2) - (3)]));
3256 if ((yyval.interm.intermTypedNode) == 0) {
3257 context->binaryOpError((yylsp[(2) - (3)]), ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString());
3259 (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode);
3267 if (context->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)))
3269 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
3276 if (context->enterStructDeclaration((yylsp[(1) - (2)]), *(yyvsp[(1) - (2)].lex).string))
3278 (yyval.lex) = (yyvsp[(1) - (2)].lex);
3285 TFunction &function = *((yyvsp[(1) - (2)].interm).function);
3287 TIntermAggregate *prototype = new TIntermAggregate;
3288 prototype->setType(function.getReturnType());
3289 prototype->setName(function.getName());
3291 for (size_t i = 0; i < function.getParamCount(); i++)
3293 const TParameter ¶m = function.getParam(i);
3294 if (param.name != 0)
3296 TVariable variable(param.name, *param.type);
3298 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable.getUniqueId(), variable.getName(), variable.getType(), (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));
3302 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (2)])), (yylsp[(1) - (2)]));
3306 prototype->setOp(EOpPrototype);
3307 (yyval.interm.intermNode) = prototype;
3309 context->symbolTable.pop();
3316 TIntermAggregate *aggNode = (yyvsp[(1) - (2)].interm).intermAggregate;
3317 if (aggNode && aggNode->getOp() == EOpNull)
3318 aggNode->setOp(EOpDeclaration);
3319 (yyval.interm.intermNode) = aggNode;
3326 if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == GL_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
3327 context->error((yylsp[(1) - (4)]), "precision is not supported in fragment shader", "highp");
3330 if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
3331 context->error((yylsp[(1) - (4)]), "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
3334 (yyval.interm.intermNode) = 0;
3341 ES3_ONLY(getQualifierString((yyvsp[(1) - (5)].interm.type).qualifier), (yylsp[(1) - (5)]), "interface blocks");
3342 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (5)].interm.type), (yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string, (yyvsp[(3) - (5)].interm.fieldList), NULL, (yyloc), NULL, (yyloc));
3349 ES3_ONLY(getQualifierString((yyvsp[(1) - (6)].interm.type).qualifier), (yylsp[(1) - (6)]), "interface blocks");
3350 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (6)].interm.type), (yylsp[(2) - (6)]), *(yyvsp[(2) - (6)].lex).string, (yyvsp[(3) - (6)].interm.fieldList), (yyvsp[(5) - (6)].lex).string, (yylsp[(5) - (6)]), NULL, (yyloc));
3357 ES3_ONLY(getQualifierString((yyvsp[(1) - (9)].interm.type).qualifier), (yylsp[(1) - (9)]), "interface blocks");
3358 (yyval.interm.intermNode) = context->addInterfaceBlock((yyvsp[(1) - (9)].interm.type), (yylsp[(2) - (9)]), *(yyvsp[(2) - (9)].lex).string, (yyvsp[(3) - (9)].interm.fieldList), (yyvsp[(5) - (9)].lex).string, (yylsp[(5) - (9)]), (yyvsp[(7) - (9)].interm.intermTypedNode), (yylsp[(6) - (9)]));
3365 context->parseGlobalLayoutQualifier((yyvsp[(1) - (2)].interm.type));
3366 (yyval.interm.intermNode) = 0;
3374 // Multiple declarations of the same function are allowed.
3376 // If this is a definition, the definition production code will check for redefinitions
3377 // (we don't know at this point if it's a definition or not).
3379 // Redeclarations are allowed. But, return types and parameter qualifiers must match.
3381 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName(), context->shaderVersion));
3383 if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
3384 context->error((yylsp[(2) - (2)]), "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
3387 for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
3388 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
3389 context->error((yylsp[(2) - (2)]), "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
3396 // Check for previously declared variables using the same name.
3398 TSymbol *prevSym = context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getName(), context->shaderVersion);
3401 if (!prevSym->isFunction())
3403 context->error((yylsp[(2) - (2)]), "redefinition", (yyvsp[(1) - (2)].interm.function)->getName().c_str(), "function");
3409 // Insert the unmangled name to detect potential future redefinition as a variable.
3410 TFunction *function = new TFunction(NewPoolTString((yyvsp[(1) - (2)].interm.function)->getName().c_str()), (yyvsp[(1) - (2)].interm.function)->getReturnType());
3411 context->symbolTable.getOuterLevel()->insert(function);
3415 // If this is a redeclaration, it could also be a definition,
3416 // in which case, we want to use the variable names from this one, and not the one that's
3417 // being redeclared. So, pass back up this declaration, not the one in the symbol table.
3419 (yyval.interm).function = (yyvsp[(1) - (2)].interm.function);
3421 // We're at the inner scope level of the function's arguments and body statement.
3422 // Add the function prototype to the surrounding scope instead.
3423 context->symbolTable.getOuterLevel()->insert((yyval.interm).function);
3430 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3437 (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function);
3444 // Add the parameter
3445 (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function);
3446 if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid)
3447 (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param);
3449 delete (yyvsp[(2) - (2)].interm).param.type;
3457 // Only first parameter of one-parameter functions can be void
3458 // The check for named parameters not being void is done in parameter_declarator
3460 if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) {
3462 // This parameter > first is void
3464 context->error((yylsp[(2) - (3)]), "cannot be an argument type except for '(void)'", "void");
3466 delete (yyvsp[(3) - (3)].interm).param.type;
3468 // Add the parameter
3469 (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function);
3470 (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param);
3478 if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) {
3479 context->error((yylsp[(2) - (3)]), "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier));
3482 // make sure a sampler is not involved as well...
3483 if (context->structQualifierErrorCheck((yylsp[(2) - (3)]), (yyvsp[(1) - (3)].interm.type)))
3486 // Add the function as a prototype after parsing it (we do not support recursion)
3487 TFunction *function;
3488 TType type((yyvsp[(1) - (3)].interm.type));
3489 function = new TFunction((yyvsp[(2) - (3)].lex).string, type);
3490 (yyval.interm.function) = function;
3492 context->symbolTable.push();
3499 if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) {
3500 context->error((yylsp[(2) - (2)]), "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str());
3503 if (context->reservedErrorCheck((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string))
3505 TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))};
3506 (yyval.interm).param = param;
3513 // Check that we can make an array out of this type
3514 if (context->arrayTypeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(1) - (5)].interm.type)))
3517 if (context->reservedErrorCheck((yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string))
3521 if (context->arraySizeErrorCheck((yylsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode), size))
3523 (yyvsp[(1) - (5)].interm.type).setArray(true, size);
3525 TType* type = new TType((yyvsp[(1) - (5)].interm.type));
3526 TParameter param = { (yyvsp[(2) - (5)].lex).string, type };
3527 (yyval.interm).param = param;
3534 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3535 if (context->paramErrorCheck((yylsp[(3) - (3)]), (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3543 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3544 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3546 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3554 (yyval.interm) = (yyvsp[(3) - (3)].interm);
3555 if (context->paramErrorCheck((yylsp[(3) - (3)]), (yyvsp[(1) - (3)].interm.qualifier), (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type))
3563 (yyval.interm) = (yyvsp[(2) - (2)].interm);
3564 if (context->parameterSamplerErrorCheck((yylsp[(2) - (2)]), (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type))
3566 if (context->paramErrorCheck((yylsp[(2) - (2)]), EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type))
3574 (yyval.interm.qualifier) = EvqIn;
3581 (yyval.interm.qualifier) = EvqIn;
3588 (yyval.interm.qualifier) = EvqOut;
3595 (yyval.interm.qualifier) = EvqInOut;
3602 TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) };
3603 (yyval.interm).param = param;
3610 (yyval.interm) = (yyvsp[(1) - (1)].interm);
3617 (yyval.interm) = (yyvsp[(1) - (3)].interm);
3618 (yyval.interm).intermAggregate = context->parseDeclarator((yyval.interm).type, (yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].lex).symbol, (yylsp[(3) - (3)]), *(yyvsp[(3) - (3)].lex).string);
3625 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3626 context->parseArrayDeclarator((yyval.interm).type, (yylsp[(3) - (5)]), *(yyvsp[(3) - (5)].lex).string, (yylsp[(4) - (5)]), NULL, NULL);
3633 (yyval.interm) = (yyvsp[(1) - (6)].interm);
3634 (yyval.interm).intermAggregate = context->parseArrayDeclarator((yyval.interm).type, (yylsp[(3) - (6)]), *(yyvsp[(3) - (6)].lex).string, (yylsp[(4) - (6)]), (yyvsp[(1) - (6)].interm).intermNode, (yyvsp[(5) - (6)].interm.intermTypedNode));
3641 (yyval.interm) = (yyvsp[(1) - (5)].interm);
3642 (yyval.interm).intermAggregate = context->parseInitDeclarator((yyval.interm).type, (yyvsp[(1) - (5)].interm).intermAggregate, (yylsp[(3) - (5)]), *(yyvsp[(3) - (5)].lex).string, (yylsp[(4) - (5)]), (yyvsp[(5) - (5)].interm.intermTypedNode));
3649 (yyval.interm).type = (yyvsp[(1) - (1)].interm.type);
3650 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(1) - (1)]), "");
3657 (yyval.interm).type = (yyvsp[(1) - (2)].interm.type);
3658 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string);
3665 context->error((yylsp[(2) - (4)]), "unsized array declarations not supported", (yyvsp[(2) - (4)].lex).string->c_str());
3668 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3669 (yyval.interm).intermAggregate = context->parseSingleDeclaration((yyval.interm).type, (yylsp[(2) - (4)]), *(yyvsp[(2) - (4)].lex).string);
3676 (yyval.interm).type = (yyvsp[(1) - (5)].interm.type);
3677 (yyval.interm).intermAggregate = context->parseSingleArrayDeclaration((yyval.interm).type, (yylsp[(2) - (5)]), *(yyvsp[(2) - (5)].lex).string, (yylsp[(3) - (5)]), (yyvsp[(4) - (5)].interm.intermTypedNode));
3684 (yyval.interm).type = (yyvsp[(1) - (4)].interm.type);
3685 (yyval.interm).intermAggregate = context->parseSingleInitDeclaration((yyval.interm).type, (yylsp[(2) - (4)]), *(yyvsp[(2) - (4)].lex).string, (yylsp[(3) - (4)]), (yyvsp[(4) - (4)].interm.intermTypedNode));
3692 // $$.type is not used in invariant declarations.
3693 (yyval.interm).intermAggregate = context->parseInvariantDeclaration((yylsp[(1) - (2)]), (yylsp[(2) - (2)]), (yyvsp[(2) - (2)].lex).string, (yyvsp[(2) - (2)].lex).symbol);
3700 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3702 if ((yyvsp[(1) - (1)].interm.type).array) {
3703 context->error((yylsp[(1) - (1)]), "not supported", "first-class array");
3705 (yyvsp[(1) - (1)].interm.type).setArray(false);
3713 (yyval.interm.type) = context->addFullySpecifiedType((yyvsp[(1) - (2)].interm.type).qualifier, (yyvsp[(1) - (2)].interm.type).layoutQualifier, (yyvsp[(2) - (2)].interm.type));
3720 (yyval.interm.type).qualifier = EvqSmooth;
3727 (yyval.interm.type).qualifier = EvqFlat;
3734 (yyval.interm.qualifier) = EvqConst;
3741 VERTEX_ONLY("attribute", (yylsp[(1) - (1)]));
3742 ES2_ONLY("attribute", (yylsp[(1) - (1)]));
3743 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "attribute"))
3745 (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yylsp[(1) - (1)]));
3752 ES2_ONLY("varying", (yylsp[(1) - (1)]));
3753 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "varying"))
3755 if (context->shaderType == GL_VERTEX_SHADER)
3756 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yylsp[(1) - (1)]));
3758 (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yylsp[(1) - (1)]));
3765 ES2_ONLY("varying", (yylsp[(1) - (2)]));
3766 if (context->globalErrorCheck((yylsp[(1) - (2)]), context->symbolTable.atGlobalLevel(), "invariant varying"))
3768 if (context->shaderType == GL_VERTEX_SHADER)
3769 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yylsp[(1) - (2)]));
3771 (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yylsp[(1) - (2)]));
3778 if ((yyvsp[(1) - (1)].interm.type).qualifier != EvqConst && !context->symbolTable.atGlobalLevel()) {
3779 context->error((yylsp[(1) - (1)]), "Local variables can only use the const storage qualifier.", getQualifierString((yyvsp[(1) - (1)].interm.type).qualifier));
3782 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(1) - (1)].interm.type).qualifier, (yylsp[(1) - (1)]));
3790 (yyval.interm.type) = context->joinInterpolationQualifiers((yylsp[(1) - (2)]), (yyvsp[(1) - (2)].interm.type).qualifier, (yylsp[(2) - (2)]), (yyvsp[(2) - (2)].interm.type).qualifier);
3797 context->error((yylsp[(1) - (1)]), "interpolation qualifier requires a fragment 'in' or vertex 'out' storage qualifier", getInterpolationString((yyvsp[(1) - (1)].interm.type).qualifier));
3800 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3801 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
3808 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3809 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (1)].interm.layoutQualifier);
3816 (yyval.interm.type).setBasic(EbtVoid, (yyvsp[(2) - (2)].interm.type).qualifier, (yylsp[(2) - (2)]));
3817 (yyval.interm.type).layoutQualifier = (yyvsp[(1) - (2)].interm.layoutQualifier);
3824 (yyval.interm.type).qualifier = EvqConst;
3831 ES3_ONLY("in", (yylsp[(1) - (1)]), "storage qualifier");
3832 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentIn : EvqVertexIn;
3839 ES3_ONLY("out", (yylsp[(1) - (1)]), "storage qualifier");
3840 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqVertexOut;
3847 ES3_ONLY("centroid in", (yylsp[(1) - (2)]), "storage qualifier");
3848 if (context->shaderType == GL_VERTEX_SHADER)
3850 context->error((yylsp[(1) - (2)]), "invalid storage qualifier", "it is an error to use 'centroid in' in the vertex shader");
3853 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqCentroidIn : EvqVertexIn;
3860 ES3_ONLY("centroid out", (yylsp[(1) - (2)]), "storage qualifier");
3861 if (context->shaderType == GL_FRAGMENT_SHADER)
3863 context->error((yylsp[(1) - (2)]), "invalid storage qualifier", "it is an error to use 'centroid out' in the fragment shader");
3866 (yyval.interm.type).qualifier = (context->shaderType == GL_FRAGMENT_SHADER) ? EvqFragmentOut : EvqCentroidOut;
3873 if (context->globalErrorCheck((yylsp[(1) - (1)]), context->symbolTable.atGlobalLevel(), "uniform"))
3875 (yyval.interm.type).qualifier = EvqUniform;
3882 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3884 if ((yyval.interm.type).precision == EbpUndefined) {
3885 (yyval.interm.type).precision = context->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm.type).type);
3886 if (context->precisionErrorCheck((yylsp[(1) - (1)]), (yyval.interm.type).precision, (yyvsp[(1) - (1)].interm.type).type)) {
3896 (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type);
3897 (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision);
3899 if (!SupportsPrecision((yyvsp[(2) - (2)].interm.type).type)) {
3900 context->error((yylsp[(1) - (2)]), "illegal type for precision qualifier", getBasicString((yyvsp[(2) - (2)].interm.type).type));
3909 (yyval.interm.precision) = EbpHigh;
3916 (yyval.interm.precision) = EbpMedium;
3923 (yyval.interm.precision) = EbpLow;
3930 ES3_ONLY("layout", (yylsp[(1) - (4)]), "qualifier");
3931 (yyval.interm.layoutQualifier) = (yyvsp[(3) - (4)].interm.layoutQualifier);
3938 (yyval.interm.layoutQualifier) = (yyvsp[(1) - (1)].interm.layoutQualifier);
3945 (yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[(1) - (3)].interm.layoutQualifier), (yyvsp[(3) - (3)].interm.layoutQualifier));
3952 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
3959 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yylsp[(1) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yylsp[(3) - (3)]));
3966 (yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[(1) - (3)].lex).string, (yylsp[(1) - (3)]), *(yyvsp[(3) - (3)].lex).string, (yyvsp[(3) - (3)].lex).i, (yylsp[(3) - (3)]));
3973 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
3980 (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type);
3982 if (context->arrayTypeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
3986 if (context->arraySizeErrorCheck((yylsp[(2) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
3988 (yyval.interm.type).setArray(true, size);
3996 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
3997 (yyval.interm.type).setBasic(EbtVoid, qual, (yylsp[(1) - (1)]));
4004 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4005 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4012 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4013 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
4020 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4021 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
4028 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4029 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
4036 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4037 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4038 (yyval.interm.type).setAggregate(2);
4045 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4046 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4047 (yyval.interm.type).setAggregate(3);
4054 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4055 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4056 (yyval.interm.type).setAggregate(4);
4063 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4064 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
4065 (yyval.interm.type).setAggregate(2);
4072 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4073 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
4074 (yyval.interm.type).setAggregate(3);
4081 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4082 (yyval.interm.type).setBasic(EbtBool, qual, (yylsp[(1) - (1)]));
4083 (yyval.interm.type).setAggregate(4);
4090 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4091 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
4092 (yyval.interm.type).setAggregate(2);
4099 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4100 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
4101 (yyval.interm.type).setAggregate(3);
4108 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4109 (yyval.interm.type).setBasic(EbtInt, qual, (yylsp[(1) - (1)]));
4110 (yyval.interm.type).setAggregate(4);
4117 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4118 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
4119 (yyval.interm.type).setAggregate(2);
4126 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4127 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
4128 (yyval.interm.type).setAggregate(3);
4135 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4136 (yyval.interm.type).setBasic(EbtUInt, qual, (yylsp[(1) - (1)]));
4137 (yyval.interm.type).setAggregate(4);
4144 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4145 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4146 (yyval.interm.type).setMatrix(2, 2);
4153 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4154 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4155 (yyval.interm.type).setMatrix(3, 3);
4162 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4163 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4164 (yyval.interm.type).setMatrix(4, 4);
4171 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4172 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4173 (yyval.interm.type).setMatrix(2, 3);
4180 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4181 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4182 (yyval.interm.type).setMatrix(3, 2);
4189 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4190 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4191 (yyval.interm.type).setMatrix(2, 4);
4198 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4199 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4200 (yyval.interm.type).setMatrix(4, 2);
4207 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4208 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4209 (yyval.interm.type).setMatrix(3, 4);
4216 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4217 (yyval.interm.type).setBasic(EbtFloat, qual, (yylsp[(1) - (1)]));
4218 (yyval.interm.type).setMatrix(4, 3);
4225 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4226 (yyval.interm.type).setBasic(EbtSampler2D, qual, (yylsp[(1) - (1)]));
4233 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4234 (yyval.interm.type).setBasic(EbtSampler3D, qual, (yylsp[(1) - (1)]));
4241 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4242 (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yylsp[(1) - (1)]));
4249 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4250 (yyval.interm.type).setBasic(EbtSampler2DArray, qual, (yylsp[(1) - (1)]));
4257 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4258 (yyval.interm.type).setBasic(EbtISampler2D, qual, (yylsp[(1) - (1)]));
4265 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4266 (yyval.interm.type).setBasic(EbtISampler3D, qual, (yylsp[(1) - (1)]));
4273 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4274 (yyval.interm.type).setBasic(EbtISamplerCube, qual, (yylsp[(1) - (1)]));
4281 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4282 (yyval.interm.type).setBasic(EbtISampler2DArray, qual, (yylsp[(1) - (1)]));
4289 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4290 (yyval.interm.type).setBasic(EbtUSampler2D, qual, (yylsp[(1) - (1)]));
4297 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4298 (yyval.interm.type).setBasic(EbtUSampler3D, qual, (yylsp[(1) - (1)]));
4305 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4306 (yyval.interm.type).setBasic(EbtUSamplerCube, qual, (yylsp[(1) - (1)]));
4313 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4314 (yyval.interm.type).setBasic(EbtUSampler2DArray, qual, (yylsp[(1) - (1)]));
4321 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4322 (yyval.interm.type).setBasic(EbtSampler2DShadow, qual, (yylsp[(1) - (1)]));
4329 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4330 (yyval.interm.type).setBasic(EbtSamplerCubeShadow, qual, (yylsp[(1) - (1)]));
4337 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4338 (yyval.interm.type).setBasic(EbtSampler2DArrayShadow, qual, (yylsp[(1) - (1)]));
4345 if (!context->supportsExtension("GL_OES_EGL_image_external")) {
4346 context->error((yylsp[(1) - (1)]), "unsupported type", "samplerExternalOES");
4349 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4350 (yyval.interm.type).setBasic(EbtSamplerExternalOES, qual, (yylsp[(1) - (1)]));
4357 if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
4358 context->error((yylsp[(1) - (1)]), "unsupported type", "sampler2DRect");
4361 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4362 (yyval.interm.type).setBasic(EbtSampler2DRect, qual, (yylsp[(1) - (1)]));
4369 (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type);
4370 (yyval.interm.type).qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4378 // This is for user defined type names. The lexical phase looked up the
4381 TType& structure = static_cast<TVariable*>((yyvsp[(1) - (1)].lex).symbol)->getType();
4382 TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
4383 (yyval.interm.type).setBasic(EbtStruct, qual, (yylsp[(1) - (1)]));
4384 (yyval.interm.type).userDef = &structure;
4390 { if (context->enterStructDeclaration((yylsp[(2) - (3)]), *(yyvsp[(2) - (3)].lex).string)) context->recover(); }
4396 (yyval.interm.type) = context->addStructure((yylsp[(1) - (6)]), (yylsp[(2) - (6)]), (yyvsp[(2) - (6)].lex).string, (yyvsp[(5) - (6)].interm.fieldList));
4402 { if (context->enterStructDeclaration((yylsp[(2) - (2)]), *(yyvsp[(2) - (2)].lex).string)) context->recover(); }
4408 (yyval.interm.type) = context->addStructure((yylsp[(1) - (5)]), (yyloc), NewPoolTString(""), (yyvsp[(4) - (5)].interm.fieldList));
4415 (yyval.interm.fieldList) = (yyvsp[(1) - (1)].interm.fieldList);
4422 (yyval.interm.fieldList) = (yyvsp[(1) - (2)].interm.fieldList);
4423 for (size_t i = 0; i < (yyvsp[(2) - (2)].interm.fieldList)->size(); ++i) {
4424 TField* field = (*(yyvsp[(2) - (2)].interm.fieldList))[i];
4425 for (size_t j = 0; j < (yyval.interm.fieldList)->size(); ++j) {
4426 if ((*(yyval.interm.fieldList))[j]->name() == field->name()) {
4427 context->error((yylsp[(2) - (2)]), "duplicate field name in structure:", "struct", field->name().c_str());
4431 (yyval.interm.fieldList)->push_back(field);
4439 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(1) - (3)].interm.type), (yyvsp[(2) - (3)].interm.fieldList));
4446 // ES3 Only, but errors should be handled elsewhere
4447 (yyvsp[(2) - (4)].interm.type).qualifier = (yyvsp[(1) - (4)].interm.type).qualifier;
4448 (yyvsp[(2) - (4)].interm.type).layoutQualifier = (yyvsp[(1) - (4)].interm.type).layoutQualifier;
4449 (yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[(2) - (4)].interm.type), (yyvsp[(3) - (4)].interm.fieldList));
4456 (yyval.interm.fieldList) = NewPoolTFieldList();
4457 (yyval.interm.fieldList)->push_back((yyvsp[(1) - (1)].interm.field));
4464 (yyval.interm.fieldList)->push_back((yyvsp[(3) - (3)].interm.field));
4471 if (context->reservedErrorCheck((yylsp[(1) - (1)]), *(yyvsp[(1) - (1)].lex).string))
4474 TType* type = new TType(EbtVoid, EbpUndefined);
4475 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (1)].lex).string, (yylsp[(1) - (1)]));
4482 if (context->reservedErrorCheck((yylsp[(1) - (4)]), *(yyvsp[(1) - (4)].lex).string))
4485 TType* type = new TType(EbtVoid, EbpUndefined);
4487 if (context->arraySizeErrorCheck((yylsp[(3) - (4)]), (yyvsp[(3) - (4)].interm.intermTypedNode), size))
4489 type->setArraySize(size);
4491 (yyval.interm.field) = new TField(type, (yyvsp[(1) - (4)].lex).string, (yylsp[(1) - (4)]));
4497 { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); }
4502 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4507 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); }
4512 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4517 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4522 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4527 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4532 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4537 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4542 { (yyval.interm.intermAggregate) = 0; }
4547 { context->symbolTable.push(); }
4552 { context->symbolTable.pop(); }
4558 if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) {
4559 (yyvsp[(3) - (5)].interm.intermAggregate)->setOp(EOpSequence);
4560 (yyvsp[(3) - (5)].interm.intermAggregate)->setLine((yyloc));
4562 (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate);
4568 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4573 { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); }
4578 { context->symbolTable.push(); }
4583 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4588 { context->symbolTable.push(); }
4593 { context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[(2) - (2)].interm.intermNode); }
4599 (yyval.interm.intermNode) = 0;
4606 if ((yyvsp[(2) - (3)].interm.intermAggregate)) {
4607 (yyvsp[(2) - (3)].interm.intermAggregate)->setOp(EOpSequence);
4608 (yyvsp[(2) - (3)].interm.intermAggregate)->setLine((yyloc));
4610 (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate);
4617 (yyval.interm.intermAggregate) = context->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), (yyloc));
4624 (yyval.interm.intermAggregate) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), (yyloc));
4630 { (yyval.interm.intermNode) = 0; }
4635 { (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[(1) - (2)].interm.intermTypedNode)); }
4641 if (context->boolErrorCheck((yylsp[(1) - (5)]), (yyvsp[(3) - (5)].interm.intermTypedNode)))
4643 (yyval.interm.intermNode) = context->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yylsp[(1) - (5)]));
4650 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode);
4651 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode);
4658 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode);
4659 (yyval.interm.nodePair).node2 = 0;
4666 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4667 if (context->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode)))
4675 TIntermNode* intermNode;
4676 if (context->structQualifierErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
4678 if (context->boolErrorCheck((yylsp[(2) - (4)]), (yyvsp[(1) - (4)].interm.type)))
4681 if (!context->executeInitializer((yylsp[(2) - (4)]), *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode))
4682 (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode);
4685 (yyval.interm.intermTypedNode) = 0;
4692 { context->symbolTable.push(); ++context->loopNestingLevel; }
4698 context->symbolTable.pop();
4699 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopWhile, 0, (yyvsp[(4) - (6)].interm.intermTypedNode), 0, (yyvsp[(6) - (6)].interm.intermNode), (yylsp[(1) - (6)]));
4700 --context->loopNestingLevel;
4706 { ++context->loopNestingLevel; }
4712 if (context->boolErrorCheck((yylsp[(8) - (8)]), (yyvsp[(6) - (8)].interm.intermTypedNode)))
4715 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopDoWhile, 0, (yyvsp[(6) - (8)].interm.intermTypedNode), 0, (yyvsp[(3) - (8)].interm.intermNode), (yylsp[(4) - (8)]));
4716 --context->loopNestingLevel;
4722 { context->symbolTable.push(); ++context->loopNestingLevel; }
4728 context->symbolTable.pop();
4729 (yyval.interm.intermNode) = context->intermediate.addLoop(ELoopFor, (yyvsp[(4) - (7)].interm.intermNode), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast<TIntermTyped*>((yyvsp[(5) - (7)].interm.nodePair).node2), (yyvsp[(7) - (7)].interm.intermNode), (yylsp[(1) - (7)]));
4730 --context->loopNestingLevel;
4737 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4744 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4751 (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode);
4758 (yyval.interm.intermTypedNode) = 0;
4765 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode);
4766 (yyval.interm.nodePair).node2 = 0;
4773 (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode);
4774 (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode);
4781 if (context->loopNestingLevel <= 0) {
4782 context->error((yylsp[(1) - (2)]), "continue statement only allowed in loops", "");
4785 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpContinue, (yylsp[(1) - (2)]));
4792 if (context->loopNestingLevel <= 0) {
4793 context->error((yylsp[(1) - (2)]), "break statement only allowed in loops", "");
4796 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpBreak, (yylsp[(1) - (2)]));
4803 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yylsp[(1) - (2)]));
4804 if (context->currentFunctionType->getBasicType() != EbtVoid) {
4805 context->error((yylsp[(1) - (2)]), "non-void function must return a value", "return");
4814 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yylsp[(1) - (3)]));
4815 context->functionReturnsValue = true;
4816 if (context->currentFunctionType->getBasicType() == EbtVoid) {
4817 context->error((yylsp[(1) - (3)]), "void function cannot return a value", "return");
4819 } else if (*(context->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) {
4820 context->error((yylsp[(1) - (3)]), "function return is not matching type:", "return");
4829 FRAG_ONLY("discard", (yylsp[(1) - (2)]));
4830 (yyval.interm.intermNode) = context->intermediate.addBranch(EOpKill, (yylsp[(1) - (2)]));
4837 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4838 context->treeRoot = (yyval.interm.intermNode);
4845 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), (yyloc));
4846 context->treeRoot = (yyval.interm.intermNode);
4853 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4860 (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode);
4867 TFunction* function = (yyvsp[(1) - (1)].interm).function;
4869 const TSymbol *builtIn = context->symbolTable.findBuiltIn(function->getMangledName(), context->shaderVersion);
4873 context->error((yylsp[(1) - (1)]), "built-in functions cannot be redefined", function->getName().c_str());
4877 TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find(function->getMangledName(), context->shaderVersion));
4879 // Note: 'prevDec' could be 'function' if this is the first time we've seen function
4880 // as it would have just been put in the symbol table. Otherwise, we're looking up
4881 // an earlier occurance.
4883 if (prevDec->isDefined()) {
4885 // Then this function already has a body.
4887 context->error((yylsp[(1) - (1)]), "function already has a body", function->getName().c_str());
4890 prevDec->setDefined();
4893 // Raise error message if main function takes any parameters or return anything other than void
4895 if (function->getName() == "main") {
4896 if (function->getParamCount() > 0) {
4897 context->error((yylsp[(1) - (1)]), "function cannot take any parameter(s)", function->getName().c_str());
4900 if (function->getReturnType().getBasicType() != EbtVoid) {
4901 context->error((yylsp[(1) - (1)]), "", function->getReturnType().getBasicString(), "main function cannot return a value");
4907 // Remember the return type for later checking for RETURN statements.
4909 context->currentFunctionType = &(prevDec->getReturnType());
4910 context->functionReturnsValue = false;
4913 // Insert parameters into the symbol table.
4914 // If the parameter has no name, it's not an error, just don't insert it
4915 // (could be used for unused args).
4917 // Also, accumulate the list of parameters into the HIL, so lower level code
4918 // knows where to find parameters.
4920 TIntermAggregate* paramNodes = new TIntermAggregate;
4921 for (size_t i = 0; i < function->getParamCount(); i++) {
4922 const TParameter& param = function->getParam(i);
4923 if (param.name != 0) {
4924 TVariable *variable = new TVariable(param.name, *param.type);
4926 // Insert the parameters with name in the symbol table.
4928 if (! context->symbolTable.declare(variable)) {
4929 context->error((yylsp[(1) - (1)]), "redefinition", variable->getName().c_str());
4935 // Add the parameter to the HIL
4937 paramNodes = context->intermediate.growAggregate(
4939 context->intermediate.addSymbol(variable->getUniqueId(),
4940 variable->getName(),
4941 variable->getType(), (yylsp[(1) - (1)])),
4942 (yylsp[(1) - (1)]));
4944 paramNodes = context->intermediate.growAggregate(paramNodes, context->intermediate.addSymbol(0, "", *param.type, (yylsp[(1) - (1)])), (yylsp[(1) - (1)]));
4947 context->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yylsp[(1) - (1)]));
4948 (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes;
4949 context->loopNestingLevel = 0;
4956 //?? Check that all paths return a value if return type != void ?
4957 // May be best done as post process phase on intermediate code
4958 if (context->currentFunctionType->getBasicType() != EbtVoid && ! context->functionReturnsValue) {
4959 context->error((yylsp[(1) - (3)]), "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str());
4963 (yyval.interm.intermNode) = context->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), (yyloc));
4964 context->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yylsp[(1) - (3)]));
4965 (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str());
4966 (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType());
4968 // store the pragma information for debug and optimize and other vendor specific
4969 // information. This information can be queried from the parse tree
4970 (yyval.interm.intermNode)->getAsAggregate()->setOptimize(context->pragma().optimize);
4971 (yyval.interm.intermNode)->getAsAggregate()->setDebug(context->pragma().debug);
4973 context->symbolTable.pop();
4981 /* User semantic actions sometimes alter yychar, and that requires
4982 that yytoken be updated with the new translation. We take the
4983 approach of translating immediately before every use of yytoken.
4984 One alternative is translating here after every semantic action,
4985 but that translation would be missed if the semantic action invokes
4986 YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
4987 if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
4988 incorrect destructor might then be invoked immediately. In the
4989 case of YYERROR or YYBACKUP, subsequent parser actions might lead
4990 to an incorrect destructor call or verbose syntax error message
4991 before the lookahead is translated. */
4992 YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
4996 YY_STACK_PRINT (yyss, yyssp);
5001 /* Now `shift' the result of the reduction. Determine what state
5002 that goes to, based on the state we popped back to and the rule
5003 number reduced by. */
5007 yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
5008 if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
5009 yystate = yytable[yystate];
5011 yystate = yydefgoto[yyn - YYNTOKENS];
5016 /*------------------------------------.
5017 | yyerrlab -- here on detecting error |
5018 `------------------------------------*/
5020 /* Make sure we have latest lookahead translation. See comments at
5021 user semantic actions for why this is necessary. */
5022 yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
5024 /* If not already recovering from an error, report this error. */
5028 #if ! YYERROR_VERBOSE
5029 yyerror (&yylloc, context, YY_("syntax error"));
5031 # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
5034 char const *yymsgp = YY_("syntax error");
5035 int yysyntax_error_status;
5036 yysyntax_error_status = YYSYNTAX_ERROR;
5037 if (yysyntax_error_status == 0)
5039 else if (yysyntax_error_status == 1)
5041 if (yymsg != yymsgbuf)
5042 YYSTACK_FREE (yymsg);
5043 yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
5047 yymsg_alloc = sizeof yymsgbuf;
5048 yysyntax_error_status = 2;
5052 yysyntax_error_status = YYSYNTAX_ERROR;
5056 yyerror (&yylloc, context, yymsgp);
5057 if (yysyntax_error_status == 2)
5058 goto yyexhaustedlab;
5060 # undef YYSYNTAX_ERROR
5064 yyerror_range[1] = yylloc;
5066 if (yyerrstatus == 3)
5068 /* If just tried and failed to reuse lookahead token after an
5069 error, discard it. */
5071 if (yychar <= YYEOF)
5073 /* Return failure if at end of input. */
5074 if (yychar == YYEOF)
5079 yydestruct ("Error: discarding",
5080 yytoken, &yylval, &yylloc, context);
5085 /* Else will try to reuse lookahead token after shifting the error
5090 /*---------------------------------------------------.
5091 | yyerrorlab -- error raised explicitly by YYERROR. |
5092 `---------------------------------------------------*/
5095 /* Pacify compilers like GCC when the user code never invokes
5096 YYERROR and the label yyerrorlab therefore never appears in user
5098 if (/*CONSTCOND*/ 0)
5101 yyerror_range[1] = yylsp[1-yylen];
5102 /* Do not reclaim the symbols of the rule which action triggered
5106 YY_STACK_PRINT (yyss, yyssp);
5111 /*-------------------------------------------------------------.
5112 | yyerrlab1 -- common code for both syntax error and YYERROR. |
5113 `-------------------------------------------------------------*/
5115 yyerrstatus = 3; /* Each real token shifted decrements this. */
5119 yyn = yypact[yystate];
5120 if (!yypact_value_is_default (yyn))
5123 if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
5131 /* Pop the current state because it cannot handle the error token. */
5135 yyerror_range[1] = *yylsp;
5136 yydestruct ("Error: popping",
5137 yystos[yystate], yyvsp, yylsp, context);
5140 YY_STACK_PRINT (yyss, yyssp);
5143 YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
5145 YY_IGNORE_MAYBE_UNINITIALIZED_END
5147 yyerror_range[2] = yylloc;
5148 /* Using YYLLOC is tempting, but would change the location of
5149 the lookahead. YYLOC is available though. */
5150 YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
5153 /* Shift the error token. */
5154 YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
5160 /*-------------------------------------.
5161 | yyacceptlab -- YYACCEPT comes here. |
5162 `-------------------------------------*/
5167 /*-----------------------------------.
5168 | yyabortlab -- YYABORT comes here. |
5169 `-----------------------------------*/
5174 #if !defined yyoverflow || YYERROR_VERBOSE
5175 /*-------------------------------------------------.
5176 | yyexhaustedlab -- memory exhaustion comes here. |
5177 `-------------------------------------------------*/
5179 yyerror (&yylloc, context, YY_("memory exhausted"));
5185 if (yychar != YYEMPTY)
5187 /* Make sure we have latest lookahead translation. See comments at
5188 user semantic actions for why this is necessary. */
5189 yytoken = YYTRANSLATE (yychar);
5190 yydestruct ("Cleanup: discarding lookahead",
5191 yytoken, &yylval, &yylloc, context);
5193 /* Do not reclaim the symbols of the rule which action triggered
5194 this YYABORT or YYACCEPT. */
5196 YY_STACK_PRINT (yyss, yyssp);
5197 while (yyssp != yyss)
5199 yydestruct ("Cleanup: popping",
5200 yystos[*yyssp], yyvsp, yylsp, context);
5205 YYSTACK_FREE (yyss);
5208 if (yymsg != yymsgbuf)
5209 YYSTACK_FREE (yymsg);
5211 /* Make sure YYID is used. */
5212 return YYID (yyresult);
5219 int glslang_parse(TParseContext* context) {
5220 return yyparse(context);